From bb4b78d5fc8f90d5465554be5069da29851a1cb5 Mon Sep 17 00:00:00 2001 From: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com> Date: Thu, 26 Sep 2024 19:30:34 +0200 Subject: [PATCH] imp(all): Move latest changes from Evmos main (incl. SDK v50) (#48) --- .github/workflows/auto-format.yml | 43 +- .github/workflows/bsr-push.yml | 2 +- .github/workflows/proto.yml | 4 +- .github/workflows/super-linter.yml | 1 + .gitignore | 3 + .gitleaks.toml | 5 +- .pylintrc | 5 + CHANGELOG.md | 1 + Makefile | 33 +- ante/cosmos/authz.go | 2 +- ante/cosmos/authz_test.go | 84 +- ante/cosmos/eip712.go | 17 +- ante/cosmos/min_gas_price_test.go | 48 +- ante/cosmos/setup_test.go | 143 +- ante/cosmos/utils_test.go | 43 +- ante/evm/01_setup_ctx.go | 3 +- ante/evm/01_setup_ctx_test.go | 52 + ante/evm/04_validate.go | 12 +- ante/evm/04_validate_test.go | 20 +- ante/evm/05_signature_verification.go | 7 +- ante/evm/07_can_transfer.go | 2 +- ante/evm/08_gas_consume_test.go | 6 +- ante/evm/09_increment_sequence.go | 5 +- ante/evm/09_increment_sequence_test.go | 8 +- ante/evm/10_gas_wanted_test.go | 17 +- ante/evm/11_emit_event.go | 9 +- ante/evm/ante_test.go | 1202 ++ ante/evm/eth_benchmark_test.go | 94 + ante/evm/fee_checker_test.go | 31 +- ante/evm/fee_market_test.go | 145 + ante/evm/setup_test.go | 120 +- ante/evm/signverify_test.go | 85 + ante/evm/sigs_test.go | 49 + ante/evm/utils_test.go | 238 +- ante/interfaces/cosmos.go | 12 +- ante/sigverify.go | 2 +- ante/sigverify_test.go | 19 +- ante/testutils/testutil.go | 158 + api/os/crypto/v1/ethsecp256k1/keys.pulsar.go | 1056 ++ api/os/erc20/v1/erc20.pulsar.go | 3411 ++++ api/os/erc20/v1/events.pulsar.go | 2739 ++++ api/os/erc20/v1/genesis.pulsar.go | 1487 ++ api/os/erc20/v1/msg.go | 24 + api/os/erc20/v1/query.pulsar.go | 3142 ++++ api/os/erc20/v1/query_grpc.pb.go | 192 + api/os/erc20/v1/tx.pulsar.go | 5230 ++++++ api/os/erc20/v1/tx_grpc.pb.go | 245 + api/os/evm/v1/access_list_tx.go | 65 + api/os/evm/v1/dynamic_fee_tx.go | 66 + api/os/evm/v1/events.pulsar.go | 2643 +++ api/os/evm/v1/evm.pulsar.go | 9305 +++++++++++ api/os/evm/v1/genesis.pulsar.go | 1448 ++ api/os/evm/v1/legacy_tx.go | 45 + api/os/evm/v1/msg.go | 56 + api/os/evm/v1/query.pulsar.go | 13653 ++++++++++++++++ api/os/evm/v1/query_grpc.pb.go | 553 + api/os/evm/v1/tx.pulsar.go | 6723 ++++++++ api/os/evm/v1/tx_data.go | 47 + api/os/evm/v1/tx_grpc.pb.go | 157 + api/os/feemarket/v1/events.pulsar.go | 1119 ++ api/os/feemarket/v1/feemarket.pulsar.go | 989 ++ api/os/feemarket/v1/genesis.pulsar.go | 659 + api/os/feemarket/v1/query.pulsar.go | 2757 ++++ api/os/feemarket/v1/query_grpc.pb.go | 192 + api/os/feemarket/v1/tx.pulsar.go | 1091 ++ api/os/feemarket/v1/tx_grpc.pb.go | 118 + api/os/types/v1/dynamic_fee.pulsar.go | 581 + api/os/types/v1/indexer.pulsar.go | 919 ++ api/os/types/v1/web3.pulsar.go | 720 + client/block/store.go | 8 +- client/keys/add.go | 5 +- client/keys/utils.go | 8 +- cmd/config/opendb.go | 2 +- contracts/hardhat.config.js | 2 +- .../solidity/ERC20MinterBurnerDecimals.json | 4 +- encoding/config.go | 56 +- encoding/config_test.go | 5 +- ethereum/eip712/eip712_test.go | 77 +- ethereum/eip712/encoding.go | 21 +- ethereum/eip712/encoding_legacy.go | 31 +- ethereum/eip712/message.go | 4 + ethereum/eip712/preprocess.go | 12 +- ethereum/eip712/preprocess_test.go | 30 +- example_chain/ante/cosmos_handler.go | 2 +- example_chain/ante/evm_benchmark_test.go | 159 + example_chain/ante/evm_handler.go | 2 +- example_chain/ante/handler_options.go | 8 +- example_chain/ante/handler_options_test.go | 186 + example_chain/ante/integration_test.go | 172 + example_chain/app.go | 441 +- example_chain/export.go | 118 +- example_chain/genesis.go | 30 +- example_chain/go.mod | 145 +- example_chain/go.sum | 313 +- example_chain/local_node.sh | 5 +- example_chain/osd/cmd/root.go | 127 +- example_chain/osd/main.go | 11 +- example_chain/precompiles.go | 4 +- example_chain/test_helpers.go | 124 +- example_chain/testutil/abci.go | 94 +- example_chain/testutil/contract.go | 8 +- example_chain/testutil/eth_setup.go | 27 +- example_chain/testutil/fund.go | 4 +- example_chain/testutil/integration.go | 8 +- go.mod | 146 +- go.sum | 316 +- go.work | 2 + go.work.sum | 992 +- ibc/module.go | 8 +- ibc/module_test.go | 10 +- ibc/testing/app.go | 38 +- ibc/testing/chain.go | 22 +- ibc/testing/coordinator.go | 18 +- ibc/testing/endpoint.go | 78 +- ibc/testing/path.go | 9 +- ibc/utils.go | 9 +- ibc/utils_test.go | 6 +- indexer/kv_indexer.go | 12 +- indexer/kv_indexer_test.go | 53 +- precompiles/authorization/events.go | 4 +- precompiles/authorization/types_test.go | 5 +- precompiles/bank/bank.go | 2 +- precompiles/bank/integration_test.go | 130 +- precompiles/bank/query_test.go | 114 +- precompiles/bank/setup_test.go | 28 +- precompiles/bank/testdata/BankCaller.json | 4 +- precompiles/bank/utils_test.go | 15 +- precompiles/bech32/bech32_test.go | 11 +- precompiles/common/precompile.go | 7 +- precompiles/common/types.go | 8 +- precompiles/common/types_test.go | 7 +- precompiles/distribution/distribution.go | 2 +- precompiles/distribution/distribution_test.go | 126 +- precompiles/distribution/events.go | 17 +- precompiles/distribution/events_test.go | 147 +- precompiles/distribution/integration_test.go | 2742 ++-- precompiles/distribution/query_test.go | 249 +- precompiles/distribution/setup_test.go | 120 +- precompiles/distribution/tx.go | 50 +- precompiles/distribution/tx_test.go | 253 +- precompiles/distribution/types.go | 16 - precompiles/distribution/utils_test.go | 294 +- precompiles/erc20/erc20.go | 2 +- precompiles/erc20/events.go | 4 +- precompiles/erc20/events_test.go | 4 +- precompiles/erc20/integration_test.go | 694 +- precompiles/erc20/query_test.go | 61 +- precompiles/erc20/setup_test.go | 3 +- .../erc20/testdata/ERC20AllowanceCaller.json | 4 +- .../erc20/testdata/ERC20NoMetadata.json | 4 +- .../erc20/testdata/ERC20TestCaller.json | 6 +- precompiles/erc20/tx.go | 7 +- precompiles/erc20/tx_test.go | 32 +- precompiles/erc20/utils_test.go | 119 +- precompiles/ics20/approve_common.go | 6 +- precompiles/ics20/approve_test.go | 611 - precompiles/ics20/events.go | 2 +- precompiles/ics20/events_test.go | 311 - precompiles/ics20/ics20.go | 7 +- precompiles/ics20/integration_test.go | 1725 -- precompiles/ics20/query.go | 8 +- precompiles/ics20/query_test.go | 398 - precompiles/ics20/setup_test.go | 72 - precompiles/ics20/tx.go | 6 +- precompiles/ics20/tx_test.go | 392 - precompiles/ics20/types.go | 11 +- precompiles/ics20/utils_test.go | 641 - precompiles/p256/integration_test.go | 49 +- precompiles/p256/p256.go | 2 +- precompiles/staking/approve.go | 37 +- precompiles/staking/approve_test.go | 320 +- precompiles/staking/events.go | 16 +- precompiles/staking/events_test.go | 315 +- precompiles/staking/integration_test.go | 3524 ++-- precompiles/staking/query.go | 14 +- precompiles/staking/query_test.go | 98 +- precompiles/staking/setup_test.go | 72 +- precompiles/staking/staking.go | 4 +- precompiles/staking/staking_test.go | 197 +- .../staking/testdata/StakingCaller.json | 4 +- .../staking/testdata/StakingCaller.sol | 2 +- .../staking/testdata/StakingCallerTwo.json | 4 +- precompiles/staking/tx.go | 42 +- precompiles/staking/tx_test.go | 356 +- precompiles/staking/types.go | 34 +- precompiles/staking/utils_test.go | 406 +- precompiles/testutil/contracts/Counter.json | 4 +- .../contracts/DistributionCaller.json | 22 +- .../testutil/contracts/DistributionCaller.sol | 157 +- precompiles/testutil/contracts/FlashLoan.json | 4 +- .../testutil/contracts/InterchainSender.json | 4 +- .../contracts/InterchainSenderCaller.json | 4 +- precompiles/testutil/contracts/Reverter.json | 4 +- .../testutil/contracts/StakingReverter.json | 22 +- .../testutil/contracts/StakingReverter.sol | 17 +- precompiles/testutil/contracts/contracts.go | 12 +- precompiles/testutil/errors.go | 2 +- precompiles/testutil/events.go | 4 +- precompiles/testutil/ibc.go | 2 +- precompiles/testutil/logs.go | 6 +- precompiles/testutil/staking.go | 11 +- precompiles/testutil/testing.go | 4 +- proto/buf.gen.pulsar.yaml | 20 + proto/os/erc20/v1/erc20.proto | 14 +- proto/os/erc20/v1/genesis.proto | 7 +- proto/os/erc20/v1/query.proto | 10 +- proto/os/erc20/v1/tx.proto | 57 +- proto/os/evm/v1/evm.proto | 9 +- proto/os/evm/v1/genesis.proto | 14 +- proto/os/evm/v1/query.proto | 42 +- proto/os/evm/v1/tx.proto | 26 +- proto/os/feemarket/v1/events.proto | 2 +- proto/os/feemarket/v1/feemarket.proto | 12 +- proto/os/feemarket/v1/genesis.proto | 4 +- proto/os/feemarket/v1/query.proto | 4 +- proto/os/feemarket/v1/tx.proto | 9 +- proto/os/types/v1/dynamic_fee.proto | 4 +- rpc/backend/account_info.go | 3 +- rpc/backend/account_info_test.go | 15 +- rpc/backend/backend.go | 2 +- rpc/backend/backend_suite_test.go | 29 +- rpc/backend/blocks.go | 2 +- rpc/backend/blocks_test.go | 186 +- rpc/backend/call_tx_test.go | 4 +- rpc/backend/chain_info.go | 13 +- rpc/backend/chain_info_test.go | 8 +- rpc/backend/client_test.go | 81 +- rpc/backend/evm_query_client_test.go | 5 +- rpc/backend/filters_test.go | 4 +- rpc/backend/mocks/client.go | 3 + rpc/backend/node_info.go | 24 +- rpc/backend/node_info_test.go | 11 +- rpc/backend/sign_tx.go | 8 +- rpc/backend/sign_tx_test.go | 10 +- rpc/backend/tracing_test.go | 23 +- rpc/backend/tx_info.go | 4 +- rpc/backend/tx_info_test.go | 20 +- rpc/backend/utils.go | 32 +- rpc/namespaces/ethereum/debug/api.go | 14 +- rpc/namespaces/ethereum/debug/utils.go | 3 +- rpc/namespaces/ethereum/eth/api.go | 5 +- rpc/namespaces/ethereum/eth/filters/api.go | 29 +- .../ethereum/eth/filters/filter_system.go | 29 +- .../eth/filters/filter_system_test.go | 5 +- .../ethereum/eth/filters/filters.go | 11 +- rpc/namespaces/ethereum/miner/api.go | 2 +- rpc/namespaces/ethereum/personal/api.go | 2 +- rpc/namespaces/ethereum/txpool/api.go | 2 +- rpc/types/events.go | 2 +- rpc/types/events_test.go | 10 +- rpc/types/types.go | 1 + rpc/types/utils.go | 29 +- rpc/websockets.go | 11 +- .../compile_smart_contracts.py | 6 +- .../test_compile_smart_contracts.py | 6 +- scripts/generate_protos_pulsar.sh | 18 + server/config/config.go | 5 +- server/config/config_test.go | 7 +- server/config/migration/migration.go | 127 + server/config/migration/v0.50-app.toml | 375 + server/flags/flags.go | 10 +- server/indexer_cmd.go | 14 +- server/json_rpc.go | 7 +- server/start.go | 486 +- server/util.go | 6 +- shell.nix | 12 + tests/integration/ledger/evmosd_suite_test.go | 23 +- tests/integration/ledger/ledger_test.go | 20 +- tests/integration/ledger/mocks/SECP256K1.go | 2 +- tests/integration/ledger/mocks/tendermint.go | 14 +- tests/solidity/init-node.sh | 52 +- tests/solidity/test-helper.js | 6 + testutil/ante.go | 25 +- testutil/{ => constants}/constants.go | 2 +- testutil/{ => constants}/constants_test.go | 11 +- testutil/fund.go | 41 + testutil/integration/common/factory/base.go | 119 + .../common/factory/distribution.go | 88 + .../integration/common/factory/factory.go | 64 +- testutil/integration/common/factory/fund.go | 51 + testutil/integration/common/factory/helper.go | 105 +- testutil/integration/common/factory/sign.go | 58 + .../integration/common/factory/staking.go | 88 + testutil/integration/common/factory/types.go | 3 +- testutil/integration/common/grpc/account.go | 10 +- testutil/integration/common/grpc/authz.go | 12 +- testutil/integration/common/grpc/bank.go | 12 + .../integration/common/grpc/distribution.go | 57 + testutil/integration/common/grpc/grpc.go | 25 +- testutil/integration/common/grpc/staking.go | 45 +- .../integration/common/network/network.go | 11 +- testutil/integration/ibc/chain/chain.go | 22 +- .../ibc/coordinator/coordinator.go | 31 +- testutil/integration/ibc/coordinator/utils.go | 15 +- testutil/integration/os/factory/broadcast.go | 19 +- testutil/integration/os/factory/build.go | 20 +- testutil/integration/os/factory/factory.go | 69 +- testutil/integration/os/factory/helpers.go | 34 +- testutil/integration/os/keyring/keyring.go | 16 +- testutil/integration/os/network/abci.go | 87 +- testutil/integration/os/network/clients.go | 46 +- testutil/integration/os/network/config.go | 51 +- .../integration/os/network/config_test.go | 6 +- testutil/integration/os/network/ibc.go | 5 +- testutil/integration/os/network/network.go | 199 +- testutil/integration/os/network/params.go | 22 - testutil/integration/os/network/setup.go | 406 +- .../integration/os/network/unit_network.go | 2 +- testutil/integration/os/utils/bank.go | 19 +- testutil/integration/os/utils/bank_test.go | 6 +- testutil/integration/os/utils/contracts.go | 14 +- testutil/integration/os/utils/erc20.go | 95 +- testutil/integration/os/utils/events.go | 55 + testutil/integration/os/utils/evm.go | 5 + testutil/integration/os/utils/genesis.go | 58 +- testutil/integration/os/utils/gov.go | 124 +- testutil/integration/os/utils/params.go | 87 + testutil/integration/os/utils/staking.go | 111 + testutil/integration/os/utils/types.go | 15 + testutil/integration/os/utils/unit.go | 18 +- testutil/network/network.go | 221 +- testutil/network/util.go | 90 +- testutil/staking_rewards.go | 126 + testutil/statedb.go | 2 +- testutil/tx/cosmos.go | 32 +- testutil/tx/eip712.go | 25 +- testutil/tx/eth.go | 27 +- testutil/tx/signer.go | 7 +- tox.ini | 4 + types/block.go | 2 +- types/codec.go | 3 +- types/dynamic_fee.pb.go | 28 +- types/gasmeter.go | 2 +- types/genesis.go | 15 + types/indexer.go | 5 +- utils/eth/eth.go | 51 + utils/utils.go | 4 +- wallets/ledger/ledger.go | 2 +- wallets/ledger/ledger_suite_test.go | 23 +- wallets/ledger/ledger_test.go | 20 +- x/erc20/client/cli/tx.go | 133 +- x/erc20/client/proposal_handler.go | 15 - x/erc20/genesis_test.go | 11 +- x/erc20/ibc_middleware.go | 8 +- x/erc20/keeper/dynamic_precompiles.go | 58 + x/erc20/keeper/dynamic_precompiles_test.go | 87 + x/erc20/keeper/erc20_utils_test.go | 94 +- x/erc20/keeper/evm_test.go | 57 +- x/erc20/keeper/grpc_query.go | 8 +- x/erc20/keeper/grpc_query_test.go | 32 +- x/erc20/keeper/ibc_callbacks.go | 19 +- .../keeper/ibc_callbacks_integration_test.go | 275 - x/erc20/keeper/ibc_callbacks_test.go | 171 +- x/erc20/keeper/integration_test.go | 213 +- x/erc20/keeper/keeper.go | 4 +- x/erc20/keeper/mint_test.go | 38 +- x/erc20/keeper/msg_server.go | 112 +- x/erc20/keeper/msg_server_test.go | 207 +- x/erc20/keeper/params.go | 25 + x/erc20/keeper/params_test.go | 28 +- x/erc20/keeper/precompiles.go | 5 +- x/erc20/keeper/precompiles_test.go | 35 +- x/erc20/keeper/proposals.go | 4 +- x/erc20/keeper/proposals_test.go | 173 +- x/erc20/keeper/setup_test.go | 92 +- .../ERC20DirectBalanceManipulation.json | 4 +- .../testdata/ERC20MaliciousDelayed.json | 4 +- x/erc20/keeper/token_pairs.go | 4 +- x/erc20/keeper/token_pairs_test.go | 100 +- x/erc20/keeper/utils_test.go | 411 +- x/erc20/module.go | 13 +- x/erc20/proposal_handler.go | 84 - x/erc20/types/codec.go | 8 +- x/erc20/types/constants.go | 11 + x/erc20/types/erc20.pb.go | 14 +- x/erc20/types/genesis.pb.go | 44 +- x/erc20/types/genesis_test.go | 23 +- x/erc20/types/interfaces.go | 17 +- x/erc20/types/mocks/AccountKeeper.go | 79 - x/erc20/types/mocks/BankKeeper.go | 1477 +- x/erc20/types/mocks/EVMKeeper.go | 65 +- x/erc20/types/mocks/MsgClient.go | 107 - x/erc20/types/mocks/MsgServer.go | 90 - x/erc20/types/mocks/QueryClient.go | 144 - x/erc20/types/mocks/QueryServer.go | 120 - x/erc20/types/mocks/README.md | 27 +- x/erc20/types/mocks/StakingKeeper.go | 46 - x/erc20/types/mocks/Subspace.go | 53 - x/erc20/types/msg.go | 49 +- x/erc20/types/msg_test.go | 1 - x/erc20/types/params_test.go | 53 +- x/erc20/types/proposal.go | 3 - x/erc20/types/query.pb.go | 68 +- x/erc20/types/tx.pb.go | 1052 +- x/erc20/types/utils.go | 23 +- x/evm/ante/ctx.go | 2 +- x/evm/ante/ctx_test.go | 2 +- x/evm/client/cli/query.go | 39 + x/evm/client/cli/tx.go | 15 +- x/evm/client/cli/utils.go | 1 + x/evm/config/configurator.go | 5 +- x/evm/core/vm/common.go | 6 + x/evm/core/vm/interface.go | 10 + x/evm/core/vm/interpreter.go | 31 + x/evm/core/vm/memory.go | 6 + x/evm/genesis_test.go | 25 +- x/evm/keeper/abci.go | 15 +- x/evm/keeper/abci_test.go | 21 +- x/evm/keeper/benchmark_test.go | 75 +- x/evm/keeper/block_proposer.go | 10 +- x/evm/keeper/call_evm.go | 3 +- x/evm/keeper/call_evm_test.go | 82 +- x/evm/keeper/fees_test.go | 128 +- x/evm/keeper/grpc_query.go | 66 +- x/evm/keeper/grpc_query_test.go | 1599 +- x/evm/keeper/integration_test.go | 72 +- x/evm/keeper/keeper.go | 14 +- x/evm/keeper/keeper_test.go | 26 +- x/evm/keeper/msg_server.go | 16 +- x/evm/keeper/msg_server_test.go | 130 +- x/evm/keeper/params_benchmark_test.go | 11 +- x/evm/keeper/params_test.go | 45 +- x/evm/keeper/setup_test.go | 192 +- x/evm/keeper/state_transition.go | 13 +- .../keeper/state_transition_benchmark_test.go | 113 +- x/evm/keeper/state_transition_test.go | 610 +- x/evm/keeper/statedb.go | 6 +- x/evm/keeper/statedb_benchmark_test.go | 36 +- x/evm/keeper/statedb_test.go | 276 +- x/evm/keeper/utils.go | 2 +- x/evm/keeper/utils_test.go | 96 +- x/evm/module.go | 46 +- x/evm/statedb/config.go | 1 + x/evm/statedb/integration_test.go | 22 + x/evm/statedb/journal.go | 8 +- x/evm/statedb/state_object.go | 4 +- x/evm/statedb/statedb.go | 8 +- x/evm/types/access_list_tx.go | 6 +- x/evm/types/codec.go | 5 +- x/evm/types/dynamic_fee_tx.go | 4 +- x/evm/types/dynamic_fee_tx_test.go | 3 + x/evm/types/evm.pb.go | 241 +- x/evm/types/genesis.pb.go | 42 +- x/evm/types/genesis_test.go | 30 +- x/evm/types/interfaces.go | 35 +- x/evm/types/legacy_tx.go | 6 +- x/evm/types/msg.go | 38 +- x/evm/types/msg_test.go | 10 +- x/evm/types/params.go | 4 +- x/evm/types/params_test.go | 21 +- x/evm/types/permissions_test.go | 27 +- x/evm/types/query.pb.go | 186 +- x/evm/types/query.pb.gw.go | 24 +- x/evm/types/tx.pb.go | 127 +- x/evm/types/tx_data.go | 44 +- x/evm/types/tx_data_test.go | 3 +- x/evm/types/utils_test.go | 9 +- x/feemarket/client/cli/query.go | 1 + x/feemarket/keeper/abci.go | 31 +- x/feemarket/keeper/abci_test.go | 42 +- x/feemarket/keeper/eip1559.go | 2 +- x/feemarket/keeper/eip1559_test.go | 55 +- x/feemarket/keeper/grpc_query_test.go | 107 +- x/feemarket/keeper/integration_test.go | 712 +- x/feemarket/keeper/keeper.go | 6 +- x/feemarket/keeper/keeper_test.go | 44 +- x/feemarket/keeper/msg_server_test.go | 24 +- x/feemarket/keeper/params_test.go | 52 +- x/feemarket/keeper/setup_test.go | 73 +- x/feemarket/keeper/utils_test.go | 204 - x/feemarket/module.go | 53 +- x/feemarket/types/codec.go | 9 +- x/feemarket/types/events.pb.go | 2 +- x/feemarket/types/feemarket.pb.go | 55 +- x/feemarket/types/genesis.pb.go | 28 +- x/feemarket/types/msg.go | 7 +- x/feemarket/types/params_test.go | 32 +- x/feemarket/types/query.pb.go | 58 +- x/feemarket/types/tx.pb.go | 41 +- x/ibc/transfer/ibc_module.go | 4 +- x/ibc/transfer/keeper/keeper.go | 14 +- x/ibc/transfer/keeper/keeper_test.go | 309 +- x/ibc/transfer/keeper/msg_server.go | 20 +- x/ibc/transfer/keeper/msg_server_test.go | 221 +- x/ibc/transfer/module.go | 14 +- x/ibc/transfer/types/interfaces.go | 5 +- 486 files changed, 83667 insertions(+), 18044 deletions(-) create mode 100644 ante/evm/01_setup_ctx_test.go create mode 100644 ante/evm/ante_test.go create mode 100644 ante/evm/eth_benchmark_test.go create mode 100644 ante/evm/fee_market_test.go create mode 100644 ante/evm/signverify_test.go create mode 100644 ante/evm/sigs_test.go create mode 100644 ante/testutils/testutil.go create mode 100644 api/os/crypto/v1/ethsecp256k1/keys.pulsar.go create mode 100644 api/os/erc20/v1/erc20.pulsar.go create mode 100644 api/os/erc20/v1/events.pulsar.go create mode 100644 api/os/erc20/v1/genesis.pulsar.go create mode 100644 api/os/erc20/v1/msg.go create mode 100644 api/os/erc20/v1/query.pulsar.go create mode 100644 api/os/erc20/v1/query_grpc.pb.go create mode 100644 api/os/erc20/v1/tx.pulsar.go create mode 100644 api/os/erc20/v1/tx_grpc.pb.go create mode 100644 api/os/evm/v1/access_list_tx.go create mode 100644 api/os/evm/v1/dynamic_fee_tx.go create mode 100644 api/os/evm/v1/events.pulsar.go create mode 100644 api/os/evm/v1/evm.pulsar.go create mode 100644 api/os/evm/v1/genesis.pulsar.go create mode 100644 api/os/evm/v1/legacy_tx.go create mode 100644 api/os/evm/v1/msg.go create mode 100644 api/os/evm/v1/query.pulsar.go create mode 100644 api/os/evm/v1/query_grpc.pb.go create mode 100644 api/os/evm/v1/tx.pulsar.go create mode 100644 api/os/evm/v1/tx_data.go create mode 100644 api/os/evm/v1/tx_grpc.pb.go create mode 100644 api/os/feemarket/v1/events.pulsar.go create mode 100644 api/os/feemarket/v1/feemarket.pulsar.go create mode 100644 api/os/feemarket/v1/genesis.pulsar.go create mode 100644 api/os/feemarket/v1/query.pulsar.go create mode 100644 api/os/feemarket/v1/query_grpc.pb.go create mode 100644 api/os/feemarket/v1/tx.pulsar.go create mode 100644 api/os/feemarket/v1/tx_grpc.pb.go create mode 100644 api/os/types/v1/dynamic_fee.pulsar.go create mode 100644 api/os/types/v1/indexer.pulsar.go create mode 100644 api/os/types/v1/web3.pulsar.go create mode 100644 example_chain/ante/evm_benchmark_test.go create mode 100644 example_chain/ante/handler_options_test.go create mode 100644 example_chain/ante/integration_test.go delete mode 100644 precompiles/ics20/approve_test.go delete mode 100644 precompiles/ics20/events_test.go delete mode 100644 precompiles/ics20/integration_test.go delete mode 100644 precompiles/ics20/query_test.go delete mode 100644 precompiles/ics20/setup_test.go delete mode 100644 precompiles/ics20/tx_test.go delete mode 100644 precompiles/ics20/utils_test.go create mode 100644 proto/buf.gen.pulsar.yaml create mode 100755 scripts/generate_protos_pulsar.sh create mode 100644 server/config/migration/migration.go create mode 100644 server/config/migration/v0.50-app.toml create mode 100644 shell.nix rename testutil/{ => constants}/constants.go (98%) rename testutil/{ => constants}/constants_test.go (80%) create mode 100644 testutil/fund.go create mode 100644 testutil/integration/common/factory/base.go create mode 100644 testutil/integration/common/factory/distribution.go create mode 100644 testutil/integration/common/factory/fund.go create mode 100644 testutil/integration/common/factory/sign.go create mode 100644 testutil/integration/common/factory/staking.go create mode 100644 testutil/integration/common/grpc/distribution.go delete mode 100644 testutil/integration/os/network/params.go create mode 100644 testutil/integration/os/utils/events.go create mode 100644 testutil/integration/os/utils/params.go create mode 100644 testutil/integration/os/utils/staking.go create mode 100644 testutil/integration/os/utils/types.go create mode 100644 testutil/staking_rewards.go create mode 100644 tox.ini create mode 100644 types/genesis.go create mode 100644 utils/eth/eth.go delete mode 100644 x/erc20/client/proposal_handler.go create mode 100644 x/erc20/keeper/dynamic_precompiles_test.go delete mode 100644 x/erc20/keeper/ibc_callbacks_integration_test.go delete mode 100644 x/erc20/proposal_handler.go create mode 100644 x/erc20/types/constants.go delete mode 100644 x/erc20/types/mocks/AccountKeeper.go delete mode 100644 x/erc20/types/mocks/MsgClient.go delete mode 100644 x/erc20/types/mocks/MsgServer.go delete mode 100644 x/erc20/types/mocks/QueryClient.go delete mode 100644 x/erc20/types/mocks/QueryServer.go delete mode 100644 x/erc20/types/mocks/StakingKeeper.go delete mode 100644 x/erc20/types/mocks/Subspace.go delete mode 100644 x/feemarket/keeper/utils_test.go diff --git a/.github/workflows/auto-format.yml b/.github/workflows/auto-format.yml index b587fa4a..7d0e59a8 100644 --- a/.github/workflows/auto-format.yml +++ b/.github/workflows/auto-format.yml @@ -6,43 +6,42 @@ on: permissions: read-all jobs: - format-go-code: + format-code: runs-on: ubuntu-latest permissions: contents: write steps: - - uses: actions/setup-go@v5 - with: - go-version: "1.22" - check-latest: true + # Checkout repository - uses: actions/checkout@v4 with: token: ${{ secrets.E2E_PAT }} - - run: go install mvdan.cc/gofumpt@latest - - run: make format - # Commit formatted files if necessary - - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: run make format - format-python-code: - runs-on: ubuntu-latest - - permissions: - contents: write + # Install shell formatter + - run: sudo apt-get install -y shfmt - steps: - - uses: actions/checkout@v4 + # Set up Go + - uses: actions/setup-go@v5 with: - token: ${{ secrets.E2E_PAT }} + go-version: "1.22" + check-latest: true + + # Install Go formatter + - run: go install mvdan.cc/gofumpt@latest + + # Set up Python - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: "3.10" + + # Install Python formatters - run: pip install black isort - - run: make format-python + + # Run the combined format command + - run: make format + # Commit formatted files if necessary - uses: stefanzweifel/git-auto-commit-action@v5 with: - commit_message: run make format-python + commit_message: run make format diff --git a/.github/workflows/bsr-push.yml b/.github/workflows/bsr-push.yml index e277618d..d42294f8 100644 --- a/.github/workflows/bsr-push.yml +++ b/.github/workflows/bsr-push.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1.39.0 + - uses: bufbuild/buf-setup-action@v1.41.0 # Push evmOS protos to the Buf Schema Registry - uses: bufbuild/buf-push-action@v1.2.0 with: diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 27efeaee..6adaf486 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -32,7 +32,7 @@ jobs: timeout-minutes: 5 steps: - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1.39.0 + - uses: bufbuild/buf-setup-action@v1.41.0 - uses: bufbuild/buf-lint-action@v1 with: input: "proto" @@ -41,7 +41,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1.39.0 + - uses: bufbuild/buf-setup-action@v1.41.0 - uses: bufbuild/buf-breaking-action@v1 with: input: "proto" diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index 5c2429e7..24d6f1e4 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -32,6 +32,7 @@ jobs: VALIDATE_OPENAPI: false VALIDATE_JSCPD: false VALIDATE_GO: false + VALIDATE_GO_MODULES: false PYTHON_PYLINT_CONFIG_FILE: .pylintrc DEFAULT_BRANCH: "main" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 514c5eff..059a56e7 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,6 @@ yarn.lock # OpenZeppelin contracts contracts/@openzeppelin/* + +# Build files +example_chain/build/ diff --git a/.gitleaks.toml b/.gitleaks.toml index e4afafed..6e3fb77f 100644 --- a/.gitleaks.toml +++ b/.gitleaks.toml @@ -15,11 +15,14 @@ description = "global allow lists" paths = [ '''gitleaks.toml''', '''(.*?)(jpg|gif|pdf|png|svg)$''', - '''(go.mod|go.sum)$''', + '''(go.mod|go.sum|go.work|go.work.sum)$''', ] stopwords = [ '''secp256k1''', '''evmospub1addwnpepqgcxazmq6wgt2j4rdfumsfwla0zfk8e5sws3p3zg5dkm9007hmfysxas0u2''', + '''0x8FA78CEB7F04118Ec6d06AaC37Ca854691d8e963''', + '''0x205CF44075E77A3543abC690437F3b2819bc450a''', + '''evmos10d07y265gmmuvt4z0w9aw880jnsr700jcrztvm''', ] [[rules]] diff --git a/.pylintrc b/.pylintrc index 4ff377fa..354b3166 100644 --- a/.pylintrc +++ b/.pylintrc @@ -11,6 +11,8 @@ # --disable=W". disable=raw-checker-failed, bad-inline-option, + broad-exception-caught, + consider-using-f-string, locally-disabled, file-ignored, suppressed-message, @@ -25,6 +27,7 @@ disable=raw-checker-failed, too-few-public-methods, too-many-public-methods, too-many-arguments, + too-many-instance-attributes, too-many-lines, too-many-locals, too-many-branches, @@ -36,3 +39,5 @@ disable=raw-checker-failed, import-error, use-dict-literal, fixme + +max-line-length=120 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 69bccfca..b33fff33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This changelog was created using the `clu` binary ### Improvements +- (all) [#48](https://github.com/evmos/os/pull/48) Move latest changes from evmOS main (f943af3b incl. SDK v50). - (all) [#43](https://github.com/evmos/os/pull/43) Update with latest evmOS main changes (2b7a8e2). - (tests) [#41](https://github.com/evmos/os/pull/41) Add Solidity and Ledger tests. - (all) [#37](https://github.com/evmos/os/pull/37) Add EVM, feemarket and precompiles from evmOS. diff --git a/Makefile b/Makefile index 0cc9d067..d424766a 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ export GO111MODULE = on # Default target executed when no arguments are given to make. default_target: all -.PHONY: default_target +.PHONY: build, default_target ############################################################################### ### Tools & Dependencies ### @@ -78,26 +78,31 @@ benchmark: ### Linting ### ############################################################################### -lint: +lint: lint-go lint-python lint-contracts + +lint-go: + gofumpt -l . golangci-lint run --out-format=tab + +lint-python: + find . -name "*.py" -type f -not -path "*/node_modules/*" | xargs pylint + flake8 + +lint-contracts: solhint contracts/**/*.sol lint-fix: golangci-lint run --fix --out-format=tab --issues-exit-code=0 lint-fix-contracts: - @cd contracts && \ - npm i && \ - npm run lint-fix solhint --fix contracts/**/*.sol -.PHONY: lint lint-fix +.PHONY: lint lint-fix lint-contracts lint-go lint-python -format: - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.pb.gw.go' | xargs gofumpt -w -l - -.PHONY: format +format: format-go format-python format-shell +format-go: + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' -not -name '*.pb.gw.go' -not -name '*.pulsar.go' | xargs gofumpt -w -l format-python: format-isort format-black @@ -107,11 +112,16 @@ format-black: format-isort: find . -name '*.py' -type f -not -path "*/node_modules/*" | xargs isort +format-shell: + shfmt -l -w . + +.PHONY: format format-go format-python format-black format-isort format-go + ############################################################################### ### Protobuf ### ############################################################################### -protoVer=0.11.6 +protoVer=0.14.0 protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace --user 0 $(protoImageName) @@ -128,6 +138,7 @@ proto-all: proto-format proto-lint proto-gen proto-gen: @echo "generating implementations from Protobuf files" @$(protoImage) sh ./scripts/generate_protos.sh + @$(protoImage) sh ./scripts/generate_protos_pulsar.sh proto-format: @echo "formatting Protobuf files" diff --git a/ante/cosmos/authz.go b/ante/cosmos/authz.go index e4a6733b..7ec39b3a 100644 --- a/ante/cosmos/authz.go +++ b/ante/cosmos/authz.go @@ -31,7 +31,7 @@ func NewAuthzLimiterDecorator(disabledMsgTypes ...string) AuthzLimiterDecorator func (ald AuthzLimiterDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { if err := ald.checkDisabledMsgs(tx.GetMsgs(), false, 1); err != nil { - return ctx, errorsmod.Wrap(errortypes.ErrUnauthorized, err.Error()) + return ctx, errorsmod.Wrapf(errortypes.ErrUnauthorized, "%s", err.Error()) } return next(ctx, tx, simulate) } diff --git a/ante/cosmos/authz_test.go b/ante/cosmos/authz_test.go index 3ab49c97..4178fcbf 100644 --- a/ante/cosmos/authz_test.go +++ b/ante/cosmos/authz_test.go @@ -17,12 +17,17 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" cosmosante "github.com/evmos/os/ante/cosmos" "github.com/evmos/os/testutil" + testconstants "github.com/evmos/os/testutil/constants" + "github.com/evmos/os/testutil/integration/common/factory" + "github.com/evmos/os/testutil/integration/os/network" utiltx "github.com/evmos/os/testutil/tx" evmtypes "github.com/evmos/os/x/evm/types" "github.com/stretchr/testify/require" ) func TestAuthzLimiterDecorator(t *testing.T) { + nw := network.New() + txCfg := nw.GetEncodingConfig().TxConfig testPrivKeys, testAddresses, err := generatePrivKeyAddressPairs(5) require.NoError(t, err) @@ -52,7 +57,7 @@ func TestAuthzLimiterDecorator(t *testing.T) { banktypes.NewMsgSend( testAddresses[0], testAddresses[1], - sdk.NewCoins(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 100e6)), + sdk.NewCoins(sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 100e6)), ), }, false, @@ -134,7 +139,7 @@ func TestAuthzLimiterDecorator(t *testing.T) { []sdk.Msg{banktypes.NewMsgSend( testAddresses[0], testAddresses[3], - sdk.NewCoins(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 100e6)), + sdk.NewCoins(sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 100e6)), )}), }, false, @@ -168,7 +173,7 @@ func TestAuthzLimiterDecorator(t *testing.T) { banktypes.NewMsgSend( testAddresses[0], testAddresses[3], - sdk.NewCoins(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 100e6)), + sdk.NewCoins(sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 100e6)), ), &evmtypes.MsgEthereumTx{}, }, @@ -219,7 +224,7 @@ func TestAuthzLimiterDecorator(t *testing.T) { banktypes.NewMsgSend( testAddresses[0], testAddresses[3], - sdk.NewCoins(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 100e6)), + sdk.NewCoins(sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 100e6)), ), }, ), @@ -237,7 +242,7 @@ func TestAuthzLimiterDecorator(t *testing.T) { banktypes.NewMsgSend( testAddresses[0], testAddresses[3], - sdk.NewCoins(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 100e6)), + sdk.NewCoins(sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 100e6)), ), }, ), @@ -248,7 +253,7 @@ func TestAuthzLimiterDecorator(t *testing.T) { banktypes.NewMsgSend( testAddresses[0], testAddresses[3], - sdk.NewCoins(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 100e6)), + sdk.NewCoins(sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 100e6)), ), }, ), @@ -261,7 +266,7 @@ func TestAuthzLimiterDecorator(t *testing.T) { for _, tc := range testCases { t.Run(fmt.Sprintf("Case %s", tc.name), func(t *testing.T) { ctx := sdk.Context{}.WithIsCheckTx(tc.checkTx) - tx, err := createTx(testPrivKeys[0], tc.msgs...) + tx, err := createTx(ctx, txCfg, testPrivKeys[0], tc.msgs...) require.NoError(t, err) _, err = decorator.AnteHandle(ctx, tx, false, testutil.NoOpNextFn) @@ -279,15 +284,17 @@ func (suite *AnteTestSuite) TestRejectMsgsInAuthz() { _, testAddresses, err := generatePrivKeyAddressPairs(10) suite.Require().NoError(err) + var gasLimit uint64 = 1000000 distantFuture := time.Date(9000, 1, 1, 0, 0, 0, 0, time.UTC) + nw := suite.GetNetwork() // create a dummy MsgEthereumTx for the test // otherwise throws error that cannot unpack tx data msgEthereumTx := evmtypes.NewTx(&evmtypes.EvmTxArgs{ - ChainID: big.NewInt(9000), + ChainID: nw.GetEIP155ChainID(), Nonce: 0, - GasLimit: 1000000, - GasFeeCap: suite.app.FeeMarketKeeper.GetBaseFee(suite.ctx), + GasLimit: gasLimit, + GasFeeCap: nw.App.FeeMarketKeeper.GetBaseFee(nw.GetContext()), GasTipCap: big.NewInt(1), Input: nil, Accesses: ðtypes.AccessList{}, @@ -337,7 +344,7 @@ func (suite *AnteTestSuite) TestRejectMsgsInAuthz() { banktypes.NewMsgSend( testAddresses[0], testAddresses[3], - sdk.NewCoins(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 100e6)), + sdk.NewCoins(sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 100e6)), ), msgEthereumTx, }, @@ -368,7 +375,7 @@ func (suite *AnteTestSuite) TestRejectMsgsInAuthz() { banktypes.NewMsgSend( testAddresses[0], testAddresses[3], - sdk.NewCoins(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 100e6)), + sdk.NewCoins(sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 100e6)), ), }, ), @@ -385,7 +392,7 @@ func (suite *AnteTestSuite) TestRejectMsgsInAuthz() { banktypes.NewMsgSend( testAddresses[0], testAddresses[3], - sdk.NewCoins(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 100e6)), + sdk.NewCoins(sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 100e6)), ), }, ), @@ -396,7 +403,7 @@ func (suite *AnteTestSuite) TestRejectMsgsInAuthz() { banktypes.NewMsgSend( testAddresses[0], testAddresses[3], - sdk.NewCoins(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 100e6)), + sdk.NewCoins(sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 100e6)), ), }, ), @@ -408,54 +415,73 @@ func (suite *AnteTestSuite) TestRejectMsgsInAuthz() { for _, tc := range testcases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() + nw = suite.GetNetwork() var ( tx sdk.Tx err error ) + ctx := nw.GetContext() + priv := suite.GetKeyring().GetPrivKey(0) if tc.isEIP712 { - coinAmount := sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(20)) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(20)) fees := sdk.NewCoins(coinAmount) cosmosTxArgs := utiltx.CosmosTxArgs{ - TxCfg: suite.clientCtx.TxConfig, - Priv: suite.priv, - ChainID: suite.ctx.ChainID(), + TxCfg: suite.GetClientCtx().TxConfig, + Priv: priv, + ChainID: ctx.ChainID(), Gas: 200000, Fees: fees, Msgs: tc.msgs, } tx, err = utiltx.CreateEIP712CosmosTx( - suite.ctx, - suite.app, + ctx, + nw.App, utiltx.EIP712TxArgs{ CosmosTxArgs: cosmosTxArgs, UseLegacyTypedData: true, }, ) } else { - tx, err = createTx(suite.priv, tc.msgs...) + tx, err = suite.GetTxFactory().BuildCosmosTx( + priv, + factory.CosmosTxArgs{ + Gas: &gasLimit, + Msgs: tc.msgs, + }, + ) } suite.Require().NoError(err) - txEncoder := suite.clientCtx.TxConfig.TxEncoder() + txEncoder := suite.GetClientCtx().TxConfig.TxEncoder() bz, err := txEncoder(tx) suite.Require().NoError(err) - resCheckTx := suite.app.CheckTx( - abci.RequestCheckTx{ + resCheckTx, err := nw.App.CheckTx( + &abci.RequestCheckTx{ Tx: bz, Type: abci.CheckTxType_New, }, ) - suite.Require().Equal(tc.expectedCode, resCheckTx.Code, resCheckTx.Log) + suite.Require().NoError(err) + suite.Require().Equal(resCheckTx.Code, tc.expectedCode, resCheckTx.Log) - resDeliverTx := suite.app.DeliverTx( - abci.RequestDeliverTx{ - Tx: bz, + header := ctx.BlockHeader() + blockRes, err := nw.App.FinalizeBlock( + &abci.RequestFinalizeBlock{ + Height: ctx.BlockHeight() + 1, + Txs: [][]byte{bz}, + Hash: header.AppHash, + NextValidatorsHash: header.NextValidatorsHash, + ProposerAddress: header.ProposerAddress, + Time: header.Time.Add(time.Second), }, ) - suite.Require().Equal(tc.expectedCode, resDeliverTx.Code, resDeliverTx.Log) + suite.Require().NoError(err) + suite.Require().Len(blockRes.TxResults, 1) + txRes := blockRes.TxResults[0] + suite.Require().Equal(txRes.Code, tc.expectedCode, txRes.Log) }) } } diff --git a/ante/cosmos/eip712.go b/ante/cosmos/eip712.go index dab204e8..9d89d7fa 100644 --- a/ante/cosmos/eip712.go +++ b/ante/cosmos/eip712.go @@ -40,18 +40,15 @@ func init() { // CONTRACT: Pubkeys are set in context for all signers before this decorator runs // CONTRACT: Tx must implement SigVerifiableTx interface type LegacyEip712SigVerificationDecorator struct { - ak evmtypes.AccountKeeper - signModeHandler authsigning.SignModeHandler + ak evmtypes.AccountKeeper } // Deprecated: NewLegacyEip712SigVerificationDecorator creates a new LegacyEip712SigVerificationDecorator func NewLegacyEip712SigVerificationDecorator( ak evmtypes.AccountKeeper, - signModeHandler authsigning.SignModeHandler, ) LegacyEip712SigVerificationDecorator { return LegacyEip712SigVerificationDecorator{ - ak: ak, - signModeHandler: signModeHandler, + ak: ak, } } @@ -84,7 +81,10 @@ func (svd LegacyEip712SigVerificationDecorator) AnteHandle(ctx sdk.Context, return ctx, err } - signerAddrs := sigTx.GetSigners() + signerAddrs, err := sigTx.GetSigners() + if err != nil { + return ctx, err + } // EIP712 allows just one signature if len(sigs) != 1 { @@ -142,7 +142,7 @@ func (svd LegacyEip712SigVerificationDecorator) AnteHandle(ctx sdk.Context, return next(ctx, tx, simulate) } - if err := VerifySignature(pubKey, signerData, sig.Data, svd.signModeHandler, authSignTx); err != nil { + if err := VerifySignature(pubKey, signerData, sig.Data, authSignTx); err != nil { errMsg := fmt.Errorf("signature verification failed; please verify account number (%d) and chain-id (%s): %w", accNum, chainID, err) return ctx, errorsmod.Wrap(errortypes.ErrUnauthorized, errMsg.Error()) } @@ -156,7 +156,6 @@ func VerifySignature( pubKey cryptotypes.PubKey, signerData authsigning.SignerData, sigData signing.SignatureData, - _ authsigning.SignModeHandler, tx authsigning.Tx, ) error { switch data := sigData.(type) { @@ -187,7 +186,7 @@ func VerifySignature( Amount: tx.GetFee(), Gas: tx.GetGas(), }, - msgs, tx.GetMemo(), tx.GetTip(), + msgs, tx.GetMemo(), ) signerChainID, err := types.ParseChainID(signerData.ChainID) diff --git a/ante/cosmos/min_gas_price_test.go b/ante/cosmos/min_gas_price_test.go index 4e6befd9..9c8d74c9 100644 --- a/ante/cosmos/min_gas_price_test.go +++ b/ante/cosmos/min_gas_price_test.go @@ -3,7 +3,10 @@ package cosmos_test import ( "fmt" + "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" cosmosante "github.com/evmos/os/ante/cosmos" @@ -21,12 +24,14 @@ var execTypes = []struct { } func (suite *AnteTestSuite) TestMinGasPriceDecorator() { - denom := testutil.ExampleAttoDenom + denom := constants.ExampleAttoDenom testMsg := banktypes.MsgSend{ FromAddress: "evmos1x8fhpj9nmhqk8z9kpgjt95ck2xwyue0ptzkucp", ToAddress: "evmos1dx67l23hz9l0k9hcher8xz04uj7wf3yu26l2yn", Amount: sdk.Coins{sdk.Coin{Amount: math.NewInt(10), Denom: denom}}, } + nw := suite.GetNetwork() + ctx := nw.GetContext() testCases := []struct { name string @@ -47,9 +52,9 @@ func (suite *AnteTestSuite) TestMinGasPriceDecorator() { { "valid cosmos tx with MinGasPrices = 0, gasPrice = 0", func() sdk.Tx { - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) + params := nw.App.FeeMarketKeeper.GetParams(ctx) params.MinGasPrice = math.LegacyZeroDec() - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) suite.Require().NoError(err) txBuilder := suite.CreateTestCosmosTxBuilder(math.NewInt(0), denom, &testMsg) @@ -62,9 +67,9 @@ func (suite *AnteTestSuite) TestMinGasPriceDecorator() { { "valid cosmos tx with MinGasPrices = 0, gasPrice > 0", func() sdk.Tx { - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) + params := nw.App.FeeMarketKeeper.GetParams(ctx) params.MinGasPrice = math.LegacyZeroDec() - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) suite.Require().NoError(err) txBuilder := suite.CreateTestCosmosTxBuilder(math.NewInt(10), denom, &testMsg) @@ -77,9 +82,9 @@ func (suite *AnteTestSuite) TestMinGasPriceDecorator() { { "valid cosmos tx with MinGasPrices = 10, gasPrice = 10", func() sdk.Tx { - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) + params := nw.App.FeeMarketKeeper.GetParams(ctx) params.MinGasPrice = math.LegacyNewDec(10) - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) suite.Require().NoError(err) txBuilder := suite.CreateTestCosmosTxBuilder(math.NewInt(10), denom, &testMsg) @@ -92,9 +97,9 @@ func (suite *AnteTestSuite) TestMinGasPriceDecorator() { { "invalid cosmos tx with MinGasPrices = 10, gasPrice = 0", func() sdk.Tx { - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) + params := nw.App.FeeMarketKeeper.GetParams(ctx) params.MinGasPrice = math.LegacyNewDec(10) - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) suite.Require().NoError(err) txBuilder := suite.CreateTestCosmosTxBuilder(math.NewInt(0), denom, &testMsg) @@ -107,9 +112,9 @@ func (suite *AnteTestSuite) TestMinGasPriceDecorator() { { "invalid cosmos tx with stake denom", func() sdk.Tx { - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) + params := nw.App.FeeMarketKeeper.GetParams(ctx) params.MinGasPrice = math.LegacyNewDec(10) - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) suite.Require().NoError(err) txBuilder := suite.CreateTestCosmosTxBuilder(math.NewInt(10), sdk.DefaultBondDenom, &testMsg) @@ -122,9 +127,9 @@ func (suite *AnteTestSuite) TestMinGasPriceDecorator() { { "valid cosmos tx with MinGasPrices = 0, gasPrice = 0, valid fee", func() sdk.Tx { - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) + params := nw.App.FeeMarketKeeper.GetParams(ctx) params.MinGasPrice = math.LegacyZeroDec() - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) suite.Require().NoError(err) txBuilder := suite.CreateTestCosmosTxBuilderWithFees(sdk.Coins{sdk.Coin{Amount: math.NewInt(0), Denom: denom}}, &testMsg) @@ -137,9 +142,9 @@ func (suite *AnteTestSuite) TestMinGasPriceDecorator() { { "valid cosmos tx with MinGasPrices = 0, gasPrice = 0, nil fees, means len(fees) == 0", func() sdk.Tx { - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) + params := nw.App.FeeMarketKeeper.GetParams(ctx) params.MinGasPrice = math.LegacyZeroDec() - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) suite.Require().NoError(err) txBuilder := suite.CreateTestCosmosTxBuilderWithFees(nil, &testMsg) @@ -152,9 +157,9 @@ func (suite *AnteTestSuite) TestMinGasPriceDecorator() { { "valid cosmos tx with MinGasPrices = 0, gasPrice = 0, empty fees, means len(fees) == 0", func() sdk.Tx { - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) + params := nw.App.FeeMarketKeeper.GetParams(ctx) params.MinGasPrice = math.LegacyZeroDec() - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) suite.Require().NoError(err) txBuilder := suite.CreateTestCosmosTxBuilderWithFees(sdk.Coins{}, &testMsg) @@ -167,9 +172,9 @@ func (suite *AnteTestSuite) TestMinGasPriceDecorator() { { "valid cosmos tx with MinGasPrices = 0, gasPrice = 0, invalid fees", func() sdk.Tx { - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) + params := nw.App.FeeMarketKeeper.GetParams(ctx) params.MinGasPrice = math.LegacyZeroDec() - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) suite.Require().NoError(err) fees := sdk.Coins{sdk.Coin{Amount: math.NewInt(0), Denom: denom}, sdk.Coin{Amount: math.NewInt(10), Denom: "stake"}} @@ -185,9 +190,8 @@ func (suite *AnteTestSuite) TestMinGasPriceDecorator() { for _, et := range execTypes { for _, tc := range testCases { suite.Run(et.name+"_"+tc.name, func() { - // s.SetupTest(et.isCheckTx) - ctx := suite.ctx.WithIsReCheckTx(et.isCheckTx) - dec := cosmosante.NewMinGasPriceDecorator(suite.app.FeeMarketKeeper, suite.app.EVMKeeper) + ctx := ctx.WithIsReCheckTx(et.isCheckTx) + dec := cosmosante.NewMinGasPriceDecorator(nw.App.FeeMarketKeeper, nw.App.EVMKeeper) _, err := dec.AnteHandle(ctx, tc.malleate(), et.simulate, testutil.NoOpNextFn) if (et.name == "deliverTx" && tc.expPass) || (et.name == "deliverTxSimulate" && et.simulate && tc.allowPassOnSimulate) { diff --git a/ante/cosmos/setup_test.go b/ante/cosmos/setup_test.go index 63b04465..432d5d52 100644 --- a/ante/cosmos/setup_test.go +++ b/ante/cosmos/setup_test.go @@ -1,149 +1,20 @@ package cosmos_test import ( - "math" "testing" - "time" - sdkmath "cosmossdk.io/math" - "cosmossdk.io/simapp" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/client" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/evmos/os/ante" - evmante "github.com/evmos/os/ante/evm" - "github.com/evmos/os/crypto/ethsecp256k1" - "github.com/evmos/os/encoding" - "github.com/evmos/os/ethereum/eip712" - exampleapp "github.com/evmos/os/example_chain" - chainante "github.com/evmos/os/example_chain/ante" - chaintestutil "github.com/evmos/os/example_chain/testutil" - "github.com/evmos/os/testutil" - "github.com/evmos/os/types" - "github.com/evmos/os/x/evm/statedb" - evmtypes "github.com/evmos/os/x/evm/types" - feemarkettypes "github.com/evmos/os/x/feemarket/types" + "github.com/evmos/os/ante/testutils" "github.com/stretchr/testify/suite" ) type AnteTestSuite struct { - suite.Suite - - ctx sdk.Context - app *exampleapp.ExampleChain - clientCtx client.Context - anteHandler sdk.AnteHandler - ethSigner ethtypes.Signer - priv cryptotypes.PrivKey - enableFeemarket bool - enableLondonHF bool - evmParamsOption func(*evmtypes.Params) -} - -const TestGasLimit uint64 = 100000 - -var chainID = testutil.ExampleChainID - -func (suite *AnteTestSuite) StateDB() *statedb.StateDB { - return statedb.New(suite.ctx, suite.app.EVMKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(suite.ctx.HeaderHash().Bytes()))) -} - -func (suite *AnteTestSuite) SetupTest() { - checkTx := false - priv, err := ethsecp256k1.GenerateKey() - suite.Require().NoError(err) - suite.priv = priv - - suite.app = chaintestutil.EthSetup(checkTx, testutil.ExampleChainID, func(app *exampleapp.ExampleChain, genesis simapp.GenesisState) simapp.GenesisState { - if suite.enableFeemarket { - // setup feemarketGenesis params - feemarketGenesis := feemarkettypes.DefaultGenesisState() - feemarketGenesis.Params.EnableHeight = 1 - feemarketGenesis.Params.NoBaseFee = false - // Verify feeMarket genesis - err := feemarketGenesis.Validate() - suite.Require().NoError(err) - genesis[feemarkettypes.ModuleName] = app.AppCodec().MustMarshalJSON(feemarketGenesis) - } - evmGenesis := evmtypes.DefaultGenesisState() - evmGenesis.Params.EvmDenom = exampleapp.ExampleChainDenom // NOTE: use chain-specific denomination here for testing - evmGenesis.Params.AllowUnprotectedTxs = false - if !suite.enableLondonHF { - maxInt := sdkmath.NewInt(math.MaxInt64) - evmGenesis.Params.ChainConfig.LondonBlock = &maxInt - evmGenesis.Params.ChainConfig.ArrowGlacierBlock = &maxInt - evmGenesis.Params.ChainConfig.GrayGlacierBlock = &maxInt - evmGenesis.Params.ChainConfig.MergeNetsplitBlock = &maxInt - evmGenesis.Params.ChainConfig.ShanghaiBlock = &maxInt - evmGenesis.Params.ChainConfig.CancunBlock = &maxInt - } - if suite.evmParamsOption != nil { - suite.evmParamsOption(&evmGenesis.Params) - } - genesis[evmtypes.ModuleName] = app.AppCodec().MustMarshalJSON(evmGenesis) - return genesis - }) - - suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 2, ChainID: chainID, Time: time.Now().UTC()}) - suite.ctx = suite.ctx.WithMinGasPrices(sdk.NewDecCoins(sdk.NewDecCoin(testutil.ExampleAttoDenom, sdkmath.OneInt()))) - suite.ctx = suite.ctx.WithBlockGasMeter(storetypes.NewGasMeter(1000000000000000000)) - - stakingParams := suite.app.StakingKeeper.GetParams(suite.ctx) - stakingParams.BondDenom = testutil.ExampleAttoDenom - err = suite.app.StakingKeeper.SetParams(suite.ctx, stakingParams) - suite.Require().NoError(err) - - infCtx := suite.ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) - err = suite.app.AccountKeeper.SetParams(infCtx, authtypes.DefaultParams()) - suite.Require().NoError(err) - - encodingConfig := encoding.MakeConfig(exampleapp.ModuleBasics) - // We're using TestMsg amino encoding in some tests, so register it here. - encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) - eip712.SetEncodingConfig(encodingConfig) - - suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) - - anteHandler := chainante.NewAnteHandler(chainante.HandlerOptions{ - AccountKeeper: suite.app.AccountKeeper, - BankKeeper: suite.app.BankKeeper, - EvmKeeper: suite.app.EVMKeeper, - FeegrantKeeper: suite.app.FeeGrantKeeper, - StakingKeeper: suite.app.StakingKeeper, - FeeMarketKeeper: suite.app.FeeMarketKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), - SigGasConsumer: ante.SigVerificationGasConsumer, - ExtensionOptionChecker: types.HasDynamicFeeExtensionOption, - TxFeeChecker: evmante.NewDynamicFeeChecker(suite.app.EVMKeeper), - }) - - suite.anteHandler = anteHandler - suite.ethSigner = ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) - - // fund signer acc to pay for tx fees - amt := sdkmath.NewInt(int64(math.Pow10(18) * 2)) - err = chaintestutil.FundAccount( - suite.ctx, - suite.app.BankKeeper, - suite.priv.PubKey().Address().Bytes(), - sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, amt)), - ) - suite.Require().NoError(err) - - header := suite.ctx.BlockHeader() - suite.ctx = suite.ctx.WithBlockHeight(header.Height - 1) - suite.ctx, err = chaintestutil.Commit(suite.ctx, suite.app, time.Second*0, nil) - suite.Require().NoError(err) + *testutils.AnteTestSuite } func TestAnteTestSuite(t *testing.T) { - suite.Run(t, &AnteTestSuite{ - enableLondonHF: true, - }) + baseSuite := new(testutils.AnteTestSuite) + baseSuite.WithLondonHardForkEnabled(true) + baseSuite.WithFeemarketEnabled(true) + + suite.Run(t, &AnteTestSuite{baseSuite}) } diff --git a/ante/cosmos/utils_test.go b/ante/cosmos/utils_test.go index 6cfdb690..cbcb928c 100644 --- a/ante/cosmos/utils_test.go +++ b/ante/cosmos/utils_test.go @@ -1,6 +1,7 @@ package cosmos_test import ( + "context" "time" sdkmath "cosmossdk.io/math" @@ -11,16 +12,15 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/cosmos/cosmos-sdk/x/authz" + "github.com/evmos/os/ante/testutils" "github.com/evmos/os/crypto/ethsecp256k1" - "github.com/evmos/os/encoding" - app "github.com/evmos/os/example_chain" ) func (suite *AnteTestSuite) CreateTestCosmosTxBuilder(gasPrice sdkmath.Int, denom string, msgs ...sdk.Msg) client.TxBuilder { - txBuilder := suite.clientCtx.TxConfig.NewTxBuilder() + txBuilder := suite.GetClientCtx().TxConfig.NewTxBuilder() - txBuilder.SetGasLimit(TestGasLimit) - fees := &sdk.Coins{{Denom: denom, Amount: gasPrice.MulRaw(int64(TestGasLimit))}} + txBuilder.SetGasLimit(testutils.TestGasLimit) + fees := &sdk.Coins{{Denom: denom, Amount: gasPrice.MulRaw(int64(testutils.TestGasLimit))}} txBuilder.SetFeeAmount(*fees) err := txBuilder.SetMsgs(msgs...) suite.Require().NoError(err) @@ -28,8 +28,8 @@ func (suite *AnteTestSuite) CreateTestCosmosTxBuilder(gasPrice sdkmath.Int, deno } func (suite *AnteTestSuite) CreateTestCosmosTxBuilderWithFees(fees sdk.Coins, msgs ...sdk.Msg) client.TxBuilder { - txBuilder := suite.clientCtx.TxConfig.NewTxBuilder() - txBuilder.SetGasLimit(TestGasLimit) + txBuilder := suite.GetClientCtx().TxConfig.NewTxBuilder() + txBuilder.SetGasLimit(testutils.TestGasLimit) txBuilder.SetFeeAmount(fees) err := txBuilder.SetMsgs(msgs...) suite.Require().NoError(err) @@ -78,9 +78,12 @@ func generatePrivKeyAddressPairs(accCount int) ([]*ethsecp256k1.PrivKey, []sdk.A return testPrivKeys, testAddresses, nil } -func createTx(priv cryptotypes.PrivKey, msgs ...sdk.Msg) (sdk.Tx, error) { - encodingConfig := encoding.MakeConfig(app.ModuleBasics) - txBuilder := encodingConfig.TxConfig.NewTxBuilder() +func createTx(ctx context.Context, txCfg client.TxConfig, priv cryptotypes.PrivKey, msgs ...sdk.Msg) (sdk.Tx, error) { + txBuilder := txCfg.NewTxBuilder() + defaultSignMode, err := authsigning.APISignModeToInternal(txCfg.SignModeHandler().DefaultMode()) + if err != nil { + return nil, err + } txBuilder.SetGasLimit(1000000) if err := txBuilder.SetMsgs(msgs...); err != nil { @@ -92,34 +95,34 @@ func createTx(priv cryptotypes.PrivKey, msgs ...sdk.Msg) (sdk.Tx, error) { sigV2 := signing.SignatureV2{ PubKey: priv.PubKey(), Data: &signing.SingleSignatureData{ - SignMode: encodingConfig.TxConfig.SignModeHandler().DefaultMode(), + SignMode: defaultSignMode, Signature: nil, }, Sequence: 0, } - sigsV2 := []signing.SignatureV2{sigV2} - - if err := txBuilder.SetSignatures(sigsV2...); err != nil { + if err := txBuilder.SetSignatures(sigV2); err != nil { return nil, err } signerData := authsigning.SignerData{ - ChainID: chainID, + Address: sdk.AccAddress(priv.PubKey().Bytes()).String(), + ChainID: "chainID", AccountNumber: 0, Sequence: 0, + PubKey: priv.PubKey(), } - sigV2, err := tx.SignWithPrivKey( - encodingConfig.TxConfig.SignModeHandler().DefaultMode(), signerData, - txBuilder, priv, encodingConfig.TxConfig, + + sigV2, err = tx.SignWithPrivKey( + ctx, defaultSignMode, signerData, + txBuilder, priv, txCfg, 0, ) if err != nil { return nil, err } - sigsV2 = []signing.SignatureV2{sigV2} - err = txBuilder.SetSignatures(sigsV2...) + err = txBuilder.SetSignatures(sigV2) if err != nil { return nil, err } diff --git a/ante/evm/01_setup_ctx.go b/ante/evm/01_setup_ctx.go index d7727133..c63d2412 100644 --- a/ante/evm/01_setup_ctx.go +++ b/ante/evm/01_setup_ctx.go @@ -5,6 +5,7 @@ package evm import ( errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" sdktypes "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" authante "github.com/cosmos/cosmos-sdk/x/auth/ante" @@ -43,7 +44,7 @@ func SetupContext(ctx sdktypes.Context, tx sdktypes.Tx, evmKeeper anteinterfaces // We need to set up an empty gas config so that the gas is consistent with Ethereum. newCtx := evmante.BuildEvmExecutionCtx(ctx). - WithGasMeter(sdktypes.NewInfiniteGasMeter()) + WithGasMeter(storetypes.NewInfiniteGasMeter()) // Reset transient gas used to prepare the execution of current cosmos tx. // Transient gas-used is necessary to sum the gas-used of cosmos tx, when it contains multiple eth msgs. evmKeeper.ResetTransientGasUsed(ctx) diff --git a/ante/evm/01_setup_ctx_test.go b/ante/evm/01_setup_ctx_test.go new file mode 100644 index 00000000..ad52ec84 --- /dev/null +++ b/ante/evm/01_setup_ctx_test.go @@ -0,0 +1,52 @@ +package evm_test + +import ( + "math/big" + + evmante "github.com/evmos/os/ante/evm" + "github.com/evmos/os/testutil" + + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + testutiltx "github.com/evmos/os/testutil/tx" + evmtypes "github.com/evmos/os/x/evm/types" +) + +func (suite *AnteTestSuite) TestEthSetupContextDecorator() { + dec := evmante.NewEthSetUpContextDecorator(suite.GetNetwork().App.EVMKeeper) + ethContractCreationTxParams := &evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + Nonce: 1, + Amount: big.NewInt(10), + GasLimit: 1000, + GasPrice: big.NewInt(1), + } + tx := evmtypes.NewTx(ethContractCreationTxParams) + + testCases := []struct { + name string + tx sdk.Tx + expPass bool + }{ + {"invalid transaction type - does not implement GasTx", &testutiltx.InvalidTx{}, false}, + { + "success - transaction implement GasTx", + tx, + true, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + ctx, err := dec.AnteHandle(suite.GetNetwork().GetContext(), tc.tx, false, testutil.NoOpNextFn) + + if tc.expPass { + suite.Require().NoError(err) + suite.Equal(storetypes.GasConfig{}, ctx.KVGasConfig()) + suite.Equal(storetypes.GasConfig{}, ctx.TransientKVGasConfig()) + } else { + suite.Require().Error(err) + } + }) + } +} diff --git a/ante/evm/04_validate.go b/ante/evm/04_validate.go index 85f49fd7..51f7737f 100644 --- a/ante/evm/04_validate.go +++ b/ante/evm/04_validate.go @@ -57,10 +57,12 @@ func checkDisabledCreateCall( // // FIXME: this shouldn't be required if the tx was an Ethereum transaction type. func ValidateTx(tx sdktypes.Tx) (*tx.Fee, error) { - err := tx.ValidateBasic() - // ErrNoSignatures is fine with eth tx - if err != nil && !errors.Is(err, errortypes.ErrNoSignatures) { - return nil, errorsmod.Wrap(err, "tx basic validation failed") + if t, ok := tx.(sdktypes.HasValidateBasic); ok { + err := t.ValidateBasic() + // ErrNoSignatures is fine with eth tx + if err != nil && !errors.Is(err, errortypes.ErrNoSignatures) { + return nil, errorsmod.Wrap(err, "tx basic validation failed") + } } // For eth type cosmos tx, some fields should be verified as zero values, @@ -103,7 +105,7 @@ func CheckTxFee(txFeeInfo *tx.Fee, txFee sdktypes.Coins, txGasLimit uint64) erro return nil } - if !txFeeInfo.Amount.IsEqual(txFee) { + if !txFeeInfo.Amount.Equal(txFee) { return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "invalid AuthInfo Fee Amount (%s != %s)", txFeeInfo.Amount, txFee) } diff --git a/ante/evm/04_validate_test.go b/ante/evm/04_validate_test.go index 9ca3276f..de4589be 100644 --- a/ante/evm/04_validate_test.go +++ b/ante/evm/04_validate_test.go @@ -9,7 +9,7 @@ import ( errortypes "github.com/cosmos/cosmos-sdk/types/errors" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/ante/evm" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/constants" testkeyring "github.com/evmos/os/testutil/integration/os/keyring" evmtypes "github.com/evmos/os/x/evm/types" ) @@ -33,7 +33,7 @@ func (suite *EvmAnteTestSuite) TestValidateMsg() { expectedError: errortypes.ErrInvalidRequest, getFunctionParams: func() validateMsgParams { return validateMsgParams{ - evmParams: evmtypes.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom), + evmParams: evmtypes.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom), txData: nil, from: keyring.GetAccAddr(0), } @@ -47,7 +47,7 @@ func (suite *EvmAnteTestSuite) TestValidateMsg() { txData, err := txArgs.ToTxData() suite.Require().NoError(err) return validateMsgParams{ - evmParams: evmtypes.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom), + evmParams: evmtypes.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom), txData: txData, from: nil, } @@ -61,7 +61,7 @@ func (suite *EvmAnteTestSuite) TestValidateMsg() { txData, err := txArgs.ToTxData() suite.Require().NoError(err) - params := evmtypes.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom) + params := evmtypes.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom) params.AccessControl.Call.AccessType = evmtypes.AccessTypeRestricted params.AccessControl.Create.AccessType = evmtypes.AccessTypeRestricted @@ -80,7 +80,7 @@ func (suite *EvmAnteTestSuite) TestValidateMsg() { txData, err := txArgs.ToTxData() suite.Require().NoError(err) return validateMsgParams{ - evmParams: evmtypes.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom), + evmParams: evmtypes.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom), txData: txData, from: nil, } @@ -94,7 +94,7 @@ func (suite *EvmAnteTestSuite) TestValidateMsg() { txData, err := txArgs.ToTxData() suite.Require().NoError(err) - params := evmtypes.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom) + params := evmtypes.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom) params.AccessControl.Create.AccessType = evmtypes.AccessTypeRestricted return validateMsgParams{ @@ -112,7 +112,7 @@ func (suite *EvmAnteTestSuite) TestValidateMsg() { txData, err := txArgs.ToTxData() suite.Require().NoError(err) - params := evmtypes.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom) + params := evmtypes.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom) params.AccessControl.Call.AccessType = evmtypes.AccessTypeRestricted return validateMsgParams{ @@ -130,7 +130,7 @@ func (suite *EvmAnteTestSuite) TestValidateMsg() { txData, err := txArgs.ToTxData() suite.Require().NoError(err) return validateMsgParams{ - evmParams: evmtypes.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom), + evmParams: evmtypes.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom), txData: txData, from: nil, } @@ -144,7 +144,7 @@ func (suite *EvmAnteTestSuite) TestValidateMsg() { txData, err := txArgs.ToTxData() suite.Require().NoError(err) - params := evmtypes.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom) + params := evmtypes.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom) params.AccessControl.Call.AccessType = evmtypes.AccessTypeRestricted return validateMsgParams{ @@ -162,7 +162,7 @@ func (suite *EvmAnteTestSuite) TestValidateMsg() { txData, err := txArgs.ToTxData() suite.Require().NoError(err) - params := evmtypes.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom) + params := evmtypes.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom) params.AccessControl.Create.AccessType = evmtypes.AccessTypeRestricted return validateMsgParams{ diff --git a/ante/evm/05_signature_verification.go b/ante/evm/05_signature_verification.go index 0b2d1edb..068df4e4 100644 --- a/ante/evm/05_signature_verification.go +++ b/ante/evm/05_signature_verification.go @@ -40,7 +40,12 @@ func (esvd EthSigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, s signer := ethtypes.MakeSigner(ethCfg, blockNum) allowUnprotectedTxs := evmParams.GetAllowUnprotectedTxs() - for _, msg := range tx.GetMsgs() { + msgs := tx.GetMsgs() + if msgs == nil { + return ctx, errorsmod.Wrap(errortypes.ErrUnknownRequest, "invalid transaction. Transaction without messages") + } + + for _, msg := range msgs { msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx) if !ok { return ctx, errorsmod.Wrapf(errortypes.ErrUnknownRequest, "invalid message type %T, expected %T", msg, (*evmtypes.MsgEthereumTx)(nil)) diff --git a/ante/evm/07_can_transfer.go b/ante/evm/07_can_transfer.go index d0dacbf4..e8db3198 100644 --- a/ante/evm/07_can_transfer.go +++ b/ante/evm/07_can_transfer.go @@ -43,7 +43,7 @@ func CanTransfer( BaseFee: baseFee, } - stateDB := statedb.New(ctx, evmKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash().Bytes()))) + stateDB := statedb.New(ctx, evmKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash()))) evm := evmKeeper.NewEVM(ctx, msg, cfg, evmtypes.NewNoOpTracer(), stateDB) // check that caller has enough balance to cover asset transfer for **topmost** call diff --git a/ante/evm/08_gas_consume_test.go b/ante/evm/08_gas_consume_test.go index 6d2182e6..7e7657d6 100644 --- a/ante/evm/08_gas_consume_test.go +++ b/ante/evm/08_gas_consume_test.go @@ -111,7 +111,7 @@ func (suite *EvmAnteTestSuite) TestConsumeGasAndEmitEvent() { { name: "success: there are non zero fees, user has sufficient bank balances and event emitted", fees: sdktypes.Coins{ - sdktypes.NewCoin(unitNetwork.GetDenom(), sdktypes.NewInt(1000)), + sdktypes.NewCoin(unitNetwork.GetDenom(), sdkmath.NewInt(1000)), }, getSender: func() sdktypes.AccAddress { // Return prefunded sender @@ -122,7 +122,7 @@ func (suite *EvmAnteTestSuite) TestConsumeGasAndEmitEvent() { name: "fail: insufficient user balance, event is NOT emitted", expectedError: "failed to deduct transaction costs from user balance", fees: sdktypes.Coins{ - sdktypes.NewCoin(unitNetwork.GetDenom(), sdktypes.NewInt(1000)), + sdktypes.NewCoin(unitNetwork.GetDenom(), sdkmath.NewInt(1000)), }, getSender: func() sdktypes.AccAddress { // Set up account with too little balance (but not zero) @@ -183,7 +183,7 @@ func (suite *EvmAnteTestSuite) TestConsumeGasAndEmitEvent() { suite.Require().NoError(err) expectedBalance := prevBalance.Balances.Sub(tc.fees...) suite.Require().True( - expectedBalance.IsEqual(afterBalance.Balances), + expectedBalance.Equal(afterBalance.Balances), ) // Event to be emitted diff --git a/ante/evm/09_increment_sequence.go b/ante/evm/09_increment_sequence.go index eeb3cc36..6ced9fad 100644 --- a/ante/evm/09_increment_sequence.go +++ b/ante/evm/09_increment_sequence.go @@ -5,11 +5,8 @@ package evm import ( errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - evmtypes "github.com/evmos/os/x/evm/types" ) @@ -17,7 +14,7 @@ import ( func IncrementNonce( ctx sdk.Context, accountKeeper evmtypes.AccountKeeper, - account authtypes.AccountI, + account sdk.AccountI, txNonce uint64, ) error { nonce := account.GetSequence() diff --git a/ante/evm/09_increment_sequence_test.go b/ante/evm/09_increment_sequence_test.go index 88bb15eb..7a385609 100644 --- a/ante/evm/09_increment_sequence_test.go +++ b/ante/evm/09_increment_sequence_test.go @@ -3,8 +3,8 @@ package evm_test import ( + sdktypes "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/evmos/os/ante/evm" "github.com/evmos/os/testutil/integration/os/grpc" testkeyring "github.com/evmos/os/testutil/integration/os/keyring" @@ -22,19 +22,19 @@ func (suite *EvmAnteTestSuite) TestIncrementSequence() { testCases := []struct { name string expectedError error - malleate func(acct authtypes.AccountI) uint64 + malleate func(acct sdktypes.AccountI) uint64 }{ { name: "fail: invalid sequence", expectedError: errortypes.ErrInvalidSequence, - malleate: func(acct authtypes.AccountI) uint64 { + malleate: func(acct sdktypes.AccountI) uint64 { return acct.GetSequence() + 1 }, }, { name: "success: increments sequence", expectedError: nil, - malleate: func(acct authtypes.AccountI) uint64 { + malleate: func(acct sdktypes.AccountI) uint64 { return acct.GetSequence() }, }, diff --git a/ante/evm/10_gas_wanted_test.go b/ante/evm/10_gas_wanted_test.go index d6c41b17..363f2a06 100644 --- a/ante/evm/10_gas_wanted_test.go +++ b/ante/evm/10_gas_wanted_test.go @@ -3,6 +3,7 @@ package evm_test import ( + storetypes "cosmossdk.io/store/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" sdktypes "github.com/cosmos/cosmos-sdk/types" @@ -11,6 +12,7 @@ import ( "github.com/evmos/os/testutil/integration/os/grpc" testkeyring "github.com/evmos/os/testutil/integration/os/keyring" "github.com/evmos/os/testutil/integration/os/network" + integrationutils "github.com/evmos/os/testutil/integration/os/utils" ) func (suite *EvmAnteTestSuite) TestCheckGasWanted() { @@ -34,7 +36,7 @@ func (suite *EvmAnteTestSuite) TestCheckGasWanted() { expectedError: nil, getCtx: func() sdktypes.Context { // Even if the gasWanted is more than the blockGasLimit, it should not error - blockMeter := sdktypes.NewGasMeter(commonGasLimit - 10000) + blockMeter := storetypes.NewGasMeter(commonGasLimit - 10000) return unitNetwork.GetContext().WithBlockGasMeter(blockMeter) }, isLondon: false, @@ -44,7 +46,7 @@ func (suite *EvmAnteTestSuite) TestCheckGasWanted() { name: "success: gasWanted is less than blockGasLimit", expectedError: nil, getCtx: func() sdktypes.Context { - blockMeter := sdktypes.NewGasMeter(commonGasLimit + 10000) + blockMeter := storetypes.NewGasMeter(commonGasLimit + 10000) return unitNetwork.GetContext().WithBlockGasMeter(blockMeter) }, isLondon: true, @@ -54,7 +56,7 @@ func (suite *EvmAnteTestSuite) TestCheckGasWanted() { name: "fail: gasWanted is more than blockGasLimit", expectedError: errortypes.ErrOutOfGas, getCtx: func() sdktypes.Context { - blockMeter := sdktypes.NewGasMeter(commonGasLimit - 10000) + blockMeter := storetypes.NewGasMeter(commonGasLimit - 10000) return unitNetwork.GetContext().WithBlockGasMeter(blockMeter) }, isLondon: true, @@ -68,10 +70,15 @@ func (suite *EvmAnteTestSuite) TestCheckGasWanted() { feeMarketParams, err := grpcHandler.GetFeeMarketParams() suite.Require().NoError(err) feeMarketParams.Params.NoBaseFee = true - err = unitNetwork.UpdateFeeMarketParams(feeMarketParams.Params) + err = integrationutils.UpdateFeeMarketParams(integrationutils.UpdateParamsInput{ + Tf: txFactory, + Network: unitNetwork, + Pk: keyring.GetPrivKey(0), + Params: feeMarketParams.Params, + }) suite.Require().NoError(err) - blockMeter := sdktypes.NewGasMeter(commonGasLimit + 10000) + blockMeter := storetypes.NewGasMeter(commonGasLimit + 10000) return unitNetwork.GetContext().WithBlockGasMeter(blockMeter) }, isLondon: true, diff --git a/ante/evm/11_emit_event.go b/ante/evm/11_emit_event.go index 971e1690..e47274ae 100644 --- a/ante/evm/11_emit_event.go +++ b/ante/evm/11_emit_event.go @@ -29,13 +29,18 @@ func (eeed EthEmitEventDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulat // we need to emit some basic events at the very end of ante handler to be indexed by tendermint. blockTxIndex := eeed.evmKeeper.GetTxIndexTransient(ctx) - for i, msg := range tx.GetMsgs() { + msgs := tx.GetMsgs() + if msgs == nil { + return ctx, errorsmod.Wrap(errortypes.ErrUnknownRequest, "invalid transaction. Transaction without messages") + } + + for i, msg := range msgs { msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx) if !ok { return ctx, errorsmod.Wrapf(errortypes.ErrUnknownRequest, "invalid message type %T, expected %T", msg, (*evmtypes.MsgEthereumTx)(nil)) } - txIdx := uint64(i) // nosec: G115 + txIdx := uint64(i) //nolint:gosec // G115 // won't exceed uint64 EmitTxHashEvent(ctx, msgEthTx, blockTxIndex, txIdx) } diff --git a/ante/evm/ante_test.go b/ante/evm/ante_test.go new file mode 100644 index 00000000..b5e1f3a4 --- /dev/null +++ b/ante/evm/ante_test.go @@ -0,0 +1,1202 @@ +package evm_test + +import ( + "errors" + "math/big" + "strings" + "time" + + sdkmath "cosmossdk.io/math" + kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/cosmos/cosmos-sdk/x/authz" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + ethparams "github.com/ethereum/go-ethereum/params" + testconstants "github.com/evmos/os/testutil/constants" + utiltx "github.com/evmos/os/testutil/tx" + evmtypes "github.com/evmos/os/x/evm/types" +) + +func (suite *AnteTestSuite) TestAnteHandler() { + var ( + ctx sdk.Context + addr common.Address + privKey cryptotypes.PrivKey + ) + to := utiltx.GenerateAddress() + + setup := func() { + suite.WithFeemarketEnabled(false) + baseFee := sdkmath.NewInt(100) + suite.WithBaseFee(&baseFee) + suite.SetupTest() // reset + + fromKey := suite.GetKeyring().GetKey(0) + addr = fromKey.Addr + privKey = fromKey.Priv + ctx = suite.GetNetwork().GetContext() + } + + ethContractCreationTxParams := evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + Nonce: 0, + Amount: big.NewInt(10), + GasLimit: 100000, + GasPrice: big.NewInt(150), + GasFeeCap: big.NewInt(200), + } + + ethTxParams := evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + To: &to, + Nonce: 0, + Amount: big.NewInt(10), + GasLimit: 100000, + GasPrice: big.NewInt(150), + GasFeeCap: big.NewInt(200), + } + + testCases := []struct { + name string + txFn func() sdk.Tx + checkTx bool + reCheckTx bool + expPass bool + }{ + { + "success - DeliverTx (contract)", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethContractCreationTxParams) + suite.Require().NoError(err) + return tx + }, + false, false, true, + }, + { + "success - CheckTx (contract)", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethContractCreationTxParams) + suite.Require().NoError(err) + return tx + }, + true, false, true, + }, + { + "success - ReCheckTx (contract)", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethContractCreationTxParams) + suite.Require().NoError(err) + return tx + }, + false, true, true, + }, + { + "success - DeliverTx", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethTxParams) + suite.Require().NoError(err) + return tx + }, + false, false, true, + }, + { + "success - CheckTx", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethTxParams) + suite.Require().NoError(err) + return tx + }, + true, false, true, + }, + { + "success - ReCheckTx", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethTxParams) + suite.Require().NoError(err) + return tx + }, false, true, true, + }, + { + "success - CheckTx (cosmos tx not signed)", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethTxParams) + suite.Require().NoError(err) + return tx + }, false, true, true, + }, + { + "fail - CheckTx (cosmos tx is not valid)", + func() sdk.Tx { + txBuilder := suite.CreateTxBuilder(privKey, ethTxParams) + + // bigger than MaxGasWanted + txBuilder.SetGasLimit(uint64(1 << 63)) + return txBuilder.GetTx() + }, true, false, false, + }, + { + "fail - CheckTx (memo too long)", + func() sdk.Tx { + txBuilder := suite.CreateTxBuilder(privKey, ethTxParams) + + txBuilder.SetMemo(strings.Repeat("*", 257)) + return txBuilder.GetTx() + }, true, false, false, + }, + { + "fail - CheckTx (ExtensionOptionsEthereumTx not set)", + func() sdk.Tx { + txBuilder := suite.CreateTxBuilder(privKey, ethTxParams, true) + return txBuilder.GetTx() + }, true, false, false, + }, + // Based on EVMBackend.SendTransaction, for cosmos tx, forcing null for some fields except ExtensionOptions, Fee, MsgEthereumTx + // should be part of consensus + { + "fail - DeliverTx (cosmos tx signed)", + func() sdk.Tx { + nonce, err := suite.GetNetwork().App.AccountKeeper.GetSequence(ctx, suite.GetKeyring().GetAccAddr(0)) + suite.Require().NoError(err) + ethTxParams := evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + To: &to, + Nonce: nonce, + Amount: big.NewInt(10), + GasLimit: 100000, + GasPrice: big.NewInt(1), + } + + txBuilder := suite.CreateTxBuilder(privKey, ethTxParams, true) + suite.Require().NoError(suite.GetTxFactory().SignCosmosTx(privKey, txBuilder)) + return txBuilder.GetTx() + }, false, false, false, + }, + { + "fail - DeliverTx (cosmos tx with memo)", + func() sdk.Tx { + nonce, err := suite.GetNetwork().App.AccountKeeper.GetSequence(ctx, suite.GetKeyring().GetAccAddr(0)) + suite.Require().NoError(err) + ethTxParams := evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + To: &to, + Nonce: nonce, + Amount: big.NewInt(10), + GasLimit: 100000, + GasPrice: big.NewInt(1), + } + txBuilder := suite.CreateTxBuilder(privKey, ethTxParams) + txBuilder.SetMemo("memo for cosmos tx not allowed") + return txBuilder.GetTx() + }, false, false, false, + }, + { + "fail - DeliverTx (cosmos tx with timeoutheight)", + func() sdk.Tx { + nonce, err := suite.GetNetwork().App.AccountKeeper.GetSequence(ctx, suite.GetKeyring().GetAccAddr(0)) + suite.Require().NoError(err) + ethTxParams := evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + To: &to, + Nonce: nonce, + Amount: big.NewInt(10), + GasLimit: 100000, + GasPrice: big.NewInt(1), + } + txBuilder := suite.CreateTxBuilder(privKey, ethTxParams) + txBuilder.SetTimeoutHeight(10) + return txBuilder.GetTx() + }, false, false, false, + }, + { + "fail - DeliverTx (invalid fee amount)", + func() sdk.Tx { + nonce, err := suite.GetNetwork().App.AccountKeeper.GetSequence(ctx, suite.GetKeyring().GetAccAddr(0)) + suite.Require().NoError(err) + ethTxParams := evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + To: &to, + Nonce: nonce, + Amount: big.NewInt(10), + GasLimit: 100000, + GasPrice: big.NewInt(1), + } + txBuilder := suite.CreateTxBuilder(privKey, ethTxParams) + + expFee := txBuilder.GetTx().GetFee() + oneCoin := sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(1)) + invalidFee := expFee.Add(oneCoin) + txBuilder.SetFeeAmount(invalidFee) + return txBuilder.GetTx() + }, false, false, false, + }, + { + "fail - DeliverTx (invalid fee gaslimit)", + func() sdk.Tx { + nonce, err := suite.GetNetwork().App.AccountKeeper.GetSequence(ctx, suite.GetKeyring().GetAccAddr(0)) + suite.Require().NoError(err) + ethTxParams := evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + To: &to, + Nonce: nonce, + Amount: big.NewInt(10), + GasLimit: 100000, + GasPrice: big.NewInt(1), + } + txBuilder := suite.CreateTxBuilder(privKey, ethTxParams) + + expGasLimit := txBuilder.GetTx().GetGas() + invalidGasLimit := expGasLimit + 1 + txBuilder.SetGasLimit(invalidGasLimit) + return txBuilder.GetTx() + }, false, false, false, + }, + { + "success - DeliverTx EIP712 signed Cosmos Tx with MsgSend", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + gas := uint64(200000) + amount := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(100*int64(gas)))) //#nosec G115 + txBuilder, err := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success - DeliverTx EIP712 signed Cosmos Tx with DelegateMsg", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + gas := uint64(200000) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(100*int64(gas))) //#nosec G115 + amount := sdk.NewCoins(coinAmount) + txBuilder, err := suite.CreateTestEIP712TxBuilderMsgDelegate(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success- DeliverTx EIP712 create validator", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712MsgCreateValidator(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success- DeliverTx EIP712 create validator (with blank fields)", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712MsgCreateValidator2(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success- DeliverTx EIP712 MsgSubmitProposal", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + gasAmount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + // reusing the gasAmount for deposit + deposit := sdk.NewCoins(coinAmount) + txBuilder, err := suite.CreateTestEIP712SubmitProposal(from, privKey, ctx.ChainID(), gas, gasAmount, deposit) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success- DeliverTx EIP712 MsgGrant", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + grantee := sdk.AccAddress("_______grantee______") + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + gasAmount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + blockTime := time.Date(1, 1, 1, 1, 1, 1, 1, time.UTC) + expiresAt := blockTime.Add(time.Hour) + msg, err := authz.NewMsgGrant( + from, grantee, &banktypes.SendAuthorization{SpendLimit: gasAmount}, &expiresAt, + ) + suite.Require().NoError(err) + builder, err := suite.CreateTestEIP712SingleMessageTxBuilder(privKey, ctx.ChainID(), gas, gasAmount, msg) + suite.Require().NoError(err) + + return builder.GetTx() + }, false, false, true, + }, + + { + "success- DeliverTx EIP712 MsgGrantAllowance", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + gasAmount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712GrantAllowance(from, privKey, ctx.ChainID(), gas, gasAmount) + suite.Require().NoError(err) + + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success- DeliverTx EIP712 edit validator", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712MsgEditValidator(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success- DeliverTx EIP712 submit evidence", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712MsgSubmitEvidence(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success- DeliverTx EIP712 submit proposal v1", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712SubmitProposalV1(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success- DeliverTx EIP712 MsgExec", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712MsgExec(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success- DeliverTx EIP712 MsgVoteV1", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712MsgVoteV1(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success- DeliverTx EIP712 Multiple MsgSend", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712MultipleMsgSend(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success- DeliverTx EIP712 Multiple Different Msgs", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712MultipleDifferentMsgs(from, privKey, ctx.ChainID(), gas, amount) + suite.RequireErrorForLegacyTypedData(err) + return suite.TxForLegacyTypedData(txBuilder) + }, false, false, !suite.useLegacyEIP712TypedData, + }, + { + "success- DeliverTx EIP712 Same Msgs, Different Schemas", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712SameMsgDifferentSchemas(from, privKey, ctx.ChainID(), gas, amount) + suite.RequireErrorForLegacyTypedData(err) + return suite.TxForLegacyTypedData(txBuilder) + }, false, false, !suite.useLegacyEIP712TypedData, + }, + { + "success- DeliverTx EIP712 Zero Value Array (Should Not Omit Field)", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712ZeroValueArray(from, privKey, ctx.ChainID(), gas, amount) + suite.RequireErrorForLegacyTypedData(err) + return suite.TxForLegacyTypedData(txBuilder) + }, false, false, !suite.useLegacyEIP712TypedData, + }, + { + "success- DeliverTx EIP712 Zero Value Number (Should Not Omit Field)", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712ZeroValueNumber(from, privKey, ctx.ChainID(), gas, amount) + suite.RequireErrorForLegacyTypedData(err) + return suite.TxForLegacyTypedData(txBuilder) + }, false, false, !suite.useLegacyEIP712TypedData, + }, + { + "success- DeliverTx EIP712 MsgTransfer", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712MsgTransfer(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "success- DeliverTx EIP712 MsgTransfer Without Memo", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712MsgTransferWithoutMemo(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, true, + }, + { + "fails - DeliverTx EIP712 Multiple Signers", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + coinAmount := sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)) + amount := sdk.NewCoins(coinAmount) + gas := uint64(200000) + txBuilder, err := suite.CreateTestEIP712MultipleSignerMsgs(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, false, + }, + { + "fails - DeliverTx EIP712 signed Cosmos Tx with wrong Chain ID", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + gas := uint64(200000) + amount := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(100*int64(gas)))) //#nosec G115 + txBuilder, err := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "evmos_9002-1", gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, false, + }, + { + "fails - DeliverTx EIP712 signed Cosmos Tx with different gas fees", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + gas := uint64(200000) + amount := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(100*int64(gas)))) //#nosec G115 + txBuilder, err := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + txBuilder.SetGasLimit(uint64(300000)) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(30)))) + return txBuilder.GetTx() + }, false, false, false, + }, + { + "fails - DeliverTx EIP712 signed Cosmos Tx with invalid chain id", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + gas := uint64(200000) + amount := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(100*int64(gas)))) //#nosec G115 + txBuilder, err := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "evmos_9005-1", gas, amount) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, false, + }, + { + "fails - DeliverTx EIP712 signed Cosmos Tx with invalid sequence", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + gas := uint64(200000) + amount := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(100*int64(gas)))) //#nosec G115 + txBuilder, err := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + nonce, err := suite.GetNetwork().App.AccountKeeper.GetSequence(ctx, suite.GetKeyring().GetAccAddr(0)) + suite.Require().NoError(err) + sigsV2 := signing.SignatureV2{ + PubKey: privKey.PubKey(), + Data: &signing.SingleSignatureData{ + SignMode: signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, + }, + Sequence: nonce - 1, + } + + err = txBuilder.SetSignatures(sigsV2) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, false, + }, + { + "fails - DeliverTx EIP712 signed Cosmos Tx with invalid signMode", + func() sdk.Tx { + from := suite.GetKeyring().GetAccAddr(0) + gas := uint64(200000) + amount := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(100*int64(gas)))) //#nosec G115 + txBuilder, err := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + nonce, err := suite.GetNetwork().App.AccountKeeper.GetSequence(ctx, suite.GetKeyring().GetAccAddr(0)) + suite.Require().NoError(err) + sigsV2 := signing.SignatureV2{ + PubKey: privKey.PubKey(), + Data: &signing.SingleSignatureData{ + SignMode: signing.SignMode_SIGN_MODE_UNSPECIFIED, + }, + Sequence: nonce, + } + err = txBuilder.SetSignatures(sigsV2) + suite.Require().NoError(err) + return txBuilder.GetTx() + }, false, false, false, + }, + { + "fails - invalid from", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethContractCreationTxParams) + suite.Require().NoError(err) + msg := tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx) + msg.From = addr.Hex() + return tx + }, true, false, false, + }, + { + "passes - Single-signer EIP-712", + func() sdk.Tx { + msg := banktypes.NewMsgSend( + sdk.AccAddress(privKey.PubKey().Address()), + addr[:], + sdk.NewCoins( + sdk.NewCoin( + "evmos", + sdkmath.NewInt(1), + ), + ), + ) + + txBuilder := suite.CreateTestSingleSignedTx( + privKey, + signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, + msg, + ctx.ChainID(), + 2000000, + "EIP-712", + ) + + return txBuilder.GetTx() + }, false, false, true, + }, + { + "passes - EIP-712 multi-key", + func() sdk.Tx { + numKeys := 5 + privKeys, pubKeys := suite.GenerateMultipleKeys(numKeys) + pk := kmultisig.NewLegacyAminoPubKey(numKeys, pubKeys) + + msg := banktypes.NewMsgSend( + sdk.AccAddress(pk.Address()), + addr[:], + sdk.NewCoins( + sdk.NewCoin( + "evmos", + sdkmath.NewInt(1), + ), + ), + ) + + txBuilder := suite.CreateTestSignedMultisigTx( + privKeys, + signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, + msg, + ctx.ChainID(), + 2000000, + "EIP-712", + ) + + return txBuilder.GetTx() + }, false, false, true, + }, + { + "passes - Mixed multi-key", + func() sdk.Tx { + numKeys := 5 + privKeys, pubKeys := suite.GenerateMultipleKeys(numKeys) + pk := kmultisig.NewLegacyAminoPubKey(numKeys, pubKeys) + + msg := banktypes.NewMsgSend( + sdk.AccAddress(pk.Address()), + addr[:], + sdk.NewCoins( + sdk.NewCoin( + "evmos", + sdkmath.NewInt(1), + ), + ), + ) + + txBuilder := suite.CreateTestSignedMultisigTx( + privKeys, + signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, + msg, + ctx.ChainID(), + 2000000, + "mixed", // Combine EIP-712 and standard signatures + ) + + return txBuilder.GetTx() + }, false, false, true, + }, + { + "passes - Mixed multi-key with MsgVote", + func() sdk.Tx { + numKeys := 5 + privKeys, pubKeys := suite.GenerateMultipleKeys(numKeys) + pk := kmultisig.NewLegacyAminoPubKey(numKeys, pubKeys) + + msg := govtypes.NewMsgVote( + sdk.AccAddress(pk.Address()), + 1, + govtypes.OptionYes, + ) + + txBuilder := suite.CreateTestSignedMultisigTx( + privKeys, + signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, + msg, + ctx.ChainID(), + 2000000, + "mixed", // Combine EIP-712 and standard signatures + ) + + return txBuilder.GetTx() + }, false, false, true, + }, + { + "Fails - Multi-Key with incorrect Chain ID", + func() sdk.Tx { + numKeys := 5 + privKeys, pubKeys := suite.GenerateMultipleKeys(numKeys) + pk := kmultisig.NewLegacyAminoPubKey(numKeys, pubKeys) + + msg := banktypes.NewMsgSend( + sdk.AccAddress(pk.Address()), + addr[:], + sdk.NewCoins( + sdk.NewCoin( + "evmos", + sdkmath.NewInt(1), + ), + ), + ) + + txBuilder := suite.CreateTestSignedMultisigTx( + privKeys, + signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, + msg, + "evmos_9005-1", + 2000000, + "mixed", + ) + + return txBuilder.GetTx() + }, false, false, false, + }, + { + "Fails - Multi-Key with incorrect sign mode", + func() sdk.Tx { + numKeys := 5 + privKeys, pubKeys := suite.GenerateMultipleKeys(numKeys) + pk := kmultisig.NewLegacyAminoPubKey(numKeys, pubKeys) + + msg := banktypes.NewMsgSend( + sdk.AccAddress(pk.Address()), + addr[:], + sdk.NewCoins( + sdk.NewCoin( + "evmos", + sdkmath.NewInt(1), + ), + ), + ) + + txBuilder := suite.CreateTestSignedMultisigTx( + privKeys, + signing.SignMode_SIGN_MODE_DIRECT, + msg, + ctx.ChainID(), + 2000000, + "mixed", + ) + + return txBuilder.GetTx() + }, false, false, false, + }, + { + "Fails - Multi-Key with too little gas", + func() sdk.Tx { + numKeys := 5 + privKeys, pubKeys := suite.GenerateMultipleKeys(numKeys) + pk := kmultisig.NewLegacyAminoPubKey(numKeys, pubKeys) + + msg := banktypes.NewMsgSend( + sdk.AccAddress(pk.Address()), + addr[:], + sdk.NewCoins( + sdk.NewCoin( + "evmos", + sdkmath.NewInt(1), + ), + ), + ) + + txBuilder := suite.CreateTestSignedMultisigTx( + privKeys, + signing.SignMode_SIGN_MODE_DIRECT, + msg, + ctx.ChainID(), + 2000, + "mixed", // Combine EIP-712 and standard signatures + ) + + return txBuilder.GetTx() + }, false, false, false, + }, + { + "Fails - Multi-Key with different payload than one signed", + func() sdk.Tx { + numKeys := 1 + privKeys, pubKeys := suite.GenerateMultipleKeys(numKeys) + pk := kmultisig.NewLegacyAminoPubKey(numKeys, pubKeys) + + msg := banktypes.NewMsgSend( + sdk.AccAddress(pk.Address()), + addr[:], + sdk.NewCoins( + sdk.NewCoin( + "evmos", + sdkmath.NewInt(1), + ), + ), + ) + + txBuilder := suite.CreateTestSignedMultisigTx( + privKeys, + signing.SignMode_SIGN_MODE_DIRECT, + msg, + ctx.ChainID(), + 2000, + "EIP-712", + ) + + msg.Amount[0].Amount = sdkmath.NewInt(5) + err := txBuilder.SetMsgs(msg) + suite.Require().NoError(err) + + return txBuilder.GetTx() + }, false, false, false, + }, + { + "Fails - Multi-Key with messages added after signing", + func() sdk.Tx { + numKeys := 1 + privKeys, pubKeys := suite.GenerateMultipleKeys(numKeys) + pk := kmultisig.NewLegacyAminoPubKey(numKeys, pubKeys) + + msg := banktypes.NewMsgSend( + sdk.AccAddress(pk.Address()), + addr[:], + sdk.NewCoins( + sdk.NewCoin( + "evmos", + sdkmath.NewInt(1), + ), + ), + ) + + txBuilder := suite.CreateTestSignedMultisigTx( + privKeys, + signing.SignMode_SIGN_MODE_DIRECT, + msg, + ctx.ChainID(), + 2000, + "EIP-712", + ) + + // Duplicate + err := txBuilder.SetMsgs(msg, msg) + suite.Require().NoError(err) + + return txBuilder.GetTx() + }, false, false, false, + }, + { + "Fails - Single-Signer EIP-712 with messages added after signing", + func() sdk.Tx { + msg := banktypes.NewMsgSend( + sdk.AccAddress(privKey.PubKey().Address()), + addr[:], + sdk.NewCoins( + sdk.NewCoin( + "evmos", + sdkmath.NewInt(1), + ), + ), + ) + + txBuilder := suite.CreateTestSingleSignedTx( + privKey, + signing.SignMode_SIGN_MODE_DIRECT, + msg, + ctx.ChainID(), + 2000, + "EIP-712", + ) + + err := txBuilder.SetMsgs(msg, msg) + suite.Require().NoError(err) + + return txBuilder.GetTx() + }, false, false, false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + setup() + + ctx = ctx.WithIsCheckTx(tc.checkTx).WithIsReCheckTx(tc.reCheckTx) + anteHandler := suite.GetAnteHandler() + _, err := anteHandler(ctx, tc.txFn(), false) + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) + } +} + +func (suite *AnteTestSuite) TestAnteHandlerWithDynamicTxFee() { + addr, privKey := utiltx.NewAddrKey() + to := utiltx.GenerateAddress() + + ethContractCreationTxParams := evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + Nonce: 0, + Amount: big.NewInt(10), + GasLimit: 100000, + GasFeeCap: big.NewInt(ethparams.InitialBaseFee + 1), + GasTipCap: big.NewInt(1), + Accesses: &types.AccessList{}, + } + + ethTxParams := evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + Nonce: 0, + Amount: big.NewInt(10), + GasLimit: 100000, + GasFeeCap: big.NewInt(ethparams.InitialBaseFee + 1), + GasTipCap: big.NewInt(1), + Accesses: &types.AccessList{}, + To: &to, + } + + testCases := []struct { + name string + txFn func() sdk.Tx + enableLondonHF bool + checkTx bool + reCheckTx bool + expPass bool + }{ + { + "success - DeliverTx (contract)", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethContractCreationTxParams) + suite.Require().NoError(err) + return tx + }, + true, + false, false, true, + }, + { + "success - CheckTx (contract)", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethContractCreationTxParams) + suite.Require().NoError(err) + return tx + }, + true, + true, false, true, + }, + { + "success - ReCheckTx (contract)", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethContractCreationTxParams) + suite.Require().NoError(err) + return tx + }, + true, + false, true, true, + }, + { + "success - DeliverTx", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethTxParams) + suite.Require().NoError(err) + return tx + }, + true, + false, false, true, + }, + { + "success - CheckTx", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethTxParams) + suite.Require().NoError(err) + return tx + }, + true, + true, false, true, + }, + { + "success - ReCheckTx", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethTxParams) + suite.Require().NoError(err) + return tx + }, + true, + false, true, true, + }, + { + "success - CheckTx (cosmos tx not signed)", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethTxParams) + suite.Require().NoError(err) + return tx + }, + true, + false, true, true, + }, + { + "fail - CheckTx (cosmos tx is not valid)", + func() sdk.Tx { + txBuilder := suite.CreateTxBuilder(privKey, ethTxParams) + // bigger than MaxGasWanted + txBuilder.SetGasLimit(uint64(1 << 63)) + return txBuilder.GetTx() + }, + true, + true, false, false, + }, + { + "fail - CheckTx (memo too long)", + func() sdk.Tx { + txBuilder := suite.CreateTxBuilder(privKey, ethTxParams) + txBuilder.SetMemo(strings.Repeat("*", 257)) + return txBuilder.GetTx() + }, + true, + true, false, false, + }, + { + "fail - DynamicFeeTx without london hark fork", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethContractCreationTxParams) + suite.Require().NoError(err) + return tx + }, + false, + false, false, false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.WithFeemarketEnabled(true) + suite.WithLondonHardForkEnabled(tc.enableLondonHF) + suite.SetupTest() // reset + ctx := suite.GetNetwork().GetContext() + acc := suite.GetNetwork().App.AccountKeeper.NewAccountWithAddress(ctx, addr.Bytes()) + suite.Require().NoError(acc.SetSequence(1)) + suite.GetNetwork().App.AccountKeeper.SetAccount(ctx, acc) + + ctx = ctx.WithIsCheckTx(tc.checkTx).WithIsReCheckTx(tc.reCheckTx) + err := suite.GetNetwork().App.EVMKeeper.SetBalance(ctx, addr, big.NewInt((ethparams.InitialBaseFee+10)*100000)) + suite.Require().NoError(err) + + anteHandler := suite.GetAnteHandler() + _, err = anteHandler(ctx, tc.txFn(), false) + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) + } + suite.WithFeemarketEnabled(false) + suite.WithLondonHardForkEnabled(true) +} + +func (suite *AnteTestSuite) TestAnteHandlerWithParams() { + addr, privKey := utiltx.NewAddrKey() + to := utiltx.GenerateAddress() + + ethContractCreationTxParams := evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + Nonce: 0, + Amount: big.NewInt(10), + GasLimit: 100000, + GasFeeCap: big.NewInt(ethparams.InitialBaseFee + 1), + GasTipCap: big.NewInt(1), + Input: []byte("create bytes"), + Accesses: &types.AccessList{}, + } + + ethTxParams := evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + Nonce: 0, + Amount: big.NewInt(10), + GasLimit: 100000, + GasFeeCap: big.NewInt(ethparams.InitialBaseFee + 1), + GasTipCap: big.NewInt(1), + Accesses: &types.AccessList{}, + Input: []byte("call bytes"), + To: &to, + } + + testCases := []struct { + name string + txFn func() sdk.Tx + permissions evmtypes.AccessControl + expErr error + }{ + { + "fail - Contract Creation Disabled", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethContractCreationTxParams) + suite.Require().NoError(err) + return tx + }, + evmtypes.AccessControl{ + Create: evmtypes.AccessControlType{ + AccessType: evmtypes.AccessTypeRestricted, + AccessControlList: evmtypes.DefaultCreateAllowlistAddresses, + }, + Call: evmtypes.AccessControlType{ + AccessType: evmtypes.AccessTypePermissionless, + AccessControlList: evmtypes.DefaultCreateAllowlistAddresses, + }, + }, + evmtypes.ErrCreateDisabled, + }, + { + "success - Contract Creation Enabled", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethContractCreationTxParams) + suite.Require().NoError(err) + return tx + }, + evmtypes.DefaultAccessControl, + nil, + }, + { + "fail - EVM Call Disabled", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethTxParams) + suite.Require().NoError(err) + return tx + }, + evmtypes.AccessControl{ + Create: evmtypes.AccessControlType{ + AccessType: evmtypes.AccessTypePermissionless, + AccessControlList: evmtypes.DefaultCreateAllowlistAddresses, + }, + Call: evmtypes.AccessControlType{ + AccessType: evmtypes.AccessTypeRestricted, + AccessControlList: evmtypes.DefaultCreateAllowlistAddresses, + }, + }, + evmtypes.ErrCallDisabled, + }, + { + "success - EVM Call Enabled", + func() sdk.Tx { + tx, err := suite.GetTxFactory().GenerateSignedEthTx(privKey, ethTxParams) + suite.Require().NoError(err) + return tx + }, + evmtypes.DefaultAccessControl, + nil, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.WithEvmParamsOptions(func(params *evmtypes.Params) { + params.AccessControl = tc.permissions + }) + // clean up the evmParamsOption + defer suite.ResetEvmParamsOptions() + + suite.SetupTest() // reset + + ctx := suite.GetNetwork().GetContext() + acc := suite.GetNetwork().App.AccountKeeper.NewAccountWithAddress(ctx, addr.Bytes()) + suite.Require().NoError(acc.SetSequence(1)) + suite.GetNetwork().App.AccountKeeper.SetAccount(ctx, acc) + + ctx = ctx.WithIsCheckTx(true) + err := suite.GetNetwork().App.EVMKeeper.SetBalance(ctx, addr, big.NewInt((ethparams.InitialBaseFee+10)*100000)) + suite.Require().NoError(err) + + anteHandler := suite.GetAnteHandler() + _, err = anteHandler(ctx, tc.txFn(), false) + if tc.expErr == nil { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + suite.Require().True(errors.Is(err, tc.expErr)) + } + }) + } + suite.WithEvmParamsOptions(nil) +} diff --git a/ante/evm/eth_benchmark_test.go b/ante/evm/eth_benchmark_test.go new file mode 100644 index 00000000..176234db --- /dev/null +++ b/ante/evm/eth_benchmark_test.go @@ -0,0 +1,94 @@ +package evm_test + +import ( + "fmt" + "math/big" + "testing" + + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + ethtypes "github.com/ethereum/go-ethereum/core/types" + ethante "github.com/evmos/os/ante/evm" + "github.com/evmos/os/ante/testutils" + "github.com/evmos/os/testutil" + testutiltx "github.com/evmos/os/testutil/tx" + "github.com/evmos/os/x/evm/statedb" + evmtypes "github.com/evmos/os/x/evm/types" +) + +func BenchmarkEthGasConsumeDecorator(b *testing.B) { + baseSuite := new(testutils.AnteTestSuite) + s := &AnteTestSuite{ + AnteTestSuite: baseSuite, + } + + s.SetT(&testing.T{}) + s.SetupTest() + ctx := s.GetNetwork().GetContext() + + args := &evmtypes.EvmTxArgs{ + ChainID: s.GetNetwork().App.EVMKeeper.ChainID(), + Nonce: 1, + Amount: big.NewInt(10), + GasLimit: uint64(1_000_000), + GasPrice: big.NewInt(1_000_000), + } + + var vmdb *statedb.StateDB + + testCases := []struct { + name string + balance sdkmath.Int + rewards sdkmath.Int + }{ + { + "legacy tx - enough funds to pay for fees", + sdkmath.NewInt(1e16), + sdkmath.ZeroInt(), + }, + } + b.ResetTimer() + + for _, tc := range testCases { + b.Run(fmt.Sprintf("Case %s", tc.name), func(b *testing.B) { + for n := 0; n < b.N; n++ { + // Stop the timer to perform expensive test setup + b.StopTimer() + addr := testutiltx.GenerateAddress() + args.Accesses = ðtypes.AccessList{{Address: addr, StorageKeys: nil}} + tx := evmtypes.NewTx(args) + tx.From = addr.Hex() + + cacheCtx, _ := ctx.CacheContext() + // Create new stateDB for each test case from the cached context + vmdb = testutil.NewStateDB(cacheCtx, s.GetNetwork().App.EVMKeeper) + cacheCtx = s.prepareAccount(cacheCtx, addr.Bytes(), tc.balance, tc.rewards) + s.Require().NoError(vmdb.Commit()) + keepers := ethante.ConsumeGasKeepers{ + Bank: s.GetNetwork().App.BankKeeper, + Distribution: s.GetNetwork().App.DistrKeeper, + Evm: s.GetNetwork().App.EVMKeeper, + Staking: s.GetNetwork().App.StakingKeeper, + } + + baseFee := s.GetNetwork().App.FeeMarketKeeper.GetParams(ctx).BaseFee + fee := tx.GetEffectiveFee(baseFee.BigInt()) + denom := s.GetNetwork().App.EVMKeeper.GetParams(ctx).EvmDenom + fees := sdk.NewCoins(sdk.NewCoin(denom, sdkmath.NewIntFromBigInt(fee))) + bechAddr := sdk.AccAddress(addr.Bytes()) + + // Benchmark only the ante handler logic - start the timer + b.StartTimer() + + err := ethante.ConsumeFeesAndEmitEvent( + cacheCtx.WithIsCheckTx(true).WithGasMeter(storetypes.NewInfiniteGasMeter()), + &keepers, + fees, + bechAddr, + ) + s.Require().NoError(err) + } + }) + } +} diff --git a/ante/evm/fee_checker_test.go b/ante/evm/fee_checker_test.go index 612f6f8d..40bf24c3 100644 --- a/ante/evm/fee_checker_test.go +++ b/ante/evm/fee_checker_test.go @@ -4,18 +4,17 @@ import ( "math/big" "testing" + "cosmossdk.io/log" "cosmossdk.io/math" - "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/ethereum/go-ethereum/params" - evmante "github.com/evmos/os/ante/evm" + "github.com/evmos/os/ante/evm" anteinterfaces "github.com/evmos/os/ante/interfaces" - "github.com/evmos/os/encoding" - "github.com/evmos/os/testutil" + testconstants "github.com/evmos/os/testutil/constants" + "github.com/evmos/os/testutil/integration/os/network" "github.com/evmos/os/types" evmtypes "github.com/evmos/os/x/evm/types" "github.com/stretchr/testify/require" @@ -36,8 +35,7 @@ func (m MockEVMKeeper) GetBaseFee(_ sdk.Context, _ *params.ChainConfig) *big.Int } func (m MockEVMKeeper) GetParams(_ sdk.Context) evmtypes.Params { - // NOTE: it's important to set the evm denomination here - return evmtypes.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom) + return evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) } func (m MockEVMKeeper) ChainID() *big.Int { @@ -54,8 +52,9 @@ func TestSDKTxFeeChecker(t *testing.T) { // with extension option // without extension option // london hardfork enableness - encodingConfig := encoding.MakeConfig(module.NewBasicManager()) - minGasPrices := sdk.NewDecCoins(sdk.NewDecCoin(testutil.ExampleAttoDenom, math.NewInt(10))) + nw := network.New() + encodingConfig := nw.GetEncodingConfig() + minGasPrices := sdk.NewDecCoins(sdk.NewDecCoin(testconstants.ExampleAttoDenom, math.NewInt(10))) genesisCtx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) checkTxCtx := sdk.NewContext(nil, tmproto.Header{Height: 1}, true, log.NewNopLogger()).WithMinGasPrices(minGasPrices) @@ -99,7 +98,7 @@ func TestSDKTxFeeChecker(t *testing.T) { func() sdk.FeeTx { txBuilder := encodingConfig.TxConfig.NewTxBuilder() txBuilder.SetGasLimit(1) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(10)))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(10)))) return txBuilder.GetTx() }, "10aevmos", @@ -141,7 +140,7 @@ func TestSDKTxFeeChecker(t *testing.T) { func() sdk.FeeTx { txBuilder := encodingConfig.TxConfig.NewTxBuilder() txBuilder.SetGasLimit(1) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(10)))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(10)))) return txBuilder.GetTx() }, "10aevmos", @@ -157,7 +156,7 @@ func TestSDKTxFeeChecker(t *testing.T) { func() sdk.FeeTx { txBuilder := encodingConfig.TxConfig.NewTxBuilder() txBuilder.SetGasLimit(1) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction).Add(math.NewInt(10))))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction).Add(math.NewInt(10))))) return txBuilder.GetTx() }, "10000010aevmos", @@ -173,7 +172,7 @@ func TestSDKTxFeeChecker(t *testing.T) { func() sdk.FeeTx { txBuilder := encodingConfig.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder) txBuilder.SetGasLimit(1) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction)))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction)))) option, err := codectypes.NewAnyWithValue(&types.ExtensionOptionDynamicFeeTx{}) require.NoError(t, err) @@ -193,7 +192,7 @@ func TestSDKTxFeeChecker(t *testing.T) { func() sdk.FeeTx { txBuilder := encodingConfig.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder) txBuilder.SetGasLimit(1) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction).Add(math.NewInt(10))))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction).Add(math.NewInt(10))))) option, err := codectypes.NewAnyWithValue(&types.ExtensionOptionDynamicFeeTx{ MaxPriorityPrice: math.NewInt(5).Mul(evmtypes.DefaultPriorityReduction), @@ -215,7 +214,7 @@ func TestSDKTxFeeChecker(t *testing.T) { func() sdk.FeeTx { txBuilder := encodingConfig.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder) txBuilder.SetGasLimit(1) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction).Add(math.NewInt(10))))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction).Add(math.NewInt(10))))) // set negative priority fee option, err := codectypes.NewAnyWithValue(&types.ExtensionOptionDynamicFeeTx{ @@ -233,7 +232,7 @@ func TestSDKTxFeeChecker(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - fees, priority, err := evmante.NewDynamicFeeChecker(tc.keeper)(tc.ctx, tc.buildTx()) + fees, priority, err := evm.NewDynamicFeeChecker(tc.keeper)(tc.ctx, tc.buildTx()) if tc.expSuccess { require.Equal(t, tc.expFees, fees.String()) require.Equal(t, tc.expPriority, priority) diff --git a/ante/evm/fee_market_test.go b/ante/evm/fee_market_test.go new file mode 100644 index 00000000..eeff5bcc --- /dev/null +++ b/ante/evm/fee_market_test.go @@ -0,0 +1,145 @@ +package evm_test + +import ( + "math/big" + + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/evmos/os/ante/evm" + "github.com/evmos/os/ante/testutils" + "github.com/evmos/os/testutil" + testconstants "github.com/evmos/os/testutil/constants" + utiltx "github.com/evmos/os/testutil/tx" + "github.com/evmos/os/types" + evmtypes "github.com/evmos/os/x/evm/types" +) + +func (suite *AnteTestSuite) TestGasWantedDecorator() { + suite.WithFeemarketEnabled(true) + suite.SetupTest() + ctx := suite.GetNetwork().GetContext() + dec := evm.NewGasWantedDecorator(suite.GetNetwork().App.EVMKeeper, suite.GetNetwork().App.FeeMarketKeeper) + from, fromPrivKey := utiltx.NewAddrKey() + to := utiltx.GenerateAddress() + + testCases := []struct { + name string + expectedGasWanted uint64 + malleate func() sdk.Tx + expPass bool + }{ + { + "Cosmos Tx", + testutils.TestGasLimit, + func() sdk.Tx { + denom := testconstants.ExampleAttoDenom + testMsg := banktypes.MsgSend{ + FromAddress: "evmos1x8fhpj9nmhqk8z9kpgjt95ck2xwyue0ptzkucp", + ToAddress: "evmos1dx67l23hz9l0k9hcher8xz04uj7wf3yu26l2yn", + Amount: sdk.Coins{sdk.Coin{Amount: sdkmath.NewInt(10), Denom: denom}}, + } + txBuilder := suite.CreateTestCosmosTxBuilder(sdkmath.NewInt(10), testconstants.ExampleAttoDenom, &testMsg) + return txBuilder.GetTx() + }, + true, + }, + { + "Ethereum Legacy Tx", + testutils.TestGasLimit, + func() sdk.Tx { + txArgs := evmtypes.EvmTxArgs{ + To: &to, + GasPrice: big.NewInt(0), + GasLimit: testutils.TestGasLimit, + } + return suite.CreateTxBuilder(fromPrivKey, txArgs).GetTx() + }, + true, + }, + { + "Ethereum Access List Tx", + testutils.TestGasLimit, + func() sdk.Tx { + emptyAccessList := ethtypes.AccessList{} + txArgs := evmtypes.EvmTxArgs{ + To: &to, + GasPrice: big.NewInt(0), + GasLimit: testutils.TestGasLimit, + Accesses: &emptyAccessList, + } + return suite.CreateTxBuilder(fromPrivKey, txArgs).GetTx() + }, + true, + }, + { + "Ethereum Dynamic Fee Tx (EIP1559)", + testutils.TestGasLimit, + func() sdk.Tx { + emptyAccessList := ethtypes.AccessList{} + txArgs := evmtypes.EvmTxArgs{ + To: &to, + GasPrice: big.NewInt(0), + GasFeeCap: big.NewInt(100), + GasLimit: testutils.TestGasLimit, + GasTipCap: big.NewInt(50), + Accesses: &emptyAccessList, + } + return suite.CreateTxBuilder(fromPrivKey, txArgs).GetTx() + }, + true, + }, + { + "EIP712 message", + 200000, + func() sdk.Tx { + amount := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20))) + gas := uint64(200000) + acc := suite.GetNetwork().App.AccountKeeper.NewAccountWithAddress(ctx, from.Bytes()) + suite.Require().NoError(acc.SetSequence(1)) + suite.GetNetwork().App.AccountKeeper.SetAccount(ctx, acc) + builder, err := suite.CreateTestEIP712TxBuilderMsgSend(acc.GetAddress(), fromPrivKey, ctx.ChainID(), gas, amount) + suite.Require().NoError(err) + return builder.GetTx() + }, + true, + }, + { + "Cosmos Tx - gasWanted > max block gas", + testutils.TestGasLimit, + func() sdk.Tx { + denom := testconstants.ExampleAttoDenom + testMsg := banktypes.MsgSend{ + FromAddress: "evmos1x8fhpj9nmhqk8z9kpgjt95ck2xwyue0ptzkucp", + ToAddress: "evmos1dx67l23hz9l0k9hcher8xz04uj7wf3yu26l2yn", + Amount: sdk.Coins{sdk.Coin{Amount: sdkmath.NewInt(10), Denom: denom}}, + } + txBuilder := suite.CreateTestCosmosTxBuilder(sdkmath.NewInt(10), testconstants.ExampleAttoDenom, &testMsg) + limit := types.BlockGasLimit(ctx) + txBuilder.SetGasLimit(limit + 5) + return txBuilder.GetTx() + }, + false, + }, + } + + // cumulative gas wanted from all test transactions in the same block + var expectedGasWanted uint64 + + for _, tc := range testCases { + suite.Run(tc.name, func() { + _, err := dec.AnteHandle(ctx, tc.malleate(), false, testutil.NoOpNextFn) + if tc.expPass { + suite.Require().NoError(err) + + gasWanted := suite.GetNetwork().App.FeeMarketKeeper.GetTransientGasWanted(ctx) + expectedGasWanted += tc.expectedGasWanted + suite.Require().Equal(expectedGasWanted, gasWanted) + } else { + // TODO: check for specific error message + suite.Require().Error(err) + } + }) + } +} diff --git a/ante/evm/setup_test.go b/ante/evm/setup_test.go index 1f63f4fb..f5978d2a 100644 --- a/ante/evm/setup_test.go +++ b/ante/evm/setup_test.go @@ -1,135 +1,29 @@ package evm_test import ( - "math" "testing" - "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/evmos/os/ante/testutils" "github.com/stretchr/testify/suite" - - sdkmath "cosmossdk.io/math" - "cosmossdk.io/simapp" - "github.com/cosmos/cosmos-sdk/client" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/ethereum/go-ethereum/core/types" - evmosante "github.com/evmos/os/ante" - "github.com/evmos/os/encoding" - "github.com/evmos/os/ethereum/eip712" - exampleapp "github.com/evmos/os/example_chain" - chainante "github.com/evmos/os/example_chain/ante" - chainutil "github.com/evmos/os/example_chain/testutil" - "github.com/evmos/os/testutil" - evmtypes "github.com/evmos/os/x/evm/types" - feemarkettypes "github.com/evmos/os/x/feemarket/types" ) type AnteTestSuite struct { - suite.Suite - - ctx sdk.Context - app *exampleapp.ExampleChain - clientCtx client.Context - anteHandler sdk.AnteHandler - ethSigner types.Signer - enableFeemarket bool - enableLondonHF bool - evmParamsOption func(*evmtypes.Params) + *testutils.AnteTestSuite useLegacyEIP712TypedData bool } -const TestGasLimit uint64 = 100000 - -func (suite *AnteTestSuite) SetupTest() { - checkTx := false - - suite.app = chainutil.EthSetup(checkTx, testutil.ExampleChainID, func(app *exampleapp.ExampleChain, genesis simapp.GenesisState) simapp.GenesisState { - if suite.enableFeemarket { - // setup feemarketGenesis params - feemarketGenesis := feemarkettypes.DefaultGenesisState() - feemarketGenesis.Params.EnableHeight = 1 - feemarketGenesis.Params.NoBaseFee = false - // Verify feeMarket genesis - err := feemarketGenesis.Validate() - suite.Require().NoError(err) - genesis[feemarkettypes.ModuleName] = app.AppCodec().MustMarshalJSON(feemarketGenesis) - } - evmGenesis := evmtypes.DefaultGenesisState() - evmGenesis.Params.EvmDenom = exampleapp.ExampleChainDenom - evmGenesis.Params.AllowUnprotectedTxs = false - if !suite.enableLondonHF { - maxInt := sdkmath.NewInt(math.MaxInt64) - evmGenesis.Params.ChainConfig.LondonBlock = &maxInt - evmGenesis.Params.ChainConfig.ArrowGlacierBlock = &maxInt - evmGenesis.Params.ChainConfig.GrayGlacierBlock = &maxInt - evmGenesis.Params.ChainConfig.MergeNetsplitBlock = &maxInt - evmGenesis.Params.ChainConfig.ShanghaiBlock = &maxInt - evmGenesis.Params.ChainConfig.CancunBlock = &maxInt - } - if suite.evmParamsOption != nil { - suite.evmParamsOption(&evmGenesis.Params) - } - genesis[evmtypes.ModuleName] = app.AppCodec().MustMarshalJSON(evmGenesis) - return genesis - }) - - suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 2, ChainID: testutil.ExampleChainID, Time: time.Now().UTC()}) - suite.ctx = suite.ctx.WithMinGasPrices(sdk.NewDecCoins(sdk.NewDecCoin(testutil.ExampleAttoDenom, sdkmath.OneInt()))) - suite.ctx = suite.ctx.WithBlockGasMeter(storetypes.NewGasMeter(1000000000000000000)) - - // set staking denomination to Evmos denom - params := suite.app.StakingKeeper.GetParams(suite.ctx) - params.BondDenom = exampleapp.ExampleChainDenom - err := suite.app.StakingKeeper.SetParams(suite.ctx, params) - suite.Require().NoError(err) - - infCtx := suite.ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) - err = suite.app.AccountKeeper.SetParams(infCtx, authtypes.DefaultParams()) - suite.Require().NoError(err) - - encodingConfig := encoding.MakeConfig(exampleapp.ModuleBasics) - // We're using TestMsg amino encoding in some tests, so register it here. - encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) - eip712.SetEncodingConfig(encodingConfig) - - suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) - - suite.Require().NotNil(suite.app.AppCodec()) - - anteHandler := chainante.NewAnteHandler(chainante.HandlerOptions{ - Cdc: suite.app.AppCodec(), - AccountKeeper: suite.app.AccountKeeper, - BankKeeper: suite.app.BankKeeper, - DistributionKeeper: suite.app.DistrKeeper, - EvmKeeper: suite.app.EVMKeeper, - FeegrantKeeper: suite.app.FeeGrantKeeper, - StakingKeeper: suite.app.StakingKeeper, - FeeMarketKeeper: suite.app.FeeMarketKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), - SigGasConsumer: evmosante.SigVerificationGasConsumer, - }) - - suite.anteHandler = anteHandler - suite.ethSigner = types.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) -} - func TestAnteTestSuite(t *testing.T) { + baseSuite := new(testutils.AnteTestSuite) + baseSuite.WithLondonHardForkEnabled(true) + suite.Run(t, &AnteTestSuite{ - enableLondonHF: true, + AnteTestSuite: baseSuite, }) // Re-run the tests with EIP-712 Legacy encodings to ensure backwards compatibility. // LegacyEIP712Extension should not be run with current TypedData encodings, since they are not compatible. suite.Run(t, &AnteTestSuite{ - enableLondonHF: true, - useLegacyEIP712TypedData: true, - }) - - suite.Run(t, &AnteTestSuite{ - enableLondonHF: true, + AnteTestSuite: baseSuite, useLegacyEIP712TypedData: true, }) } diff --git a/ante/evm/signverify_test.go b/ante/evm/signverify_test.go new file mode 100644 index 00000000..fc752829 --- /dev/null +++ b/ante/evm/signverify_test.go @@ -0,0 +1,85 @@ +package evm_test + +import ( + "math/big" + + sdk "github.com/cosmos/cosmos-sdk/types" + ethtypes "github.com/ethereum/go-ethereum/core/types" + ethante "github.com/evmos/os/ante/evm" + "github.com/evmos/os/testutil" + testutiltx "github.com/evmos/os/testutil/tx" + evmtypes "github.com/evmos/os/x/evm/types" +) + +func (suite *AnteTestSuite) TestEthSigVerificationDecorator() { + addr, privKey := testutiltx.NewAddrKey() + ethSigner := ethtypes.LatestSignerForChainID(suite.GetNetwork().App.EVMKeeper.ChainID()) + + ethContractCreationTxParams := &evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + Nonce: 1, + Amount: big.NewInt(10), + GasLimit: 1000, + GasPrice: big.NewInt(1), + } + signedTx := evmtypes.NewTx(ethContractCreationTxParams) + signedTx.From = addr.Hex() + err := signedTx.Sign(ethSigner, testutiltx.NewSigner(privKey)) + suite.Require().NoError(err) + + unprotectedEthTxParams := &evmtypes.EvmTxArgs{ + Nonce: 1, + Amount: big.NewInt(10), + GasLimit: 1000, + GasPrice: big.NewInt(1), + } + unprotectedTx := evmtypes.NewTx(unprotectedEthTxParams) + unprotectedTx.From = addr.Hex() + err = unprotectedTx.Sign(ethtypes.HomesteadSigner{}, testutiltx.NewSigner(privKey)) + suite.Require().NoError(err) + + testCases := []struct { + name string + tx sdk.Tx + allowUnprotectedTxs bool + reCheckTx bool + expPass bool + }{ + {"ReCheckTx", &testutiltx.InvalidTx{}, false, true, false}, + {"invalid transaction type", &testutiltx.InvalidTx{}, false, false, false}, + { + "invalid sender", + evmtypes.NewTx(&evmtypes.EvmTxArgs{ + To: &addr, + Nonce: 1, + Amount: big.NewInt(10), + GasLimit: 1000, + GasPrice: big.NewInt(1), + }), + true, + false, + false, + }, + {"successful signature verification", signedTx, false, false, true}, + {"invalid, reject unprotected txs", unprotectedTx, false, false, false}, + {"successful, allow unprotected txs", unprotectedTx, true, false, true}, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.WithEvmParamsOptions(func(params *evmtypes.Params) { + params.AllowUnprotectedTxs = tc.allowUnprotectedTxs + }) + suite.SetupTest() + dec := ethante.NewEthSigVerificationDecorator(suite.GetNetwork().App.EVMKeeper) + _, err := dec.AnteHandle(suite.GetNetwork().GetContext().WithIsReCheckTx(tc.reCheckTx), tc.tx, false, testutil.NoOpNextFn) + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) + } + suite.WithEvmParamsOptions(nil) +} diff --git a/ante/evm/sigs_test.go b/ante/evm/sigs_test.go new file mode 100644 index 00000000..de7d8e26 --- /dev/null +++ b/ante/evm/sigs_test.go @@ -0,0 +1,49 @@ +package evm_test + +import ( + "math/big" + + utiltx "github.com/evmos/os/testutil/tx" + evmtypes "github.com/evmos/os/x/evm/types" +) + +func (suite *AnteTestSuite) TestSignatures() { + suite.WithFeemarketEnabled(false) + suite.SetupTest() // reset + + privKey := suite.GetKeyring().GetPrivKey(0) + to := utiltx.GenerateAddress() + + txArgs := evmtypes.EvmTxArgs{ + ChainID: suite.GetNetwork().App.EVMKeeper.ChainID(), + Nonce: 0, + To: &to, + Amount: big.NewInt(10), + GasLimit: 100000, + GasPrice: big.NewInt(1), + } + + // CreateTestTx will sign the msgEthereumTx but not sign the cosmos tx since we have signCosmosTx as false + tx := suite.CreateTxBuilder(privKey, txArgs).GetTx() + sigs, err := tx.GetSignaturesV2() + suite.Require().NoError(err) + + // signatures of cosmos tx should be empty + suite.Require().Equal(len(sigs), 0) + + msg := tx.GetMsgs()[0] + msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx) + suite.Require().True(ok) + txData, err := evmtypes.UnpackTxData(msgEthTx.Data) + suite.Require().NoError(err) + + msgV, msgR, msgS := txData.GetRawSignatureValues() + + ethTx := msgEthTx.AsTransaction() + ethV, ethR, ethS := ethTx.RawSignatureValues() + + // The signatures of MsgEthereumTx should be the same with the corresponding eth tx + suite.Require().Equal(msgV, ethV) + suite.Require().Equal(msgR, ethR) + suite.Require().Equal(msgS, ethS) +} diff --git a/ante/evm/utils_test.go b/ante/evm/utils_test.go index 25b60136..800df225 100644 --- a/ante/evm/utils_test.go +++ b/ante/evm/utils_test.go @@ -6,9 +6,11 @@ import ( "math/big" "time" - "cosmossdk.io/math" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + evtypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" @@ -16,7 +18,6 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" sdk "github.com/cosmos/cosmos-sdk/types" - txtypes "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" sdkante "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" @@ -24,137 +25,53 @@ import ( authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authz "github.com/cosmos/cosmos-sdk/x/authz" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - evtypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibctypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + ibctypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/evmos/os/ante/testutils" "github.com/evmos/os/crypto/ethsecp256k1" "github.com/evmos/os/ethereum/eip712" "github.com/evmos/os/testutil" + testconstants "github.com/evmos/os/testutil/constants" utiltx "github.com/evmos/os/testutil/tx" evmtypes "github.com/evmos/os/x/evm/types" ) -func (suite *AnteTestSuite) BuildTestEthTx( - from common.Address, - to common.Address, - amount *big.Int, - input []byte, - gasPrice *big.Int, - gasFeeCap *big.Int, - gasTipCap *big.Int, - accesses *ethtypes.AccessList, -) *evmtypes.MsgEthereumTx { - chainID := suite.app.EVMKeeper.ChainID() - nonce := suite.app.EVMKeeper.GetNonce( - suite.ctx, - common.BytesToAddress(from.Bytes()), - ) - - ethTxParams := &evmtypes.EvmTxArgs{ - ChainID: chainID, - Nonce: nonce, - To: &to, - Amount: amount, - GasLimit: TestGasLimit, - GasPrice: gasPrice, - GasFeeCap: gasFeeCap, - GasTipCap: gasTipCap, - Input: input, - Accesses: accesses, - } - - msgEthereumTx := evmtypes.NewTx(ethTxParams) - msgEthereumTx.From = from.String() - return msgEthereumTx -} - -// CreateTestTx is a helper function to create a tx given multiple inputs. -// -//nolint:revive -func (suite *AnteTestSuite) CreateTestTx( - msg *evmtypes.MsgEthereumTx, priv cryptotypes.PrivKey, accNum uint64, signCosmosTx bool, - unsetExtensionOptions ...bool, -) authsigning.Tx { - return suite.CreateTestTxBuilder(msg, priv, accNum, signCosmosTx).GetTx() -} - -// CreateTestTxBuilder is a helper function to create a tx builder given multiple inputs. -func (suite *AnteTestSuite) CreateTestTxBuilder( - msg *evmtypes.MsgEthereumTx, priv cryptotypes.PrivKey, accNum uint64, signCosmosTx bool, - unsetExtensionOptions ...bool, -) client.TxBuilder { +func (suite *AnteTestSuite) CreateTxBuilder(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs, unsetExtensionOptions ...bool) client.TxBuilder { var option *codectypes.Any var err error if len(unsetExtensionOptions) == 0 { option, err = codectypes.NewAnyWithValue(&evmtypes.ExtensionOptionsEthereumTx{}) suite.Require().NoError(err) } + msgEthTx, err := suite.GetTxFactory().GenerateMsgEthereumTx(privKey, txArgs) + suite.Require().NoError(err) + + signedMsg, err := suite.GetTxFactory().SignMsgEthereumTx(privKey, msgEthTx) + suite.Require().NoError(err) + suite.Require().NoError(signedMsg.ValidateBasic()) - txBuilder := suite.clientCtx.TxConfig.NewTxBuilder() - builder, ok := txBuilder.(authtx.ExtensionOptionsTxBuilder) + tb := suite.GetClientCtx().TxConfig.NewTxBuilder() + builder, ok := tb.(authtx.ExtensionOptionsTxBuilder) suite.Require().True(ok) if len(unsetExtensionOptions) == 0 { builder.SetExtensionOptions(option) } - err = msg.Sign(suite.ethSigner, utiltx.NewSigner(priv)) - suite.Require().NoError(err) - - msg.From = "" - err = builder.SetMsgs(msg) + err = builder.SetMsgs(&signedMsg) suite.Require().NoError(err) - txData, err := evmtypes.UnpackTxData(msg.Data) + txData, err := evmtypes.UnpackTxData(signedMsg.Data) suite.Require().NoError(err) - fees := sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewIntFromBigInt(txData.Fee()))) + fees := sdk.NewCoins(sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewIntFromBigInt(txData.Fee()))) builder.SetFeeAmount(fees) - builder.SetGasLimit(msg.GetGas()) - - if signCosmosTx { - // First round: we gather all the signer infos. We use the "set empty - // signature" hack to do that. - sigV2 := signing.SignatureV2{ - PubKey: priv.PubKey(), - Data: &signing.SingleSignatureData{ - SignMode: suite.clientCtx.TxConfig.SignModeHandler().DefaultMode(), - Signature: nil, - }, - Sequence: txData.GetNonce(), - } - - sigsV2 := []signing.SignatureV2{sigV2} - - err = txBuilder.SetSignatures(sigsV2...) - suite.Require().NoError(err) - - // Second round: all signer infos are set, so each signer can sign. - - signerData := authsigning.SignerData{ - ChainID: suite.ctx.ChainID(), - AccountNumber: accNum, - Sequence: txData.GetNonce(), - } - sigV2, err = tx.SignWithPrivKey( - suite.clientCtx.TxConfig.SignModeHandler().DefaultMode(), signerData, - txBuilder, priv, suite.clientCtx.TxConfig, txData.GetNonce(), - ) - suite.Require().NoError(err) - - sigsV2 = []signing.SignatureV2{sigV2} - - err = txBuilder.SetSignatures(sigsV2...) - suite.Require().NoError(err) - } - - return txBuilder + builder.SetGasLimit(signedMsg.GetGas()) + return builder } func (suite *AnteTestSuite) RequireErrorForLegacyTypedData(err error) { @@ -169,18 +86,18 @@ func (suite *AnteTestSuite) TxForLegacyTypedData(txBuilder client.TxBuilder) sdk if suite.useLegacyEIP712TypedData { // Since the TxBuilder will be nil on failure, // we return an empty Tx to avoid panics. - emptyTxBuilder := suite.clientCtx.TxConfig.NewTxBuilder() + emptyTxBuilder := suite.GetClientCtx().TxConfig.NewTxBuilder() return emptyTxBuilder.GetTx() } return txBuilder.GetTx() } -func (suite *AnteTestSuite) CreateTestCosmosTxBuilder(gasPrice math.Int, denom string, msgs ...sdk.Msg) client.TxBuilder { - txBuilder := suite.clientCtx.TxConfig.NewTxBuilder() +func (suite *AnteTestSuite) CreateTestCosmosTxBuilder(gasPrice sdkmath.Int, denom string, msgs ...sdk.Msg) client.TxBuilder { + txBuilder := suite.GetClientCtx().TxConfig.NewTxBuilder() - txBuilder.SetGasLimit(TestGasLimit) - fees := &sdk.Coins{{Denom: denom, Amount: gasPrice.MulRaw(int64(TestGasLimit))}} + txBuilder.SetGasLimit(testutils.TestGasLimit) + fees := &sdk.Coins{{Denom: denom, Amount: gasPrice.MulRaw(int64(testutils.TestGasLimit))}} txBuilder.SetFeeAmount(*fees) err := txBuilder.SetMsgs(msgs...) suite.Require().NoError(err) @@ -190,16 +107,15 @@ func (suite *AnteTestSuite) CreateTestCosmosTxBuilder(gasPrice math.Int, denom s func (suite *AnteTestSuite) CreateTestEIP712TxBuilderMsgSend(from sdk.AccAddress, priv cryptotypes.PrivKey, chainID string, gas uint64, gasAmount sdk.Coins) (client.TxBuilder, error) { // Build MsgSend recipient := sdk.AccAddress(common.Address{}.Bytes()) - msgSend := banktypes.NewMsgSend(from, recipient, sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1)))) + msgSend := banktypes.NewMsgSend(from, recipient, sdk.NewCoins(sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(1)))) return suite.CreateTestEIP712SingleMessageTxBuilder(priv, chainID, gas, gasAmount, msgSend) } func (suite *AnteTestSuite) CreateTestEIP712TxBuilderMsgDelegate(from sdk.AccAddress, priv cryptotypes.PrivKey, chainID string, gas uint64, gasAmount sdk.Coins) (client.TxBuilder, error) { - // Build MsgSend - valEthAddr := utiltx.GenerateAddress() - valAddr := sdk.ValAddress(valEthAddr.Bytes()) - msgSend := stakingtypes.NewMsgDelegate(from, valAddr, sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(20))) - return suite.CreateTestEIP712SingleMessageTxBuilder(priv, chainID, gas, gasAmount, msgSend) + // Build MsgDelegate + val := suite.GetNetwork().GetValidators()[0] + msgDelegate := stakingtypes.NewMsgDelegate(from.String(), val.OperatorAddress, sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(20))) + return suite.CreateTestEIP712SingleMessageTxBuilder(priv, chainID, gas, gasAmount, msgDelegate) } func (suite *AnteTestSuite) CreateTestEIP712MsgCreateValidator(from sdk.AccAddress, priv cryptotypes.PrivKey, chainID string, gas uint64, gasAmount sdk.Coins) (client.TxBuilder, error) { @@ -207,12 +123,12 @@ func (suite *AnteTestSuite) CreateTestEIP712MsgCreateValidator(from sdk.AccAddre valAddr := sdk.ValAddress(from.Bytes()) privEd := ed25519.GenPrivKey() msgCreate, err := stakingtypes.NewMsgCreateValidator( - valAddr, + valAddr.String(), privEd.PubKey(), - sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(20)), + sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(20)), stakingtypes.NewDescription("moniker", "identity", "website", "security_contract", "details"), - stakingtypes.NewCommissionRates(math.LegacyOneDec(), math.LegacyOneDec(), math.LegacyOneDec()), - math.OneInt(), + stakingtypes.NewCommissionRates(sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec()), + sdkmath.OneInt(), ) suite.Require().NoError(err) return suite.CreateTestEIP712SingleMessageTxBuilder(priv, chainID, gas, gasAmount, msgCreate) @@ -223,13 +139,13 @@ func (suite *AnteTestSuite) CreateTestEIP712MsgCreateValidator2(from sdk.AccAddr valAddr := sdk.ValAddress(from.Bytes()) privEd := ed25519.GenPrivKey() msgCreate, err := stakingtypes.NewMsgCreateValidator( - valAddr, + valAddr.String(), privEd.PubKey(), - sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(20)), + sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(20)), // Ensure optional fields can be left blank stakingtypes.NewDescription("moniker", "identity", "", "", ""), - stakingtypes.NewCommissionRates(math.LegacyOneDec(), math.LegacyOneDec(), math.LegacyOneDec()), - math.OneInt(), + stakingtypes.NewCommissionRates(sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec()), + sdkmath.OneInt(), ) suite.Require().NoError(err) return suite.CreateTestEIP712SingleMessageTxBuilder(priv, chainID, gas, gasAmount, msgCreate) @@ -244,14 +160,14 @@ func (suite *AnteTestSuite) CreateTestEIP712SubmitProposal(from sdk.AccAddress, } func (suite *AnteTestSuite) CreateTestEIP712GrantAllowance(from sdk.AccAddress, priv cryptotypes.PrivKey, chainID string, gas uint64, gasAmount sdk.Coins) (client.TxBuilder, error) { - spendLimit := sdk.NewCoins(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 10)) + spendLimit := sdk.NewCoins(sdk.NewInt64Coin(suite.GetNetwork().GetDenom(), 10)) threeHours := time.Now().Add(3 * time.Hour) basic := &feegrant.BasicAllowance{ SpendLimit: spendLimit, Expiration: &threeHours, } granted := utiltx.GenerateAddress() - grantedAddr := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, granted.Bytes()) + grantedAddr := suite.GetNetwork().App.AccountKeeper.NewAccountWithAddress(suite.GetNetwork().GetContext(), granted.Bytes()) msgGrant, err := feegrant.NewMsgGrantAllowance(basic, from, grantedAddr.GetAddress()) suite.Require().NoError(err) return suite.CreateTestEIP712SingleMessageTxBuilder(priv, chainID, gas, gasAmount, msgGrant) @@ -260,7 +176,7 @@ func (suite *AnteTestSuite) CreateTestEIP712GrantAllowance(from sdk.AccAddress, func (suite *AnteTestSuite) CreateTestEIP712MsgEditValidator(from sdk.AccAddress, priv cryptotypes.PrivKey, chainID string, gas uint64, gasAmount sdk.Coins) (client.TxBuilder, error) { valAddr := sdk.ValAddress(from.Bytes()) msgEdit := stakingtypes.NewMsgEditValidator( - valAddr, + valAddr.String(), stakingtypes.NewDescription("moniker", "identity", "website", "security_contract", "details"), nil, nil, @@ -289,7 +205,7 @@ func (suite *AnteTestSuite) CreateTestEIP712MsgVoteV1(from sdk.AccAddress, priv func (suite *AnteTestSuite) CreateTestEIP712SubmitProposalV1(from sdk.AccAddress, priv cryptotypes.PrivKey, chainID string, gas uint64, gasAmount sdk.Coins) (client.TxBuilder, error) { // Build V1 proposal messages. Must all be same-type, since EIP-712 // does not support arrays of variable type. - authAcc := suite.app.GovKeeper.GetGovernanceAccount(suite.ctx) + authAcc := suite.GetNetwork().App.GovKeeper.GetGovernanceAccount(suite.GetNetwork().GetContext()) proposal1, ok := govtypes.ContentFromProposalType("My proposal 1", "My description 1", govtypes.ProposalTypeText) suite.Require().True(ok) @@ -315,9 +231,10 @@ func (suite *AnteTestSuite) CreateTestEIP712SubmitProposalV1(from sdk.AccAddress // Build V1 proposal msgProposal, err := govtypesv1.NewMsgSubmitProposal( proposalMsgs, - sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(100))), + sdk.NewCoins(sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(100))), sdk.MustBech32ifyAddressBytes(sdk.GetConfig().GetBech32AccountAddrPrefix(), from.Bytes()), "Metadata", "title", "summary", + false, ) suite.Require().NoError(err) @@ -327,26 +244,26 @@ func (suite *AnteTestSuite) CreateTestEIP712SubmitProposalV1(from sdk.AccAddress func (suite *AnteTestSuite) CreateTestEIP712MsgExec(from sdk.AccAddress, priv cryptotypes.PrivKey, chainID string, gas uint64, gasAmount sdk.Coins) (client.TxBuilder, error) { recipient := sdk.AccAddress(common.Address{}.Bytes()) - msgSend := banktypes.NewMsgSend(from, recipient, sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1)))) + msgSend := banktypes.NewMsgSend(from, recipient, sdk.NewCoins(sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(1)))) msgExec := authz.NewMsgExec(from, []sdk.Msg{msgSend}) return suite.CreateTestEIP712SingleMessageTxBuilder(priv, chainID, gas, gasAmount, &msgExec) } func (suite *AnteTestSuite) CreateTestEIP712MultipleMsgSend(from sdk.AccAddress, priv cryptotypes.PrivKey, chainID string, gas uint64, gasAmount sdk.Coins) (client.TxBuilder, error) { recipient := sdk.AccAddress(common.Address{}.Bytes()) - msgSend := banktypes.NewMsgSend(from, recipient, sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1)))) + msgSend := banktypes.NewMsgSend(from, recipient, sdk.NewCoins(sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(1)))) return suite.CreateTestEIP712CosmosTxBuilder(priv, chainID, gas, gasAmount, []sdk.Msg{msgSend, msgSend, msgSend}) } func (suite *AnteTestSuite) CreateTestEIP712MultipleDifferentMsgs(from sdk.AccAddress, priv cryptotypes.PrivKey, chainID string, gas uint64, gasAmount sdk.Coins) (client.TxBuilder, error) { recipient := sdk.AccAddress(common.Address{}.Bytes()) - msgSend := banktypes.NewMsgSend(from, recipient, sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1)))) + msgSend := banktypes.NewMsgSend(from, recipient, sdk.NewCoins(sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(1)))) msgVote := govtypesv1.NewMsgVote(from, 1, govtypesv1.VoteOption_VOTE_OPTION_YES, "") valEthAddr := utiltx.GenerateAddress() valAddr := sdk.ValAddress(valEthAddr.Bytes()) - msgDelegate := stakingtypes.NewMsgDelegate(from, valAddr, sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(20))) + msgDelegate := stakingtypes.NewMsgDelegate(from.String(), valAddr.String(), sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(20))) return suite.CreateTestEIP712CosmosTxBuilder(priv, chainID, gas, gasAmount, []sdk.Msg{msgSend, msgVote, msgDelegate}) } @@ -382,19 +299,19 @@ func (suite *AnteTestSuite) CreateTestEIP712MsgTransferWithoutMemo(from sdk.AccA func (suite *AnteTestSuite) createMsgTransfer(from sdk.AccAddress, memo string) *ibctypes.MsgTransfer { recipient := sdk.AccAddress(common.Address{}.Bytes()) - msgTransfer := ibctypes.NewMsgTransfer("transfer", "channel-25", sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(100000)), from.String(), recipient.String(), ibcclienttypes.NewHeight(1000, 1000), 1000, memo) + msgTransfer := ibctypes.NewMsgTransfer("transfer", "channel-25", sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(100000)), from.String(), recipient.String(), ibcclienttypes.NewHeight(1000, 1000), 1000, memo) return msgTransfer } func (suite *AnteTestSuite) CreateTestEIP712MultipleSignerMsgs(from sdk.AccAddress, priv cryptotypes.PrivKey, chainID string, gas uint64, gasAmount sdk.Coins) (client.TxBuilder, error) { recipient := sdk.AccAddress(common.Address{}.Bytes()) - msgSend1 := banktypes.NewMsgSend(from, recipient, sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1)))) - msgSend2 := banktypes.NewMsgSend(recipient, from, sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1)))) + msgSend1 := banktypes.NewMsgSend(from, recipient, sdk.NewCoins(sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(1)))) + msgSend2 := banktypes.NewMsgSend(recipient, from, sdk.NewCoins(sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(1)))) return suite.CreateTestEIP712CosmosTxBuilder(priv, chainID, gas, gasAmount, []sdk.Msg{msgSend1, msgSend2}) } // StdSignBytes returns the bytes to sign for a transaction. -func StdSignBytes(cdc *codec.LegacyAmino, chainID string, accnum uint64, sequence uint64, timeout uint64, fee legacytx.StdFee, msgs []sdk.Msg, memo string, tip *txtypes.Tip) []byte { +func StdSignBytes(cdc *codec.LegacyAmino, chainID string, accnum uint64, sequence uint64, timeout uint64, fee legacytx.StdFee, msgs []sdk.Msg, memo string) []byte { msgsBytes := make([]json.RawMessage, 0, len(msgs)) for _, msg := range msgs { legacyMsg, ok := msg.(legacytx.LegacyMsg) @@ -405,15 +322,6 @@ func StdSignBytes(cdc *codec.LegacyAmino, chainID string, accnum uint64, sequenc msgsBytes = append(msgsBytes, json.RawMessage(legacyMsg.GetSignBytes())) } - var stdTip *legacytx.StdTip - if tip != nil { - if tip.Tipper == "" { - panic(fmt.Errorf("tipper cannot be empty")) - } - - stdTip = &legacytx.StdTip{Amount: tip.Amount, Tipper: tip.Tipper} - } - bz, err := cdc.MarshalJSON(legacytx.StdSignDoc{ AccountNumber: accnum, ChainID: chainID, @@ -422,7 +330,6 @@ func StdSignBytes(cdc *codec.LegacyAmino, chainID string, accnum uint64, sequenc Msgs: msgsBytes, Sequence: sequence, TimeoutHeight: timeout, - Tip: stdTip, }) if err != nil { panic(err) @@ -447,7 +354,7 @@ func (suite *AnteTestSuite) CreateTestEIP712SingleMessageTxBuilder( func (suite *AnteTestSuite) CreateTestEIP712CosmosTxBuilder( priv cryptotypes.PrivKey, chainID string, gas uint64, gasAmount sdk.Coins, msgs []sdk.Msg, ) (client.TxBuilder, error) { - txConf := suite.clientCtx.TxConfig + txConf := suite.GetClientCtx().TxConfig cosmosTxArgs := utiltx.CosmosTxArgs{ TxCfg: txConf, Priv: priv, @@ -458,8 +365,8 @@ func (suite *AnteTestSuite) CreateTestEIP712CosmosTxBuilder( } return utiltx.PrepareEIP712CosmosTx( - suite.ctx, - suite.app, + suite.GetNetwork().GetContext(), + suite.GetNetwork().App, utiltx.EIP712TxArgs{ CosmosTxArgs: cosmosTxArgs, UseLegacyTypedData: suite.useLegacyEIP712TypedData, @@ -537,16 +444,18 @@ func (suite *AnteTestSuite) generateMultikeySignatures(signMode signing.SignMode // RegisterAccount creates an account with the keeper and populates the initial balance func (suite *AnteTestSuite) RegisterAccount(pubKey cryptotypes.PubKey, balance *big.Int) { - acc := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, sdk.AccAddress(pubKey.Address())) - suite.app.AccountKeeper.SetAccount(suite.ctx, acc) + ctx := suite.GetNetwork().GetContext() + acc := suite.GetNetwork().App.AccountKeeper.NewAccountWithAddress(ctx, sdk.AccAddress(pubKey.Address())) + suite.GetNetwork().App.AccountKeeper.SetAccount(ctx, acc) - err := suite.app.EVMKeeper.SetBalance(suite.ctx, common.BytesToAddress(pubKey.Address()), balance) + err := suite.GetNetwork().App.EVMKeeper.SetBalance(ctx, common.BytesToAddress(pubKey.Address()), balance) suite.Require().NoError(err) } // createSignerBytes generates sign doc bytes using the given parameters func (suite *AnteTestSuite) createSignerBytes(chainID string, signMode signing.SignMode, pubKey cryptotypes.PubKey, txBuilder client.TxBuilder) []byte { - acc, err := sdkante.GetSignerAcc(suite.ctx, suite.app.AccountKeeper, sdk.AccAddress(pubKey.Address())) + ctx := suite.GetNetwork().GetContext() + acc, err := sdkante.GetSignerAcc(ctx, suite.GetNetwork().App.AccountKeeper, sdk.AccAddress(pubKey.Address())) suite.Require().NoError(err) signerInfo := authsigning.SignerData{ Address: sdk.MustBech32ifyAddressBytes(sdk.GetConfig().GetBech32AccountAddrPrefix(), acc.GetAddress().Bytes()), @@ -556,11 +465,14 @@ func (suite *AnteTestSuite) createSignerBytes(chainID string, signMode signing.S PubKey: pubKey, } - signerBytes, err := suite.clientCtx.TxConfig.SignModeHandler().GetSignBytes( + signerBytes, err := authsigning.GetSignBytesAdapter( + ctx, + suite.GetClientCtx().TxConfig.SignModeHandler(), signMode, signerInfo, txBuilder.GetTx(), ) + suite.Require().NoError(err) return signerBytes @@ -568,11 +480,11 @@ func (suite *AnteTestSuite) createSignerBytes(chainID string, signMode signing.S // createBaseTxBuilder creates a TxBuilder to be used for Single- or Multi-signing func (suite *AnteTestSuite) createBaseTxBuilder(msg sdk.Msg, gas uint64) client.TxBuilder { - txBuilder := suite.clientCtx.TxConfig.NewTxBuilder() + txBuilder := suite.GetClientCtx().TxConfig.NewTxBuilder() txBuilder.SetGasLimit(gas) txBuilder.SetFeeAmount(sdk.NewCoins( - sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(10000)), + sdk.NewCoin(suite.GetNetwork().GetDenom(), sdkmath.NewInt(10000)), )) err := txBuilder.SetMsgs(msg) @@ -648,3 +560,15 @@ func (suite *AnteTestSuite) CreateTestSingleSignedTx(privKey cryptotypes.PrivKey return txBuilder } + +// prepareAccount is a helper function that assigns the corresponding +// balance and rewards to the provided account +func (suite *AnteTestSuite) prepareAccount(ctx sdk.Context, addr sdk.AccAddress, balance, rewards sdkmath.Int) sdk.Context { + ctx, err := testutil.PrepareAccountsForDelegationRewards( + suite.T(), ctx, suite.GetNetwork().App, addr, balance, rewards, + ) + suite.Require().NoError(err, "error while preparing accounts for delegation rewards") + return ctx. + WithBlockGasMeter(storetypes.NewGasMeter(1e19)). + WithBlockHeight(ctx.BlockHeight() + 1) +} diff --git a/ante/interfaces/cosmos.go b/ante/interfaces/cosmos.go index c1004603..743a30dd 100644 --- a/ante/interfaces/cosmos.go +++ b/ante/interfaces/cosmos.go @@ -4,6 +4,9 @@ package interfaces import ( + "context" + + addresscodec "cosmossdk.io/core/address" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -11,18 +14,19 @@ import ( // BankKeeper defines the exposed interface for using functionality of the bank keeper // in the context of the AnteHandler utils package. type BankKeeper interface { - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin } // DistributionKeeper defines the exposed interface for using functionality of the distribution // keeper in the context of the AnteHandler utils package. type DistributionKeeper interface { - WithdrawDelegationRewards(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error) + WithdrawDelegationRewards(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error) } // StakingKeeper defines the exposed interface for using functionality of the staking keeper // in the context of the AnteHandler utils package. type StakingKeeper interface { - BondDenom(ctx sdk.Context) string - IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) + BondDenom(ctx context.Context) (string, error) + ValidatorAddressCodec() addresscodec.Codec + IterateDelegations(ctx context.Context, delegator sdk.AccAddress, fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) error } diff --git a/ante/sigverify.go b/ante/sigverify.go index de947075..d33c3e73 100644 --- a/ante/sigverify.go +++ b/ante/sigverify.go @@ -7,9 +7,9 @@ import ( "fmt" errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" - storetypes "github.com/cosmos/cosmos-sdk/store/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx/signing" authante "github.com/cosmos/cosmos-sdk/x/auth/ante" diff --git a/ante/sigverify_test.go b/ante/sigverify_test.go index 8cd669c6..18f3a941 100644 --- a/ante/sigverify_test.go +++ b/ante/sigverify_test.go @@ -5,29 +5,26 @@ import ( "github.com/stretchr/testify/require" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/evmos/os/ante" "github.com/evmos/os/crypto/ethsecp256k1" "github.com/evmos/os/encoding" - app "github.com/evmos/os/example_chain" ) func TestConsumeSignatureVerificationGas(t *testing.T) { params := authtypes.DefaultParams() msg := []byte{1, 2, 3, 4} - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeConfig() cdc := encodingConfig.Amino p := authtypes.DefaultParams() @@ -62,37 +59,37 @@ func TestConsumeSignatureVerificationGas(t *testing.T) { }{ { "PubKeyEd25519", - args{sdk.NewInfiniteGasMeter(), nil, ed25519.GenPrivKey().PubKey(), params}, + args{storetypes.NewInfiniteGasMeter(), nil, ed25519.GenPrivKey().PubKey(), params}, p.SigVerifyCostED25519, true, }, { "PubKeyEthsecp256k1", - args{sdk.NewInfiniteGasMeter(), nil, ethsecKey.PubKey(), params}, + args{storetypes.NewInfiniteGasMeter(), nil, ethsecKey.PubKey(), params}, ante.Secp256k1VerifyCost, false, }, { "PubKeySecp256k1", - args{sdk.NewInfiniteGasMeter(), nil, secp256k1.GenPrivKey().PubKey(), params}, + args{storetypes.NewInfiniteGasMeter(), nil, secp256k1.GenPrivKey().PubKey(), params}, p.SigVerifyCostSecp256k1, true, }, { "PubKeySecp256r1", - args{sdk.NewInfiniteGasMeter(), nil, skR1.PubKey(), params}, + args{storetypes.NewInfiniteGasMeter(), nil, skR1.PubKey(), params}, p.SigVerifyCostSecp256r1(), true, }, { "Multisig", - args{sdk.NewInfiniteGasMeter(), multisignature1, multisigKey1, params}, + args{storetypes.NewInfiniteGasMeter(), multisignature1, multisigKey1, params}, expectedCost1, false, }, { "unknown key", - args{sdk.NewInfiniteGasMeter(), nil, nil, params}, + args{storetypes.NewInfiniteGasMeter(), nil, nil, params}, 0, true, }, diff --git a/ante/testutils/testutil.go b/ante/testutils/testutil.go new file mode 100644 index 00000000..6d4d2b74 --- /dev/null +++ b/ante/testutils/testutil.go @@ -0,0 +1,158 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package testutils + +import ( + "math" + + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" + sdk "github.com/cosmos/cosmos-sdk/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + "github.com/evmos/os/ante" + evmante "github.com/evmos/os/ante/evm" + chainante "github.com/evmos/os/example_chain/ante" + chainutil "github.com/evmos/os/example_chain/testutil" + testconstants "github.com/evmos/os/testutil/constants" + "github.com/evmos/os/testutil/integration/os/factory" + "github.com/evmos/os/testutil/integration/os/grpc" + "github.com/evmos/os/testutil/integration/os/keyring" + "github.com/evmos/os/testutil/integration/os/network" + "github.com/evmos/os/types" + evmtypes "github.com/evmos/os/x/evm/types" + feemarkettypes "github.com/evmos/os/x/feemarket/types" + "github.com/stretchr/testify/suite" +) + +type AnteTestSuite struct { + suite.Suite + + network *network.UnitTestNetwork + handler grpc.Handler + keyring keyring.Keyring + factory factory.TxFactory + clientCtx client.Context + + anteHandler sdk.AnteHandler + enableFeemarket bool + baseFee *sdkmath.Int + enableLondonHF bool + evmParamsOption func(*evmtypes.Params) +} + +const TestGasLimit uint64 = 100000 + +func (suite *AnteTestSuite) SetupTest() { + keys := keyring.New(2) + + customGenesis := network.CustomGenesisState{} + feemarketGenesis := feemarkettypes.DefaultGenesisState() + if suite.enableFeemarket { + feemarketGenesis.Params.EnableHeight = 1 + feemarketGenesis.Params.NoBaseFee = false + } else { + feemarketGenesis.Params.NoBaseFee = true + } + if suite.baseFee != nil { + feemarketGenesis.Params.BaseFee = *suite.baseFee + } + customGenesis[feemarkettypes.ModuleName] = feemarketGenesis + + evmGenesis := evmtypes.DefaultGenesisState() + evmGenesis.Params.EvmDenom = testconstants.ExampleAttoDenom + if !suite.enableLondonHF { + maxInt := sdkmath.NewInt(math.MaxInt64) + evmGenesis.Params.ChainConfig.LondonBlock = &maxInt + evmGenesis.Params.ChainConfig.ArrowGlacierBlock = &maxInt + evmGenesis.Params.ChainConfig.GrayGlacierBlock = &maxInt + evmGenesis.Params.ChainConfig.MergeNetsplitBlock = &maxInt + evmGenesis.Params.ChainConfig.ShanghaiBlock = &maxInt + evmGenesis.Params.ChainConfig.CancunBlock = &maxInt + } + if suite.evmParamsOption != nil { + suite.evmParamsOption(&evmGenesis.Params) + } + customGenesis[evmtypes.ModuleName] = evmGenesis + + // set block max gas to be less than maxUint64 + cp := chainutil.DefaultConsensusParams + cp.Block.MaxGas = 1000000000000000000 + customGenesis[consensustypes.ModuleName] = cp + + nw := network.NewUnitTestNetwork( + network.WithPreFundedAccounts(keys.GetAllAccAddrs()...), + network.WithCustomGenesis(customGenesis), + ) + gh := grpc.NewIntegrationHandler(nw) + tf := factory.New(nw, gh) + + suite.network = nw + suite.factory = tf + suite.handler = gh + suite.keyring = keys + + encodingConfig := nw.GetEncodingConfig() + + suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) + + suite.Require().NotNil(suite.network.App.AppCodec()) + + anteHandler := chainante.NewAnteHandler(chainante.HandlerOptions{ + Cdc: suite.network.App.AppCodec(), + AccountKeeper: suite.network.App.AccountKeeper, + BankKeeper: suite.network.App.BankKeeper, + DistributionKeeper: suite.network.App.DistrKeeper, + EvmKeeper: suite.network.App.EVMKeeper, + FeegrantKeeper: suite.network.App.FeeGrantKeeper, + IBCKeeper: suite.network.App.IBCKeeper, + StakingKeeper: suite.network.App.StakingKeeper, + FeeMarketKeeper: suite.network.App.FeeMarketKeeper, + SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), + SigGasConsumer: ante.SigVerificationGasConsumer, + ExtensionOptionChecker: types.HasDynamicFeeExtensionOption, + TxFeeChecker: evmante.NewDynamicFeeChecker(suite.network.App.EVMKeeper), + }) + + suite.anteHandler = anteHandler +} + +func (suite *AnteTestSuite) WithFeemarketEnabled(enabled bool) { + suite.enableFeemarket = enabled +} + +func (suite *AnteTestSuite) WithLondonHardForkEnabled(enabled bool) { + suite.enableLondonHF = enabled +} + +func (suite *AnteTestSuite) WithBaseFee(baseFee *sdkmath.Int) { + suite.baseFee = baseFee +} + +func (suite *AnteTestSuite) WithEvmParamsOptions(evmParamsOpts func(*evmtypes.Params)) { + suite.evmParamsOption = evmParamsOpts +} + +func (suite *AnteTestSuite) ResetEvmParamsOptions() { + suite.evmParamsOption = nil +} + +func (suite *AnteTestSuite) GetKeyring() keyring.Keyring { + return suite.keyring +} + +func (suite *AnteTestSuite) GetTxFactory() factory.TxFactory { + return suite.factory +} + +func (suite *AnteTestSuite) GetNetwork() *network.UnitTestNetwork { + return suite.network +} + +func (suite *AnteTestSuite) GetClientCtx() client.Context { + return suite.clientCtx +} + +func (suite *AnteTestSuite) GetAnteHandler() sdk.AnteHandler { + return suite.anteHandler +} diff --git a/api/os/crypto/v1/ethsecp256k1/keys.pulsar.go b/api/os/crypto/v1/ethsecp256k1/keys.pulsar.go new file mode 100644 index 00000000..441a3596 --- /dev/null +++ b/api/os/crypto/v1/ethsecp256k1/keys.pulsar.go @@ -0,0 +1,1056 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package ethsecp256k1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_PubKey protoreflect.MessageDescriptor + fd_PubKey_key protoreflect.FieldDescriptor +) + +func init() { + file_os_crypto_v1_ethsecp256k1_keys_proto_init() + md_PubKey = File_os_crypto_v1_ethsecp256k1_keys_proto.Messages().ByName("PubKey") + fd_PubKey_key = md_PubKey.Fields().ByName("key") +} + +var _ protoreflect.Message = (*fastReflection_PubKey)(nil) + +type fastReflection_PubKey PubKey + +func (x *PubKey) ProtoReflect() protoreflect.Message { + return (*fastReflection_PubKey)(x) +} + +func (x *PubKey) slowProtoReflect() protoreflect.Message { + mi := &file_os_crypto_v1_ethsecp256k1_keys_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_PubKey_messageType fastReflection_PubKey_messageType +var _ protoreflect.MessageType = fastReflection_PubKey_messageType{} + +type fastReflection_PubKey_messageType struct{} + +func (x fastReflection_PubKey_messageType) Zero() protoreflect.Message { + return (*fastReflection_PubKey)(nil) +} +func (x fastReflection_PubKey_messageType) New() protoreflect.Message { + return new(fastReflection_PubKey) +} +func (x fastReflection_PubKey_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_PubKey +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_PubKey) Descriptor() protoreflect.MessageDescriptor { + return md_PubKey +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_PubKey) Type() protoreflect.MessageType { + return _fastReflection_PubKey_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_PubKey) New() protoreflect.Message { + return new(fastReflection_PubKey) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_PubKey) Interface() protoreflect.ProtoMessage { + return (*PubKey)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_PubKey) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Key) != 0 { + value := protoreflect.ValueOfBytes(x.Key) + if !f(fd_PubKey_key, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_PubKey) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.crypto.v1.ethsecp256k1.PubKey.key": + return len(x.Key) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.crypto.v1.ethsecp256k1.PubKey")) + } + panic(fmt.Errorf("message os.crypto.v1.ethsecp256k1.PubKey does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.crypto.v1.ethsecp256k1.PubKey.key": + x.Key = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.crypto.v1.ethsecp256k1.PubKey")) + } + panic(fmt.Errorf("message os.crypto.v1.ethsecp256k1.PubKey does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_PubKey) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.crypto.v1.ethsecp256k1.PubKey.key": + value := x.Key + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.crypto.v1.ethsecp256k1.PubKey")) + } + panic(fmt.Errorf("message os.crypto.v1.ethsecp256k1.PubKey does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.crypto.v1.ethsecp256k1.PubKey.key": + x.Key = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.crypto.v1.ethsecp256k1.PubKey")) + } + panic(fmt.Errorf("message os.crypto.v1.ethsecp256k1.PubKey does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.crypto.v1.ethsecp256k1.PubKey.key": + panic(fmt.Errorf("field key of message os.crypto.v1.ethsecp256k1.PubKey is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.crypto.v1.ethsecp256k1.PubKey")) + } + panic(fmt.Errorf("message os.crypto.v1.ethsecp256k1.PubKey does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_PubKey) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.crypto.v1.ethsecp256k1.PubKey.key": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.crypto.v1.ethsecp256k1.PubKey")) + } + panic(fmt.Errorf("message os.crypto.v1.ethsecp256k1.PubKey does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_PubKey) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.crypto.v1.ethsecp256k1.PubKey", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_PubKey) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PubKey) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_PubKey) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_PubKey) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*PubKey) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Key) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*PubKey) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Key) > 0 { + i -= len(x.Key) + copy(dAtA[i:], x.Key) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Key))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*PubKey) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Key = append(x.Key[:0], dAtA[iNdEx:postIndex]...) + if x.Key == nil { + x.Key = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_PrivKey protoreflect.MessageDescriptor + fd_PrivKey_key protoreflect.FieldDescriptor +) + +func init() { + file_os_crypto_v1_ethsecp256k1_keys_proto_init() + md_PrivKey = File_os_crypto_v1_ethsecp256k1_keys_proto.Messages().ByName("PrivKey") + fd_PrivKey_key = md_PrivKey.Fields().ByName("key") +} + +var _ protoreflect.Message = (*fastReflection_PrivKey)(nil) + +type fastReflection_PrivKey PrivKey + +func (x *PrivKey) ProtoReflect() protoreflect.Message { + return (*fastReflection_PrivKey)(x) +} + +func (x *PrivKey) slowProtoReflect() protoreflect.Message { + mi := &file_os_crypto_v1_ethsecp256k1_keys_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_PrivKey_messageType fastReflection_PrivKey_messageType +var _ protoreflect.MessageType = fastReflection_PrivKey_messageType{} + +type fastReflection_PrivKey_messageType struct{} + +func (x fastReflection_PrivKey_messageType) Zero() protoreflect.Message { + return (*fastReflection_PrivKey)(nil) +} +func (x fastReflection_PrivKey_messageType) New() protoreflect.Message { + return new(fastReflection_PrivKey) +} +func (x fastReflection_PrivKey_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_PrivKey +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_PrivKey) Descriptor() protoreflect.MessageDescriptor { + return md_PrivKey +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_PrivKey) Type() protoreflect.MessageType { + return _fastReflection_PrivKey_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_PrivKey) New() protoreflect.Message { + return new(fastReflection_PrivKey) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_PrivKey) Interface() protoreflect.ProtoMessage { + return (*PrivKey)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_PrivKey) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Key) != 0 { + value := protoreflect.ValueOfBytes(x.Key) + if !f(fd_PrivKey_key, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_PrivKey) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.crypto.v1.ethsecp256k1.PrivKey.key": + return len(x.Key) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.crypto.v1.ethsecp256k1.PrivKey")) + } + panic(fmt.Errorf("message os.crypto.v1.ethsecp256k1.PrivKey does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PrivKey) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.crypto.v1.ethsecp256k1.PrivKey.key": + x.Key = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.crypto.v1.ethsecp256k1.PrivKey")) + } + panic(fmt.Errorf("message os.crypto.v1.ethsecp256k1.PrivKey does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_PrivKey) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.crypto.v1.ethsecp256k1.PrivKey.key": + value := x.Key + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.crypto.v1.ethsecp256k1.PrivKey")) + } + panic(fmt.Errorf("message os.crypto.v1.ethsecp256k1.PrivKey does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PrivKey) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.crypto.v1.ethsecp256k1.PrivKey.key": + x.Key = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.crypto.v1.ethsecp256k1.PrivKey")) + } + panic(fmt.Errorf("message os.crypto.v1.ethsecp256k1.PrivKey does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PrivKey) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.crypto.v1.ethsecp256k1.PrivKey.key": + panic(fmt.Errorf("field key of message os.crypto.v1.ethsecp256k1.PrivKey is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.crypto.v1.ethsecp256k1.PrivKey")) + } + panic(fmt.Errorf("message os.crypto.v1.ethsecp256k1.PrivKey does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_PrivKey) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.crypto.v1.ethsecp256k1.PrivKey.key": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.crypto.v1.ethsecp256k1.PrivKey")) + } + panic(fmt.Errorf("message os.crypto.v1.ethsecp256k1.PrivKey does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_PrivKey) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.crypto.v1.ethsecp256k1.PrivKey", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_PrivKey) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_PrivKey) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_PrivKey) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_PrivKey) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*PrivKey) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Key) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*PrivKey) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Key) > 0 { + i -= len(x.Key) + copy(dAtA[i:], x.Key) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Key))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*PrivKey) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PrivKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PrivKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Key = append(x.Key[:0], dAtA[iNdEx:postIndex]...) + if x.Key == nil { + x.Key = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/crypto/v1/ethsecp256k1/keys.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// PubKey defines a type alias for an ecdsa.PublicKey that implements +// Tendermint's PubKey interface. It represents the 33-byte compressed public +// key format. +type PubKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // key is the public key in byte form + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *PubKey) Reset() { + *x = PubKey{} + if protoimpl.UnsafeEnabled { + mi := &file_os_crypto_v1_ethsecp256k1_keys_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PubKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PubKey) ProtoMessage() {} + +// Deprecated: Use PubKey.ProtoReflect.Descriptor instead. +func (*PubKey) Descriptor() ([]byte, []int) { + return file_os_crypto_v1_ethsecp256k1_keys_proto_rawDescGZIP(), []int{0} +} + +func (x *PubKey) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +// PrivKey defines a type alias for an ecdsa.PrivateKey that implements +// Tendermint's PrivateKey interface. +type PrivKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // key is the private key in byte form + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *PrivKey) Reset() { + *x = PrivKey{} + if protoimpl.UnsafeEnabled { + mi := &file_os_crypto_v1_ethsecp256k1_keys_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrivKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivKey) ProtoMessage() {} + +// Deprecated: Use PrivKey.ProtoReflect.Descriptor instead. +func (*PrivKey) Descriptor() ([]byte, []int) { + return file_os_crypto_v1_ethsecp256k1_keys_proto_rawDescGZIP(), []int{1} +} + +func (x *PrivKey) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +var File_os_crypto_v1_ethsecp256k1_keys_proto protoreflect.FileDescriptor + +var file_os_crypto_v1_ethsecp256k1_keys_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x6f, 0x73, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x65, + 0x74, 0x68, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x2f, 0x6b, 0x65, 0x79, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, + 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x20, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x4b, 0x65, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x3a, 0x04, 0x98, 0xa0, 0x1f, 0x00, 0x22, 0x1b, 0x0a, 0x07, 0x50, 0x72, 0x69, + 0x76, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x42, 0xde, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, + 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x73, + 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x42, 0x09, 0x4b, 0x65, 0x79, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x74, 0x68, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, + 0x31, 0xa2, 0x02, 0x04, 0x4f, 0x43, 0x56, 0x45, 0xaa, 0x02, 0x19, 0x4f, 0x73, 0x2e, 0x43, 0x72, + 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x56, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x73, 0x65, 0x63, 0x70, 0x32, + 0x35, 0x36, 0x6b, 0x31, 0xca, 0x02, 0x19, 0x4f, 0x73, 0x5c, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x5c, 0x56, 0x31, 0x5c, 0x45, 0x74, 0x68, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, + 0xe2, 0x02, 0x25, 0x4f, 0x73, 0x5c, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5c, 0x56, 0x31, 0x5c, + 0x45, 0x74, 0x68, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x4f, 0x73, 0x3a, 0x3a, 0x43, + 0x72, 0x79, 0x70, 0x74, 0x6f, 0x3a, 0x3a, 0x56, 0x31, 0x3a, 0x3a, 0x45, 0x74, 0x68, 0x73, 0x65, + 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_crypto_v1_ethsecp256k1_keys_proto_rawDescOnce sync.Once + file_os_crypto_v1_ethsecp256k1_keys_proto_rawDescData = file_os_crypto_v1_ethsecp256k1_keys_proto_rawDesc +) + +func file_os_crypto_v1_ethsecp256k1_keys_proto_rawDescGZIP() []byte { + file_os_crypto_v1_ethsecp256k1_keys_proto_rawDescOnce.Do(func() { + file_os_crypto_v1_ethsecp256k1_keys_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_crypto_v1_ethsecp256k1_keys_proto_rawDescData) + }) + return file_os_crypto_v1_ethsecp256k1_keys_proto_rawDescData +} + +var file_os_crypto_v1_ethsecp256k1_keys_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_os_crypto_v1_ethsecp256k1_keys_proto_goTypes = []interface{}{ + (*PubKey)(nil), // 0: os.crypto.v1.ethsecp256k1.PubKey + (*PrivKey)(nil), // 1: os.crypto.v1.ethsecp256k1.PrivKey +} +var file_os_crypto_v1_ethsecp256k1_keys_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_os_crypto_v1_ethsecp256k1_keys_proto_init() } +func file_os_crypto_v1_ethsecp256k1_keys_proto_init() { + if File_os_crypto_v1_ethsecp256k1_keys_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_os_crypto_v1_ethsecp256k1_keys_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PubKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_crypto_v1_ethsecp256k1_keys_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_crypto_v1_ethsecp256k1_keys_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_crypto_v1_ethsecp256k1_keys_proto_goTypes, + DependencyIndexes: file_os_crypto_v1_ethsecp256k1_keys_proto_depIdxs, + MessageInfos: file_os_crypto_v1_ethsecp256k1_keys_proto_msgTypes, + }.Build() + File_os_crypto_v1_ethsecp256k1_keys_proto = out.File + file_os_crypto_v1_ethsecp256k1_keys_proto_rawDesc = nil + file_os_crypto_v1_ethsecp256k1_keys_proto_goTypes = nil + file_os_crypto_v1_ethsecp256k1_keys_proto_depIdxs = nil +} diff --git a/api/os/erc20/v1/erc20.pulsar.go b/api/os/erc20/v1/erc20.pulsar.go new file mode 100644 index 00000000..c3196e0d --- /dev/null +++ b/api/os/erc20/v1/erc20.pulsar.go @@ -0,0 +1,3411 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package erc20v1 + +import ( + v1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_TokenPair protoreflect.MessageDescriptor + fd_TokenPair_erc20_address protoreflect.FieldDescriptor + fd_TokenPair_denom protoreflect.FieldDescriptor + fd_TokenPair_enabled protoreflect.FieldDescriptor + fd_TokenPair_contract_owner protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_erc20_proto_init() + md_TokenPair = File_os_erc20_v1_erc20_proto.Messages().ByName("TokenPair") + fd_TokenPair_erc20_address = md_TokenPair.Fields().ByName("erc20_address") + fd_TokenPair_denom = md_TokenPair.Fields().ByName("denom") + fd_TokenPair_enabled = md_TokenPair.Fields().ByName("enabled") + fd_TokenPair_contract_owner = md_TokenPair.Fields().ByName("contract_owner") +} + +var _ protoreflect.Message = (*fastReflection_TokenPair)(nil) + +type fastReflection_TokenPair TokenPair + +func (x *TokenPair) ProtoReflect() protoreflect.Message { + return (*fastReflection_TokenPair)(x) +} + +func (x *TokenPair) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_erc20_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_TokenPair_messageType fastReflection_TokenPair_messageType +var _ protoreflect.MessageType = fastReflection_TokenPair_messageType{} + +type fastReflection_TokenPair_messageType struct{} + +func (x fastReflection_TokenPair_messageType) Zero() protoreflect.Message { + return (*fastReflection_TokenPair)(nil) +} +func (x fastReflection_TokenPair_messageType) New() protoreflect.Message { + return new(fastReflection_TokenPair) +} +func (x fastReflection_TokenPair_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_TokenPair +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_TokenPair) Descriptor() protoreflect.MessageDescriptor { + return md_TokenPair +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_TokenPair) Type() protoreflect.MessageType { + return _fastReflection_TokenPair_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_TokenPair) New() protoreflect.Message { + return new(fastReflection_TokenPair) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_TokenPair) Interface() protoreflect.ProtoMessage { + return (*TokenPair)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_TokenPair) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Erc20Address != "" { + value := protoreflect.ValueOfString(x.Erc20Address) + if !f(fd_TokenPair_erc20_address, value) { + return + } + } + if x.Denom != "" { + value := protoreflect.ValueOfString(x.Denom) + if !f(fd_TokenPair_denom, value) { + return + } + } + if x.Enabled != false { + value := protoreflect.ValueOfBool(x.Enabled) + if !f(fd_TokenPair_enabled, value) { + return + } + } + if x.ContractOwner != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.ContractOwner)) + if !f(fd_TokenPair_contract_owner, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_TokenPair) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.TokenPair.erc20_address": + return x.Erc20Address != "" + case "os.erc20.v1.TokenPair.denom": + return x.Denom != "" + case "os.erc20.v1.TokenPair.enabled": + return x.Enabled != false + case "os.erc20.v1.TokenPair.contract_owner": + return x.ContractOwner != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.TokenPair")) + } + panic(fmt.Errorf("message os.erc20.v1.TokenPair does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TokenPair) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.TokenPair.erc20_address": + x.Erc20Address = "" + case "os.erc20.v1.TokenPair.denom": + x.Denom = "" + case "os.erc20.v1.TokenPair.enabled": + x.Enabled = false + case "os.erc20.v1.TokenPair.contract_owner": + x.ContractOwner = 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.TokenPair")) + } + panic(fmt.Errorf("message os.erc20.v1.TokenPair does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_TokenPair) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.TokenPair.erc20_address": + value := x.Erc20Address + return protoreflect.ValueOfString(value) + case "os.erc20.v1.TokenPair.denom": + value := x.Denom + return protoreflect.ValueOfString(value) + case "os.erc20.v1.TokenPair.enabled": + value := x.Enabled + return protoreflect.ValueOfBool(value) + case "os.erc20.v1.TokenPair.contract_owner": + value := x.ContractOwner + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.TokenPair")) + } + panic(fmt.Errorf("message os.erc20.v1.TokenPair does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TokenPair) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.TokenPair.erc20_address": + x.Erc20Address = value.Interface().(string) + case "os.erc20.v1.TokenPair.denom": + x.Denom = value.Interface().(string) + case "os.erc20.v1.TokenPair.enabled": + x.Enabled = value.Bool() + case "os.erc20.v1.TokenPair.contract_owner": + x.ContractOwner = (Owner)(value.Enum()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.TokenPair")) + } + panic(fmt.Errorf("message os.erc20.v1.TokenPair does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TokenPair) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.TokenPair.erc20_address": + panic(fmt.Errorf("field erc20_address of message os.erc20.v1.TokenPair is not mutable")) + case "os.erc20.v1.TokenPair.denom": + panic(fmt.Errorf("field denom of message os.erc20.v1.TokenPair is not mutable")) + case "os.erc20.v1.TokenPair.enabled": + panic(fmt.Errorf("field enabled of message os.erc20.v1.TokenPair is not mutable")) + case "os.erc20.v1.TokenPair.contract_owner": + panic(fmt.Errorf("field contract_owner of message os.erc20.v1.TokenPair is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.TokenPair")) + } + panic(fmt.Errorf("message os.erc20.v1.TokenPair does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_TokenPair) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.TokenPair.erc20_address": + return protoreflect.ValueOfString("") + case "os.erc20.v1.TokenPair.denom": + return protoreflect.ValueOfString("") + case "os.erc20.v1.TokenPair.enabled": + return protoreflect.ValueOfBool(false) + case "os.erc20.v1.TokenPair.contract_owner": + return protoreflect.ValueOfEnum(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.TokenPair")) + } + panic(fmt.Errorf("message os.erc20.v1.TokenPair does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_TokenPair) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.TokenPair", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_TokenPair) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TokenPair) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_TokenPair) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_TokenPair) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*TokenPair) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Erc20Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Denom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Enabled { + n += 2 + } + if x.ContractOwner != 0 { + n += 1 + runtime.Sov(uint64(x.ContractOwner)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*TokenPair) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.ContractOwner != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ContractOwner)) + i-- + dAtA[i] = 0x20 + } + if x.Enabled { + i-- + if x.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(x.Denom) > 0 { + i -= len(x.Denom) + copy(dAtA[i:], x.Denom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denom))) + i-- + dAtA[i] = 0x12 + } + if len(x.Erc20Address) > 0 { + i -= len(x.Erc20Address) + copy(dAtA[i:], x.Erc20Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Erc20Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*TokenPair) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TokenPair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TokenPair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Erc20Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Erc20Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Enabled = bool(v != 0) + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ContractOwner", wireType) + } + x.ContractOwner = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ContractOwner |= Owner(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_RegisterCoinProposal_3_list)(nil) + +type _RegisterCoinProposal_3_list struct { + list *[]*v1beta1.Metadata +} + +func (x *_RegisterCoinProposal_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_RegisterCoinProposal_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_RegisterCoinProposal_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Metadata) + (*x.list)[i] = concreteValue +} + +func (x *_RegisterCoinProposal_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Metadata) + *x.list = append(*x.list, concreteValue) +} + +func (x *_RegisterCoinProposal_3_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Metadata) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_RegisterCoinProposal_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_RegisterCoinProposal_3_list) NewElement() protoreflect.Value { + v := new(v1beta1.Metadata) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_RegisterCoinProposal_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_RegisterCoinProposal protoreflect.MessageDescriptor + fd_RegisterCoinProposal_title protoreflect.FieldDescriptor + fd_RegisterCoinProposal_description protoreflect.FieldDescriptor + fd_RegisterCoinProposal_metadata protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_erc20_proto_init() + md_RegisterCoinProposal = File_os_erc20_v1_erc20_proto.Messages().ByName("RegisterCoinProposal") + fd_RegisterCoinProposal_title = md_RegisterCoinProposal.Fields().ByName("title") + fd_RegisterCoinProposal_description = md_RegisterCoinProposal.Fields().ByName("description") + fd_RegisterCoinProposal_metadata = md_RegisterCoinProposal.Fields().ByName("metadata") +} + +var _ protoreflect.Message = (*fastReflection_RegisterCoinProposal)(nil) + +type fastReflection_RegisterCoinProposal RegisterCoinProposal + +func (x *RegisterCoinProposal) ProtoReflect() protoreflect.Message { + return (*fastReflection_RegisterCoinProposal)(x) +} + +func (x *RegisterCoinProposal) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_erc20_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_RegisterCoinProposal_messageType fastReflection_RegisterCoinProposal_messageType +var _ protoreflect.MessageType = fastReflection_RegisterCoinProposal_messageType{} + +type fastReflection_RegisterCoinProposal_messageType struct{} + +func (x fastReflection_RegisterCoinProposal_messageType) Zero() protoreflect.Message { + return (*fastReflection_RegisterCoinProposal)(nil) +} +func (x fastReflection_RegisterCoinProposal_messageType) New() protoreflect.Message { + return new(fastReflection_RegisterCoinProposal) +} +func (x fastReflection_RegisterCoinProposal_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_RegisterCoinProposal +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_RegisterCoinProposal) Descriptor() protoreflect.MessageDescriptor { + return md_RegisterCoinProposal +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_RegisterCoinProposal) Type() protoreflect.MessageType { + return _fastReflection_RegisterCoinProposal_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_RegisterCoinProposal) New() protoreflect.Message { + return new(fastReflection_RegisterCoinProposal) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_RegisterCoinProposal) Interface() protoreflect.ProtoMessage { + return (*RegisterCoinProposal)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_RegisterCoinProposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Title != "" { + value := protoreflect.ValueOfString(x.Title) + if !f(fd_RegisterCoinProposal_title, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_RegisterCoinProposal_description, value) { + return + } + } + if len(x.Metadata) != 0 { + value := protoreflect.ValueOfList(&_RegisterCoinProposal_3_list{list: &x.Metadata}) + if !f(fd_RegisterCoinProposal_metadata, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_RegisterCoinProposal) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.RegisterCoinProposal.title": + return x.Title != "" + case "os.erc20.v1.RegisterCoinProposal.description": + return x.Description != "" + case "os.erc20.v1.RegisterCoinProposal.metadata": + return len(x.Metadata) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.RegisterCoinProposal")) + } + panic(fmt.Errorf("message os.erc20.v1.RegisterCoinProposal does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_RegisterCoinProposal) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.RegisterCoinProposal.title": + x.Title = "" + case "os.erc20.v1.RegisterCoinProposal.description": + x.Description = "" + case "os.erc20.v1.RegisterCoinProposal.metadata": + x.Metadata = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.RegisterCoinProposal")) + } + panic(fmt.Errorf("message os.erc20.v1.RegisterCoinProposal does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_RegisterCoinProposal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.RegisterCoinProposal.title": + value := x.Title + return protoreflect.ValueOfString(value) + case "os.erc20.v1.RegisterCoinProposal.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "os.erc20.v1.RegisterCoinProposal.metadata": + if len(x.Metadata) == 0 { + return protoreflect.ValueOfList(&_RegisterCoinProposal_3_list{}) + } + listValue := &_RegisterCoinProposal_3_list{list: &x.Metadata} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.RegisterCoinProposal")) + } + panic(fmt.Errorf("message os.erc20.v1.RegisterCoinProposal does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_RegisterCoinProposal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.RegisterCoinProposal.title": + x.Title = value.Interface().(string) + case "os.erc20.v1.RegisterCoinProposal.description": + x.Description = value.Interface().(string) + case "os.erc20.v1.RegisterCoinProposal.metadata": + lv := value.List() + clv := lv.(*_RegisterCoinProposal_3_list) + x.Metadata = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.RegisterCoinProposal")) + } + panic(fmt.Errorf("message os.erc20.v1.RegisterCoinProposal does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_RegisterCoinProposal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.RegisterCoinProposal.metadata": + if x.Metadata == nil { + x.Metadata = []*v1beta1.Metadata{} + } + value := &_RegisterCoinProposal_3_list{list: &x.Metadata} + return protoreflect.ValueOfList(value) + case "os.erc20.v1.RegisterCoinProposal.title": + panic(fmt.Errorf("field title of message os.erc20.v1.RegisterCoinProposal is not mutable")) + case "os.erc20.v1.RegisterCoinProposal.description": + panic(fmt.Errorf("field description of message os.erc20.v1.RegisterCoinProposal is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.RegisterCoinProposal")) + } + panic(fmt.Errorf("message os.erc20.v1.RegisterCoinProposal does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_RegisterCoinProposal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.RegisterCoinProposal.title": + return protoreflect.ValueOfString("") + case "os.erc20.v1.RegisterCoinProposal.description": + return protoreflect.ValueOfString("") + case "os.erc20.v1.RegisterCoinProposal.metadata": + list := []*v1beta1.Metadata{} + return protoreflect.ValueOfList(&_RegisterCoinProposal_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.RegisterCoinProposal")) + } + panic(fmt.Errorf("message os.erc20.v1.RegisterCoinProposal does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_RegisterCoinProposal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.RegisterCoinProposal", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_RegisterCoinProposal) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_RegisterCoinProposal) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_RegisterCoinProposal) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_RegisterCoinProposal) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*RegisterCoinProposal) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Title) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Metadata) > 0 { + for _, e := range x.Metadata { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*RegisterCoinProposal) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Metadata) > 0 { + for iNdEx := len(x.Metadata) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Metadata[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x12 + } + if len(x.Title) > 0 { + i -= len(x.Title) + copy(dAtA[i:], x.Title) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Title))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*RegisterCoinProposal) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RegisterCoinProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RegisterCoinProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Metadata = append(x.Metadata, &v1beta1.Metadata{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Metadata[len(x.Metadata)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_ProposalMetadata_1_list)(nil) + +type _ProposalMetadata_1_list struct { + list *[]*v1beta1.Metadata +} + +func (x *_ProposalMetadata_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ProposalMetadata_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_ProposalMetadata_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Metadata) + (*x.list)[i] = concreteValue +} + +func (x *_ProposalMetadata_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Metadata) + *x.list = append(*x.list, concreteValue) +} + +func (x *_ProposalMetadata_1_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Metadata) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ProposalMetadata_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_ProposalMetadata_1_list) NewElement() protoreflect.Value { + v := new(v1beta1.Metadata) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ProposalMetadata_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_ProposalMetadata protoreflect.MessageDescriptor + fd_ProposalMetadata_metadata protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_erc20_proto_init() + md_ProposalMetadata = File_os_erc20_v1_erc20_proto.Messages().ByName("ProposalMetadata") + fd_ProposalMetadata_metadata = md_ProposalMetadata.Fields().ByName("metadata") +} + +var _ protoreflect.Message = (*fastReflection_ProposalMetadata)(nil) + +type fastReflection_ProposalMetadata ProposalMetadata + +func (x *ProposalMetadata) ProtoReflect() protoreflect.Message { + return (*fastReflection_ProposalMetadata)(x) +} + +func (x *ProposalMetadata) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_erc20_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ProposalMetadata_messageType fastReflection_ProposalMetadata_messageType +var _ protoreflect.MessageType = fastReflection_ProposalMetadata_messageType{} + +type fastReflection_ProposalMetadata_messageType struct{} + +func (x fastReflection_ProposalMetadata_messageType) Zero() protoreflect.Message { + return (*fastReflection_ProposalMetadata)(nil) +} +func (x fastReflection_ProposalMetadata_messageType) New() protoreflect.Message { + return new(fastReflection_ProposalMetadata) +} +func (x fastReflection_ProposalMetadata_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ProposalMetadata +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ProposalMetadata) Descriptor() protoreflect.MessageDescriptor { + return md_ProposalMetadata +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ProposalMetadata) Type() protoreflect.MessageType { + return _fastReflection_ProposalMetadata_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ProposalMetadata) New() protoreflect.Message { + return new(fastReflection_ProposalMetadata) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ProposalMetadata) Interface() protoreflect.ProtoMessage { + return (*ProposalMetadata)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ProposalMetadata) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Metadata) != 0 { + value := protoreflect.ValueOfList(&_ProposalMetadata_1_list{list: &x.Metadata}) + if !f(fd_ProposalMetadata_metadata, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ProposalMetadata) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.ProposalMetadata.metadata": + return len(x.Metadata) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.ProposalMetadata")) + } + panic(fmt.Errorf("message os.erc20.v1.ProposalMetadata does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ProposalMetadata) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.ProposalMetadata.metadata": + x.Metadata = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.ProposalMetadata")) + } + panic(fmt.Errorf("message os.erc20.v1.ProposalMetadata does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ProposalMetadata) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.ProposalMetadata.metadata": + if len(x.Metadata) == 0 { + return protoreflect.ValueOfList(&_ProposalMetadata_1_list{}) + } + listValue := &_ProposalMetadata_1_list{list: &x.Metadata} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.ProposalMetadata")) + } + panic(fmt.Errorf("message os.erc20.v1.ProposalMetadata does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ProposalMetadata) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.ProposalMetadata.metadata": + lv := value.List() + clv := lv.(*_ProposalMetadata_1_list) + x.Metadata = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.ProposalMetadata")) + } + panic(fmt.Errorf("message os.erc20.v1.ProposalMetadata does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ProposalMetadata) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.ProposalMetadata.metadata": + if x.Metadata == nil { + x.Metadata = []*v1beta1.Metadata{} + } + value := &_ProposalMetadata_1_list{list: &x.Metadata} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.ProposalMetadata")) + } + panic(fmt.Errorf("message os.erc20.v1.ProposalMetadata does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ProposalMetadata) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.ProposalMetadata.metadata": + list := []*v1beta1.Metadata{} + return protoreflect.ValueOfList(&_ProposalMetadata_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.ProposalMetadata")) + } + panic(fmt.Errorf("message os.erc20.v1.ProposalMetadata does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ProposalMetadata) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.ProposalMetadata", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ProposalMetadata) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ProposalMetadata) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ProposalMetadata) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ProposalMetadata) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ProposalMetadata) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Metadata) > 0 { + for _, e := range x.Metadata { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ProposalMetadata) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Metadata) > 0 { + for iNdEx := len(x.Metadata) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Metadata[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ProposalMetadata) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ProposalMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ProposalMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Metadata = append(x.Metadata, &v1beta1.Metadata{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Metadata[len(x.Metadata)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_RegisterERC20Proposal_3_list)(nil) + +type _RegisterERC20Proposal_3_list struct { + list *[]string +} + +func (x *_RegisterERC20Proposal_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_RegisterERC20Proposal_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_RegisterERC20Proposal_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_RegisterERC20Proposal_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_RegisterERC20Proposal_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message RegisterERC20Proposal at list field Erc20Addresses as it is not of Message kind")) +} + +func (x *_RegisterERC20Proposal_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_RegisterERC20Proposal_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_RegisterERC20Proposal_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_RegisterERC20Proposal protoreflect.MessageDescriptor + fd_RegisterERC20Proposal_title protoreflect.FieldDescriptor + fd_RegisterERC20Proposal_description protoreflect.FieldDescriptor + fd_RegisterERC20Proposal_erc20addresses protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_erc20_proto_init() + md_RegisterERC20Proposal = File_os_erc20_v1_erc20_proto.Messages().ByName("RegisterERC20Proposal") + fd_RegisterERC20Proposal_title = md_RegisterERC20Proposal.Fields().ByName("title") + fd_RegisterERC20Proposal_description = md_RegisterERC20Proposal.Fields().ByName("description") + fd_RegisterERC20Proposal_erc20addresses = md_RegisterERC20Proposal.Fields().ByName("erc20addresses") +} + +var _ protoreflect.Message = (*fastReflection_RegisterERC20Proposal)(nil) + +type fastReflection_RegisterERC20Proposal RegisterERC20Proposal + +func (x *RegisterERC20Proposal) ProtoReflect() protoreflect.Message { + return (*fastReflection_RegisterERC20Proposal)(x) +} + +func (x *RegisterERC20Proposal) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_erc20_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_RegisterERC20Proposal_messageType fastReflection_RegisterERC20Proposal_messageType +var _ protoreflect.MessageType = fastReflection_RegisterERC20Proposal_messageType{} + +type fastReflection_RegisterERC20Proposal_messageType struct{} + +func (x fastReflection_RegisterERC20Proposal_messageType) Zero() protoreflect.Message { + return (*fastReflection_RegisterERC20Proposal)(nil) +} +func (x fastReflection_RegisterERC20Proposal_messageType) New() protoreflect.Message { + return new(fastReflection_RegisterERC20Proposal) +} +func (x fastReflection_RegisterERC20Proposal_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_RegisterERC20Proposal +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_RegisterERC20Proposal) Descriptor() protoreflect.MessageDescriptor { + return md_RegisterERC20Proposal +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_RegisterERC20Proposal) Type() protoreflect.MessageType { + return _fastReflection_RegisterERC20Proposal_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_RegisterERC20Proposal) New() protoreflect.Message { + return new(fastReflection_RegisterERC20Proposal) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_RegisterERC20Proposal) Interface() protoreflect.ProtoMessage { + return (*RegisterERC20Proposal)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_RegisterERC20Proposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Title != "" { + value := protoreflect.ValueOfString(x.Title) + if !f(fd_RegisterERC20Proposal_title, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_RegisterERC20Proposal_description, value) { + return + } + } + if len(x.Erc20Addresses) != 0 { + value := protoreflect.ValueOfList(&_RegisterERC20Proposal_3_list{list: &x.Erc20Addresses}) + if !f(fd_RegisterERC20Proposal_erc20addresses, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_RegisterERC20Proposal) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.RegisterERC20Proposal.title": + return x.Title != "" + case "os.erc20.v1.RegisterERC20Proposal.description": + return x.Description != "" + case "os.erc20.v1.RegisterERC20Proposal.erc20addresses": + return len(x.Erc20Addresses) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.RegisterERC20Proposal")) + } + panic(fmt.Errorf("message os.erc20.v1.RegisterERC20Proposal does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_RegisterERC20Proposal) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.RegisterERC20Proposal.title": + x.Title = "" + case "os.erc20.v1.RegisterERC20Proposal.description": + x.Description = "" + case "os.erc20.v1.RegisterERC20Proposal.erc20addresses": + x.Erc20Addresses = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.RegisterERC20Proposal")) + } + panic(fmt.Errorf("message os.erc20.v1.RegisterERC20Proposal does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_RegisterERC20Proposal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.RegisterERC20Proposal.title": + value := x.Title + return protoreflect.ValueOfString(value) + case "os.erc20.v1.RegisterERC20Proposal.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "os.erc20.v1.RegisterERC20Proposal.erc20addresses": + if len(x.Erc20Addresses) == 0 { + return protoreflect.ValueOfList(&_RegisterERC20Proposal_3_list{}) + } + listValue := &_RegisterERC20Proposal_3_list{list: &x.Erc20Addresses} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.RegisterERC20Proposal")) + } + panic(fmt.Errorf("message os.erc20.v1.RegisterERC20Proposal does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_RegisterERC20Proposal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.RegisterERC20Proposal.title": + x.Title = value.Interface().(string) + case "os.erc20.v1.RegisterERC20Proposal.description": + x.Description = value.Interface().(string) + case "os.erc20.v1.RegisterERC20Proposal.erc20addresses": + lv := value.List() + clv := lv.(*_RegisterERC20Proposal_3_list) + x.Erc20Addresses = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.RegisterERC20Proposal")) + } + panic(fmt.Errorf("message os.erc20.v1.RegisterERC20Proposal does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_RegisterERC20Proposal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.RegisterERC20Proposal.erc20addresses": + if x.Erc20Addresses == nil { + x.Erc20Addresses = []string{} + } + value := &_RegisterERC20Proposal_3_list{list: &x.Erc20Addresses} + return protoreflect.ValueOfList(value) + case "os.erc20.v1.RegisterERC20Proposal.title": + panic(fmt.Errorf("field title of message os.erc20.v1.RegisterERC20Proposal is not mutable")) + case "os.erc20.v1.RegisterERC20Proposal.description": + panic(fmt.Errorf("field description of message os.erc20.v1.RegisterERC20Proposal is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.RegisterERC20Proposal")) + } + panic(fmt.Errorf("message os.erc20.v1.RegisterERC20Proposal does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_RegisterERC20Proposal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.RegisterERC20Proposal.title": + return protoreflect.ValueOfString("") + case "os.erc20.v1.RegisterERC20Proposal.description": + return protoreflect.ValueOfString("") + case "os.erc20.v1.RegisterERC20Proposal.erc20addresses": + list := []string{} + return protoreflect.ValueOfList(&_RegisterERC20Proposal_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.RegisterERC20Proposal")) + } + panic(fmt.Errorf("message os.erc20.v1.RegisterERC20Proposal does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_RegisterERC20Proposal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.RegisterERC20Proposal", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_RegisterERC20Proposal) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_RegisterERC20Proposal) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_RegisterERC20Proposal) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_RegisterERC20Proposal) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*RegisterERC20Proposal) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Title) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Erc20Addresses) > 0 { + for _, s := range x.Erc20Addresses { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*RegisterERC20Proposal) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Erc20Addresses) > 0 { + for iNdEx := len(x.Erc20Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Erc20Addresses[iNdEx]) + copy(dAtA[i:], x.Erc20Addresses[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Erc20Addresses[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x12 + } + if len(x.Title) > 0 { + i -= len(x.Title) + copy(dAtA[i:], x.Title) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Title))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*RegisterERC20Proposal) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RegisterERC20Proposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RegisterERC20Proposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Erc20Addresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Erc20Addresses = append(x.Erc20Addresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_ToggleTokenConversionProposal protoreflect.MessageDescriptor + fd_ToggleTokenConversionProposal_title protoreflect.FieldDescriptor + fd_ToggleTokenConversionProposal_description protoreflect.FieldDescriptor + fd_ToggleTokenConversionProposal_token protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_erc20_proto_init() + md_ToggleTokenConversionProposal = File_os_erc20_v1_erc20_proto.Messages().ByName("ToggleTokenConversionProposal") + fd_ToggleTokenConversionProposal_title = md_ToggleTokenConversionProposal.Fields().ByName("title") + fd_ToggleTokenConversionProposal_description = md_ToggleTokenConversionProposal.Fields().ByName("description") + fd_ToggleTokenConversionProposal_token = md_ToggleTokenConversionProposal.Fields().ByName("token") +} + +var _ protoreflect.Message = (*fastReflection_ToggleTokenConversionProposal)(nil) + +type fastReflection_ToggleTokenConversionProposal ToggleTokenConversionProposal + +func (x *ToggleTokenConversionProposal) ProtoReflect() protoreflect.Message { + return (*fastReflection_ToggleTokenConversionProposal)(x) +} + +func (x *ToggleTokenConversionProposal) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_erc20_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ToggleTokenConversionProposal_messageType fastReflection_ToggleTokenConversionProposal_messageType +var _ protoreflect.MessageType = fastReflection_ToggleTokenConversionProposal_messageType{} + +type fastReflection_ToggleTokenConversionProposal_messageType struct{} + +func (x fastReflection_ToggleTokenConversionProposal_messageType) Zero() protoreflect.Message { + return (*fastReflection_ToggleTokenConversionProposal)(nil) +} +func (x fastReflection_ToggleTokenConversionProposal_messageType) New() protoreflect.Message { + return new(fastReflection_ToggleTokenConversionProposal) +} +func (x fastReflection_ToggleTokenConversionProposal_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ToggleTokenConversionProposal +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ToggleTokenConversionProposal) Descriptor() protoreflect.MessageDescriptor { + return md_ToggleTokenConversionProposal +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ToggleTokenConversionProposal) Type() protoreflect.MessageType { + return _fastReflection_ToggleTokenConversionProposal_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ToggleTokenConversionProposal) New() protoreflect.Message { + return new(fastReflection_ToggleTokenConversionProposal) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ToggleTokenConversionProposal) Interface() protoreflect.ProtoMessage { + return (*ToggleTokenConversionProposal)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ToggleTokenConversionProposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Title != "" { + value := protoreflect.ValueOfString(x.Title) + if !f(fd_ToggleTokenConversionProposal_title, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_ToggleTokenConversionProposal_description, value) { + return + } + } + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) + if !f(fd_ToggleTokenConversionProposal_token, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ToggleTokenConversionProposal) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.ToggleTokenConversionProposal.title": + return x.Title != "" + case "os.erc20.v1.ToggleTokenConversionProposal.description": + return x.Description != "" + case "os.erc20.v1.ToggleTokenConversionProposal.token": + return x.Token != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.ToggleTokenConversionProposal")) + } + panic(fmt.Errorf("message os.erc20.v1.ToggleTokenConversionProposal does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ToggleTokenConversionProposal) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.ToggleTokenConversionProposal.title": + x.Title = "" + case "os.erc20.v1.ToggleTokenConversionProposal.description": + x.Description = "" + case "os.erc20.v1.ToggleTokenConversionProposal.token": + x.Token = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.ToggleTokenConversionProposal")) + } + panic(fmt.Errorf("message os.erc20.v1.ToggleTokenConversionProposal does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ToggleTokenConversionProposal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.ToggleTokenConversionProposal.title": + value := x.Title + return protoreflect.ValueOfString(value) + case "os.erc20.v1.ToggleTokenConversionProposal.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "os.erc20.v1.ToggleTokenConversionProposal.token": + value := x.Token + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.ToggleTokenConversionProposal")) + } + panic(fmt.Errorf("message os.erc20.v1.ToggleTokenConversionProposal does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ToggleTokenConversionProposal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.ToggleTokenConversionProposal.title": + x.Title = value.Interface().(string) + case "os.erc20.v1.ToggleTokenConversionProposal.description": + x.Description = value.Interface().(string) + case "os.erc20.v1.ToggleTokenConversionProposal.token": + x.Token = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.ToggleTokenConversionProposal")) + } + panic(fmt.Errorf("message os.erc20.v1.ToggleTokenConversionProposal does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ToggleTokenConversionProposal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.ToggleTokenConversionProposal.title": + panic(fmt.Errorf("field title of message os.erc20.v1.ToggleTokenConversionProposal is not mutable")) + case "os.erc20.v1.ToggleTokenConversionProposal.description": + panic(fmt.Errorf("field description of message os.erc20.v1.ToggleTokenConversionProposal is not mutable")) + case "os.erc20.v1.ToggleTokenConversionProposal.token": + panic(fmt.Errorf("field token of message os.erc20.v1.ToggleTokenConversionProposal is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.ToggleTokenConversionProposal")) + } + panic(fmt.Errorf("message os.erc20.v1.ToggleTokenConversionProposal does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ToggleTokenConversionProposal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.ToggleTokenConversionProposal.title": + return protoreflect.ValueOfString("") + case "os.erc20.v1.ToggleTokenConversionProposal.description": + return protoreflect.ValueOfString("") + case "os.erc20.v1.ToggleTokenConversionProposal.token": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.ToggleTokenConversionProposal")) + } + panic(fmt.Errorf("message os.erc20.v1.ToggleTokenConversionProposal does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ToggleTokenConversionProposal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.ToggleTokenConversionProposal", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ToggleTokenConversionProposal) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ToggleTokenConversionProposal) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ToggleTokenConversionProposal) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ToggleTokenConversionProposal) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ToggleTokenConversionProposal) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Title) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Token) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ToggleTokenConversionProposal) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) + i-- + dAtA[i] = 0x1a + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x12 + } + if len(x.Title) > 0 { + i -= len(x.Title) + copy(dAtA[i:], x.Title) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Title))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ToggleTokenConversionProposal) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ToggleTokenConversionProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ToggleTokenConversionProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/erc20/v1/erc20.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Owner enumerates the ownership of a ERC20 contract. +type Owner int32 + +const ( + // OWNER_UNSPECIFIED defines an invalid/undefined owner. + Owner_OWNER_UNSPECIFIED Owner = 0 + // OWNER_MODULE - erc20 is owned by the erc20 module account. + Owner_OWNER_MODULE Owner = 1 + // OWNER_EXTERNAL - erc20 is owned by an external account. + Owner_OWNER_EXTERNAL Owner = 2 +) + +// Enum value maps for Owner. +var ( + Owner_name = map[int32]string{ + 0: "OWNER_UNSPECIFIED", + 1: "OWNER_MODULE", + 2: "OWNER_EXTERNAL", + } + Owner_value = map[string]int32{ + "OWNER_UNSPECIFIED": 0, + "OWNER_MODULE": 1, + "OWNER_EXTERNAL": 2, + } +) + +func (x Owner) Enum() *Owner { + p := new(Owner) + *p = x + return p +} + +func (x Owner) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Owner) Descriptor() protoreflect.EnumDescriptor { + return file_os_erc20_v1_erc20_proto_enumTypes[0].Descriptor() +} + +func (Owner) Type() protoreflect.EnumType { + return &file_os_erc20_v1_erc20_proto_enumTypes[0] +} + +func (x Owner) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Owner.Descriptor instead. +func (Owner) EnumDescriptor() ([]byte, []int) { + return file_os_erc20_v1_erc20_proto_rawDescGZIP(), []int{0} +} + +// TokenPair defines an instance that records a pairing consisting of a native +// Cosmos Coin and an ERC20 token address. +type TokenPair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // erc20_address is the hex address of ERC20 contract token + Erc20Address string `protobuf:"bytes,1,opt,name=erc20_address,json=erc20Address,proto3" json:"erc20_address,omitempty"` + // denom defines the cosmos base denomination to be mapped to + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` + // enabled defines the token mapping enable status + Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` + // contract_owner is the an ENUM specifying the type of ERC20 owner (0 + // invalid, 1 ModuleAccount, 2 external address) + ContractOwner Owner `protobuf:"varint,4,opt,name=contract_owner,json=contractOwner,proto3,enum=os.erc20.v1.Owner" json:"contract_owner,omitempty"` +} + +func (x *TokenPair) Reset() { + *x = TokenPair{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_erc20_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TokenPair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenPair) ProtoMessage() {} + +// Deprecated: Use TokenPair.ProtoReflect.Descriptor instead. +func (*TokenPair) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_erc20_proto_rawDescGZIP(), []int{0} +} + +func (x *TokenPair) GetErc20Address() string { + if x != nil { + return x.Erc20Address + } + return "" +} + +func (x *TokenPair) GetDenom() string { + if x != nil { + return x.Denom + } + return "" +} + +func (x *TokenPair) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *TokenPair) GetContractOwner() Owner { + if x != nil { + return x.ContractOwner + } + return Owner_OWNER_UNSPECIFIED +} + +// Deprecated: RegisterCoinProposal is a gov Content type to register a token +// pair for a native Cosmos coin. We're keeping it to remove the existing +// proposals from store. After that, remove this message. +// +// NOTE: Keep this message for backwards compatibility on proposals query +type RegisterCoinProposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // title of the proposal + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // description of the proposal + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // metadata slice of the native Cosmos coins + Metadata []*v1beta1.Metadata `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *RegisterCoinProposal) Reset() { + *x = RegisterCoinProposal{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_erc20_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterCoinProposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterCoinProposal) ProtoMessage() {} + +// Deprecated: Use RegisterCoinProposal.ProtoReflect.Descriptor instead. +func (*RegisterCoinProposal) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_erc20_proto_rawDescGZIP(), []int{1} +} + +func (x *RegisterCoinProposal) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *RegisterCoinProposal) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *RegisterCoinProposal) GetMetadata() []*v1beta1.Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +// Deprecated: ProposalMetadata is used to parse a slice of denom metadata and +// generate the RegisterCoinProposal content. We're keeping it to remove the +// existing proposals from store. After that, remove this message. +type ProposalMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // metadata slice of the native Cosmos coins + Metadata []*v1beta1.Metadata `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *ProposalMetadata) Reset() { + *x = ProposalMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_erc20_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProposalMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProposalMetadata) ProtoMessage() {} + +// Deprecated: Use ProposalMetadata.ProtoReflect.Descriptor instead. +func (*ProposalMetadata) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_erc20_proto_rawDescGZIP(), []int{2} +} + +func (x *ProposalMetadata) GetMetadata() []*v1beta1.Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +// Deprecated: RegisterERC20Proposal is a gov Content type to register a token +// pair for an ERC20 token. +// +// NOTE: Keep this message for backwards compatibility on proposals query +type RegisterERC20Proposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // title of the proposal + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // description of the proposal + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // erc20addresses is a slice of ERC20 token contract addresses + Erc20Addresses []string `protobuf:"bytes,3,rep,name=erc20addresses,proto3" json:"erc20addresses,omitempty"` +} + +func (x *RegisterERC20Proposal) Reset() { + *x = RegisterERC20Proposal{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_erc20_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterERC20Proposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterERC20Proposal) ProtoMessage() {} + +// Deprecated: Use RegisterERC20Proposal.ProtoReflect.Descriptor instead. +func (*RegisterERC20Proposal) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_erc20_proto_rawDescGZIP(), []int{3} +} + +func (x *RegisterERC20Proposal) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *RegisterERC20Proposal) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *RegisterERC20Proposal) GetErc20Addresses() []string { + if x != nil { + return x.Erc20Addresses + } + return nil +} + +// Deprecated: ToggleTokenConversionProposal is a gov Content type to toggle the +// conversion of a token pair. +// +// NOTE: Keep this message for backwards compatibility on proposals query +type ToggleTokenConversionProposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // title of the proposal + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // description of the proposal + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // token identifier can be either the hex contract address of the ERC20 or the + // Cosmos base denomination + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *ToggleTokenConversionProposal) Reset() { + *x = ToggleTokenConversionProposal{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_erc20_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ToggleTokenConversionProposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ToggleTokenConversionProposal) ProtoMessage() {} + +// Deprecated: Use ToggleTokenConversionProposal.ProtoReflect.Descriptor instead. +func (*ToggleTokenConversionProposal) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_erc20_proto_rawDescGZIP(), []int{4} +} + +func (x *ToggleTokenConversionProposal) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ToggleTokenConversionProposal) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *ToggleTokenConversionProposal) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +var File_os_erc20_v1_erc20_proto protoreflect.FileDescriptor + +var file_os_erc20_v1_erc20_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x72, + 0x63, 0x32, 0x30, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6f, 0x73, 0x2e, 0x65, 0x72, + 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, + 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6e, 0x6b, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa1, 0x01, 0x0a, + 0x09, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, + 0x63, 0x32, 0x30, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x65, 0x72, 0x63, 0x32, 0x30, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, + 0x39, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, + 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x0d, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, + 0x22, 0x95, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x69, + 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x3f, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, + 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x53, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3f, 0x0a, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x7d, 0x0a, + 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x52, 0x43, 0x32, 0x30, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, + 0x0a, 0x0e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x73, 0x0a, 0x1d, + 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, + 0x01, 0x2a, 0x4a, 0x0a, 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x57, + 0x4e, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x5f, 0x4d, 0x4f, 0x44, 0x55, 0x4c, + 0x45, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x5f, 0x45, 0x58, 0x54, + 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x02, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x42, 0x91, 0x01, + 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, + 0x31, 0x42, 0x0a, 0x45, 0x72, 0x63, 0x32, 0x30, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x72, + 0x63, 0x32, 0x30, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x45, 0x58, 0xaa, 0x02, 0x0b, 0x4f, 0x73, + 0x2e, 0x45, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4f, 0x73, 0x5c, 0x45, + 0x72, 0x63, 0x32, 0x30, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4f, 0x73, 0x5c, 0x45, 0x72, 0x63, + 0x32, 0x30, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0d, 0x4f, 0x73, 0x3a, 0x3a, 0x45, 0x72, 0x63, 0x32, 0x30, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_erc20_v1_erc20_proto_rawDescOnce sync.Once + file_os_erc20_v1_erc20_proto_rawDescData = file_os_erc20_v1_erc20_proto_rawDesc +) + +func file_os_erc20_v1_erc20_proto_rawDescGZIP() []byte { + file_os_erc20_v1_erc20_proto_rawDescOnce.Do(func() { + file_os_erc20_v1_erc20_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_erc20_v1_erc20_proto_rawDescData) + }) + return file_os_erc20_v1_erc20_proto_rawDescData +} + +var file_os_erc20_v1_erc20_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_os_erc20_v1_erc20_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_os_erc20_v1_erc20_proto_goTypes = []interface{}{ + (Owner)(0), // 0: os.erc20.v1.Owner + (*TokenPair)(nil), // 1: os.erc20.v1.TokenPair + (*RegisterCoinProposal)(nil), // 2: os.erc20.v1.RegisterCoinProposal + (*ProposalMetadata)(nil), // 3: os.erc20.v1.ProposalMetadata + (*RegisterERC20Proposal)(nil), // 4: os.erc20.v1.RegisterERC20Proposal + (*ToggleTokenConversionProposal)(nil), // 5: os.erc20.v1.ToggleTokenConversionProposal + (*v1beta1.Metadata)(nil), // 6: cosmos.bank.v1beta1.Metadata +} +var file_os_erc20_v1_erc20_proto_depIdxs = []int32{ + 0, // 0: os.erc20.v1.TokenPair.contract_owner:type_name -> os.erc20.v1.Owner + 6, // 1: os.erc20.v1.RegisterCoinProposal.metadata:type_name -> cosmos.bank.v1beta1.Metadata + 6, // 2: os.erc20.v1.ProposalMetadata.metadata:type_name -> cosmos.bank.v1beta1.Metadata + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_os_erc20_v1_erc20_proto_init() } +func file_os_erc20_v1_erc20_proto_init() { + if File_os_erc20_v1_erc20_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_os_erc20_v1_erc20_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TokenPair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_erc20_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterCoinProposal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_erc20_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProposalMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_erc20_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterERC20Proposal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_erc20_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ToggleTokenConversionProposal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_erc20_v1_erc20_proto_rawDesc, + NumEnums: 1, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_erc20_v1_erc20_proto_goTypes, + DependencyIndexes: file_os_erc20_v1_erc20_proto_depIdxs, + EnumInfos: file_os_erc20_v1_erc20_proto_enumTypes, + MessageInfos: file_os_erc20_v1_erc20_proto_msgTypes, + }.Build() + File_os_erc20_v1_erc20_proto = out.File + file_os_erc20_v1_erc20_proto_rawDesc = nil + file_os_erc20_v1_erc20_proto_goTypes = nil + file_os_erc20_v1_erc20_proto_depIdxs = nil +} diff --git a/api/os/erc20/v1/events.pulsar.go b/api/os/erc20/v1/events.pulsar.go new file mode 100644 index 00000000..eed69e8b --- /dev/null +++ b/api/os/erc20/v1/events.pulsar.go @@ -0,0 +1,2739 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package erc20v1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_EventRegisterPair protoreflect.MessageDescriptor + fd_EventRegisterPair_denom protoreflect.FieldDescriptor + fd_EventRegisterPair_erc20_address protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_events_proto_init() + md_EventRegisterPair = File_os_erc20_v1_events_proto.Messages().ByName("EventRegisterPair") + fd_EventRegisterPair_denom = md_EventRegisterPair.Fields().ByName("denom") + fd_EventRegisterPair_erc20_address = md_EventRegisterPair.Fields().ByName("erc20_address") +} + +var _ protoreflect.Message = (*fastReflection_EventRegisterPair)(nil) + +type fastReflection_EventRegisterPair EventRegisterPair + +func (x *EventRegisterPair) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventRegisterPair)(x) +} + +func (x *EventRegisterPair) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_events_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventRegisterPair_messageType fastReflection_EventRegisterPair_messageType +var _ protoreflect.MessageType = fastReflection_EventRegisterPair_messageType{} + +type fastReflection_EventRegisterPair_messageType struct{} + +func (x fastReflection_EventRegisterPair_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventRegisterPair)(nil) +} +func (x fastReflection_EventRegisterPair_messageType) New() protoreflect.Message { + return new(fastReflection_EventRegisterPair) +} +func (x fastReflection_EventRegisterPair_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventRegisterPair +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventRegisterPair) Descriptor() protoreflect.MessageDescriptor { + return md_EventRegisterPair +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventRegisterPair) Type() protoreflect.MessageType { + return _fastReflection_EventRegisterPair_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventRegisterPair) New() protoreflect.Message { + return new(fastReflection_EventRegisterPair) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventRegisterPair) Interface() protoreflect.ProtoMessage { + return (*EventRegisterPair)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventRegisterPair) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Denom != "" { + value := protoreflect.ValueOfString(x.Denom) + if !f(fd_EventRegisterPair_denom, value) { + return + } + } + if x.Erc20Address != "" { + value := protoreflect.ValueOfString(x.Erc20Address) + if !f(fd_EventRegisterPair_erc20_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventRegisterPair) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.EventRegisterPair.denom": + return x.Denom != "" + case "os.erc20.v1.EventRegisterPair.erc20_address": + return x.Erc20Address != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventRegisterPair")) + } + panic(fmt.Errorf("message os.erc20.v1.EventRegisterPair does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventRegisterPair) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.EventRegisterPair.denom": + x.Denom = "" + case "os.erc20.v1.EventRegisterPair.erc20_address": + x.Erc20Address = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventRegisterPair")) + } + panic(fmt.Errorf("message os.erc20.v1.EventRegisterPair does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventRegisterPair) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.EventRegisterPair.denom": + value := x.Denom + return protoreflect.ValueOfString(value) + case "os.erc20.v1.EventRegisterPair.erc20_address": + value := x.Erc20Address + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventRegisterPair")) + } + panic(fmt.Errorf("message os.erc20.v1.EventRegisterPair does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventRegisterPair) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.EventRegisterPair.denom": + x.Denom = value.Interface().(string) + case "os.erc20.v1.EventRegisterPair.erc20_address": + x.Erc20Address = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventRegisterPair")) + } + panic(fmt.Errorf("message os.erc20.v1.EventRegisterPair does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventRegisterPair) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.EventRegisterPair.denom": + panic(fmt.Errorf("field denom of message os.erc20.v1.EventRegisterPair is not mutable")) + case "os.erc20.v1.EventRegisterPair.erc20_address": + panic(fmt.Errorf("field erc20_address of message os.erc20.v1.EventRegisterPair is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventRegisterPair")) + } + panic(fmt.Errorf("message os.erc20.v1.EventRegisterPair does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventRegisterPair) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.EventRegisterPair.denom": + return protoreflect.ValueOfString("") + case "os.erc20.v1.EventRegisterPair.erc20_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventRegisterPair")) + } + panic(fmt.Errorf("message os.erc20.v1.EventRegisterPair does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventRegisterPair) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.EventRegisterPair", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventRegisterPair) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventRegisterPair) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventRegisterPair) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventRegisterPair) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventRegisterPair) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Denom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Erc20Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventRegisterPair) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Erc20Address) > 0 { + i -= len(x.Erc20Address) + copy(dAtA[i:], x.Erc20Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Erc20Address))) + i-- + dAtA[i] = 0x12 + } + if len(x.Denom) > 0 { + i -= len(x.Denom) + copy(dAtA[i:], x.Denom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denom))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventRegisterPair) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRegisterPair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRegisterPair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Erc20Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Erc20Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventToggleTokenConversion protoreflect.MessageDescriptor + fd_EventToggleTokenConversion_denom protoreflect.FieldDescriptor + fd_EventToggleTokenConversion_erc20_address protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_events_proto_init() + md_EventToggleTokenConversion = File_os_erc20_v1_events_proto.Messages().ByName("EventToggleTokenConversion") + fd_EventToggleTokenConversion_denom = md_EventToggleTokenConversion.Fields().ByName("denom") + fd_EventToggleTokenConversion_erc20_address = md_EventToggleTokenConversion.Fields().ByName("erc20_address") +} + +var _ protoreflect.Message = (*fastReflection_EventToggleTokenConversion)(nil) + +type fastReflection_EventToggleTokenConversion EventToggleTokenConversion + +func (x *EventToggleTokenConversion) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventToggleTokenConversion)(x) +} + +func (x *EventToggleTokenConversion) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_events_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventToggleTokenConversion_messageType fastReflection_EventToggleTokenConversion_messageType +var _ protoreflect.MessageType = fastReflection_EventToggleTokenConversion_messageType{} + +type fastReflection_EventToggleTokenConversion_messageType struct{} + +func (x fastReflection_EventToggleTokenConversion_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventToggleTokenConversion)(nil) +} +func (x fastReflection_EventToggleTokenConversion_messageType) New() protoreflect.Message { + return new(fastReflection_EventToggleTokenConversion) +} +func (x fastReflection_EventToggleTokenConversion_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventToggleTokenConversion +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventToggleTokenConversion) Descriptor() protoreflect.MessageDescriptor { + return md_EventToggleTokenConversion +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventToggleTokenConversion) Type() protoreflect.MessageType { + return _fastReflection_EventToggleTokenConversion_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventToggleTokenConversion) New() protoreflect.Message { + return new(fastReflection_EventToggleTokenConversion) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventToggleTokenConversion) Interface() protoreflect.ProtoMessage { + return (*EventToggleTokenConversion)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventToggleTokenConversion) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Denom != "" { + value := protoreflect.ValueOfString(x.Denom) + if !f(fd_EventToggleTokenConversion_denom, value) { + return + } + } + if x.Erc20Address != "" { + value := protoreflect.ValueOfString(x.Erc20Address) + if !f(fd_EventToggleTokenConversion_erc20_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventToggleTokenConversion) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.EventToggleTokenConversion.denom": + return x.Denom != "" + case "os.erc20.v1.EventToggleTokenConversion.erc20_address": + return x.Erc20Address != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventToggleTokenConversion")) + } + panic(fmt.Errorf("message os.erc20.v1.EventToggleTokenConversion does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventToggleTokenConversion) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.EventToggleTokenConversion.denom": + x.Denom = "" + case "os.erc20.v1.EventToggleTokenConversion.erc20_address": + x.Erc20Address = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventToggleTokenConversion")) + } + panic(fmt.Errorf("message os.erc20.v1.EventToggleTokenConversion does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventToggleTokenConversion) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.EventToggleTokenConversion.denom": + value := x.Denom + return protoreflect.ValueOfString(value) + case "os.erc20.v1.EventToggleTokenConversion.erc20_address": + value := x.Erc20Address + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventToggleTokenConversion")) + } + panic(fmt.Errorf("message os.erc20.v1.EventToggleTokenConversion does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventToggleTokenConversion) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.EventToggleTokenConversion.denom": + x.Denom = value.Interface().(string) + case "os.erc20.v1.EventToggleTokenConversion.erc20_address": + x.Erc20Address = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventToggleTokenConversion")) + } + panic(fmt.Errorf("message os.erc20.v1.EventToggleTokenConversion does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventToggleTokenConversion) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.EventToggleTokenConversion.denom": + panic(fmt.Errorf("field denom of message os.erc20.v1.EventToggleTokenConversion is not mutable")) + case "os.erc20.v1.EventToggleTokenConversion.erc20_address": + panic(fmt.Errorf("field erc20_address of message os.erc20.v1.EventToggleTokenConversion is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventToggleTokenConversion")) + } + panic(fmt.Errorf("message os.erc20.v1.EventToggleTokenConversion does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventToggleTokenConversion) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.EventToggleTokenConversion.denom": + return protoreflect.ValueOfString("") + case "os.erc20.v1.EventToggleTokenConversion.erc20_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventToggleTokenConversion")) + } + panic(fmt.Errorf("message os.erc20.v1.EventToggleTokenConversion does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventToggleTokenConversion) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.EventToggleTokenConversion", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventToggleTokenConversion) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventToggleTokenConversion) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventToggleTokenConversion) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventToggleTokenConversion) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventToggleTokenConversion) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Denom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Erc20Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventToggleTokenConversion) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Erc20Address) > 0 { + i -= len(x.Erc20Address) + copy(dAtA[i:], x.Erc20Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Erc20Address))) + i-- + dAtA[i] = 0x12 + } + if len(x.Denom) > 0 { + i -= len(x.Denom) + copy(dAtA[i:], x.Denom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denom))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventToggleTokenConversion) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventToggleTokenConversion: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventToggleTokenConversion: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Erc20Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Erc20Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventConvertCoin protoreflect.MessageDescriptor + fd_EventConvertCoin_sender protoreflect.FieldDescriptor + fd_EventConvertCoin_receiver protoreflect.FieldDescriptor + fd_EventConvertCoin_amount protoreflect.FieldDescriptor + fd_EventConvertCoin_denom protoreflect.FieldDescriptor + fd_EventConvertCoin_erc20_address protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_events_proto_init() + md_EventConvertCoin = File_os_erc20_v1_events_proto.Messages().ByName("EventConvertCoin") + fd_EventConvertCoin_sender = md_EventConvertCoin.Fields().ByName("sender") + fd_EventConvertCoin_receiver = md_EventConvertCoin.Fields().ByName("receiver") + fd_EventConvertCoin_amount = md_EventConvertCoin.Fields().ByName("amount") + fd_EventConvertCoin_denom = md_EventConvertCoin.Fields().ByName("denom") + fd_EventConvertCoin_erc20_address = md_EventConvertCoin.Fields().ByName("erc20_address") +} + +var _ protoreflect.Message = (*fastReflection_EventConvertCoin)(nil) + +type fastReflection_EventConvertCoin EventConvertCoin + +func (x *EventConvertCoin) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventConvertCoin)(x) +} + +func (x *EventConvertCoin) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_events_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventConvertCoin_messageType fastReflection_EventConvertCoin_messageType +var _ protoreflect.MessageType = fastReflection_EventConvertCoin_messageType{} + +type fastReflection_EventConvertCoin_messageType struct{} + +func (x fastReflection_EventConvertCoin_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventConvertCoin)(nil) +} +func (x fastReflection_EventConvertCoin_messageType) New() protoreflect.Message { + return new(fastReflection_EventConvertCoin) +} +func (x fastReflection_EventConvertCoin_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventConvertCoin +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventConvertCoin) Descriptor() protoreflect.MessageDescriptor { + return md_EventConvertCoin +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventConvertCoin) Type() protoreflect.MessageType { + return _fastReflection_EventConvertCoin_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventConvertCoin) New() protoreflect.Message { + return new(fastReflection_EventConvertCoin) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventConvertCoin) Interface() protoreflect.ProtoMessage { + return (*EventConvertCoin)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventConvertCoin) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_EventConvertCoin_sender, value) { + return + } + } + if x.Receiver != "" { + value := protoreflect.ValueOfString(x.Receiver) + if !f(fd_EventConvertCoin_receiver, value) { + return + } + } + if x.Amount != "" { + value := protoreflect.ValueOfString(x.Amount) + if !f(fd_EventConvertCoin_amount, value) { + return + } + } + if x.Denom != "" { + value := protoreflect.ValueOfString(x.Denom) + if !f(fd_EventConvertCoin_denom, value) { + return + } + } + if x.Erc20Address != "" { + value := protoreflect.ValueOfString(x.Erc20Address) + if !f(fd_EventConvertCoin_erc20_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventConvertCoin) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.EventConvertCoin.sender": + return x.Sender != "" + case "os.erc20.v1.EventConvertCoin.receiver": + return x.Receiver != "" + case "os.erc20.v1.EventConvertCoin.amount": + return x.Amount != "" + case "os.erc20.v1.EventConvertCoin.denom": + return x.Denom != "" + case "os.erc20.v1.EventConvertCoin.erc20_address": + return x.Erc20Address != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventConvertCoin")) + } + panic(fmt.Errorf("message os.erc20.v1.EventConvertCoin does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventConvertCoin) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.EventConvertCoin.sender": + x.Sender = "" + case "os.erc20.v1.EventConvertCoin.receiver": + x.Receiver = "" + case "os.erc20.v1.EventConvertCoin.amount": + x.Amount = "" + case "os.erc20.v1.EventConvertCoin.denom": + x.Denom = "" + case "os.erc20.v1.EventConvertCoin.erc20_address": + x.Erc20Address = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventConvertCoin")) + } + panic(fmt.Errorf("message os.erc20.v1.EventConvertCoin does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventConvertCoin) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.EventConvertCoin.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + case "os.erc20.v1.EventConvertCoin.receiver": + value := x.Receiver + return protoreflect.ValueOfString(value) + case "os.erc20.v1.EventConvertCoin.amount": + value := x.Amount + return protoreflect.ValueOfString(value) + case "os.erc20.v1.EventConvertCoin.denom": + value := x.Denom + return protoreflect.ValueOfString(value) + case "os.erc20.v1.EventConvertCoin.erc20_address": + value := x.Erc20Address + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventConvertCoin")) + } + panic(fmt.Errorf("message os.erc20.v1.EventConvertCoin does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventConvertCoin) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.EventConvertCoin.sender": + x.Sender = value.Interface().(string) + case "os.erc20.v1.EventConvertCoin.receiver": + x.Receiver = value.Interface().(string) + case "os.erc20.v1.EventConvertCoin.amount": + x.Amount = value.Interface().(string) + case "os.erc20.v1.EventConvertCoin.denom": + x.Denom = value.Interface().(string) + case "os.erc20.v1.EventConvertCoin.erc20_address": + x.Erc20Address = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventConvertCoin")) + } + panic(fmt.Errorf("message os.erc20.v1.EventConvertCoin does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventConvertCoin) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.EventConvertCoin.sender": + panic(fmt.Errorf("field sender of message os.erc20.v1.EventConvertCoin is not mutable")) + case "os.erc20.v1.EventConvertCoin.receiver": + panic(fmt.Errorf("field receiver of message os.erc20.v1.EventConvertCoin is not mutable")) + case "os.erc20.v1.EventConvertCoin.amount": + panic(fmt.Errorf("field amount of message os.erc20.v1.EventConvertCoin is not mutable")) + case "os.erc20.v1.EventConvertCoin.denom": + panic(fmt.Errorf("field denom of message os.erc20.v1.EventConvertCoin is not mutable")) + case "os.erc20.v1.EventConvertCoin.erc20_address": + panic(fmt.Errorf("field erc20_address of message os.erc20.v1.EventConvertCoin is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventConvertCoin")) + } + panic(fmt.Errorf("message os.erc20.v1.EventConvertCoin does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventConvertCoin) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.EventConvertCoin.sender": + return protoreflect.ValueOfString("") + case "os.erc20.v1.EventConvertCoin.receiver": + return protoreflect.ValueOfString("") + case "os.erc20.v1.EventConvertCoin.amount": + return protoreflect.ValueOfString("") + case "os.erc20.v1.EventConvertCoin.denom": + return protoreflect.ValueOfString("") + case "os.erc20.v1.EventConvertCoin.erc20_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventConvertCoin")) + } + panic(fmt.Errorf("message os.erc20.v1.EventConvertCoin does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventConvertCoin) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.EventConvertCoin", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventConvertCoin) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventConvertCoin) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventConvertCoin) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventConvertCoin) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventConvertCoin) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Sender) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Receiver) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Amount) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Denom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Erc20Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventConvertCoin) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Erc20Address) > 0 { + i -= len(x.Erc20Address) + copy(dAtA[i:], x.Erc20Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Erc20Address))) + i-- + dAtA[i] = 0x2a + } + if len(x.Denom) > 0 { + i -= len(x.Denom) + copy(dAtA[i:], x.Denom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denom))) + i-- + dAtA[i] = 0x22 + } + if len(x.Amount) > 0 { + i -= len(x.Amount) + copy(dAtA[i:], x.Amount) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Amount))) + i-- + dAtA[i] = 0x1a + } + if len(x.Receiver) > 0 { + i -= len(x.Receiver) + copy(dAtA[i:], x.Receiver) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Receiver))) + i-- + dAtA[i] = 0x12 + } + if len(x.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventConvertCoin) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventConvertCoin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventConvertCoin: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Erc20Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Erc20Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventConvertERC20 protoreflect.MessageDescriptor + fd_EventConvertERC20_sender protoreflect.FieldDescriptor + fd_EventConvertERC20_receiver protoreflect.FieldDescriptor + fd_EventConvertERC20_amount protoreflect.FieldDescriptor + fd_EventConvertERC20_denom protoreflect.FieldDescriptor + fd_EventConvertERC20_contract_address protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_events_proto_init() + md_EventConvertERC20 = File_os_erc20_v1_events_proto.Messages().ByName("EventConvertERC20") + fd_EventConvertERC20_sender = md_EventConvertERC20.Fields().ByName("sender") + fd_EventConvertERC20_receiver = md_EventConvertERC20.Fields().ByName("receiver") + fd_EventConvertERC20_amount = md_EventConvertERC20.Fields().ByName("amount") + fd_EventConvertERC20_denom = md_EventConvertERC20.Fields().ByName("denom") + fd_EventConvertERC20_contract_address = md_EventConvertERC20.Fields().ByName("contract_address") +} + +var _ protoreflect.Message = (*fastReflection_EventConvertERC20)(nil) + +type fastReflection_EventConvertERC20 EventConvertERC20 + +func (x *EventConvertERC20) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventConvertERC20)(x) +} + +func (x *EventConvertERC20) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_events_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventConvertERC20_messageType fastReflection_EventConvertERC20_messageType +var _ protoreflect.MessageType = fastReflection_EventConvertERC20_messageType{} + +type fastReflection_EventConvertERC20_messageType struct{} + +func (x fastReflection_EventConvertERC20_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventConvertERC20)(nil) +} +func (x fastReflection_EventConvertERC20_messageType) New() protoreflect.Message { + return new(fastReflection_EventConvertERC20) +} +func (x fastReflection_EventConvertERC20_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventConvertERC20 +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventConvertERC20) Descriptor() protoreflect.MessageDescriptor { + return md_EventConvertERC20 +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventConvertERC20) Type() protoreflect.MessageType { + return _fastReflection_EventConvertERC20_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventConvertERC20) New() protoreflect.Message { + return new(fastReflection_EventConvertERC20) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventConvertERC20) Interface() protoreflect.ProtoMessage { + return (*EventConvertERC20)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventConvertERC20) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_EventConvertERC20_sender, value) { + return + } + } + if x.Receiver != "" { + value := protoreflect.ValueOfString(x.Receiver) + if !f(fd_EventConvertERC20_receiver, value) { + return + } + } + if x.Amount != "" { + value := protoreflect.ValueOfString(x.Amount) + if !f(fd_EventConvertERC20_amount, value) { + return + } + } + if x.Denom != "" { + value := protoreflect.ValueOfString(x.Denom) + if !f(fd_EventConvertERC20_denom, value) { + return + } + } + if x.ContractAddress != "" { + value := protoreflect.ValueOfString(x.ContractAddress) + if !f(fd_EventConvertERC20_contract_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventConvertERC20) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.EventConvertERC20.sender": + return x.Sender != "" + case "os.erc20.v1.EventConvertERC20.receiver": + return x.Receiver != "" + case "os.erc20.v1.EventConvertERC20.amount": + return x.Amount != "" + case "os.erc20.v1.EventConvertERC20.denom": + return x.Denom != "" + case "os.erc20.v1.EventConvertERC20.contract_address": + return x.ContractAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventConvertERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.EventConvertERC20 does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventConvertERC20) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.EventConvertERC20.sender": + x.Sender = "" + case "os.erc20.v1.EventConvertERC20.receiver": + x.Receiver = "" + case "os.erc20.v1.EventConvertERC20.amount": + x.Amount = "" + case "os.erc20.v1.EventConvertERC20.denom": + x.Denom = "" + case "os.erc20.v1.EventConvertERC20.contract_address": + x.ContractAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventConvertERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.EventConvertERC20 does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventConvertERC20) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.EventConvertERC20.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + case "os.erc20.v1.EventConvertERC20.receiver": + value := x.Receiver + return protoreflect.ValueOfString(value) + case "os.erc20.v1.EventConvertERC20.amount": + value := x.Amount + return protoreflect.ValueOfString(value) + case "os.erc20.v1.EventConvertERC20.denom": + value := x.Denom + return protoreflect.ValueOfString(value) + case "os.erc20.v1.EventConvertERC20.contract_address": + value := x.ContractAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventConvertERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.EventConvertERC20 does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventConvertERC20) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.EventConvertERC20.sender": + x.Sender = value.Interface().(string) + case "os.erc20.v1.EventConvertERC20.receiver": + x.Receiver = value.Interface().(string) + case "os.erc20.v1.EventConvertERC20.amount": + x.Amount = value.Interface().(string) + case "os.erc20.v1.EventConvertERC20.denom": + x.Denom = value.Interface().(string) + case "os.erc20.v1.EventConvertERC20.contract_address": + x.ContractAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventConvertERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.EventConvertERC20 does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventConvertERC20) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.EventConvertERC20.sender": + panic(fmt.Errorf("field sender of message os.erc20.v1.EventConvertERC20 is not mutable")) + case "os.erc20.v1.EventConvertERC20.receiver": + panic(fmt.Errorf("field receiver of message os.erc20.v1.EventConvertERC20 is not mutable")) + case "os.erc20.v1.EventConvertERC20.amount": + panic(fmt.Errorf("field amount of message os.erc20.v1.EventConvertERC20 is not mutable")) + case "os.erc20.v1.EventConvertERC20.denom": + panic(fmt.Errorf("field denom of message os.erc20.v1.EventConvertERC20 is not mutable")) + case "os.erc20.v1.EventConvertERC20.contract_address": + panic(fmt.Errorf("field contract_address of message os.erc20.v1.EventConvertERC20 is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventConvertERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.EventConvertERC20 does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventConvertERC20) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.EventConvertERC20.sender": + return protoreflect.ValueOfString("") + case "os.erc20.v1.EventConvertERC20.receiver": + return protoreflect.ValueOfString("") + case "os.erc20.v1.EventConvertERC20.amount": + return protoreflect.ValueOfString("") + case "os.erc20.v1.EventConvertERC20.denom": + return protoreflect.ValueOfString("") + case "os.erc20.v1.EventConvertERC20.contract_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.EventConvertERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.EventConvertERC20 does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventConvertERC20) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.EventConvertERC20", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventConvertERC20) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventConvertERC20) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventConvertERC20) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventConvertERC20) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventConvertERC20) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Sender) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Receiver) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Amount) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Denom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ContractAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventConvertERC20) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.ContractAddress) > 0 { + i -= len(x.ContractAddress) + copy(dAtA[i:], x.ContractAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ContractAddress))) + i-- + dAtA[i] = 0x2a + } + if len(x.Denom) > 0 { + i -= len(x.Denom) + copy(dAtA[i:], x.Denom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denom))) + i-- + dAtA[i] = 0x22 + } + if len(x.Amount) > 0 { + i -= len(x.Amount) + copy(dAtA[i:], x.Amount) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Amount))) + i-- + dAtA[i] = 0x1a + } + if len(x.Receiver) > 0 { + i -= len(x.Receiver) + copy(dAtA[i:], x.Receiver) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Receiver))) + i-- + dAtA[i] = 0x12 + } + if len(x.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventConvertERC20) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventConvertERC20: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventConvertERC20: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/erc20/v1/events.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EventRegisterPair is an event emitted when a coin is registered. +type EventRegisterPair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // denom is the coin's denomination. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // erc20_address is the ERC20 contract address. + Erc20Address string `protobuf:"bytes,2,opt,name=erc20_address,json=erc20Address,proto3" json:"erc20_address,omitempty"` +} + +func (x *EventRegisterPair) Reset() { + *x = EventRegisterPair{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventRegisterPair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventRegisterPair) ProtoMessage() {} + +// Deprecated: Use EventRegisterPair.ProtoReflect.Descriptor instead. +func (*EventRegisterPair) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_events_proto_rawDescGZIP(), []int{0} +} + +func (x *EventRegisterPair) GetDenom() string { + if x != nil { + return x.Denom + } + return "" +} + +func (x *EventRegisterPair) GetErc20Address() string { + if x != nil { + return x.Erc20Address + } + return "" +} + +// EventToggleTokenConversion is an event emitted when a coin's token conversion +// is toggled. +type EventToggleTokenConversion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // denom is the coin's denomination. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // erc20_address is the ERC20 contract address. + Erc20Address string `protobuf:"bytes,2,opt,name=erc20_address,json=erc20Address,proto3" json:"erc20_address,omitempty"` +} + +func (x *EventToggleTokenConversion) Reset() { + *x = EventToggleTokenConversion{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_events_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventToggleTokenConversion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventToggleTokenConversion) ProtoMessage() {} + +// Deprecated: Use EventToggleTokenConversion.ProtoReflect.Descriptor instead. +func (*EventToggleTokenConversion) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_events_proto_rawDescGZIP(), []int{1} +} + +func (x *EventToggleTokenConversion) GetDenom() string { + if x != nil { + return x.Denom + } + return "" +} + +func (x *EventToggleTokenConversion) GetErc20Address() string { + if x != nil { + return x.Erc20Address + } + return "" +} + +// EventConvertCoin is an event emitted when a coin is converted. +type EventConvertCoin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // sender is the sender's address. + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // receiver is the receiver's address. + Receiver string `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"` + // amount is the amount of coins to be converted. + Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + // denom is the coin's denomination. + Denom string `protobuf:"bytes,4,opt,name=denom,proto3" json:"denom,omitempty"` + // erc20_address is the ERC20 contract address. + Erc20Address string `protobuf:"bytes,5,opt,name=erc20_address,json=erc20Address,proto3" json:"erc20_address,omitempty"` +} + +func (x *EventConvertCoin) Reset() { + *x = EventConvertCoin{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_events_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventConvertCoin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventConvertCoin) ProtoMessage() {} + +// Deprecated: Use EventConvertCoin.ProtoReflect.Descriptor instead. +func (*EventConvertCoin) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_events_proto_rawDescGZIP(), []int{2} +} + +func (x *EventConvertCoin) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +func (x *EventConvertCoin) GetReceiver() string { + if x != nil { + return x.Receiver + } + return "" +} + +func (x *EventConvertCoin) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +func (x *EventConvertCoin) GetDenom() string { + if x != nil { + return x.Denom + } + return "" +} + +func (x *EventConvertCoin) GetErc20Address() string { + if x != nil { + return x.Erc20Address + } + return "" +} + +// EventConvertERC20 is an event emitted when an ERC20 is converted. +type EventConvertERC20 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // sender is the sender's address. + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // receiver is the receiver's address. + Receiver string `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"` + // amount is the amount of coins to be converted. + Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + // denom is the coin's denomination. + Denom string `protobuf:"bytes,4,opt,name=denom,proto3" json:"denom,omitempty"` + // contract_address of an ERC20 token contract, that is registered in a token + // pair + ContractAddress string `protobuf:"bytes,5,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` +} + +func (x *EventConvertERC20) Reset() { + *x = EventConvertERC20{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_events_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventConvertERC20) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventConvertERC20) ProtoMessage() {} + +// Deprecated: Use EventConvertERC20.ProtoReflect.Descriptor instead. +func (*EventConvertERC20) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_events_proto_rawDescGZIP(), []int{3} +} + +func (x *EventConvertERC20) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +func (x *EventConvertERC20) GetReceiver() string { + if x != nil { + return x.Receiver + } + return "" +} + +func (x *EventConvertERC20) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +func (x *EventConvertERC20) GetDenom() string { + if x != nil { + return x.Denom + } + return "" +} + +func (x *EventConvertERC20) GetContractAddress() string { + if x != nil { + return x.ContractAddress + } + return "" +} + +var File_os_erc20_v1_events_proto protoreflect.FileDescriptor + +var file_os_erc20_v1_events_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6f, 0x73, 0x2e, 0x65, + 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x22, 0x4e, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x12, 0x14, 0x0a, 0x05, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x63, 0x32, 0x30, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x63, 0x32, 0x30, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x57, 0x0a, 0x1a, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x23, 0x0a, 0x0d, 0x65, + 0x72, 0x63, 0x32, 0x30, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x63, 0x32, 0x30, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x22, 0x99, 0x01, 0x0a, 0x10, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, + 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, + 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x63, 0x32, 0x30, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x65, 0x72, 0x63, 0x32, 0x30, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa0, 0x01, 0x0a, + 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x45, 0x52, 0x43, + 0x32, 0x30, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, + 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, + 0x92, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, + 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, + 0x3b, 0x65, 0x72, 0x63, 0x32, 0x30, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x45, 0x58, 0xaa, 0x02, + 0x0b, 0x4f, 0x73, 0x2e, 0x45, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4f, + 0x73, 0x5c, 0x45, 0x72, 0x63, 0x32, 0x30, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4f, 0x73, 0x5c, + 0x45, 0x72, 0x63, 0x32, 0x30, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x4f, 0x73, 0x3a, 0x3a, 0x45, 0x72, 0x63, 0x32, 0x30, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_erc20_v1_events_proto_rawDescOnce sync.Once + file_os_erc20_v1_events_proto_rawDescData = file_os_erc20_v1_events_proto_rawDesc +) + +func file_os_erc20_v1_events_proto_rawDescGZIP() []byte { + file_os_erc20_v1_events_proto_rawDescOnce.Do(func() { + file_os_erc20_v1_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_erc20_v1_events_proto_rawDescData) + }) + return file_os_erc20_v1_events_proto_rawDescData +} + +var file_os_erc20_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_os_erc20_v1_events_proto_goTypes = []interface{}{ + (*EventRegisterPair)(nil), // 0: os.erc20.v1.EventRegisterPair + (*EventToggleTokenConversion)(nil), // 1: os.erc20.v1.EventToggleTokenConversion + (*EventConvertCoin)(nil), // 2: os.erc20.v1.EventConvertCoin + (*EventConvertERC20)(nil), // 3: os.erc20.v1.EventConvertERC20 +} +var file_os_erc20_v1_events_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_os_erc20_v1_events_proto_init() } +func file_os_erc20_v1_events_proto_init() { + if File_os_erc20_v1_events_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_os_erc20_v1_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventRegisterPair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventToggleTokenConversion); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventConvertCoin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_events_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventConvertERC20); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_erc20_v1_events_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_erc20_v1_events_proto_goTypes, + DependencyIndexes: file_os_erc20_v1_events_proto_depIdxs, + MessageInfos: file_os_erc20_v1_events_proto_msgTypes, + }.Build() + File_os_erc20_v1_events_proto = out.File + file_os_erc20_v1_events_proto_rawDesc = nil + file_os_erc20_v1_events_proto_goTypes = nil + file_os_erc20_v1_events_proto_depIdxs = nil +} diff --git a/api/os/erc20/v1/genesis.pulsar.go b/api/os/erc20/v1/genesis.pulsar.go new file mode 100644 index 00000000..fd51d30d --- /dev/null +++ b/api/os/erc20/v1/genesis.pulsar.go @@ -0,0 +1,1487 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package erc20v1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_GenesisState_2_list)(nil) + +type _GenesisState_2_list struct { + list *[]*TokenPair +} + +func (x *_GenesisState_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*TokenPair) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*TokenPair) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { + v := new(TokenPair) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_2_list) NewElement() protoreflect.Value { + v := new(TokenPair) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_token_pairs protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_genesis_proto_init() + md_GenesisState = File_os_erc20_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_token_pairs = md_GenesisState.Fields().ByName("token_pairs") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } + if len(x.TokenPairs) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.TokenPairs}) + if !f(fd_GenesisState_token_pairs, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.GenesisState.params": + return x.Params != nil + case "os.erc20.v1.GenesisState.token_pairs": + return len(x.TokenPairs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.GenesisState")) + } + panic(fmt.Errorf("message os.erc20.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.GenesisState.params": + x.Params = nil + case "os.erc20.v1.GenesisState.token_pairs": + x.TokenPairs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.GenesisState")) + } + panic(fmt.Errorf("message os.erc20.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.erc20.v1.GenesisState.token_pairs": + if len(x.TokenPairs) == 0 { + return protoreflect.ValueOfList(&_GenesisState_2_list{}) + } + listValue := &_GenesisState_2_list{list: &x.TokenPairs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.GenesisState")) + } + panic(fmt.Errorf("message os.erc20.v1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + case "os.erc20.v1.GenesisState.token_pairs": + lv := value.List() + clv := lv.(*_GenesisState_2_list) + x.TokenPairs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.GenesisState")) + } + panic(fmt.Errorf("message os.erc20.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "os.erc20.v1.GenesisState.token_pairs": + if x.TokenPairs == nil { + x.TokenPairs = []*TokenPair{} + } + value := &_GenesisState_2_list{list: &x.TokenPairs} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.GenesisState")) + } + panic(fmt.Errorf("message os.erc20.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.erc20.v1.GenesisState.token_pairs": + list := []*TokenPair{} + return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.GenesisState")) + } + panic(fmt.Errorf("message os.erc20.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.TokenPairs) > 0 { + for _, e := range x.TokenPairs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.TokenPairs) > 0 { + for iNdEx := len(x.TokenPairs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.TokenPairs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TokenPairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.TokenPairs = append(x.TokenPairs, &TokenPair{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TokenPairs[len(x.TokenPairs)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_Params_3_list)(nil) + +type _Params_3_list struct { + list *[]string +} + +func (x *_Params_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Params_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Params_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field NativePrecompiles as it is not of Message kind")) +} + +func (x *_Params_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Params_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Params_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Params_4_list)(nil) + +type _Params_4_list struct { + list *[]string +} + +func (x *_Params_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Params_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Params_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_4_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field DynamicPrecompiles as it is not of Message kind")) +} + +func (x *_Params_4_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Params_4_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Params_4_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_enable_erc20 protoreflect.FieldDescriptor + fd_Params_native_precompiles protoreflect.FieldDescriptor + fd_Params_dynamic_precompiles protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_genesis_proto_init() + md_Params = File_os_erc20_v1_genesis_proto.Messages().ByName("Params") + fd_Params_enable_erc20 = md_Params.Fields().ByName("enable_erc20") + fd_Params_native_precompiles = md_Params.Fields().ByName("native_precompiles") + fd_Params_dynamic_precompiles = md_Params.Fields().ByName("dynamic_precompiles") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_genesis_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.EnableErc20 != false { + value := protoreflect.ValueOfBool(x.EnableErc20) + if !f(fd_Params_enable_erc20, value) { + return + } + } + if len(x.NativePrecompiles) != 0 { + value := protoreflect.ValueOfList(&_Params_3_list{list: &x.NativePrecompiles}) + if !f(fd_Params_native_precompiles, value) { + return + } + } + if len(x.DynamicPrecompiles) != 0 { + value := protoreflect.ValueOfList(&_Params_4_list{list: &x.DynamicPrecompiles}) + if !f(fd_Params_dynamic_precompiles, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.Params.enable_erc20": + return x.EnableErc20 != false + case "os.erc20.v1.Params.native_precompiles": + return len(x.NativePrecompiles) != 0 + case "os.erc20.v1.Params.dynamic_precompiles": + return len(x.DynamicPrecompiles) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.Params")) + } + panic(fmt.Errorf("message os.erc20.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.Params.enable_erc20": + x.EnableErc20 = false + case "os.erc20.v1.Params.native_precompiles": + x.NativePrecompiles = nil + case "os.erc20.v1.Params.dynamic_precompiles": + x.DynamicPrecompiles = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.Params")) + } + panic(fmt.Errorf("message os.erc20.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.Params.enable_erc20": + value := x.EnableErc20 + return protoreflect.ValueOfBool(value) + case "os.erc20.v1.Params.native_precompiles": + if len(x.NativePrecompiles) == 0 { + return protoreflect.ValueOfList(&_Params_3_list{}) + } + listValue := &_Params_3_list{list: &x.NativePrecompiles} + return protoreflect.ValueOfList(listValue) + case "os.erc20.v1.Params.dynamic_precompiles": + if len(x.DynamicPrecompiles) == 0 { + return protoreflect.ValueOfList(&_Params_4_list{}) + } + listValue := &_Params_4_list{list: &x.DynamicPrecompiles} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.Params")) + } + panic(fmt.Errorf("message os.erc20.v1.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.Params.enable_erc20": + x.EnableErc20 = value.Bool() + case "os.erc20.v1.Params.native_precompiles": + lv := value.List() + clv := lv.(*_Params_3_list) + x.NativePrecompiles = *clv.list + case "os.erc20.v1.Params.dynamic_precompiles": + lv := value.List() + clv := lv.(*_Params_4_list) + x.DynamicPrecompiles = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.Params")) + } + panic(fmt.Errorf("message os.erc20.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.Params.native_precompiles": + if x.NativePrecompiles == nil { + x.NativePrecompiles = []string{} + } + value := &_Params_3_list{list: &x.NativePrecompiles} + return protoreflect.ValueOfList(value) + case "os.erc20.v1.Params.dynamic_precompiles": + if x.DynamicPrecompiles == nil { + x.DynamicPrecompiles = []string{} + } + value := &_Params_4_list{list: &x.DynamicPrecompiles} + return protoreflect.ValueOfList(value) + case "os.erc20.v1.Params.enable_erc20": + panic(fmt.Errorf("field enable_erc20 of message os.erc20.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.Params")) + } + panic(fmt.Errorf("message os.erc20.v1.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.Params.enable_erc20": + return protoreflect.ValueOfBool(false) + case "os.erc20.v1.Params.native_precompiles": + list := []string{} + return protoreflect.ValueOfList(&_Params_3_list{list: &list}) + case "os.erc20.v1.Params.dynamic_precompiles": + list := []string{} + return protoreflect.ValueOfList(&_Params_4_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.Params")) + } + panic(fmt.Errorf("message os.erc20.v1.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.EnableErc20 { + n += 2 + } + if len(x.NativePrecompiles) > 0 { + for _, s := range x.NativePrecompiles { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.DynamicPrecompiles) > 0 { + for _, s := range x.DynamicPrecompiles { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.DynamicPrecompiles) > 0 { + for iNdEx := len(x.DynamicPrecompiles) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.DynamicPrecompiles[iNdEx]) + copy(dAtA[i:], x.DynamicPrecompiles[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DynamicPrecompiles[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(x.NativePrecompiles) > 0 { + for iNdEx := len(x.NativePrecompiles) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.NativePrecompiles[iNdEx]) + copy(dAtA[i:], x.NativePrecompiles[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NativePrecompiles[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if x.EnableErc20 { + i-- + if x.EnableErc20 { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EnableErc20", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.EnableErc20 = bool(v != 0) + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NativePrecompiles", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.NativePrecompiles = append(x.NativePrecompiles, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DynamicPrecompiles", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.DynamicPrecompiles = append(x.DynamicPrecompiles, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/erc20/v1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params are the erc20 module parameters at genesis + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + // token_pairs is a slice of the registered token pairs at genesis + TokenPairs []*TokenPair `protobuf:"bytes,2,rep,name=token_pairs,json=tokenPairs,proto3" json:"token_pairs,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +func (x *GenesisState) GetTokenPairs() []*TokenPair { + if x != nil { + return x.TokenPairs + } + return nil +} + +// Params defines the erc20 module params +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // enable_erc20 is the parameter to enable the conversion of Cosmos coins <--> + // ERC20 tokens. + EnableErc20 bool `protobuf:"varint,1,opt,name=enable_erc20,json=enableErc20,proto3" json:"enable_erc20,omitempty"` + // native_precompiles defines the slice of hex addresses of the + // active precompiles that are used to interact with native staking coins as + // ERC20s + NativePrecompiles []string `protobuf:"bytes,3,rep,name=native_precompiles,json=nativePrecompiles,proto3" json:"native_precompiles,omitempty"` + // dynamic_precompiles defines the slice of hex addresses of the + // active precompiles that are used to interact with Bank coins as ERC20s + DynamicPrecompiles []string `protobuf:"bytes,4,rep,name=dynamic_precompiles,json=dynamicPrecompiles,proto3" json:"dynamic_precompiles,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_genesis_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_genesis_proto_rawDescGZIP(), []int{1} +} + +func (x *Params) GetEnableErc20() bool { + if x != nil { + return x.EnableErc20 + } + return false +} + +func (x *Params) GetNativePrecompiles() []string { + if x != nil { + return x.NativePrecompiles + } + return nil +} + +func (x *Params) GetDynamicPrecompiles() []string { + if x != nil { + return x.DynamicPrecompiles + } + return nil +} + +var File_os_erc20_v1_genesis_proto protoreflect.FileDescriptor + +var file_os_erc20_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6f, 0x73, 0x2e, + 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, + 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, + 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x17, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x65, + 0x72, 0x63, 0x32, 0x30, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x01, 0x0a, 0x0c, 0x47, + 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x73, + 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x42, 0x0a, 0x0b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x70, 0x61, 0x69, + 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, + 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, + 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x73, 0x22, 0x91, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x72, 0x63, + 0x32, 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x45, 0x72, 0x63, 0x32, 0x30, 0x12, 0x2d, 0x0a, 0x12, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, + 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x11, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, + 0x69, 0x6c, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, + 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x12, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, + 0x70, 0x69, 0x6c, 0x65, 0x73, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x42, 0x93, 0x01, 0x0a, 0x0f, + 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x42, + 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x72, + 0x63, 0x32, 0x30, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x45, 0x58, 0xaa, 0x02, 0x0b, 0x4f, 0x73, + 0x2e, 0x45, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4f, 0x73, 0x5c, 0x45, + 0x72, 0x63, 0x32, 0x30, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4f, 0x73, 0x5c, 0x45, 0x72, 0x63, + 0x32, 0x30, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0d, 0x4f, 0x73, 0x3a, 0x3a, 0x45, 0x72, 0x63, 0x32, 0x30, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_erc20_v1_genesis_proto_rawDescOnce sync.Once + file_os_erc20_v1_genesis_proto_rawDescData = file_os_erc20_v1_genesis_proto_rawDesc +) + +func file_os_erc20_v1_genesis_proto_rawDescGZIP() []byte { + file_os_erc20_v1_genesis_proto_rawDescOnce.Do(func() { + file_os_erc20_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_erc20_v1_genesis_proto_rawDescData) + }) + return file_os_erc20_v1_genesis_proto_rawDescData +} + +var file_os_erc20_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_os_erc20_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: os.erc20.v1.GenesisState + (*Params)(nil), // 1: os.erc20.v1.Params + (*TokenPair)(nil), // 2: os.erc20.v1.TokenPair +} +var file_os_erc20_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: os.erc20.v1.GenesisState.params:type_name -> os.erc20.v1.Params + 2, // 1: os.erc20.v1.GenesisState.token_pairs:type_name -> os.erc20.v1.TokenPair + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_os_erc20_v1_genesis_proto_init() } +func file_os_erc20_v1_genesis_proto_init() { + if File_os_erc20_v1_genesis_proto != nil { + return + } + file_os_erc20_v1_erc20_proto_init() + if !protoimpl.UnsafeEnabled { + file_os_erc20_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_genesis_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_erc20_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_erc20_v1_genesis_proto_goTypes, + DependencyIndexes: file_os_erc20_v1_genesis_proto_depIdxs, + MessageInfos: file_os_erc20_v1_genesis_proto_msgTypes, + }.Build() + File_os_erc20_v1_genesis_proto = out.File + file_os_erc20_v1_genesis_proto_rawDesc = nil + file_os_erc20_v1_genesis_proto_goTypes = nil + file_os_erc20_v1_genesis_proto_depIdxs = nil +} diff --git a/api/os/erc20/v1/msg.go b/api/os/erc20/v1/msg.go new file mode 100644 index 00000000..a9fbcfbd --- /dev/null +++ b/api/os/erc20/v1/msg.go @@ -0,0 +1,24 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package erc20v1 + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + protov2 "google.golang.org/protobuf/proto" +) + +// GetSigners gets the signer's address from the Ethereum tx signature +func GetSigners(msg protov2.Message) ([][]byte, error) { + msgConvERC20, ok := msg.(*MsgConvertERC20) + if !ok { + return nil, fmt.Errorf("invalid type, expected MsgConvertERC20 and got %T", msg) + } + + // The sender on the msg is a hex address + sender := common.HexToAddress(msgConvERC20.Sender) + + return [][]byte{sender.Bytes()}, nil +} diff --git a/api/os/erc20/v1/query.pulsar.go b/api/os/erc20/v1/query.pulsar.go new file mode 100644 index 00000000..9566854e --- /dev/null +++ b/api/os/erc20/v1/query.pulsar.go @@ -0,0 +1,3142 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package erc20v1 + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryTokenPairsRequest protoreflect.MessageDescriptor + fd_QueryTokenPairsRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_query_proto_init() + md_QueryTokenPairsRequest = File_os_erc20_v1_query_proto.Messages().ByName("QueryTokenPairsRequest") + fd_QueryTokenPairsRequest_pagination = md_QueryTokenPairsRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryTokenPairsRequest)(nil) + +type fastReflection_QueryTokenPairsRequest QueryTokenPairsRequest + +func (x *QueryTokenPairsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryTokenPairsRequest)(x) +} + +func (x *QueryTokenPairsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryTokenPairsRequest_messageType fastReflection_QueryTokenPairsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryTokenPairsRequest_messageType{} + +type fastReflection_QueryTokenPairsRequest_messageType struct{} + +func (x fastReflection_QueryTokenPairsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryTokenPairsRequest)(nil) +} +func (x fastReflection_QueryTokenPairsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryTokenPairsRequest) +} +func (x fastReflection_QueryTokenPairsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTokenPairsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryTokenPairsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTokenPairsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryTokenPairsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryTokenPairsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryTokenPairsRequest) New() protoreflect.Message { + return new(fastReflection_QueryTokenPairsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryTokenPairsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryTokenPairsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryTokenPairsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryTokenPairsRequest_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryTokenPairsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairsRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairsRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairsRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairsRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryTokenPairsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.QueryTokenPairsRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairsRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairsRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairsRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairsRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairsRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryTokenPairsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairsRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairsRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryTokenPairsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.QueryTokenPairsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryTokenPairsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryTokenPairsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryTokenPairsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryTokenPairsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryTokenPairsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryTokenPairsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTokenPairsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTokenPairsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryTokenPairsResponse_1_list)(nil) + +type _QueryTokenPairsResponse_1_list struct { + list *[]*TokenPair +} + +func (x *_QueryTokenPairsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryTokenPairsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryTokenPairsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*TokenPair) + (*x.list)[i] = concreteValue +} + +func (x *_QueryTokenPairsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*TokenPair) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryTokenPairsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(TokenPair) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryTokenPairsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryTokenPairsResponse_1_list) NewElement() protoreflect.Value { + v := new(TokenPair) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryTokenPairsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryTokenPairsResponse protoreflect.MessageDescriptor + fd_QueryTokenPairsResponse_token_pairs protoreflect.FieldDescriptor + fd_QueryTokenPairsResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_query_proto_init() + md_QueryTokenPairsResponse = File_os_erc20_v1_query_proto.Messages().ByName("QueryTokenPairsResponse") + fd_QueryTokenPairsResponse_token_pairs = md_QueryTokenPairsResponse.Fields().ByName("token_pairs") + fd_QueryTokenPairsResponse_pagination = md_QueryTokenPairsResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryTokenPairsResponse)(nil) + +type fastReflection_QueryTokenPairsResponse QueryTokenPairsResponse + +func (x *QueryTokenPairsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryTokenPairsResponse)(x) +} + +func (x *QueryTokenPairsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryTokenPairsResponse_messageType fastReflection_QueryTokenPairsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryTokenPairsResponse_messageType{} + +type fastReflection_QueryTokenPairsResponse_messageType struct{} + +func (x fastReflection_QueryTokenPairsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryTokenPairsResponse)(nil) +} +func (x fastReflection_QueryTokenPairsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryTokenPairsResponse) +} +func (x fastReflection_QueryTokenPairsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTokenPairsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryTokenPairsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTokenPairsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryTokenPairsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryTokenPairsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryTokenPairsResponse) New() protoreflect.Message { + return new(fastReflection_QueryTokenPairsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryTokenPairsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryTokenPairsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryTokenPairsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.TokenPairs) != 0 { + value := protoreflect.ValueOfList(&_QueryTokenPairsResponse_1_list{list: &x.TokenPairs}) + if !f(fd_QueryTokenPairsResponse_token_pairs, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryTokenPairsResponse_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryTokenPairsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairsResponse.token_pairs": + return len(x.TokenPairs) != 0 + case "os.erc20.v1.QueryTokenPairsResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairsResponse.token_pairs": + x.TokenPairs = nil + case "os.erc20.v1.QueryTokenPairsResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryTokenPairsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.QueryTokenPairsResponse.token_pairs": + if len(x.TokenPairs) == 0 { + return protoreflect.ValueOfList(&_QueryTokenPairsResponse_1_list{}) + } + listValue := &_QueryTokenPairsResponse_1_list{list: &x.TokenPairs} + return protoreflect.ValueOfList(listValue) + case "os.erc20.v1.QueryTokenPairsResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairsResponse.token_pairs": + lv := value.List() + clv := lv.(*_QueryTokenPairsResponse_1_list) + x.TokenPairs = *clv.list + case "os.erc20.v1.QueryTokenPairsResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairsResponse.token_pairs": + if x.TokenPairs == nil { + x.TokenPairs = []*TokenPair{} + } + value := &_QueryTokenPairsResponse_1_list{list: &x.TokenPairs} + return protoreflect.ValueOfList(value) + case "os.erc20.v1.QueryTokenPairsResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryTokenPairsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairsResponse.token_pairs": + list := []*TokenPair{} + return protoreflect.ValueOfList(&_QueryTokenPairsResponse_1_list{list: &list}) + case "os.erc20.v1.QueryTokenPairsResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryTokenPairsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.QueryTokenPairsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryTokenPairsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryTokenPairsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryTokenPairsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryTokenPairsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.TokenPairs) > 0 { + for _, e := range x.TokenPairs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryTokenPairsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.TokenPairs) > 0 { + for iNdEx := len(x.TokenPairs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.TokenPairs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryTokenPairsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTokenPairsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTokenPairsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TokenPairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.TokenPairs = append(x.TokenPairs, &TokenPair{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TokenPairs[len(x.TokenPairs)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryTokenPairRequest protoreflect.MessageDescriptor + fd_QueryTokenPairRequest_token protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_query_proto_init() + md_QueryTokenPairRequest = File_os_erc20_v1_query_proto.Messages().ByName("QueryTokenPairRequest") + fd_QueryTokenPairRequest_token = md_QueryTokenPairRequest.Fields().ByName("token") +} + +var _ protoreflect.Message = (*fastReflection_QueryTokenPairRequest)(nil) + +type fastReflection_QueryTokenPairRequest QueryTokenPairRequest + +func (x *QueryTokenPairRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryTokenPairRequest)(x) +} + +func (x *QueryTokenPairRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryTokenPairRequest_messageType fastReflection_QueryTokenPairRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryTokenPairRequest_messageType{} + +type fastReflection_QueryTokenPairRequest_messageType struct{} + +func (x fastReflection_QueryTokenPairRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryTokenPairRequest)(nil) +} +func (x fastReflection_QueryTokenPairRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryTokenPairRequest) +} +func (x fastReflection_QueryTokenPairRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTokenPairRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryTokenPairRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTokenPairRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryTokenPairRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryTokenPairRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryTokenPairRequest) New() protoreflect.Message { + return new(fastReflection_QueryTokenPairRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryTokenPairRequest) Interface() protoreflect.ProtoMessage { + return (*QueryTokenPairRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryTokenPairRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) + if !f(fd_QueryTokenPairRequest_token, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryTokenPairRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairRequest.token": + return x.Token != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairRequest.token": + x.Token = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryTokenPairRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.QueryTokenPairRequest.token": + value := x.Token + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairRequest.token": + x.Token = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairRequest.token": + panic(fmt.Errorf("field token of message os.erc20.v1.QueryTokenPairRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryTokenPairRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairRequest.token": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryTokenPairRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.QueryTokenPairRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryTokenPairRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryTokenPairRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryTokenPairRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryTokenPairRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Token) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryTokenPairRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryTokenPairRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTokenPairRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTokenPairRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryTokenPairResponse protoreflect.MessageDescriptor + fd_QueryTokenPairResponse_token_pair protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_query_proto_init() + md_QueryTokenPairResponse = File_os_erc20_v1_query_proto.Messages().ByName("QueryTokenPairResponse") + fd_QueryTokenPairResponse_token_pair = md_QueryTokenPairResponse.Fields().ByName("token_pair") +} + +var _ protoreflect.Message = (*fastReflection_QueryTokenPairResponse)(nil) + +type fastReflection_QueryTokenPairResponse QueryTokenPairResponse + +func (x *QueryTokenPairResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryTokenPairResponse)(x) +} + +func (x *QueryTokenPairResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryTokenPairResponse_messageType fastReflection_QueryTokenPairResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryTokenPairResponse_messageType{} + +type fastReflection_QueryTokenPairResponse_messageType struct{} + +func (x fastReflection_QueryTokenPairResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryTokenPairResponse)(nil) +} +func (x fastReflection_QueryTokenPairResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryTokenPairResponse) +} +func (x fastReflection_QueryTokenPairResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTokenPairResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryTokenPairResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTokenPairResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryTokenPairResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryTokenPairResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryTokenPairResponse) New() protoreflect.Message { + return new(fastReflection_QueryTokenPairResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryTokenPairResponse) Interface() protoreflect.ProtoMessage { + return (*QueryTokenPairResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryTokenPairResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.TokenPair != nil { + value := protoreflect.ValueOfMessage(x.TokenPair.ProtoReflect()) + if !f(fd_QueryTokenPairResponse_token_pair, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryTokenPairResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairResponse.token_pair": + return x.TokenPair != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairResponse.token_pair": + x.TokenPair = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryTokenPairResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.QueryTokenPairResponse.token_pair": + value := x.TokenPair + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairResponse.token_pair": + x.TokenPair = value.Message().Interface().(*TokenPair) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairResponse.token_pair": + if x.TokenPair == nil { + x.TokenPair = new(TokenPair) + } + return protoreflect.ValueOfMessage(x.TokenPair.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryTokenPairResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.QueryTokenPairResponse.token_pair": + m := new(TokenPair) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryTokenPairResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryTokenPairResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryTokenPairResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.QueryTokenPairResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryTokenPairResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTokenPairResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryTokenPairResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryTokenPairResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryTokenPairResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.TokenPair != nil { + l = options.Size(x.TokenPair) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryTokenPairResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.TokenPair != nil { + encoded, err := options.Marshal(x.TokenPair) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryTokenPairResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTokenPairResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTokenPairResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TokenPair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.TokenPair == nil { + x.TokenPair = &TokenPair{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TokenPair); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_os_erc20_v1_query_proto_init() + md_QueryParamsRequest = File_os_erc20_v1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_query_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.QueryParamsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_query_proto_init() + md_QueryParamsResponse = File_os_erc20_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_query_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.QueryParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/erc20/v1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryTokenPairsRequest is the request type for the Query/TokenPairs RPC +// method. +type QueryTokenPairsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pagination defines an optional pagination for the request. + Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryTokenPairsRequest) Reset() { + *x = QueryTokenPairsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryTokenPairsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryTokenPairsRequest) ProtoMessage() {} + +// Deprecated: Use QueryTokenPairsRequest.ProtoReflect.Descriptor instead. +func (*QueryTokenPairsRequest) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_query_proto_rawDescGZIP(), []int{0} +} + +func (x *QueryTokenPairsRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryTokenPairsResponse is the response type for the Query/TokenPairs RPC +// method. +type QueryTokenPairsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // token_pairs is a slice of registered token pairs for the erc20 module + TokenPairs []*TokenPair `protobuf:"bytes,1,rep,name=token_pairs,json=tokenPairs,proto3" json:"token_pairs,omitempty"` + // pagination defines the pagination in the response. + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryTokenPairsResponse) Reset() { + *x = QueryTokenPairsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryTokenPairsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryTokenPairsResponse) ProtoMessage() {} + +// Deprecated: Use QueryTokenPairsResponse.ProtoReflect.Descriptor instead. +func (*QueryTokenPairsResponse) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryTokenPairsResponse) GetTokenPairs() []*TokenPair { + if x != nil { + return x.TokenPairs + } + return nil +} + +func (x *QueryTokenPairsResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryTokenPairRequest is the request type for the Query/TokenPair RPC method. +type QueryTokenPairRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // token identifier can be either the hex contract address of the ERC20 or the + // Cosmos base denomination + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *QueryTokenPairRequest) Reset() { + *x = QueryTokenPairRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryTokenPairRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryTokenPairRequest) ProtoMessage() {} + +// Deprecated: Use QueryTokenPairRequest.ProtoReflect.Descriptor instead. +func (*QueryTokenPairRequest) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryTokenPairRequest) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// QueryTokenPairResponse is the response type for the Query/TokenPair RPC +// method. +type QueryTokenPairResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // token_pairs returns the info about a registered token pair for the erc20 + // module + TokenPair *TokenPair `protobuf:"bytes,1,opt,name=token_pair,json=tokenPair,proto3" json:"token_pair,omitempty"` +} + +func (x *QueryTokenPairResponse) Reset() { + *x = QueryTokenPairResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryTokenPairResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryTokenPairResponse) ProtoMessage() {} + +// Deprecated: Use QueryTokenPairResponse.ProtoReflect.Descriptor instead. +func (*QueryTokenPairResponse) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryTokenPairResponse) GetTokenPair() *TokenPair { + if x != nil { + return x.TokenPair + } + return nil +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_query_proto_rawDescGZIP(), []int{4} +} + +// QueryParamsResponse is the response type for the Query/Params RPC +// method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params are the erc20 module parameters + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +var File_os_erc20_v1_query_proto protoreflect.FileDescriptor + +var file_os_erc20_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6f, 0x73, 0x2e, 0x65, 0x72, + 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, + 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x6f, 0x73, 0x2f, 0x65, 0x72, + 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x19, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x2f, + 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x60, 0x0a, + 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0xa6, 0x01, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, + 0x69, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, + 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2d, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5a, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x40, 0x0a, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x42, 0x09, 0xc8, + 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x50, + 0x61, 0x69, 0x72, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, 0x13, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x36, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0xec, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x79, 0x0a, 0x0a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x73, + 0x12, 0x23, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, + 0x69, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, + 0x31, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x73, 0x12, 0x7e, 0x0a, + 0x09, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x12, 0x22, 0x2e, 0x6f, 0x73, 0x2e, + 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, + 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x6f, 0x73, + 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, + 0x70, 0x61, 0x69, 0x72, 0x73, 0x2f, 0x7b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x7d, 0x12, 0x68, 0x0a, + 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, + 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, + 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x15, 0x12, 0x13, 0x2f, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x91, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, + 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x65, + 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x72, 0x63, 0x32, 0x30, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x4f, 0x45, 0x58, 0xaa, 0x02, 0x0b, 0x4f, 0x73, 0x2e, 0x45, 0x72, 0x63, 0x32, 0x30, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4f, 0x73, 0x5c, 0x45, 0x72, 0x63, 0x32, 0x30, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x17, 0x4f, 0x73, 0x5c, 0x45, 0x72, 0x63, 0x32, 0x30, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x4f, 0x73, + 0x3a, 0x3a, 0x45, 0x72, 0x63, 0x32, 0x30, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_os_erc20_v1_query_proto_rawDescOnce sync.Once + file_os_erc20_v1_query_proto_rawDescData = file_os_erc20_v1_query_proto_rawDesc +) + +func file_os_erc20_v1_query_proto_rawDescGZIP() []byte { + file_os_erc20_v1_query_proto_rawDescOnce.Do(func() { + file_os_erc20_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_erc20_v1_query_proto_rawDescData) + }) + return file_os_erc20_v1_query_proto_rawDescData +} + +var file_os_erc20_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_os_erc20_v1_query_proto_goTypes = []interface{}{ + (*QueryTokenPairsRequest)(nil), // 0: os.erc20.v1.QueryTokenPairsRequest + (*QueryTokenPairsResponse)(nil), // 1: os.erc20.v1.QueryTokenPairsResponse + (*QueryTokenPairRequest)(nil), // 2: os.erc20.v1.QueryTokenPairRequest + (*QueryTokenPairResponse)(nil), // 3: os.erc20.v1.QueryTokenPairResponse + (*QueryParamsRequest)(nil), // 4: os.erc20.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 5: os.erc20.v1.QueryParamsResponse + (*v1beta1.PageRequest)(nil), // 6: cosmos.base.query.v1beta1.PageRequest + (*TokenPair)(nil), // 7: os.erc20.v1.TokenPair + (*v1beta1.PageResponse)(nil), // 8: cosmos.base.query.v1beta1.PageResponse + (*Params)(nil), // 9: os.erc20.v1.Params +} +var file_os_erc20_v1_query_proto_depIdxs = []int32{ + 6, // 0: os.erc20.v1.QueryTokenPairsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 7, // 1: os.erc20.v1.QueryTokenPairsResponse.token_pairs:type_name -> os.erc20.v1.TokenPair + 8, // 2: os.erc20.v1.QueryTokenPairsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 7, // 3: os.erc20.v1.QueryTokenPairResponse.token_pair:type_name -> os.erc20.v1.TokenPair + 9, // 4: os.erc20.v1.QueryParamsResponse.params:type_name -> os.erc20.v1.Params + 0, // 5: os.erc20.v1.Query.TokenPairs:input_type -> os.erc20.v1.QueryTokenPairsRequest + 2, // 6: os.erc20.v1.Query.TokenPair:input_type -> os.erc20.v1.QueryTokenPairRequest + 4, // 7: os.erc20.v1.Query.Params:input_type -> os.erc20.v1.QueryParamsRequest + 1, // 8: os.erc20.v1.Query.TokenPairs:output_type -> os.erc20.v1.QueryTokenPairsResponse + 3, // 9: os.erc20.v1.Query.TokenPair:output_type -> os.erc20.v1.QueryTokenPairResponse + 5, // 10: os.erc20.v1.Query.Params:output_type -> os.erc20.v1.QueryParamsResponse + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_os_erc20_v1_query_proto_init() } +func file_os_erc20_v1_query_proto_init() { + if File_os_erc20_v1_query_proto != nil { + return + } + file_os_erc20_v1_erc20_proto_init() + file_os_erc20_v1_genesis_proto_init() + if !protoimpl.UnsafeEnabled { + file_os_erc20_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryTokenPairsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryTokenPairsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryTokenPairRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryTokenPairResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_erc20_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_os_erc20_v1_query_proto_goTypes, + DependencyIndexes: file_os_erc20_v1_query_proto_depIdxs, + MessageInfos: file_os_erc20_v1_query_proto_msgTypes, + }.Build() + File_os_erc20_v1_query_proto = out.File + file_os_erc20_v1_query_proto_rawDesc = nil + file_os_erc20_v1_query_proto_goTypes = nil + file_os_erc20_v1_query_proto_depIdxs = nil +} diff --git a/api/os/erc20/v1/query_grpc.pb.go b/api/os/erc20/v1/query_grpc.pb.go new file mode 100644 index 00000000..e8601298 --- /dev/null +++ b/api/os/erc20/v1/query_grpc.pb.go @@ -0,0 +1,192 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: os/erc20/v1/query.proto + +package erc20v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_TokenPairs_FullMethodName = "/os.erc20.v1.Query/TokenPairs" + Query_TokenPair_FullMethodName = "/os.erc20.v1.Query/TokenPair" + Query_Params_FullMethodName = "/os.erc20.v1.Query/Params" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + // TokenPairs retrieves registered token pairs + TokenPairs(ctx context.Context, in *QueryTokenPairsRequest, opts ...grpc.CallOption) (*QueryTokenPairsResponse, error) + // TokenPair retrieves a registered token pair + TokenPair(ctx context.Context, in *QueryTokenPairRequest, opts ...grpc.CallOption) (*QueryTokenPairResponse, error) + // Params retrieves the erc20 module params + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) TokenPairs(ctx context.Context, in *QueryTokenPairsRequest, opts ...grpc.CallOption) (*QueryTokenPairsResponse, error) { + out := new(QueryTokenPairsResponse) + err := c.cc.Invoke(ctx, Query_TokenPairs_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TokenPair(ctx context.Context, in *QueryTokenPairRequest, opts ...grpc.CallOption) (*QueryTokenPairResponse, error) { + out := new(QueryTokenPairResponse) + err := c.cc.Invoke(ctx, Query_TokenPair_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // TokenPairs retrieves registered token pairs + TokenPairs(context.Context, *QueryTokenPairsRequest) (*QueryTokenPairsResponse, error) + // TokenPair retrieves a registered token pair + TokenPair(context.Context, *QueryTokenPairRequest) (*QueryTokenPairResponse, error) + // Params retrieves the erc20 module params + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) TokenPairs(context.Context, *QueryTokenPairsRequest) (*QueryTokenPairsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TokenPairs not implemented") +} +func (UnimplementedQueryServer) TokenPair(context.Context, *QueryTokenPairRequest) (*QueryTokenPairResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TokenPair not implemented") +} +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_TokenPairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTokenPairsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TokenPairs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_TokenPairs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TokenPairs(ctx, req.(*QueryTokenPairsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TokenPair_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTokenPairRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TokenPair(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_TokenPair_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TokenPair(ctx, req.(*QueryTokenPairRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "os.erc20.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "TokenPairs", + Handler: _Query_TokenPairs_Handler, + }, + { + MethodName: "TokenPair", + Handler: _Query_TokenPair_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "os/erc20/v1/query.proto", +} diff --git a/api/os/erc20/v1/tx.pulsar.go b/api/os/erc20/v1/tx.pulsar.go new file mode 100644 index 00000000..825d72cc --- /dev/null +++ b/api/os/erc20/v1/tx.pulsar.go @@ -0,0 +1,5230 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package erc20v1 + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgConvertERC20 protoreflect.MessageDescriptor + fd_MsgConvertERC20_contract_address protoreflect.FieldDescriptor + fd_MsgConvertERC20_amount protoreflect.FieldDescriptor + fd_MsgConvertERC20_receiver protoreflect.FieldDescriptor + fd_MsgConvertERC20_sender protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_tx_proto_init() + md_MsgConvertERC20 = File_os_erc20_v1_tx_proto.Messages().ByName("MsgConvertERC20") + fd_MsgConvertERC20_contract_address = md_MsgConvertERC20.Fields().ByName("contract_address") + fd_MsgConvertERC20_amount = md_MsgConvertERC20.Fields().ByName("amount") + fd_MsgConvertERC20_receiver = md_MsgConvertERC20.Fields().ByName("receiver") + fd_MsgConvertERC20_sender = md_MsgConvertERC20.Fields().ByName("sender") +} + +var _ protoreflect.Message = (*fastReflection_MsgConvertERC20)(nil) + +type fastReflection_MsgConvertERC20 MsgConvertERC20 + +func (x *MsgConvertERC20) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgConvertERC20)(x) +} + +func (x *MsgConvertERC20) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgConvertERC20_messageType fastReflection_MsgConvertERC20_messageType +var _ protoreflect.MessageType = fastReflection_MsgConvertERC20_messageType{} + +type fastReflection_MsgConvertERC20_messageType struct{} + +func (x fastReflection_MsgConvertERC20_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgConvertERC20)(nil) +} +func (x fastReflection_MsgConvertERC20_messageType) New() protoreflect.Message { + return new(fastReflection_MsgConvertERC20) +} +func (x fastReflection_MsgConvertERC20_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgConvertERC20 +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgConvertERC20) Descriptor() protoreflect.MessageDescriptor { + return md_MsgConvertERC20 +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgConvertERC20) Type() protoreflect.MessageType { + return _fastReflection_MsgConvertERC20_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgConvertERC20) New() protoreflect.Message { + return new(fastReflection_MsgConvertERC20) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgConvertERC20) Interface() protoreflect.ProtoMessage { + return (*MsgConvertERC20)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgConvertERC20) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ContractAddress != "" { + value := protoreflect.ValueOfString(x.ContractAddress) + if !f(fd_MsgConvertERC20_contract_address, value) { + return + } + } + if x.Amount != "" { + value := protoreflect.ValueOfString(x.Amount) + if !f(fd_MsgConvertERC20_amount, value) { + return + } + } + if x.Receiver != "" { + value := protoreflect.ValueOfString(x.Receiver) + if !f(fd_MsgConvertERC20_receiver, value) { + return + } + } + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_MsgConvertERC20_sender, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgConvertERC20) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.MsgConvertERC20.contract_address": + return x.ContractAddress != "" + case "os.erc20.v1.MsgConvertERC20.amount": + return x.Amount != "" + case "os.erc20.v1.MsgConvertERC20.receiver": + return x.Receiver != "" + case "os.erc20.v1.MsgConvertERC20.sender": + return x.Sender != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertERC20 does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertERC20) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.MsgConvertERC20.contract_address": + x.ContractAddress = "" + case "os.erc20.v1.MsgConvertERC20.amount": + x.Amount = "" + case "os.erc20.v1.MsgConvertERC20.receiver": + x.Receiver = "" + case "os.erc20.v1.MsgConvertERC20.sender": + x.Sender = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertERC20 does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgConvertERC20) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.MsgConvertERC20.contract_address": + value := x.ContractAddress + return protoreflect.ValueOfString(value) + case "os.erc20.v1.MsgConvertERC20.amount": + value := x.Amount + return protoreflect.ValueOfString(value) + case "os.erc20.v1.MsgConvertERC20.receiver": + value := x.Receiver + return protoreflect.ValueOfString(value) + case "os.erc20.v1.MsgConvertERC20.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertERC20 does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertERC20) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.MsgConvertERC20.contract_address": + x.ContractAddress = value.Interface().(string) + case "os.erc20.v1.MsgConvertERC20.amount": + x.Amount = value.Interface().(string) + case "os.erc20.v1.MsgConvertERC20.receiver": + x.Receiver = value.Interface().(string) + case "os.erc20.v1.MsgConvertERC20.sender": + x.Sender = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertERC20 does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertERC20) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.MsgConvertERC20.contract_address": + panic(fmt.Errorf("field contract_address of message os.erc20.v1.MsgConvertERC20 is not mutable")) + case "os.erc20.v1.MsgConvertERC20.amount": + panic(fmt.Errorf("field amount of message os.erc20.v1.MsgConvertERC20 is not mutable")) + case "os.erc20.v1.MsgConvertERC20.receiver": + panic(fmt.Errorf("field receiver of message os.erc20.v1.MsgConvertERC20 is not mutable")) + case "os.erc20.v1.MsgConvertERC20.sender": + panic(fmt.Errorf("field sender of message os.erc20.v1.MsgConvertERC20 is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertERC20 does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgConvertERC20) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.MsgConvertERC20.contract_address": + return protoreflect.ValueOfString("") + case "os.erc20.v1.MsgConvertERC20.amount": + return protoreflect.ValueOfString("") + case "os.erc20.v1.MsgConvertERC20.receiver": + return protoreflect.ValueOfString("") + case "os.erc20.v1.MsgConvertERC20.sender": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertERC20 does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgConvertERC20) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.MsgConvertERC20", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgConvertERC20) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertERC20) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgConvertERC20) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgConvertERC20) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgConvertERC20) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.ContractAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Amount) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Receiver) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Sender) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgConvertERC20) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + i-- + dAtA[i] = 0x22 + } + if len(x.Receiver) > 0 { + i -= len(x.Receiver) + copy(dAtA[i:], x.Receiver) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Receiver))) + i-- + dAtA[i] = 0x1a + } + if len(x.Amount) > 0 { + i -= len(x.Amount) + copy(dAtA[i:], x.Amount) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Amount))) + i-- + dAtA[i] = 0x12 + } + if len(x.ContractAddress) > 0 { + i -= len(x.ContractAddress) + copy(dAtA[i:], x.ContractAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ContractAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgConvertERC20) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgConvertERC20: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgConvertERC20: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgConvertERC20Response protoreflect.MessageDescriptor +) + +func init() { + file_os_erc20_v1_tx_proto_init() + md_MsgConvertERC20Response = File_os_erc20_v1_tx_proto.Messages().ByName("MsgConvertERC20Response") +} + +var _ protoreflect.Message = (*fastReflection_MsgConvertERC20Response)(nil) + +type fastReflection_MsgConvertERC20Response MsgConvertERC20Response + +func (x *MsgConvertERC20Response) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgConvertERC20Response)(x) +} + +func (x *MsgConvertERC20Response) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgConvertERC20Response_messageType fastReflection_MsgConvertERC20Response_messageType +var _ protoreflect.MessageType = fastReflection_MsgConvertERC20Response_messageType{} + +type fastReflection_MsgConvertERC20Response_messageType struct{} + +func (x fastReflection_MsgConvertERC20Response_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgConvertERC20Response)(nil) +} +func (x fastReflection_MsgConvertERC20Response_messageType) New() protoreflect.Message { + return new(fastReflection_MsgConvertERC20Response) +} +func (x fastReflection_MsgConvertERC20Response_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgConvertERC20Response +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgConvertERC20Response) Descriptor() protoreflect.MessageDescriptor { + return md_MsgConvertERC20Response +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgConvertERC20Response) Type() protoreflect.MessageType { + return _fastReflection_MsgConvertERC20Response_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgConvertERC20Response) New() protoreflect.Message { + return new(fastReflection_MsgConvertERC20Response) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgConvertERC20Response) Interface() protoreflect.ProtoMessage { + return (*MsgConvertERC20Response)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgConvertERC20Response) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgConvertERC20Response) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertERC20Response")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertERC20Response does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertERC20Response) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertERC20Response")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertERC20Response does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgConvertERC20Response) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertERC20Response")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertERC20Response does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertERC20Response) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertERC20Response")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertERC20Response does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertERC20Response) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertERC20Response")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertERC20Response does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgConvertERC20Response) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertERC20Response")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertERC20Response does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgConvertERC20Response) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.MsgConvertERC20Response", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgConvertERC20Response) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertERC20Response) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgConvertERC20Response) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgConvertERC20Response) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgConvertERC20Response) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgConvertERC20Response) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgConvertERC20Response) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgConvertERC20Response: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgConvertERC20Response: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgConvertCoin protoreflect.MessageDescriptor + fd_MsgConvertCoin_coin protoreflect.FieldDescriptor + fd_MsgConvertCoin_receiver protoreflect.FieldDescriptor + fd_MsgConvertCoin_sender protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_tx_proto_init() + md_MsgConvertCoin = File_os_erc20_v1_tx_proto.Messages().ByName("MsgConvertCoin") + fd_MsgConvertCoin_coin = md_MsgConvertCoin.Fields().ByName("coin") + fd_MsgConvertCoin_receiver = md_MsgConvertCoin.Fields().ByName("receiver") + fd_MsgConvertCoin_sender = md_MsgConvertCoin.Fields().ByName("sender") +} + +var _ protoreflect.Message = (*fastReflection_MsgConvertCoin)(nil) + +type fastReflection_MsgConvertCoin MsgConvertCoin + +func (x *MsgConvertCoin) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgConvertCoin)(x) +} + +func (x *MsgConvertCoin) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_tx_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgConvertCoin_messageType fastReflection_MsgConvertCoin_messageType +var _ protoreflect.MessageType = fastReflection_MsgConvertCoin_messageType{} + +type fastReflection_MsgConvertCoin_messageType struct{} + +func (x fastReflection_MsgConvertCoin_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgConvertCoin)(nil) +} +func (x fastReflection_MsgConvertCoin_messageType) New() protoreflect.Message { + return new(fastReflection_MsgConvertCoin) +} +func (x fastReflection_MsgConvertCoin_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgConvertCoin +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgConvertCoin) Descriptor() protoreflect.MessageDescriptor { + return md_MsgConvertCoin +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgConvertCoin) Type() protoreflect.MessageType { + return _fastReflection_MsgConvertCoin_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgConvertCoin) New() protoreflect.Message { + return new(fastReflection_MsgConvertCoin) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgConvertCoin) Interface() protoreflect.ProtoMessage { + return (*MsgConvertCoin)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgConvertCoin) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Coin != nil { + value := protoreflect.ValueOfMessage(x.Coin.ProtoReflect()) + if !f(fd_MsgConvertCoin_coin, value) { + return + } + } + if x.Receiver != "" { + value := protoreflect.ValueOfString(x.Receiver) + if !f(fd_MsgConvertCoin_receiver, value) { + return + } + } + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_MsgConvertCoin_sender, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgConvertCoin) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.MsgConvertCoin.coin": + return x.Coin != nil + case "os.erc20.v1.MsgConvertCoin.receiver": + return x.Receiver != "" + case "os.erc20.v1.MsgConvertCoin.sender": + return x.Sender != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertCoin")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertCoin does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertCoin) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.MsgConvertCoin.coin": + x.Coin = nil + case "os.erc20.v1.MsgConvertCoin.receiver": + x.Receiver = "" + case "os.erc20.v1.MsgConvertCoin.sender": + x.Sender = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertCoin")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertCoin does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgConvertCoin) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.MsgConvertCoin.coin": + value := x.Coin + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.erc20.v1.MsgConvertCoin.receiver": + value := x.Receiver + return protoreflect.ValueOfString(value) + case "os.erc20.v1.MsgConvertCoin.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertCoin")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertCoin does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertCoin) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.MsgConvertCoin.coin": + x.Coin = value.Message().Interface().(*v1beta1.Coin) + case "os.erc20.v1.MsgConvertCoin.receiver": + x.Receiver = value.Interface().(string) + case "os.erc20.v1.MsgConvertCoin.sender": + x.Sender = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertCoin")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertCoin does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertCoin) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.MsgConvertCoin.coin": + if x.Coin == nil { + x.Coin = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Coin.ProtoReflect()) + case "os.erc20.v1.MsgConvertCoin.receiver": + panic(fmt.Errorf("field receiver of message os.erc20.v1.MsgConvertCoin is not mutable")) + case "os.erc20.v1.MsgConvertCoin.sender": + panic(fmt.Errorf("field sender of message os.erc20.v1.MsgConvertCoin is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertCoin")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertCoin does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgConvertCoin) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.MsgConvertCoin.coin": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.erc20.v1.MsgConvertCoin.receiver": + return protoreflect.ValueOfString("") + case "os.erc20.v1.MsgConvertCoin.sender": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertCoin")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertCoin does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgConvertCoin) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.MsgConvertCoin", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgConvertCoin) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertCoin) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgConvertCoin) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgConvertCoin) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgConvertCoin) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Coin != nil { + l = options.Size(x.Coin) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Receiver) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Sender) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgConvertCoin) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + i-- + dAtA[i] = 0x1a + } + if len(x.Receiver) > 0 { + i -= len(x.Receiver) + copy(dAtA[i:], x.Receiver) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Receiver))) + i-- + dAtA[i] = 0x12 + } + if x.Coin != nil { + encoded, err := options.Marshal(x.Coin) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgConvertCoin) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgConvertCoin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgConvertCoin: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Coin", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Coin == nil { + x.Coin = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Coin); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgConvertCoinResponse protoreflect.MessageDescriptor +) + +func init() { + file_os_erc20_v1_tx_proto_init() + md_MsgConvertCoinResponse = File_os_erc20_v1_tx_proto.Messages().ByName("MsgConvertCoinResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgConvertCoinResponse)(nil) + +type fastReflection_MsgConvertCoinResponse MsgConvertCoinResponse + +func (x *MsgConvertCoinResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgConvertCoinResponse)(x) +} + +func (x *MsgConvertCoinResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_tx_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgConvertCoinResponse_messageType fastReflection_MsgConvertCoinResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgConvertCoinResponse_messageType{} + +type fastReflection_MsgConvertCoinResponse_messageType struct{} + +func (x fastReflection_MsgConvertCoinResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgConvertCoinResponse)(nil) +} +func (x fastReflection_MsgConvertCoinResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgConvertCoinResponse) +} +func (x fastReflection_MsgConvertCoinResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgConvertCoinResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgConvertCoinResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgConvertCoinResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgConvertCoinResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgConvertCoinResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgConvertCoinResponse) New() protoreflect.Message { + return new(fastReflection_MsgConvertCoinResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgConvertCoinResponse) Interface() protoreflect.ProtoMessage { + return (*MsgConvertCoinResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgConvertCoinResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgConvertCoinResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertCoinResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertCoinResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertCoinResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertCoinResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertCoinResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgConvertCoinResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertCoinResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertCoinResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertCoinResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertCoinResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertCoinResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertCoinResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertCoinResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertCoinResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgConvertCoinResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgConvertCoinResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgConvertCoinResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgConvertCoinResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.MsgConvertCoinResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgConvertCoinResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgConvertCoinResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgConvertCoinResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgConvertCoinResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgConvertCoinResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgConvertCoinResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgConvertCoinResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgConvertCoinResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgConvertCoinResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_tx_proto_init() + md_MsgUpdateParams = File_os_erc20_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_tx_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "os.erc20.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.MsgUpdateParams.authority": + x.Authority = "" + case "os.erc20.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "os.erc20.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "os.erc20.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "os.erc20.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message os.erc20.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "os.erc20.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.MsgUpdateParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_os_erc20_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_os_erc20_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_tx_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.MsgUpdateParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_MsgRegisterERC20_2_list)(nil) + +type _MsgRegisterERC20_2_list struct { + list *[]string +} + +func (x *_MsgRegisterERC20_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgRegisterERC20_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgRegisterERC20_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgRegisterERC20_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgRegisterERC20_2_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgRegisterERC20 at list field Erc20Addresses as it is not of Message kind")) +} + +func (x *_MsgRegisterERC20_2_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgRegisterERC20_2_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgRegisterERC20_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgRegisterERC20 protoreflect.MessageDescriptor + fd_MsgRegisterERC20_authority protoreflect.FieldDescriptor + fd_MsgRegisterERC20_erc20addresses protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_tx_proto_init() + md_MsgRegisterERC20 = File_os_erc20_v1_tx_proto.Messages().ByName("MsgRegisterERC20") + fd_MsgRegisterERC20_authority = md_MsgRegisterERC20.Fields().ByName("authority") + fd_MsgRegisterERC20_erc20addresses = md_MsgRegisterERC20.Fields().ByName("erc20addresses") +} + +var _ protoreflect.Message = (*fastReflection_MsgRegisterERC20)(nil) + +type fastReflection_MsgRegisterERC20 MsgRegisterERC20 + +func (x *MsgRegisterERC20) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRegisterERC20)(x) +} + +func (x *MsgRegisterERC20) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_tx_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgRegisterERC20_messageType fastReflection_MsgRegisterERC20_messageType +var _ protoreflect.MessageType = fastReflection_MsgRegisterERC20_messageType{} + +type fastReflection_MsgRegisterERC20_messageType struct{} + +func (x fastReflection_MsgRegisterERC20_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRegisterERC20)(nil) +} +func (x fastReflection_MsgRegisterERC20_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRegisterERC20) +} +func (x fastReflection_MsgRegisterERC20_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterERC20 +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRegisterERC20) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterERC20 +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgRegisterERC20) Type() protoreflect.MessageType { + return _fastReflection_MsgRegisterERC20_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRegisterERC20) New() protoreflect.Message { + return new(fastReflection_MsgRegisterERC20) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRegisterERC20) Interface() protoreflect.ProtoMessage { + return (*MsgRegisterERC20)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgRegisterERC20) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgRegisterERC20_authority, value) { + return + } + } + if len(x.Erc20Addresses) != 0 { + value := protoreflect.ValueOfList(&_MsgRegisterERC20_2_list{list: &x.Erc20Addresses}) + if !f(fd_MsgRegisterERC20_erc20addresses, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgRegisterERC20) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.MsgRegisterERC20.authority": + return x.Authority != "" + case "os.erc20.v1.MsgRegisterERC20.erc20addresses": + return len(x.Erc20Addresses) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgRegisterERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgRegisterERC20 does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgRegisterERC20) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.MsgRegisterERC20.authority": + x.Authority = "" + case "os.erc20.v1.MsgRegisterERC20.erc20addresses": + x.Erc20Addresses = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgRegisterERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgRegisterERC20 does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgRegisterERC20) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.MsgRegisterERC20.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "os.erc20.v1.MsgRegisterERC20.erc20addresses": + if len(x.Erc20Addresses) == 0 { + return protoreflect.ValueOfList(&_MsgRegisterERC20_2_list{}) + } + listValue := &_MsgRegisterERC20_2_list{list: &x.Erc20Addresses} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgRegisterERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgRegisterERC20 does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgRegisterERC20) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.MsgRegisterERC20.authority": + x.Authority = value.Interface().(string) + case "os.erc20.v1.MsgRegisterERC20.erc20addresses": + lv := value.List() + clv := lv.(*_MsgRegisterERC20_2_list) + x.Erc20Addresses = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgRegisterERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgRegisterERC20 does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgRegisterERC20) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.MsgRegisterERC20.erc20addresses": + if x.Erc20Addresses == nil { + x.Erc20Addresses = []string{} + } + value := &_MsgRegisterERC20_2_list{list: &x.Erc20Addresses} + return protoreflect.ValueOfList(value) + case "os.erc20.v1.MsgRegisterERC20.authority": + panic(fmt.Errorf("field authority of message os.erc20.v1.MsgRegisterERC20 is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgRegisterERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgRegisterERC20 does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgRegisterERC20) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.MsgRegisterERC20.authority": + return protoreflect.ValueOfString("") + case "os.erc20.v1.MsgRegisterERC20.erc20addresses": + list := []string{} + return protoreflect.ValueOfList(&_MsgRegisterERC20_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgRegisterERC20")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgRegisterERC20 does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgRegisterERC20) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.MsgRegisterERC20", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgRegisterERC20) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgRegisterERC20) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgRegisterERC20) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgRegisterERC20) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRegisterERC20) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Erc20Addresses) > 0 { + for _, s := range x.Erc20Addresses { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgRegisterERC20) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Erc20Addresses) > 0 { + for iNdEx := len(x.Erc20Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Erc20Addresses[iNdEx]) + copy(dAtA[i:], x.Erc20Addresses[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Erc20Addresses[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgRegisterERC20) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterERC20: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterERC20: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Erc20Addresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Erc20Addresses = append(x.Erc20Addresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgRegisterERC20Response protoreflect.MessageDescriptor +) + +func init() { + file_os_erc20_v1_tx_proto_init() + md_MsgRegisterERC20Response = File_os_erc20_v1_tx_proto.Messages().ByName("MsgRegisterERC20Response") +} + +var _ protoreflect.Message = (*fastReflection_MsgRegisterERC20Response)(nil) + +type fastReflection_MsgRegisterERC20Response MsgRegisterERC20Response + +func (x *MsgRegisterERC20Response) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRegisterERC20Response)(x) +} + +func (x *MsgRegisterERC20Response) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_tx_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgRegisterERC20Response_messageType fastReflection_MsgRegisterERC20Response_messageType +var _ protoreflect.MessageType = fastReflection_MsgRegisterERC20Response_messageType{} + +type fastReflection_MsgRegisterERC20Response_messageType struct{} + +func (x fastReflection_MsgRegisterERC20Response_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRegisterERC20Response)(nil) +} +func (x fastReflection_MsgRegisterERC20Response_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRegisterERC20Response) +} +func (x fastReflection_MsgRegisterERC20Response_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterERC20Response +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRegisterERC20Response) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterERC20Response +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgRegisterERC20Response) Type() protoreflect.MessageType { + return _fastReflection_MsgRegisterERC20Response_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRegisterERC20Response) New() protoreflect.Message { + return new(fastReflection_MsgRegisterERC20Response) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRegisterERC20Response) Interface() protoreflect.ProtoMessage { + return (*MsgRegisterERC20Response)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgRegisterERC20Response) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgRegisterERC20Response) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgRegisterERC20Response")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgRegisterERC20Response does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgRegisterERC20Response) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgRegisterERC20Response")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgRegisterERC20Response does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgRegisterERC20Response) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgRegisterERC20Response")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgRegisterERC20Response does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgRegisterERC20Response) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgRegisterERC20Response")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgRegisterERC20Response does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgRegisterERC20Response) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgRegisterERC20Response")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgRegisterERC20Response does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgRegisterERC20Response) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgRegisterERC20Response")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgRegisterERC20Response does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgRegisterERC20Response) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.MsgRegisterERC20Response", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgRegisterERC20Response) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgRegisterERC20Response) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgRegisterERC20Response) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgRegisterERC20Response) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRegisterERC20Response) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgRegisterERC20Response) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgRegisterERC20Response) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterERC20Response: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterERC20Response: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgToggleConversion protoreflect.MessageDescriptor + fd_MsgToggleConversion_authority protoreflect.FieldDescriptor + fd_MsgToggleConversion_token protoreflect.FieldDescriptor +) + +func init() { + file_os_erc20_v1_tx_proto_init() + md_MsgToggleConversion = File_os_erc20_v1_tx_proto.Messages().ByName("MsgToggleConversion") + fd_MsgToggleConversion_authority = md_MsgToggleConversion.Fields().ByName("authority") + fd_MsgToggleConversion_token = md_MsgToggleConversion.Fields().ByName("token") +} + +var _ protoreflect.Message = (*fastReflection_MsgToggleConversion)(nil) + +type fastReflection_MsgToggleConversion MsgToggleConversion + +func (x *MsgToggleConversion) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgToggleConversion)(x) +} + +func (x *MsgToggleConversion) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_tx_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgToggleConversion_messageType fastReflection_MsgToggleConversion_messageType +var _ protoreflect.MessageType = fastReflection_MsgToggleConversion_messageType{} + +type fastReflection_MsgToggleConversion_messageType struct{} + +func (x fastReflection_MsgToggleConversion_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgToggleConversion)(nil) +} +func (x fastReflection_MsgToggleConversion_messageType) New() protoreflect.Message { + return new(fastReflection_MsgToggleConversion) +} +func (x fastReflection_MsgToggleConversion_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgToggleConversion +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgToggleConversion) Descriptor() protoreflect.MessageDescriptor { + return md_MsgToggleConversion +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgToggleConversion) Type() protoreflect.MessageType { + return _fastReflection_MsgToggleConversion_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgToggleConversion) New() protoreflect.Message { + return new(fastReflection_MsgToggleConversion) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgToggleConversion) Interface() protoreflect.ProtoMessage { + return (*MsgToggleConversion)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgToggleConversion) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgToggleConversion_authority, value) { + return + } + } + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) + if !f(fd_MsgToggleConversion_token, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgToggleConversion) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.erc20.v1.MsgToggleConversion.authority": + return x.Authority != "" + case "os.erc20.v1.MsgToggleConversion.token": + return x.Token != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgToggleConversion")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgToggleConversion does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgToggleConversion) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.erc20.v1.MsgToggleConversion.authority": + x.Authority = "" + case "os.erc20.v1.MsgToggleConversion.token": + x.Token = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgToggleConversion")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgToggleConversion does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgToggleConversion) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.erc20.v1.MsgToggleConversion.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "os.erc20.v1.MsgToggleConversion.token": + value := x.Token + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgToggleConversion")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgToggleConversion does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgToggleConversion) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.erc20.v1.MsgToggleConversion.authority": + x.Authority = value.Interface().(string) + case "os.erc20.v1.MsgToggleConversion.token": + x.Token = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgToggleConversion")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgToggleConversion does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgToggleConversion) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.MsgToggleConversion.authority": + panic(fmt.Errorf("field authority of message os.erc20.v1.MsgToggleConversion is not mutable")) + case "os.erc20.v1.MsgToggleConversion.token": + panic(fmt.Errorf("field token of message os.erc20.v1.MsgToggleConversion is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgToggleConversion")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgToggleConversion does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgToggleConversion) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.erc20.v1.MsgToggleConversion.authority": + return protoreflect.ValueOfString("") + case "os.erc20.v1.MsgToggleConversion.token": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgToggleConversion")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgToggleConversion does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgToggleConversion) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.MsgToggleConversion", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgToggleConversion) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgToggleConversion) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgToggleConversion) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgToggleConversion) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgToggleConversion) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Token) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgToggleConversion) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgToggleConversion) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgToggleConversion: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgToggleConversion: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgToggleConversionResponse protoreflect.MessageDescriptor +) + +func init() { + file_os_erc20_v1_tx_proto_init() + md_MsgToggleConversionResponse = File_os_erc20_v1_tx_proto.Messages().ByName("MsgToggleConversionResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgToggleConversionResponse)(nil) + +type fastReflection_MsgToggleConversionResponse MsgToggleConversionResponse + +func (x *MsgToggleConversionResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgToggleConversionResponse)(x) +} + +func (x *MsgToggleConversionResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_erc20_v1_tx_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgToggleConversionResponse_messageType fastReflection_MsgToggleConversionResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgToggleConversionResponse_messageType{} + +type fastReflection_MsgToggleConversionResponse_messageType struct{} + +func (x fastReflection_MsgToggleConversionResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgToggleConversionResponse)(nil) +} +func (x fastReflection_MsgToggleConversionResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgToggleConversionResponse) +} +func (x fastReflection_MsgToggleConversionResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgToggleConversionResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgToggleConversionResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgToggleConversionResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgToggleConversionResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgToggleConversionResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgToggleConversionResponse) New() protoreflect.Message { + return new(fastReflection_MsgToggleConversionResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgToggleConversionResponse) Interface() protoreflect.ProtoMessage { + return (*MsgToggleConversionResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgToggleConversionResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgToggleConversionResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgToggleConversionResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgToggleConversionResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgToggleConversionResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgToggleConversionResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgToggleConversionResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgToggleConversionResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgToggleConversionResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgToggleConversionResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgToggleConversionResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgToggleConversionResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgToggleConversionResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgToggleConversionResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgToggleConversionResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgToggleConversionResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgToggleConversionResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.erc20.v1.MsgToggleConversionResponse")) + } + panic(fmt.Errorf("message os.erc20.v1.MsgToggleConversionResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgToggleConversionResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.erc20.v1.MsgToggleConversionResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgToggleConversionResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgToggleConversionResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgToggleConversionResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgToggleConversionResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgToggleConversionResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgToggleConversionResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgToggleConversionResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgToggleConversionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgToggleConversionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/erc20/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgConvertERC20 defines a Msg to convert a ERC20 token to a native Cosmos +// coin. +type MsgConvertERC20 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // contract_address of an ERC20 token contract, that is registered in a token + // pair + ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` + // amount of ERC20 tokens to convert + Amount string `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` + // receiver is the bech32 address to receive native Cosmos coins + Receiver string `protobuf:"bytes,3,opt,name=receiver,proto3" json:"receiver,omitempty"` + // sender is the hex address from the owner of the given ERC20 tokens + Sender string `protobuf:"bytes,4,opt,name=sender,proto3" json:"sender,omitempty"` +} + +func (x *MsgConvertERC20) Reset() { + *x = MsgConvertERC20{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgConvertERC20) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgConvertERC20) ProtoMessage() {} + +// Deprecated: Use MsgConvertERC20.ProtoReflect.Descriptor instead. +func (*MsgConvertERC20) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgConvertERC20) GetContractAddress() string { + if x != nil { + return x.ContractAddress + } + return "" +} + +func (x *MsgConvertERC20) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +func (x *MsgConvertERC20) GetReceiver() string { + if x != nil { + return x.Receiver + } + return "" +} + +func (x *MsgConvertERC20) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +// MsgConvertERC20Response returns no fields +type MsgConvertERC20Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgConvertERC20Response) Reset() { + *x = MsgConvertERC20Response{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgConvertERC20Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgConvertERC20Response) ProtoMessage() {} + +// Deprecated: Use MsgConvertERC20Response.ProtoReflect.Descriptor instead. +func (*MsgConvertERC20Response) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_tx_proto_rawDescGZIP(), []int{1} +} + +// MsgConvertCoin defines a Msg to convert a native Cosmos coin to a ERC20 token +type MsgConvertCoin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // coin is a Cosmos coin whose denomination is registered in a token pair. The + // coin amount defines the amount of coins to convert. + Coin *v1beta1.Coin `protobuf:"bytes,1,opt,name=coin,proto3" json:"coin,omitempty"` + // receiver is the hex address to receive ERC20 token + Receiver string `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"` + // sender is the cosmos bech32 address from the owner of the given Cosmos + // coins + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` +} + +func (x *MsgConvertCoin) Reset() { + *x = MsgConvertCoin{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgConvertCoin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgConvertCoin) ProtoMessage() {} + +// Deprecated: Use MsgConvertCoin.ProtoReflect.Descriptor instead. +func (*MsgConvertCoin) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgConvertCoin) GetCoin() *v1beta1.Coin { + if x != nil { + return x.Coin + } + return nil +} + +func (x *MsgConvertCoin) GetReceiver() string { + if x != nil { + return x.Receiver + } + return "" +} + +func (x *MsgConvertCoin) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +// MsgConvertCoinResponse returns no fields +type MsgConvertCoinResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgConvertCoinResponse) Reset() { + *x = MsgConvertCoinResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgConvertCoinResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgConvertCoinResponse) ProtoMessage() {} + +// Deprecated: Use MsgConvertCoinResponse.ProtoReflect.Descriptor instead. +func (*MsgConvertCoinResponse) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_tx_proto_rawDescGZIP(), []int{3} +} + +// MsgUpdateParams is the Msg/UpdateParams request type for Erc20 parameters. +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/evm parameters to update. + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// Since: cosmos-sdk 0.47 +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_tx_proto_rawDescGZIP(), []int{5} +} + +// MsgRegisterERC20 is the Msg/RegisterERC20 request type for registering +// an Erc20 contract token pair. +type MsgRegisterERC20 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // erc20addresses is a slice of ERC20 token contract hex addresses + Erc20Addresses []string `protobuf:"bytes,2,rep,name=erc20addresses,proto3" json:"erc20addresses,omitempty"` +} + +func (x *MsgRegisterERC20) Reset() { + *x = MsgRegisterERC20{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRegisterERC20) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRegisterERC20) ProtoMessage() {} + +// Deprecated: Use MsgRegisterERC20.ProtoReflect.Descriptor instead. +func (*MsgRegisterERC20) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgRegisterERC20) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgRegisterERC20) GetErc20Addresses() []string { + if x != nil { + return x.Erc20Addresses + } + return nil +} + +// MsgRegisterERC20Response defines the response structure for executing a +// MsgRegisterERC20 message. +type MsgRegisterERC20Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgRegisterERC20Response) Reset() { + *x = MsgRegisterERC20Response{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRegisterERC20Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRegisterERC20Response) ProtoMessage() {} + +// Deprecated: Use MsgRegisterERC20Response.ProtoReflect.Descriptor instead. +func (*MsgRegisterERC20Response) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_tx_proto_rawDescGZIP(), []int{7} +} + +// MsgToggleConversion is the Msg/MsgToggleConversion request type for toggling +// an Erc20 contract conversion capability. +type MsgToggleConversion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // token identifier can be either the hex contract address of the ERC20 or the + // Cosmos base denomination + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *MsgToggleConversion) Reset() { + *x = MsgToggleConversion{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgToggleConversion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgToggleConversion) ProtoMessage() {} + +// Deprecated: Use MsgToggleConversion.ProtoReflect.Descriptor instead. +func (*MsgToggleConversion) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgToggleConversion) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgToggleConversion) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// MsgToggleConversionResponse defines the response structure for executing a +// ToggleConversion message. +type MsgToggleConversionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgToggleConversionResponse) Reset() { + *x = MsgToggleConversionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_erc20_v1_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgToggleConversionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgToggleConversionResponse) ProtoMessage() {} + +// Deprecated: Use MsgToggleConversionResponse.ProtoReflect.Descriptor instead. +func (*MsgToggleConversionResponse) Descriptor() ([]byte, []int) { + return file_os_erc20_v1_tx_proto_rawDescGZIP(), []int{9} +} + +var File_os_erc20_v1_tx_proto protoreflect.FileDescriptor + +var file_os_erc20_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, + 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, + 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, + 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, + 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd0, 0x01, 0x0a, 0x0f, 0x4d, 0x73, + 0x67, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x45, 0x52, 0x43, 0x32, 0x30, 0x12, 0x29, 0x0a, + 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x22, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x12, 0x6f, 0x73, 0x2f, 0x4d, 0x73, 0x67, + 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x45, 0x52, 0x43, 0x32, 0x30, 0x22, 0x19, 0x0a, 0x17, + 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x45, 0x52, 0x43, 0x32, 0x30, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x79, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x43, 0x6f, + 0x6e, 0x76, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x33, 0x0a, 0x04, 0x63, 0x6f, 0x69, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x12, 0x1a, + 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x22, 0x18, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, + 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb0, 0x01, 0x0a, + 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x36, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, + 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, + 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x3a, 0x2d, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x8a, 0xe7, 0xb0, 0x2a, 0x1a, 0x6f, 0x73, 0x2f, 0x78, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, + 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa2, 0x01, 0x0a, 0x10, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x52, 0x43, 0x32, 0x30, 0x12, + 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x26, 0x0a, 0x0e, 0x65, 0x72, 0x63, 0x32, 0x30, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x3a, + 0x2e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, + 0xe7, 0xb0, 0x2a, 0x1b, 0x6f, 0x73, 0x2f, 0x78, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2f, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x52, 0x43, 0x32, 0x30, 0x22, + 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x52, + 0x43, 0x32, 0x30, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x96, 0x01, 0x0a, 0x13, + 0x4d, 0x73, 0x67, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x3a, 0x31, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1e, 0x6f, 0x73, 0x2f, 0x78, 0x2f, 0x65, 0x72, 0x63, 0x32, 0x30, + 0x2f, 0x4d, 0x73, 0x67, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x1d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x54, 0x6f, 0x67, 0x67, 0x6c, + 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x32, 0x92, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x79, 0x0a, 0x0c, 0x43, + 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x45, 0x52, 0x43, 0x32, 0x30, 0x12, 0x1c, 0x2e, 0x6f, 0x73, + 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6e, + 0x76, 0x65, 0x72, 0x74, 0x45, 0x52, 0x43, 0x32, 0x30, 0x1a, 0x24, 0x2e, 0x6f, 0x73, 0x2e, 0x65, + 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6e, 0x76, 0x65, + 0x72, 0x74, 0x45, 0x52, 0x43, 0x32, 0x30, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, + 0x32, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, + 0x5f, 0x65, 0x72, 0x63, 0x32, 0x30, 0x12, 0x52, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, + 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x24, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0d, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x52, 0x43, 0x32, 0x30, 0x12, 0x1d, 0x2e, 0x6f, 0x73, + 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x52, 0x43, 0x32, 0x30, 0x1a, 0x25, 0x2e, 0x6f, 0x73, 0x2e, + 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x45, 0x52, 0x43, 0x32, 0x30, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5e, 0x0a, 0x10, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x6f, 0x6e, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x28, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, + 0x32, 0x30, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, + 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x8e, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, + 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x65, 0x72, 0x63, + 0x32, 0x30, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x72, 0x63, 0x32, 0x30, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x4f, 0x45, 0x58, 0xaa, 0x02, 0x0b, 0x4f, 0x73, 0x2e, 0x45, 0x72, 0x63, 0x32, 0x30, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x0b, 0x4f, 0x73, 0x5c, 0x45, 0x72, 0x63, 0x32, 0x30, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x17, 0x4f, 0x73, 0x5c, 0x45, 0x72, 0x63, 0x32, 0x30, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x4f, 0x73, 0x3a, 0x3a, + 0x45, 0x72, 0x63, 0x32, 0x30, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_os_erc20_v1_tx_proto_rawDescOnce sync.Once + file_os_erc20_v1_tx_proto_rawDescData = file_os_erc20_v1_tx_proto_rawDesc +) + +func file_os_erc20_v1_tx_proto_rawDescGZIP() []byte { + file_os_erc20_v1_tx_proto_rawDescOnce.Do(func() { + file_os_erc20_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_erc20_v1_tx_proto_rawDescData) + }) + return file_os_erc20_v1_tx_proto_rawDescData +} + +var file_os_erc20_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_os_erc20_v1_tx_proto_goTypes = []interface{}{ + (*MsgConvertERC20)(nil), // 0: os.erc20.v1.MsgConvertERC20 + (*MsgConvertERC20Response)(nil), // 1: os.erc20.v1.MsgConvertERC20Response + (*MsgConvertCoin)(nil), // 2: os.erc20.v1.MsgConvertCoin + (*MsgConvertCoinResponse)(nil), // 3: os.erc20.v1.MsgConvertCoinResponse + (*MsgUpdateParams)(nil), // 4: os.erc20.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 5: os.erc20.v1.MsgUpdateParamsResponse + (*MsgRegisterERC20)(nil), // 6: os.erc20.v1.MsgRegisterERC20 + (*MsgRegisterERC20Response)(nil), // 7: os.erc20.v1.MsgRegisterERC20Response + (*MsgToggleConversion)(nil), // 8: os.erc20.v1.MsgToggleConversion + (*MsgToggleConversionResponse)(nil), // 9: os.erc20.v1.MsgToggleConversionResponse + (*v1beta1.Coin)(nil), // 10: cosmos.base.v1beta1.Coin + (*Params)(nil), // 11: os.erc20.v1.Params +} +var file_os_erc20_v1_tx_proto_depIdxs = []int32{ + 10, // 0: os.erc20.v1.MsgConvertCoin.coin:type_name -> cosmos.base.v1beta1.Coin + 11, // 1: os.erc20.v1.MsgUpdateParams.params:type_name -> os.erc20.v1.Params + 0, // 2: os.erc20.v1.Msg.ConvertERC20:input_type -> os.erc20.v1.MsgConvertERC20 + 4, // 3: os.erc20.v1.Msg.UpdateParams:input_type -> os.erc20.v1.MsgUpdateParams + 6, // 4: os.erc20.v1.Msg.RegisterERC20:input_type -> os.erc20.v1.MsgRegisterERC20 + 8, // 5: os.erc20.v1.Msg.ToggleConversion:input_type -> os.erc20.v1.MsgToggleConversion + 1, // 6: os.erc20.v1.Msg.ConvertERC20:output_type -> os.erc20.v1.MsgConvertERC20Response + 5, // 7: os.erc20.v1.Msg.UpdateParams:output_type -> os.erc20.v1.MsgUpdateParamsResponse + 7, // 8: os.erc20.v1.Msg.RegisterERC20:output_type -> os.erc20.v1.MsgRegisterERC20Response + 9, // 9: os.erc20.v1.Msg.ToggleConversion:output_type -> os.erc20.v1.MsgToggleConversionResponse + 6, // [6:10] is the sub-list for method output_type + 2, // [2:6] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_os_erc20_v1_tx_proto_init() } +func file_os_erc20_v1_tx_proto_init() { + if File_os_erc20_v1_tx_proto != nil { + return + } + file_os_erc20_v1_genesis_proto_init() + if !protoimpl.UnsafeEnabled { + file_os_erc20_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgConvertERC20); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgConvertERC20Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgConvertCoin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgConvertCoinResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgRegisterERC20); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgRegisterERC20Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgToggleConversion); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_erc20_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgToggleConversionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_erc20_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_os_erc20_v1_tx_proto_goTypes, + DependencyIndexes: file_os_erc20_v1_tx_proto_depIdxs, + MessageInfos: file_os_erc20_v1_tx_proto_msgTypes, + }.Build() + File_os_erc20_v1_tx_proto = out.File + file_os_erc20_v1_tx_proto_rawDesc = nil + file_os_erc20_v1_tx_proto_goTypes = nil + file_os_erc20_v1_tx_proto_depIdxs = nil +} diff --git a/api/os/erc20/v1/tx_grpc.pb.go b/api/os/erc20/v1/tx_grpc.pb.go new file mode 100644 index 00000000..5f9aa683 --- /dev/null +++ b/api/os/erc20/v1/tx_grpc.pb.go @@ -0,0 +1,245 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: os/erc20/v1/tx.proto + +package erc20v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_ConvertERC20_FullMethodName = "/os.erc20.v1.Msg/ConvertERC20" + Msg_UpdateParams_FullMethodName = "/os.erc20.v1.Msg/UpdateParams" + Msg_RegisterERC20_FullMethodName = "/os.erc20.v1.Msg/RegisterERC20" + Msg_ToggleConversion_FullMethodName = "/os.erc20.v1.Msg/ToggleConversion" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // ConvertERC20 mints a native Cosmos coin representation of the ERC20 token + // contract that is registered on the token mapping. + ConvertERC20(ctx context.Context, in *MsgConvertERC20, opts ...grpc.CallOption) (*MsgConvertERC20Response, error) + // UpdateParams defines a governance operation for updating the x/erc20 module + // parameters. The authority is hard-coded to the Cosmos SDK x/gov module + // account + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // RegisterERC20 defines a governance operation for registering a token pair + // for the specified erc20 contract. The authority is hard-coded to the Cosmos + // SDK x/gov module account + RegisterERC20(ctx context.Context, in *MsgRegisterERC20, opts ...grpc.CallOption) (*MsgRegisterERC20Response, error) + // ToggleConversion defines a governance operation for enabling/disablen a + // token pair conversion. The authority is hard-coded to the Cosmos SDK x/gov + // module account + ToggleConversion(ctx context.Context, in *MsgToggleConversion, opts ...grpc.CallOption) (*MsgToggleConversionResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) ConvertERC20(ctx context.Context, in *MsgConvertERC20, opts ...grpc.CallOption) (*MsgConvertERC20Response, error) { + out := new(MsgConvertERC20Response) + err := c.cc.Invoke(ctx, Msg_ConvertERC20_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RegisterERC20(ctx context.Context, in *MsgRegisterERC20, opts ...grpc.CallOption) (*MsgRegisterERC20Response, error) { + out := new(MsgRegisterERC20Response) + err := c.cc.Invoke(ctx, Msg_RegisterERC20_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ToggleConversion(ctx context.Context, in *MsgToggleConversion, opts ...grpc.CallOption) (*MsgToggleConversionResponse, error) { + out := new(MsgToggleConversionResponse) + err := c.cc.Invoke(ctx, Msg_ToggleConversion_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // ConvertERC20 mints a native Cosmos coin representation of the ERC20 token + // contract that is registered on the token mapping. + ConvertERC20(context.Context, *MsgConvertERC20) (*MsgConvertERC20Response, error) + // UpdateParams defines a governance operation for updating the x/erc20 module + // parameters. The authority is hard-coded to the Cosmos SDK x/gov module + // account + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // RegisterERC20 defines a governance operation for registering a token pair + // for the specified erc20 contract. The authority is hard-coded to the Cosmos + // SDK x/gov module account + RegisterERC20(context.Context, *MsgRegisterERC20) (*MsgRegisterERC20Response, error) + // ToggleConversion defines a governance operation for enabling/disablen a + // token pair conversion. The authority is hard-coded to the Cosmos SDK x/gov + // module account + ToggleConversion(context.Context, *MsgToggleConversion) (*MsgToggleConversionResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) ConvertERC20(context.Context, *MsgConvertERC20) (*MsgConvertERC20Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConvertERC20 not implemented") +} +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) RegisterERC20(context.Context, *MsgRegisterERC20) (*MsgRegisterERC20Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterERC20 not implemented") +} +func (UnimplementedMsgServer) ToggleConversion(context.Context, *MsgToggleConversion) (*MsgToggleConversionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ToggleConversion not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_ConvertERC20_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConvertERC20) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConvertERC20(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_ConvertERC20_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConvertERC20(ctx, req.(*MsgConvertERC20)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RegisterERC20_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRegisterERC20) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RegisterERC20(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_RegisterERC20_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RegisterERC20(ctx, req.(*MsgRegisterERC20)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ToggleConversion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgToggleConversion) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ToggleConversion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_ToggleConversion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ToggleConversion(ctx, req.(*MsgToggleConversion)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "os.erc20.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ConvertERC20", + Handler: _Msg_ConvertERC20_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "RegisterERC20", + Handler: _Msg_RegisterERC20_Handler, + }, + { + MethodName: "ToggleConversion", + Handler: _Msg_ToggleConversion_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "os/erc20/v1/tx.proto", +} diff --git a/api/os/evm/v1/access_list_tx.go b/api/os/evm/v1/access_list_tx.go new file mode 100644 index 00000000..8672166b --- /dev/null +++ b/api/os/evm/v1/access_list_tx.go @@ -0,0 +1,65 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package evmv1 + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + ethutils "github.com/evmos/os/utils/eth" +) + +// GetChainID returns the chain id field from the AccessListTx +func (tx *AccessListTx) GetChainID() *big.Int { + return stringToBigInt(tx.GetChainId()) +} + +// GetAccessList returns the AccessList field. +func (tx *AccessListTx) GetAccessList() ethtypes.AccessList { + if tx.Accesses == nil { + return nil + } + var ethAccessList ethtypes.AccessList + + for _, tuple := range tx.Accesses { + storageKeys := make([]common.Hash, len(tuple.StorageKeys)) + + for i := range tuple.StorageKeys { + storageKeys[i] = common.HexToHash(tuple.StorageKeys[i]) + } + + ethAccessList = append(ethAccessList, ethtypes.AccessTuple{ + Address: common.HexToAddress(tuple.Address), + StorageKeys: storageKeys, + }) + } + + return ethAccessList +} + +// AsEthereumData returns an AccessListTx transaction tx from the proto-formatted +// TxData defined on the Cosmos EVM. +func (tx *AccessListTx) AsEthereumData() ethtypes.TxData { + v, r, s := tx.GetRawSignatureValues() + return ðtypes.AccessListTx{ + ChainID: tx.GetChainID(), + Nonce: tx.GetNonce(), + GasPrice: stringToBigInt(tx.GetGasPrice()), + Gas: tx.GetGas(), + To: stringToAddress(tx.GetTo()), + Value: stringToBigInt(tx.GetValue()), + Data: tx.GetData(), + AccessList: tx.GetAccessList(), + V: v, + R: r, + S: s, + } +} + +// GetRawSignatureValues returns the V, R, S signature values of the transaction. +// The return values should not be modified by the caller. +func (tx *AccessListTx) GetRawSignatureValues() (v, r, s *big.Int) { + return ethutils.RawSignatureValues(tx.V, tx.R, tx.S) +} diff --git a/api/os/evm/v1/dynamic_fee_tx.go b/api/os/evm/v1/dynamic_fee_tx.go new file mode 100644 index 00000000..d0f49c28 --- /dev/null +++ b/api/os/evm/v1/dynamic_fee_tx.go @@ -0,0 +1,66 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package evmv1 + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + ethutils "github.com/evmos/os/utils/eth" +) + +// GetChainID returns the chain id field from the DynamicFeeTx +func (tx *DynamicFeeTx) GetChainID() *big.Int { + return stringToBigInt(tx.GetChainId()) +} + +// AsEthereumData returns an DynamicFeeTx transaction tx from the proto-formatted +// TxData defined on the Cosmos EVM. +func (tx *DynamicFeeTx) AsEthereumData() ethtypes.TxData { + v, r, s := tx.GetRawSignatureValues() + return ðtypes.DynamicFeeTx{ + ChainID: tx.GetChainID(), + Nonce: tx.GetNonce(), + GasTipCap: stringToBigInt(tx.GetGasTipCap()), + GasFeeCap: stringToBigInt(tx.GetGasFeeCap()), + Gas: tx.GetGas(), + To: stringToAddress(tx.GetTo()), + Value: stringToBigInt(tx.GetValue()), + Data: tx.GetData(), + AccessList: tx.GetAccessList(), + V: v, + R: r, + S: s, + } +} + +// GetAccessList returns the AccessList field. +func (tx *DynamicFeeTx) GetAccessList() ethtypes.AccessList { + if tx.Accesses == nil { + return nil + } + var ethAccessList ethtypes.AccessList + + for _, tuple := range tx.Accesses { + storageKeys := make([]common.Hash, len(tuple.StorageKeys)) + + for i := range tuple.StorageKeys { + storageKeys[i] = common.HexToHash(tuple.StorageKeys[i]) + } + + ethAccessList = append(ethAccessList, ethtypes.AccessTuple{ + Address: common.HexToAddress(tuple.Address), + StorageKeys: storageKeys, + }) + } + + return ethAccessList +} + +// GetRawSignatureValues returns the V, R, S signature values of the transaction. +// The return values should not be modified by the caller. +func (tx *DynamicFeeTx) GetRawSignatureValues() (v, r, s *big.Int) { + return ethutils.RawSignatureValues(tx.V, tx.R, tx.S) +} diff --git a/api/os/evm/v1/events.pulsar.go b/api/os/evm/v1/events.pulsar.go new file mode 100644 index 00000000..c18a29d9 --- /dev/null +++ b/api/os/evm/v1/events.pulsar.go @@ -0,0 +1,2643 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package evmv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_EventEthereumTx protoreflect.MessageDescriptor + fd_EventEthereumTx_amount protoreflect.FieldDescriptor + fd_EventEthereumTx_eth_hash protoreflect.FieldDescriptor + fd_EventEthereumTx_index protoreflect.FieldDescriptor + fd_EventEthereumTx_gas_used protoreflect.FieldDescriptor + fd_EventEthereumTx_hash protoreflect.FieldDescriptor + fd_EventEthereumTx_recipient protoreflect.FieldDescriptor + fd_EventEthereumTx_eth_tx_failed protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_events_proto_init() + md_EventEthereumTx = File_os_evm_v1_events_proto.Messages().ByName("EventEthereumTx") + fd_EventEthereumTx_amount = md_EventEthereumTx.Fields().ByName("amount") + fd_EventEthereumTx_eth_hash = md_EventEthereumTx.Fields().ByName("eth_hash") + fd_EventEthereumTx_index = md_EventEthereumTx.Fields().ByName("index") + fd_EventEthereumTx_gas_used = md_EventEthereumTx.Fields().ByName("gas_used") + fd_EventEthereumTx_hash = md_EventEthereumTx.Fields().ByName("hash") + fd_EventEthereumTx_recipient = md_EventEthereumTx.Fields().ByName("recipient") + fd_EventEthereumTx_eth_tx_failed = md_EventEthereumTx.Fields().ByName("eth_tx_failed") +} + +var _ protoreflect.Message = (*fastReflection_EventEthereumTx)(nil) + +type fastReflection_EventEthereumTx EventEthereumTx + +func (x *EventEthereumTx) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventEthereumTx)(x) +} + +func (x *EventEthereumTx) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_events_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventEthereumTx_messageType fastReflection_EventEthereumTx_messageType +var _ protoreflect.MessageType = fastReflection_EventEthereumTx_messageType{} + +type fastReflection_EventEthereumTx_messageType struct{} + +func (x fastReflection_EventEthereumTx_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventEthereumTx)(nil) +} +func (x fastReflection_EventEthereumTx_messageType) New() protoreflect.Message { + return new(fastReflection_EventEthereumTx) +} +func (x fastReflection_EventEthereumTx_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventEthereumTx +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventEthereumTx) Descriptor() protoreflect.MessageDescriptor { + return md_EventEthereumTx +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventEthereumTx) Type() protoreflect.MessageType { + return _fastReflection_EventEthereumTx_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventEthereumTx) New() protoreflect.Message { + return new(fastReflection_EventEthereumTx) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventEthereumTx) Interface() protoreflect.ProtoMessage { + return (*EventEthereumTx)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventEthereumTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Amount != "" { + value := protoreflect.ValueOfString(x.Amount) + if !f(fd_EventEthereumTx_amount, value) { + return + } + } + if x.EthHash != "" { + value := protoreflect.ValueOfString(x.EthHash) + if !f(fd_EventEthereumTx_eth_hash, value) { + return + } + } + if x.Index != "" { + value := protoreflect.ValueOfString(x.Index) + if !f(fd_EventEthereumTx_index, value) { + return + } + } + if x.GasUsed != "" { + value := protoreflect.ValueOfString(x.GasUsed) + if !f(fd_EventEthereumTx_gas_used, value) { + return + } + } + if x.Hash != "" { + value := protoreflect.ValueOfString(x.Hash) + if !f(fd_EventEthereumTx_hash, value) { + return + } + } + if x.Recipient != "" { + value := protoreflect.ValueOfString(x.Recipient) + if !f(fd_EventEthereumTx_recipient, value) { + return + } + } + if x.EthTxFailed != "" { + value := protoreflect.ValueOfString(x.EthTxFailed) + if !f(fd_EventEthereumTx_eth_tx_failed, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventEthereumTx) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.EventEthereumTx.amount": + return x.Amount != "" + case "os.evm.v1.EventEthereumTx.eth_hash": + return x.EthHash != "" + case "os.evm.v1.EventEthereumTx.index": + return x.Index != "" + case "os.evm.v1.EventEthereumTx.gas_used": + return x.GasUsed != "" + case "os.evm.v1.EventEthereumTx.hash": + return x.Hash != "" + case "os.evm.v1.EventEthereumTx.recipient": + return x.Recipient != "" + case "os.evm.v1.EventEthereumTx.eth_tx_failed": + return x.EthTxFailed != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.EventEthereumTx does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventEthereumTx) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.EventEthereumTx.amount": + x.Amount = "" + case "os.evm.v1.EventEthereumTx.eth_hash": + x.EthHash = "" + case "os.evm.v1.EventEthereumTx.index": + x.Index = "" + case "os.evm.v1.EventEthereumTx.gas_used": + x.GasUsed = "" + case "os.evm.v1.EventEthereumTx.hash": + x.Hash = "" + case "os.evm.v1.EventEthereumTx.recipient": + x.Recipient = "" + case "os.evm.v1.EventEthereumTx.eth_tx_failed": + x.EthTxFailed = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.EventEthereumTx does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventEthereumTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.EventEthereumTx.amount": + value := x.Amount + return protoreflect.ValueOfString(value) + case "os.evm.v1.EventEthereumTx.eth_hash": + value := x.EthHash + return protoreflect.ValueOfString(value) + case "os.evm.v1.EventEthereumTx.index": + value := x.Index + return protoreflect.ValueOfString(value) + case "os.evm.v1.EventEthereumTx.gas_used": + value := x.GasUsed + return protoreflect.ValueOfString(value) + case "os.evm.v1.EventEthereumTx.hash": + value := x.Hash + return protoreflect.ValueOfString(value) + case "os.evm.v1.EventEthereumTx.recipient": + value := x.Recipient + return protoreflect.ValueOfString(value) + case "os.evm.v1.EventEthereumTx.eth_tx_failed": + value := x.EthTxFailed + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.EventEthereumTx does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventEthereumTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.EventEthereumTx.amount": + x.Amount = value.Interface().(string) + case "os.evm.v1.EventEthereumTx.eth_hash": + x.EthHash = value.Interface().(string) + case "os.evm.v1.EventEthereumTx.index": + x.Index = value.Interface().(string) + case "os.evm.v1.EventEthereumTx.gas_used": + x.GasUsed = value.Interface().(string) + case "os.evm.v1.EventEthereumTx.hash": + x.Hash = value.Interface().(string) + case "os.evm.v1.EventEthereumTx.recipient": + x.Recipient = value.Interface().(string) + case "os.evm.v1.EventEthereumTx.eth_tx_failed": + x.EthTxFailed = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.EventEthereumTx does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventEthereumTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.EventEthereumTx.amount": + panic(fmt.Errorf("field amount of message os.evm.v1.EventEthereumTx is not mutable")) + case "os.evm.v1.EventEthereumTx.eth_hash": + panic(fmt.Errorf("field eth_hash of message os.evm.v1.EventEthereumTx is not mutable")) + case "os.evm.v1.EventEthereumTx.index": + panic(fmt.Errorf("field index of message os.evm.v1.EventEthereumTx is not mutable")) + case "os.evm.v1.EventEthereumTx.gas_used": + panic(fmt.Errorf("field gas_used of message os.evm.v1.EventEthereumTx is not mutable")) + case "os.evm.v1.EventEthereumTx.hash": + panic(fmt.Errorf("field hash of message os.evm.v1.EventEthereumTx is not mutable")) + case "os.evm.v1.EventEthereumTx.recipient": + panic(fmt.Errorf("field recipient of message os.evm.v1.EventEthereumTx is not mutable")) + case "os.evm.v1.EventEthereumTx.eth_tx_failed": + panic(fmt.Errorf("field eth_tx_failed of message os.evm.v1.EventEthereumTx is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.EventEthereumTx does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventEthereumTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.EventEthereumTx.amount": + return protoreflect.ValueOfString("") + case "os.evm.v1.EventEthereumTx.eth_hash": + return protoreflect.ValueOfString("") + case "os.evm.v1.EventEthereumTx.index": + return protoreflect.ValueOfString("") + case "os.evm.v1.EventEthereumTx.gas_used": + return protoreflect.ValueOfString("") + case "os.evm.v1.EventEthereumTx.hash": + return protoreflect.ValueOfString("") + case "os.evm.v1.EventEthereumTx.recipient": + return protoreflect.ValueOfString("") + case "os.evm.v1.EventEthereumTx.eth_tx_failed": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.EventEthereumTx does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventEthereumTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.EventEthereumTx", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventEthereumTx) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventEthereumTx) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventEthereumTx) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventEthereumTx) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventEthereumTx) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Amount) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.EthHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Index) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.GasUsed) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Hash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Recipient) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.EthTxFailed) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventEthereumTx) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.EthTxFailed) > 0 { + i -= len(x.EthTxFailed) + copy(dAtA[i:], x.EthTxFailed) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EthTxFailed))) + i-- + dAtA[i] = 0x3a + } + if len(x.Recipient) > 0 { + i -= len(x.Recipient) + copy(dAtA[i:], x.Recipient) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Recipient))) + i-- + dAtA[i] = 0x32 + } + if len(x.Hash) > 0 { + i -= len(x.Hash) + copy(dAtA[i:], x.Hash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Hash))) + i-- + dAtA[i] = 0x2a + } + if len(x.GasUsed) > 0 { + i -= len(x.GasUsed) + copy(dAtA[i:], x.GasUsed) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GasUsed))) + i-- + dAtA[i] = 0x22 + } + if len(x.Index) > 0 { + i -= len(x.Index) + copy(dAtA[i:], x.Index) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Index))) + i-- + dAtA[i] = 0x1a + } + if len(x.EthHash) > 0 { + i -= len(x.EthHash) + copy(dAtA[i:], x.EthHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EthHash))) + i-- + dAtA[i] = 0x12 + } + if len(x.Amount) > 0 { + i -= len(x.Amount) + copy(dAtA[i:], x.Amount) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Amount))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventEthereumTx) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventEthereumTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventEthereumTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EthHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.EthHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GasUsed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EthTxFailed", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.EthTxFailed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_EventTxLog_1_list)(nil) + +type _EventTxLog_1_list struct { + list *[]string +} + +func (x *_EventTxLog_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_EventTxLog_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_EventTxLog_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_EventTxLog_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_EventTxLog_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message EventTxLog at list field TxLogs as it is not of Message kind")) +} + +func (x *_EventTxLog_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_EventTxLog_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_EventTxLog_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_EventTxLog protoreflect.MessageDescriptor + fd_EventTxLog_tx_logs protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_events_proto_init() + md_EventTxLog = File_os_evm_v1_events_proto.Messages().ByName("EventTxLog") + fd_EventTxLog_tx_logs = md_EventTxLog.Fields().ByName("tx_logs") +} + +var _ protoreflect.Message = (*fastReflection_EventTxLog)(nil) + +type fastReflection_EventTxLog EventTxLog + +func (x *EventTxLog) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventTxLog)(x) +} + +func (x *EventTxLog) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_events_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventTxLog_messageType fastReflection_EventTxLog_messageType +var _ protoreflect.MessageType = fastReflection_EventTxLog_messageType{} + +type fastReflection_EventTxLog_messageType struct{} + +func (x fastReflection_EventTxLog_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventTxLog)(nil) +} +func (x fastReflection_EventTxLog_messageType) New() protoreflect.Message { + return new(fastReflection_EventTxLog) +} +func (x fastReflection_EventTxLog_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventTxLog +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventTxLog) Descriptor() protoreflect.MessageDescriptor { + return md_EventTxLog +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventTxLog) Type() protoreflect.MessageType { + return _fastReflection_EventTxLog_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventTxLog) New() protoreflect.Message { + return new(fastReflection_EventTxLog) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventTxLog) Interface() protoreflect.ProtoMessage { + return (*EventTxLog)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventTxLog) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.TxLogs) != 0 { + value := protoreflect.ValueOfList(&_EventTxLog_1_list{list: &x.TxLogs}) + if !f(fd_EventTxLog_tx_logs, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventTxLog) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.EventTxLog.tx_logs": + return len(x.TxLogs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventTxLog")) + } + panic(fmt.Errorf("message os.evm.v1.EventTxLog does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventTxLog) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.EventTxLog.tx_logs": + x.TxLogs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventTxLog")) + } + panic(fmt.Errorf("message os.evm.v1.EventTxLog does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventTxLog) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.EventTxLog.tx_logs": + if len(x.TxLogs) == 0 { + return protoreflect.ValueOfList(&_EventTxLog_1_list{}) + } + listValue := &_EventTxLog_1_list{list: &x.TxLogs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventTxLog")) + } + panic(fmt.Errorf("message os.evm.v1.EventTxLog does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventTxLog) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.EventTxLog.tx_logs": + lv := value.List() + clv := lv.(*_EventTxLog_1_list) + x.TxLogs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventTxLog")) + } + panic(fmt.Errorf("message os.evm.v1.EventTxLog does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventTxLog) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.EventTxLog.tx_logs": + if x.TxLogs == nil { + x.TxLogs = []string{} + } + value := &_EventTxLog_1_list{list: &x.TxLogs} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventTxLog")) + } + panic(fmt.Errorf("message os.evm.v1.EventTxLog does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventTxLog) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.EventTxLog.tx_logs": + list := []string{} + return protoreflect.ValueOfList(&_EventTxLog_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventTxLog")) + } + panic(fmt.Errorf("message os.evm.v1.EventTxLog does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventTxLog) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.EventTxLog", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventTxLog) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventTxLog) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventTxLog) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventTxLog) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventTxLog) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.TxLogs) > 0 { + for _, s := range x.TxLogs { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventTxLog) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.TxLogs) > 0 { + for iNdEx := len(x.TxLogs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.TxLogs[iNdEx]) + copy(dAtA[i:], x.TxLogs[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TxLogs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventTxLog) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventTxLog: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventTxLog: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TxLogs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.TxLogs = append(x.TxLogs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventMessage protoreflect.MessageDescriptor + fd_EventMessage_module protoreflect.FieldDescriptor + fd_EventMessage_sender protoreflect.FieldDescriptor + fd_EventMessage_tx_type protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_events_proto_init() + md_EventMessage = File_os_evm_v1_events_proto.Messages().ByName("EventMessage") + fd_EventMessage_module = md_EventMessage.Fields().ByName("module") + fd_EventMessage_sender = md_EventMessage.Fields().ByName("sender") + fd_EventMessage_tx_type = md_EventMessage.Fields().ByName("tx_type") +} + +var _ protoreflect.Message = (*fastReflection_EventMessage)(nil) + +type fastReflection_EventMessage EventMessage + +func (x *EventMessage) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventMessage)(x) +} + +func (x *EventMessage) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_events_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventMessage_messageType fastReflection_EventMessage_messageType +var _ protoreflect.MessageType = fastReflection_EventMessage_messageType{} + +type fastReflection_EventMessage_messageType struct{} + +func (x fastReflection_EventMessage_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventMessage)(nil) +} +func (x fastReflection_EventMessage_messageType) New() protoreflect.Message { + return new(fastReflection_EventMessage) +} +func (x fastReflection_EventMessage_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventMessage +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventMessage) Descriptor() protoreflect.MessageDescriptor { + return md_EventMessage +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventMessage) Type() protoreflect.MessageType { + return _fastReflection_EventMessage_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventMessage) New() protoreflect.Message { + return new(fastReflection_EventMessage) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventMessage) Interface() protoreflect.ProtoMessage { + return (*EventMessage)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventMessage) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Module != "" { + value := protoreflect.ValueOfString(x.Module) + if !f(fd_EventMessage_module, value) { + return + } + } + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_EventMessage_sender, value) { + return + } + } + if x.TxType != "" { + value := protoreflect.ValueOfString(x.TxType) + if !f(fd_EventMessage_tx_type, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventMessage) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.EventMessage.module": + return x.Module != "" + case "os.evm.v1.EventMessage.sender": + return x.Sender != "" + case "os.evm.v1.EventMessage.tx_type": + return x.TxType != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventMessage")) + } + panic(fmt.Errorf("message os.evm.v1.EventMessage does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventMessage) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.EventMessage.module": + x.Module = "" + case "os.evm.v1.EventMessage.sender": + x.Sender = "" + case "os.evm.v1.EventMessage.tx_type": + x.TxType = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventMessage")) + } + panic(fmt.Errorf("message os.evm.v1.EventMessage does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventMessage) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.EventMessage.module": + value := x.Module + return protoreflect.ValueOfString(value) + case "os.evm.v1.EventMessage.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + case "os.evm.v1.EventMessage.tx_type": + value := x.TxType + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventMessage")) + } + panic(fmt.Errorf("message os.evm.v1.EventMessage does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventMessage) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.EventMessage.module": + x.Module = value.Interface().(string) + case "os.evm.v1.EventMessage.sender": + x.Sender = value.Interface().(string) + case "os.evm.v1.EventMessage.tx_type": + x.TxType = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventMessage")) + } + panic(fmt.Errorf("message os.evm.v1.EventMessage does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventMessage) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.EventMessage.module": + panic(fmt.Errorf("field module of message os.evm.v1.EventMessage is not mutable")) + case "os.evm.v1.EventMessage.sender": + panic(fmt.Errorf("field sender of message os.evm.v1.EventMessage is not mutable")) + case "os.evm.v1.EventMessage.tx_type": + panic(fmt.Errorf("field tx_type of message os.evm.v1.EventMessage is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventMessage")) + } + panic(fmt.Errorf("message os.evm.v1.EventMessage does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventMessage) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.EventMessage.module": + return protoreflect.ValueOfString("") + case "os.evm.v1.EventMessage.sender": + return protoreflect.ValueOfString("") + case "os.evm.v1.EventMessage.tx_type": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventMessage")) + } + panic(fmt.Errorf("message os.evm.v1.EventMessage does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventMessage) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.EventMessage", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventMessage) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventMessage) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventMessage) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventMessage) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventMessage) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Module) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Sender) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.TxType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventMessage) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.TxType) > 0 { + i -= len(x.TxType) + copy(dAtA[i:], x.TxType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TxType))) + i-- + dAtA[i] = 0x1a + } + if len(x.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + i-- + dAtA[i] = 0x12 + } + if len(x.Module) > 0 { + i -= len(x.Module) + copy(dAtA[i:], x.Module) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Module))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventMessage) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Module = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TxType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.TxType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventBlockBloom protoreflect.MessageDescriptor + fd_EventBlockBloom_bloom protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_events_proto_init() + md_EventBlockBloom = File_os_evm_v1_events_proto.Messages().ByName("EventBlockBloom") + fd_EventBlockBloom_bloom = md_EventBlockBloom.Fields().ByName("bloom") +} + +var _ protoreflect.Message = (*fastReflection_EventBlockBloom)(nil) + +type fastReflection_EventBlockBloom EventBlockBloom + +func (x *EventBlockBloom) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventBlockBloom)(x) +} + +func (x *EventBlockBloom) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_events_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventBlockBloom_messageType fastReflection_EventBlockBloom_messageType +var _ protoreflect.MessageType = fastReflection_EventBlockBloom_messageType{} + +type fastReflection_EventBlockBloom_messageType struct{} + +func (x fastReflection_EventBlockBloom_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventBlockBloom)(nil) +} +func (x fastReflection_EventBlockBloom_messageType) New() protoreflect.Message { + return new(fastReflection_EventBlockBloom) +} +func (x fastReflection_EventBlockBloom_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventBlockBloom +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventBlockBloom) Descriptor() protoreflect.MessageDescriptor { + return md_EventBlockBloom +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventBlockBloom) Type() protoreflect.MessageType { + return _fastReflection_EventBlockBloom_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventBlockBloom) New() protoreflect.Message { + return new(fastReflection_EventBlockBloom) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventBlockBloom) Interface() protoreflect.ProtoMessage { + return (*EventBlockBloom)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventBlockBloom) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Bloom != "" { + value := protoreflect.ValueOfString(x.Bloom) + if !f(fd_EventBlockBloom_bloom, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventBlockBloom) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.EventBlockBloom.bloom": + return x.Bloom != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventBlockBloom")) + } + panic(fmt.Errorf("message os.evm.v1.EventBlockBloom does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventBlockBloom) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.EventBlockBloom.bloom": + x.Bloom = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventBlockBloom")) + } + panic(fmt.Errorf("message os.evm.v1.EventBlockBloom does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventBlockBloom) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.EventBlockBloom.bloom": + value := x.Bloom + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventBlockBloom")) + } + panic(fmt.Errorf("message os.evm.v1.EventBlockBloom does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventBlockBloom) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.EventBlockBloom.bloom": + x.Bloom = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventBlockBloom")) + } + panic(fmt.Errorf("message os.evm.v1.EventBlockBloom does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventBlockBloom) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.EventBlockBloom.bloom": + panic(fmt.Errorf("field bloom of message os.evm.v1.EventBlockBloom is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventBlockBloom")) + } + panic(fmt.Errorf("message os.evm.v1.EventBlockBloom does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventBlockBloom) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.EventBlockBloom.bloom": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EventBlockBloom")) + } + panic(fmt.Errorf("message os.evm.v1.EventBlockBloom does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventBlockBloom) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.EventBlockBloom", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventBlockBloom) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventBlockBloom) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventBlockBloom) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventBlockBloom) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventBlockBloom) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Bloom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventBlockBloom) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Bloom) > 0 { + i -= len(x.Bloom) + copy(dAtA[i:], x.Bloom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bloom))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventBlockBloom) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventBlockBloom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventBlockBloom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Bloom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Bloom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/evm/v1/events.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EventEthereumTx defines the event for an Ethereum transaction +type EventEthereumTx struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // amount + Amount string `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + // eth_hash is the Ethereum hash of the transaction + EthHash string `protobuf:"bytes,2,opt,name=eth_hash,json=ethHash,proto3" json:"eth_hash,omitempty"` + // index of the transaction in the block + Index string `protobuf:"bytes,3,opt,name=index,proto3" json:"index,omitempty"` + // gas_used is the amount of gas used by the transaction + GasUsed string `protobuf:"bytes,4,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + // hash is the Tendermint hash of the transaction + Hash string `protobuf:"bytes,5,opt,name=hash,proto3" json:"hash,omitempty"` + // recipient of the transaction + Recipient string `protobuf:"bytes,6,opt,name=recipient,proto3" json:"recipient,omitempty"` + // eth_tx_failed contains a VM error should it occur + EthTxFailed string `protobuf:"bytes,7,opt,name=eth_tx_failed,json=ethTxFailed,proto3" json:"eth_tx_failed,omitempty"` +} + +func (x *EventEthereumTx) Reset() { + *x = EventEthereumTx{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventEthereumTx) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventEthereumTx) ProtoMessage() {} + +// Deprecated: Use EventEthereumTx.ProtoReflect.Descriptor instead. +func (*EventEthereumTx) Descriptor() ([]byte, []int) { + return file_os_evm_v1_events_proto_rawDescGZIP(), []int{0} +} + +func (x *EventEthereumTx) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +func (x *EventEthereumTx) GetEthHash() string { + if x != nil { + return x.EthHash + } + return "" +} + +func (x *EventEthereumTx) GetIndex() string { + if x != nil { + return x.Index + } + return "" +} + +func (x *EventEthereumTx) GetGasUsed() string { + if x != nil { + return x.GasUsed + } + return "" +} + +func (x *EventEthereumTx) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + +func (x *EventEthereumTx) GetRecipient() string { + if x != nil { + return x.Recipient + } + return "" +} + +func (x *EventEthereumTx) GetEthTxFailed() string { + if x != nil { + return x.EthTxFailed + } + return "" +} + +// EventTxLog defines the event for an Ethereum transaction log +type EventTxLog struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // tx_logs is an array of transaction logs + TxLogs []string `protobuf:"bytes,1,rep,name=tx_logs,json=txLogs,proto3" json:"tx_logs,omitempty"` +} + +func (x *EventTxLog) Reset() { + *x = EventTxLog{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_events_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventTxLog) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventTxLog) ProtoMessage() {} + +// Deprecated: Use EventTxLog.ProtoReflect.Descriptor instead. +func (*EventTxLog) Descriptor() ([]byte, []int) { + return file_os_evm_v1_events_proto_rawDescGZIP(), []int{1} +} + +func (x *EventTxLog) GetTxLogs() []string { + if x != nil { + return x.TxLogs + } + return nil +} + +// EventMessage +type EventMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // module which emits the event + Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` + // sender of the message + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` + // tx_type is the type of the message + TxType string `protobuf:"bytes,3,opt,name=tx_type,json=txType,proto3" json:"tx_type,omitempty"` +} + +func (x *EventMessage) Reset() { + *x = EventMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_events_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventMessage) ProtoMessage() {} + +// Deprecated: Use EventMessage.ProtoReflect.Descriptor instead. +func (*EventMessage) Descriptor() ([]byte, []int) { + return file_os_evm_v1_events_proto_rawDescGZIP(), []int{2} +} + +func (x *EventMessage) GetModule() string { + if x != nil { + return x.Module + } + return "" +} + +func (x *EventMessage) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +func (x *EventMessage) GetTxType() string { + if x != nil { + return x.TxType + } + return "" +} + +// EventBlockBloom defines an Ethereum block bloom filter event +type EventBlockBloom struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bloom is the bloom filter of the block + Bloom string `protobuf:"bytes,1,opt,name=bloom,proto3" json:"bloom,omitempty"` +} + +func (x *EventBlockBloom) Reset() { + *x = EventBlockBloom{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_events_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventBlockBloom) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventBlockBloom) ProtoMessage() {} + +// Deprecated: Use EventBlockBloom.ProtoReflect.Descriptor instead. +func (*EventBlockBloom) Descriptor() ([]byte, []int) { + return file_os_evm_v1_events_proto_rawDescGZIP(), []int{3} +} + +func (x *EventBlockBloom) GetBloom() string { + if x != nil { + return x.Bloom + } + return "" +} + +var File_os_evm_v1_events_proto protoreflect.FileDescriptor + +var file_os_evm_v1_events_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, + 0x2e, 0x76, 0x31, 0x22, 0xcb, 0x01, 0x0a, 0x0f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x45, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x19, 0x0a, 0x08, 0x65, 0x74, 0x68, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x65, 0x74, 0x68, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, + 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x22, 0x0a, + 0x0d, 0x65, 0x74, 0x68, 0x5f, 0x74, 0x78, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x74, 0x68, 0x54, 0x78, 0x46, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x22, 0x25, 0x0a, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x78, 0x4c, 0x6f, 0x67, 0x12, + 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x06, 0x74, 0x78, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x57, 0x0a, 0x0c, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x54, 0x79, 0x70, + 0x65, 0x22, 0x27, 0x0a, 0x0f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, + 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x42, 0x84, 0x01, 0x0a, 0x0d, 0x63, + 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, + 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x4f, 0x45, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x73, 0x2e, 0x45, 0x76, 0x6d, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x09, 0x4f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x73, + 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_evm_v1_events_proto_rawDescOnce sync.Once + file_os_evm_v1_events_proto_rawDescData = file_os_evm_v1_events_proto_rawDesc +) + +func file_os_evm_v1_events_proto_rawDescGZIP() []byte { + file_os_evm_v1_events_proto_rawDescOnce.Do(func() { + file_os_evm_v1_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_evm_v1_events_proto_rawDescData) + }) + return file_os_evm_v1_events_proto_rawDescData +} + +var file_os_evm_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_os_evm_v1_events_proto_goTypes = []interface{}{ + (*EventEthereumTx)(nil), // 0: os.evm.v1.EventEthereumTx + (*EventTxLog)(nil), // 1: os.evm.v1.EventTxLog + (*EventMessage)(nil), // 2: os.evm.v1.EventMessage + (*EventBlockBloom)(nil), // 3: os.evm.v1.EventBlockBloom +} +var file_os_evm_v1_events_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_os_evm_v1_events_proto_init() } +func file_os_evm_v1_events_proto_init() { + if File_os_evm_v1_events_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_os_evm_v1_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventEthereumTx); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventTxLog); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_events_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventBlockBloom); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_evm_v1_events_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_evm_v1_events_proto_goTypes, + DependencyIndexes: file_os_evm_v1_events_proto_depIdxs, + MessageInfos: file_os_evm_v1_events_proto_msgTypes, + }.Build() + File_os_evm_v1_events_proto = out.File + file_os_evm_v1_events_proto_rawDesc = nil + file_os_evm_v1_events_proto_goTypes = nil + file_os_evm_v1_events_proto_depIdxs = nil +} diff --git a/api/os/evm/v1/evm.pulsar.go b/api/os/evm/v1/evm.pulsar.go new file mode 100644 index 00000000..21a390cb --- /dev/null +++ b/api/os/evm/v1/evm.pulsar.go @@ -0,0 +1,9305 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package evmv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_Params_4_list)(nil) + +type _Params_4_list struct { + list *[]string +} + +func (x *_Params_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Params_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Params_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_4_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field ExtraEips as it is not of Message kind")) +} + +func (x *_Params_4_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Params_4_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Params_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Params_8_list)(nil) + +type _Params_8_list struct { + list *[]string +} + +func (x *_Params_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Params_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Params_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_8_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field EvmChannels as it is not of Message kind")) +} + +func (x *_Params_8_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Params_8_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Params_8_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Params_10_list)(nil) + +type _Params_10_list struct { + list *[]string +} + +func (x *_Params_10_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_10_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Params_10_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Params_10_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_10_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field ActiveStaticPrecompiles as it is not of Message kind")) +} + +func (x *_Params_10_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Params_10_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Params_10_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_evm_denom protoreflect.FieldDescriptor + fd_Params_extra_eips protoreflect.FieldDescriptor + fd_Params_chain_config protoreflect.FieldDescriptor + fd_Params_allow_unprotected_txs protoreflect.FieldDescriptor + fd_Params_evm_channels protoreflect.FieldDescriptor + fd_Params_access_control protoreflect.FieldDescriptor + fd_Params_active_static_precompiles protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_evm_proto_init() + md_Params = File_os_evm_v1_evm_proto.Messages().ByName("Params") + fd_Params_evm_denom = md_Params.Fields().ByName("evm_denom") + fd_Params_extra_eips = md_Params.Fields().ByName("extra_eips") + fd_Params_chain_config = md_Params.Fields().ByName("chain_config") + fd_Params_allow_unprotected_txs = md_Params.Fields().ByName("allow_unprotected_txs") + fd_Params_evm_channels = md_Params.Fields().ByName("evm_channels") + fd_Params_access_control = md_Params.Fields().ByName("access_control") + fd_Params_active_static_precompiles = md_Params.Fields().ByName("active_static_precompiles") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_evm_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.EvmDenom != "" { + value := protoreflect.ValueOfString(x.EvmDenom) + if !f(fd_Params_evm_denom, value) { + return + } + } + if len(x.ExtraEips) != 0 { + value := protoreflect.ValueOfList(&_Params_4_list{list: &x.ExtraEips}) + if !f(fd_Params_extra_eips, value) { + return + } + } + if x.ChainConfig != nil { + value := protoreflect.ValueOfMessage(x.ChainConfig.ProtoReflect()) + if !f(fd_Params_chain_config, value) { + return + } + } + if x.AllowUnprotectedTxs != false { + value := protoreflect.ValueOfBool(x.AllowUnprotectedTxs) + if !f(fd_Params_allow_unprotected_txs, value) { + return + } + } + if len(x.EvmChannels) != 0 { + value := protoreflect.ValueOfList(&_Params_8_list{list: &x.EvmChannels}) + if !f(fd_Params_evm_channels, value) { + return + } + } + if x.AccessControl != nil { + value := protoreflect.ValueOfMessage(x.AccessControl.ProtoReflect()) + if !f(fd_Params_access_control, value) { + return + } + } + if len(x.ActiveStaticPrecompiles) != 0 { + value := protoreflect.ValueOfList(&_Params_10_list{list: &x.ActiveStaticPrecompiles}) + if !f(fd_Params_active_static_precompiles, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.Params.evm_denom": + return x.EvmDenom != "" + case "os.evm.v1.Params.extra_eips": + return len(x.ExtraEips) != 0 + case "os.evm.v1.Params.chain_config": + return x.ChainConfig != nil + case "os.evm.v1.Params.allow_unprotected_txs": + return x.AllowUnprotectedTxs != false + case "os.evm.v1.Params.evm_channels": + return len(x.EvmChannels) != 0 + case "os.evm.v1.Params.access_control": + return x.AccessControl != nil + case "os.evm.v1.Params.active_static_precompiles": + return len(x.ActiveStaticPrecompiles) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.Params")) + } + panic(fmt.Errorf("message os.evm.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.Params.evm_denom": + x.EvmDenom = "" + case "os.evm.v1.Params.extra_eips": + x.ExtraEips = nil + case "os.evm.v1.Params.chain_config": + x.ChainConfig = nil + case "os.evm.v1.Params.allow_unprotected_txs": + x.AllowUnprotectedTxs = false + case "os.evm.v1.Params.evm_channels": + x.EvmChannels = nil + case "os.evm.v1.Params.access_control": + x.AccessControl = nil + case "os.evm.v1.Params.active_static_precompiles": + x.ActiveStaticPrecompiles = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.Params")) + } + panic(fmt.Errorf("message os.evm.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.Params.evm_denom": + value := x.EvmDenom + return protoreflect.ValueOfString(value) + case "os.evm.v1.Params.extra_eips": + if len(x.ExtraEips) == 0 { + return protoreflect.ValueOfList(&_Params_4_list{}) + } + listValue := &_Params_4_list{list: &x.ExtraEips} + return protoreflect.ValueOfList(listValue) + case "os.evm.v1.Params.chain_config": + value := x.ChainConfig + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.evm.v1.Params.allow_unprotected_txs": + value := x.AllowUnprotectedTxs + return protoreflect.ValueOfBool(value) + case "os.evm.v1.Params.evm_channels": + if len(x.EvmChannels) == 0 { + return protoreflect.ValueOfList(&_Params_8_list{}) + } + listValue := &_Params_8_list{list: &x.EvmChannels} + return protoreflect.ValueOfList(listValue) + case "os.evm.v1.Params.access_control": + value := x.AccessControl + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.evm.v1.Params.active_static_precompiles": + if len(x.ActiveStaticPrecompiles) == 0 { + return protoreflect.ValueOfList(&_Params_10_list{}) + } + listValue := &_Params_10_list{list: &x.ActiveStaticPrecompiles} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.Params")) + } + panic(fmt.Errorf("message os.evm.v1.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.Params.evm_denom": + x.EvmDenom = value.Interface().(string) + case "os.evm.v1.Params.extra_eips": + lv := value.List() + clv := lv.(*_Params_4_list) + x.ExtraEips = *clv.list + case "os.evm.v1.Params.chain_config": + x.ChainConfig = value.Message().Interface().(*ChainConfig) + case "os.evm.v1.Params.allow_unprotected_txs": + x.AllowUnprotectedTxs = value.Bool() + case "os.evm.v1.Params.evm_channels": + lv := value.List() + clv := lv.(*_Params_8_list) + x.EvmChannels = *clv.list + case "os.evm.v1.Params.access_control": + x.AccessControl = value.Message().Interface().(*AccessControl) + case "os.evm.v1.Params.active_static_precompiles": + lv := value.List() + clv := lv.(*_Params_10_list) + x.ActiveStaticPrecompiles = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.Params")) + } + panic(fmt.Errorf("message os.evm.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.Params.extra_eips": + if x.ExtraEips == nil { + x.ExtraEips = []string{} + } + value := &_Params_4_list{list: &x.ExtraEips} + return protoreflect.ValueOfList(value) + case "os.evm.v1.Params.chain_config": + if x.ChainConfig == nil { + x.ChainConfig = new(ChainConfig) + } + return protoreflect.ValueOfMessage(x.ChainConfig.ProtoReflect()) + case "os.evm.v1.Params.evm_channels": + if x.EvmChannels == nil { + x.EvmChannels = []string{} + } + value := &_Params_8_list{list: &x.EvmChannels} + return protoreflect.ValueOfList(value) + case "os.evm.v1.Params.access_control": + if x.AccessControl == nil { + x.AccessControl = new(AccessControl) + } + return protoreflect.ValueOfMessage(x.AccessControl.ProtoReflect()) + case "os.evm.v1.Params.active_static_precompiles": + if x.ActiveStaticPrecompiles == nil { + x.ActiveStaticPrecompiles = []string{} + } + value := &_Params_10_list{list: &x.ActiveStaticPrecompiles} + return protoreflect.ValueOfList(value) + case "os.evm.v1.Params.evm_denom": + panic(fmt.Errorf("field evm_denom of message os.evm.v1.Params is not mutable")) + case "os.evm.v1.Params.allow_unprotected_txs": + panic(fmt.Errorf("field allow_unprotected_txs of message os.evm.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.Params")) + } + panic(fmt.Errorf("message os.evm.v1.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.Params.evm_denom": + return protoreflect.ValueOfString("") + case "os.evm.v1.Params.extra_eips": + list := []string{} + return protoreflect.ValueOfList(&_Params_4_list{list: &list}) + case "os.evm.v1.Params.chain_config": + m := new(ChainConfig) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.evm.v1.Params.allow_unprotected_txs": + return protoreflect.ValueOfBool(false) + case "os.evm.v1.Params.evm_channels": + list := []string{} + return protoreflect.ValueOfList(&_Params_8_list{list: &list}) + case "os.evm.v1.Params.access_control": + m := new(AccessControl) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.evm.v1.Params.active_static_precompiles": + list := []string{} + return protoreflect.ValueOfList(&_Params_10_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.Params")) + } + panic(fmt.Errorf("message os.evm.v1.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.EvmDenom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.ExtraEips) > 0 { + for _, s := range x.ExtraEips { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.ChainConfig != nil { + l = options.Size(x.ChainConfig) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.AllowUnprotectedTxs { + n += 2 + } + if len(x.EvmChannels) > 0 { + for _, s := range x.EvmChannels { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.AccessControl != nil { + l = options.Size(x.AccessControl) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.ActiveStaticPrecompiles) > 0 { + for _, s := range x.ActiveStaticPrecompiles { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.ActiveStaticPrecompiles) > 0 { + for iNdEx := len(x.ActiveStaticPrecompiles) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.ActiveStaticPrecompiles[iNdEx]) + copy(dAtA[i:], x.ActiveStaticPrecompiles[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ActiveStaticPrecompiles[iNdEx]))) + i-- + dAtA[i] = 0x52 + } + } + if x.AccessControl != nil { + encoded, err := options.Marshal(x.AccessControl) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x4a + } + if len(x.EvmChannels) > 0 { + for iNdEx := len(x.EvmChannels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.EvmChannels[iNdEx]) + copy(dAtA[i:], x.EvmChannels[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EvmChannels[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if x.AllowUnprotectedTxs { + i-- + if x.AllowUnprotectedTxs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if x.ChainConfig != nil { + encoded, err := options.Marshal(x.ChainConfig) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + if len(x.ExtraEips) > 0 { + for iNdEx := len(x.ExtraEips) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.ExtraEips[iNdEx]) + copy(dAtA[i:], x.ExtraEips[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ExtraEips[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(x.EvmDenom) > 0 { + i -= len(x.EvmDenom) + copy(dAtA[i:], x.EvmDenom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EvmDenom))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EvmDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.EvmDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExtraEips", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ExtraEips = append(x.ExtraEips, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ChainConfig == nil { + x.ChainConfig = &ChainConfig{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ChainConfig); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AllowUnprotectedTxs", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.AllowUnprotectedTxs = bool(v != 0) + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EvmChannels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.EvmChannels = append(x.EvmChannels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AccessControl", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.AccessControl == nil { + x.AccessControl = &AccessControl{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AccessControl); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ActiveStaticPrecompiles", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ActiveStaticPrecompiles = append(x.ActiveStaticPrecompiles, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_AccessControl protoreflect.MessageDescriptor + fd_AccessControl_create protoreflect.FieldDescriptor + fd_AccessControl_call protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_evm_proto_init() + md_AccessControl = File_os_evm_v1_evm_proto.Messages().ByName("AccessControl") + fd_AccessControl_create = md_AccessControl.Fields().ByName("create") + fd_AccessControl_call = md_AccessControl.Fields().ByName("call") +} + +var _ protoreflect.Message = (*fastReflection_AccessControl)(nil) + +type fastReflection_AccessControl AccessControl + +func (x *AccessControl) ProtoReflect() protoreflect.Message { + return (*fastReflection_AccessControl)(x) +} + +func (x *AccessControl) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_evm_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_AccessControl_messageType fastReflection_AccessControl_messageType +var _ protoreflect.MessageType = fastReflection_AccessControl_messageType{} + +type fastReflection_AccessControl_messageType struct{} + +func (x fastReflection_AccessControl_messageType) Zero() protoreflect.Message { + return (*fastReflection_AccessControl)(nil) +} +func (x fastReflection_AccessControl_messageType) New() protoreflect.Message { + return new(fastReflection_AccessControl) +} +func (x fastReflection_AccessControl_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AccessControl +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AccessControl) Descriptor() protoreflect.MessageDescriptor { + return md_AccessControl +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_AccessControl) Type() protoreflect.MessageType { + return _fastReflection_AccessControl_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AccessControl) New() protoreflect.Message { + return new(fastReflection_AccessControl) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AccessControl) Interface() protoreflect.ProtoMessage { + return (*AccessControl)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_AccessControl) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Create != nil { + value := protoreflect.ValueOfMessage(x.Create.ProtoReflect()) + if !f(fd_AccessControl_create, value) { + return + } + } + if x.Call != nil { + value := protoreflect.ValueOfMessage(x.Call.ProtoReflect()) + if !f(fd_AccessControl_call, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_AccessControl) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.AccessControl.create": + return x.Create != nil + case "os.evm.v1.AccessControl.call": + return x.Call != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessControl")) + } + panic(fmt.Errorf("message os.evm.v1.AccessControl does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessControl) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.AccessControl.create": + x.Create = nil + case "os.evm.v1.AccessControl.call": + x.Call = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessControl")) + } + panic(fmt.Errorf("message os.evm.v1.AccessControl does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_AccessControl) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.AccessControl.create": + value := x.Create + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.evm.v1.AccessControl.call": + value := x.Call + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessControl")) + } + panic(fmt.Errorf("message os.evm.v1.AccessControl does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessControl) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.AccessControl.create": + x.Create = value.Message().Interface().(*AccessControlType) + case "os.evm.v1.AccessControl.call": + x.Call = value.Message().Interface().(*AccessControlType) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessControl")) + } + panic(fmt.Errorf("message os.evm.v1.AccessControl does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessControl) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.AccessControl.create": + if x.Create == nil { + x.Create = new(AccessControlType) + } + return protoreflect.ValueOfMessage(x.Create.ProtoReflect()) + case "os.evm.v1.AccessControl.call": + if x.Call == nil { + x.Call = new(AccessControlType) + } + return protoreflect.ValueOfMessage(x.Call.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessControl")) + } + panic(fmt.Errorf("message os.evm.v1.AccessControl does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_AccessControl) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.AccessControl.create": + m := new(AccessControlType) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.evm.v1.AccessControl.call": + m := new(AccessControlType) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessControl")) + } + panic(fmt.Errorf("message os.evm.v1.AccessControl does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_AccessControl) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.AccessControl", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_AccessControl) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessControl) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_AccessControl) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_AccessControl) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AccessControl) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Create != nil { + l = options.Size(x.Create) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Call != nil { + l = options.Size(x.Call) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*AccessControl) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Call != nil { + encoded, err := options.Marshal(x.Call) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.Create != nil { + encoded, err := options.Marshal(x.Create) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*AccessControl) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccessControl: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccessControl: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Create", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Create == nil { + x.Create = &AccessControlType{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Create); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Call", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Call == nil { + x.Call = &AccessControlType{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Call); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_AccessControlType_2_list)(nil) + +type _AccessControlType_2_list struct { + list *[]string +} + +func (x *_AccessControlType_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_AccessControlType_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_AccessControlType_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_AccessControlType_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_AccessControlType_2_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message AccessControlType at list field AccessControlList as it is not of Message kind")) +} + +func (x *_AccessControlType_2_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_AccessControlType_2_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_AccessControlType_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_AccessControlType protoreflect.MessageDescriptor + fd_AccessControlType_access_type protoreflect.FieldDescriptor + fd_AccessControlType_access_control_list protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_evm_proto_init() + md_AccessControlType = File_os_evm_v1_evm_proto.Messages().ByName("AccessControlType") + fd_AccessControlType_access_type = md_AccessControlType.Fields().ByName("access_type") + fd_AccessControlType_access_control_list = md_AccessControlType.Fields().ByName("access_control_list") +} + +var _ protoreflect.Message = (*fastReflection_AccessControlType)(nil) + +type fastReflection_AccessControlType AccessControlType + +func (x *AccessControlType) ProtoReflect() protoreflect.Message { + return (*fastReflection_AccessControlType)(x) +} + +func (x *AccessControlType) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_evm_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_AccessControlType_messageType fastReflection_AccessControlType_messageType +var _ protoreflect.MessageType = fastReflection_AccessControlType_messageType{} + +type fastReflection_AccessControlType_messageType struct{} + +func (x fastReflection_AccessControlType_messageType) Zero() protoreflect.Message { + return (*fastReflection_AccessControlType)(nil) +} +func (x fastReflection_AccessControlType_messageType) New() protoreflect.Message { + return new(fastReflection_AccessControlType) +} +func (x fastReflection_AccessControlType_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AccessControlType +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AccessControlType) Descriptor() protoreflect.MessageDescriptor { + return md_AccessControlType +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_AccessControlType) Type() protoreflect.MessageType { + return _fastReflection_AccessControlType_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AccessControlType) New() protoreflect.Message { + return new(fastReflection_AccessControlType) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AccessControlType) Interface() protoreflect.ProtoMessage { + return (*AccessControlType)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_AccessControlType) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AccessType != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.AccessType)) + if !f(fd_AccessControlType_access_type, value) { + return + } + } + if len(x.AccessControlList) != 0 { + value := protoreflect.ValueOfList(&_AccessControlType_2_list{list: &x.AccessControlList}) + if !f(fd_AccessControlType_access_control_list, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_AccessControlType) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.AccessControlType.access_type": + return x.AccessType != 0 + case "os.evm.v1.AccessControlType.access_control_list": + return len(x.AccessControlList) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessControlType")) + } + panic(fmt.Errorf("message os.evm.v1.AccessControlType does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessControlType) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.AccessControlType.access_type": + x.AccessType = 0 + case "os.evm.v1.AccessControlType.access_control_list": + x.AccessControlList = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessControlType")) + } + panic(fmt.Errorf("message os.evm.v1.AccessControlType does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_AccessControlType) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.AccessControlType.access_type": + value := x.AccessType + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "os.evm.v1.AccessControlType.access_control_list": + if len(x.AccessControlList) == 0 { + return protoreflect.ValueOfList(&_AccessControlType_2_list{}) + } + listValue := &_AccessControlType_2_list{list: &x.AccessControlList} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessControlType")) + } + panic(fmt.Errorf("message os.evm.v1.AccessControlType does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessControlType) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.AccessControlType.access_type": + x.AccessType = (AccessType)(value.Enum()) + case "os.evm.v1.AccessControlType.access_control_list": + lv := value.List() + clv := lv.(*_AccessControlType_2_list) + x.AccessControlList = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessControlType")) + } + panic(fmt.Errorf("message os.evm.v1.AccessControlType does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessControlType) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.AccessControlType.access_control_list": + if x.AccessControlList == nil { + x.AccessControlList = []string{} + } + value := &_AccessControlType_2_list{list: &x.AccessControlList} + return protoreflect.ValueOfList(value) + case "os.evm.v1.AccessControlType.access_type": + panic(fmt.Errorf("field access_type of message os.evm.v1.AccessControlType is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessControlType")) + } + panic(fmt.Errorf("message os.evm.v1.AccessControlType does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_AccessControlType) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.AccessControlType.access_type": + return protoreflect.ValueOfEnum(0) + case "os.evm.v1.AccessControlType.access_control_list": + list := []string{} + return protoreflect.ValueOfList(&_AccessControlType_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessControlType")) + } + panic(fmt.Errorf("message os.evm.v1.AccessControlType does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_AccessControlType) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.AccessControlType", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_AccessControlType) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessControlType) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_AccessControlType) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_AccessControlType) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AccessControlType) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.AccessType != 0 { + n += 1 + runtime.Sov(uint64(x.AccessType)) + } + if len(x.AccessControlList) > 0 { + for _, s := range x.AccessControlList { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*AccessControlType) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.AccessControlList) > 0 { + for iNdEx := len(x.AccessControlList) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AccessControlList[iNdEx]) + copy(dAtA[i:], x.AccessControlList[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AccessControlList[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if x.AccessType != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AccessType)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*AccessControlType) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccessControlType: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccessControlType: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AccessType", wireType) + } + x.AccessType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.AccessType |= AccessType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AccessControlList", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AccessControlList = append(x.AccessControlList, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_ChainConfig protoreflect.MessageDescriptor + fd_ChainConfig_homestead_block protoreflect.FieldDescriptor + fd_ChainConfig_dao_fork_block protoreflect.FieldDescriptor + fd_ChainConfig_dao_fork_support protoreflect.FieldDescriptor + fd_ChainConfig_eip150_block protoreflect.FieldDescriptor + fd_ChainConfig_eip150_hash protoreflect.FieldDescriptor + fd_ChainConfig_eip155_block protoreflect.FieldDescriptor + fd_ChainConfig_eip158_block protoreflect.FieldDescriptor + fd_ChainConfig_byzantium_block protoreflect.FieldDescriptor + fd_ChainConfig_constantinople_block protoreflect.FieldDescriptor + fd_ChainConfig_petersburg_block protoreflect.FieldDescriptor + fd_ChainConfig_istanbul_block protoreflect.FieldDescriptor + fd_ChainConfig_muir_glacier_block protoreflect.FieldDescriptor + fd_ChainConfig_berlin_block protoreflect.FieldDescriptor + fd_ChainConfig_london_block protoreflect.FieldDescriptor + fd_ChainConfig_arrow_glacier_block protoreflect.FieldDescriptor + fd_ChainConfig_gray_glacier_block protoreflect.FieldDescriptor + fd_ChainConfig_merge_netsplit_block protoreflect.FieldDescriptor + fd_ChainConfig_shanghai_block protoreflect.FieldDescriptor + fd_ChainConfig_cancun_block protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_evm_proto_init() + md_ChainConfig = File_os_evm_v1_evm_proto.Messages().ByName("ChainConfig") + fd_ChainConfig_homestead_block = md_ChainConfig.Fields().ByName("homestead_block") + fd_ChainConfig_dao_fork_block = md_ChainConfig.Fields().ByName("dao_fork_block") + fd_ChainConfig_dao_fork_support = md_ChainConfig.Fields().ByName("dao_fork_support") + fd_ChainConfig_eip150_block = md_ChainConfig.Fields().ByName("eip150_block") + fd_ChainConfig_eip150_hash = md_ChainConfig.Fields().ByName("eip150_hash") + fd_ChainConfig_eip155_block = md_ChainConfig.Fields().ByName("eip155_block") + fd_ChainConfig_eip158_block = md_ChainConfig.Fields().ByName("eip158_block") + fd_ChainConfig_byzantium_block = md_ChainConfig.Fields().ByName("byzantium_block") + fd_ChainConfig_constantinople_block = md_ChainConfig.Fields().ByName("constantinople_block") + fd_ChainConfig_petersburg_block = md_ChainConfig.Fields().ByName("petersburg_block") + fd_ChainConfig_istanbul_block = md_ChainConfig.Fields().ByName("istanbul_block") + fd_ChainConfig_muir_glacier_block = md_ChainConfig.Fields().ByName("muir_glacier_block") + fd_ChainConfig_berlin_block = md_ChainConfig.Fields().ByName("berlin_block") + fd_ChainConfig_london_block = md_ChainConfig.Fields().ByName("london_block") + fd_ChainConfig_arrow_glacier_block = md_ChainConfig.Fields().ByName("arrow_glacier_block") + fd_ChainConfig_gray_glacier_block = md_ChainConfig.Fields().ByName("gray_glacier_block") + fd_ChainConfig_merge_netsplit_block = md_ChainConfig.Fields().ByName("merge_netsplit_block") + fd_ChainConfig_shanghai_block = md_ChainConfig.Fields().ByName("shanghai_block") + fd_ChainConfig_cancun_block = md_ChainConfig.Fields().ByName("cancun_block") +} + +var _ protoreflect.Message = (*fastReflection_ChainConfig)(nil) + +type fastReflection_ChainConfig ChainConfig + +func (x *ChainConfig) ProtoReflect() protoreflect.Message { + return (*fastReflection_ChainConfig)(x) +} + +func (x *ChainConfig) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_evm_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ChainConfig_messageType fastReflection_ChainConfig_messageType +var _ protoreflect.MessageType = fastReflection_ChainConfig_messageType{} + +type fastReflection_ChainConfig_messageType struct{} + +func (x fastReflection_ChainConfig_messageType) Zero() protoreflect.Message { + return (*fastReflection_ChainConfig)(nil) +} +func (x fastReflection_ChainConfig_messageType) New() protoreflect.Message { + return new(fastReflection_ChainConfig) +} +func (x fastReflection_ChainConfig_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ChainConfig +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ChainConfig) Descriptor() protoreflect.MessageDescriptor { + return md_ChainConfig +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ChainConfig) Type() protoreflect.MessageType { + return _fastReflection_ChainConfig_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ChainConfig) New() protoreflect.Message { + return new(fastReflection_ChainConfig) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ChainConfig) Interface() protoreflect.ProtoMessage { + return (*ChainConfig)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ChainConfig) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.HomesteadBlock != "" { + value := protoreflect.ValueOfString(x.HomesteadBlock) + if !f(fd_ChainConfig_homestead_block, value) { + return + } + } + if x.DaoForkBlock != "" { + value := protoreflect.ValueOfString(x.DaoForkBlock) + if !f(fd_ChainConfig_dao_fork_block, value) { + return + } + } + if x.DaoForkSupport != false { + value := protoreflect.ValueOfBool(x.DaoForkSupport) + if !f(fd_ChainConfig_dao_fork_support, value) { + return + } + } + if x.Eip150Block != "" { + value := protoreflect.ValueOfString(x.Eip150Block) + if !f(fd_ChainConfig_eip150_block, value) { + return + } + } + if x.Eip150Hash != "" { + value := protoreflect.ValueOfString(x.Eip150Hash) + if !f(fd_ChainConfig_eip150_hash, value) { + return + } + } + if x.Eip155Block != "" { + value := protoreflect.ValueOfString(x.Eip155Block) + if !f(fd_ChainConfig_eip155_block, value) { + return + } + } + if x.Eip158Block != "" { + value := protoreflect.ValueOfString(x.Eip158Block) + if !f(fd_ChainConfig_eip158_block, value) { + return + } + } + if x.ByzantiumBlock != "" { + value := protoreflect.ValueOfString(x.ByzantiumBlock) + if !f(fd_ChainConfig_byzantium_block, value) { + return + } + } + if x.ConstantinopleBlock != "" { + value := protoreflect.ValueOfString(x.ConstantinopleBlock) + if !f(fd_ChainConfig_constantinople_block, value) { + return + } + } + if x.PetersburgBlock != "" { + value := protoreflect.ValueOfString(x.PetersburgBlock) + if !f(fd_ChainConfig_petersburg_block, value) { + return + } + } + if x.IstanbulBlock != "" { + value := protoreflect.ValueOfString(x.IstanbulBlock) + if !f(fd_ChainConfig_istanbul_block, value) { + return + } + } + if x.MuirGlacierBlock != "" { + value := protoreflect.ValueOfString(x.MuirGlacierBlock) + if !f(fd_ChainConfig_muir_glacier_block, value) { + return + } + } + if x.BerlinBlock != "" { + value := protoreflect.ValueOfString(x.BerlinBlock) + if !f(fd_ChainConfig_berlin_block, value) { + return + } + } + if x.LondonBlock != "" { + value := protoreflect.ValueOfString(x.LondonBlock) + if !f(fd_ChainConfig_london_block, value) { + return + } + } + if x.ArrowGlacierBlock != "" { + value := protoreflect.ValueOfString(x.ArrowGlacierBlock) + if !f(fd_ChainConfig_arrow_glacier_block, value) { + return + } + } + if x.GrayGlacierBlock != "" { + value := protoreflect.ValueOfString(x.GrayGlacierBlock) + if !f(fd_ChainConfig_gray_glacier_block, value) { + return + } + } + if x.MergeNetsplitBlock != "" { + value := protoreflect.ValueOfString(x.MergeNetsplitBlock) + if !f(fd_ChainConfig_merge_netsplit_block, value) { + return + } + } + if x.ShanghaiBlock != "" { + value := protoreflect.ValueOfString(x.ShanghaiBlock) + if !f(fd_ChainConfig_shanghai_block, value) { + return + } + } + if x.CancunBlock != "" { + value := protoreflect.ValueOfString(x.CancunBlock) + if !f(fd_ChainConfig_cancun_block, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ChainConfig) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.ChainConfig.homestead_block": + return x.HomesteadBlock != "" + case "os.evm.v1.ChainConfig.dao_fork_block": + return x.DaoForkBlock != "" + case "os.evm.v1.ChainConfig.dao_fork_support": + return x.DaoForkSupport != false + case "os.evm.v1.ChainConfig.eip150_block": + return x.Eip150Block != "" + case "os.evm.v1.ChainConfig.eip150_hash": + return x.Eip150Hash != "" + case "os.evm.v1.ChainConfig.eip155_block": + return x.Eip155Block != "" + case "os.evm.v1.ChainConfig.eip158_block": + return x.Eip158Block != "" + case "os.evm.v1.ChainConfig.byzantium_block": + return x.ByzantiumBlock != "" + case "os.evm.v1.ChainConfig.constantinople_block": + return x.ConstantinopleBlock != "" + case "os.evm.v1.ChainConfig.petersburg_block": + return x.PetersburgBlock != "" + case "os.evm.v1.ChainConfig.istanbul_block": + return x.IstanbulBlock != "" + case "os.evm.v1.ChainConfig.muir_glacier_block": + return x.MuirGlacierBlock != "" + case "os.evm.v1.ChainConfig.berlin_block": + return x.BerlinBlock != "" + case "os.evm.v1.ChainConfig.london_block": + return x.LondonBlock != "" + case "os.evm.v1.ChainConfig.arrow_glacier_block": + return x.ArrowGlacierBlock != "" + case "os.evm.v1.ChainConfig.gray_glacier_block": + return x.GrayGlacierBlock != "" + case "os.evm.v1.ChainConfig.merge_netsplit_block": + return x.MergeNetsplitBlock != "" + case "os.evm.v1.ChainConfig.shanghai_block": + return x.ShanghaiBlock != "" + case "os.evm.v1.ChainConfig.cancun_block": + return x.CancunBlock != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.ChainConfig")) + } + panic(fmt.Errorf("message os.evm.v1.ChainConfig does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ChainConfig) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.ChainConfig.homestead_block": + x.HomesteadBlock = "" + case "os.evm.v1.ChainConfig.dao_fork_block": + x.DaoForkBlock = "" + case "os.evm.v1.ChainConfig.dao_fork_support": + x.DaoForkSupport = false + case "os.evm.v1.ChainConfig.eip150_block": + x.Eip150Block = "" + case "os.evm.v1.ChainConfig.eip150_hash": + x.Eip150Hash = "" + case "os.evm.v1.ChainConfig.eip155_block": + x.Eip155Block = "" + case "os.evm.v1.ChainConfig.eip158_block": + x.Eip158Block = "" + case "os.evm.v1.ChainConfig.byzantium_block": + x.ByzantiumBlock = "" + case "os.evm.v1.ChainConfig.constantinople_block": + x.ConstantinopleBlock = "" + case "os.evm.v1.ChainConfig.petersburg_block": + x.PetersburgBlock = "" + case "os.evm.v1.ChainConfig.istanbul_block": + x.IstanbulBlock = "" + case "os.evm.v1.ChainConfig.muir_glacier_block": + x.MuirGlacierBlock = "" + case "os.evm.v1.ChainConfig.berlin_block": + x.BerlinBlock = "" + case "os.evm.v1.ChainConfig.london_block": + x.LondonBlock = "" + case "os.evm.v1.ChainConfig.arrow_glacier_block": + x.ArrowGlacierBlock = "" + case "os.evm.v1.ChainConfig.gray_glacier_block": + x.GrayGlacierBlock = "" + case "os.evm.v1.ChainConfig.merge_netsplit_block": + x.MergeNetsplitBlock = "" + case "os.evm.v1.ChainConfig.shanghai_block": + x.ShanghaiBlock = "" + case "os.evm.v1.ChainConfig.cancun_block": + x.CancunBlock = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.ChainConfig")) + } + panic(fmt.Errorf("message os.evm.v1.ChainConfig does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ChainConfig) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.ChainConfig.homestead_block": + value := x.HomesteadBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.dao_fork_block": + value := x.DaoForkBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.dao_fork_support": + value := x.DaoForkSupport + return protoreflect.ValueOfBool(value) + case "os.evm.v1.ChainConfig.eip150_block": + value := x.Eip150Block + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.eip150_hash": + value := x.Eip150Hash + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.eip155_block": + value := x.Eip155Block + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.eip158_block": + value := x.Eip158Block + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.byzantium_block": + value := x.ByzantiumBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.constantinople_block": + value := x.ConstantinopleBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.petersburg_block": + value := x.PetersburgBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.istanbul_block": + value := x.IstanbulBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.muir_glacier_block": + value := x.MuirGlacierBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.berlin_block": + value := x.BerlinBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.london_block": + value := x.LondonBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.arrow_glacier_block": + value := x.ArrowGlacierBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.gray_glacier_block": + value := x.GrayGlacierBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.merge_netsplit_block": + value := x.MergeNetsplitBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.shanghai_block": + value := x.ShanghaiBlock + return protoreflect.ValueOfString(value) + case "os.evm.v1.ChainConfig.cancun_block": + value := x.CancunBlock + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.ChainConfig")) + } + panic(fmt.Errorf("message os.evm.v1.ChainConfig does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ChainConfig) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.ChainConfig.homestead_block": + x.HomesteadBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.dao_fork_block": + x.DaoForkBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.dao_fork_support": + x.DaoForkSupport = value.Bool() + case "os.evm.v1.ChainConfig.eip150_block": + x.Eip150Block = value.Interface().(string) + case "os.evm.v1.ChainConfig.eip150_hash": + x.Eip150Hash = value.Interface().(string) + case "os.evm.v1.ChainConfig.eip155_block": + x.Eip155Block = value.Interface().(string) + case "os.evm.v1.ChainConfig.eip158_block": + x.Eip158Block = value.Interface().(string) + case "os.evm.v1.ChainConfig.byzantium_block": + x.ByzantiumBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.constantinople_block": + x.ConstantinopleBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.petersburg_block": + x.PetersburgBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.istanbul_block": + x.IstanbulBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.muir_glacier_block": + x.MuirGlacierBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.berlin_block": + x.BerlinBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.london_block": + x.LondonBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.arrow_glacier_block": + x.ArrowGlacierBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.gray_glacier_block": + x.GrayGlacierBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.merge_netsplit_block": + x.MergeNetsplitBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.shanghai_block": + x.ShanghaiBlock = value.Interface().(string) + case "os.evm.v1.ChainConfig.cancun_block": + x.CancunBlock = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.ChainConfig")) + } + panic(fmt.Errorf("message os.evm.v1.ChainConfig does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ChainConfig) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.ChainConfig.homestead_block": + panic(fmt.Errorf("field homestead_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.dao_fork_block": + panic(fmt.Errorf("field dao_fork_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.dao_fork_support": + panic(fmt.Errorf("field dao_fork_support of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.eip150_block": + panic(fmt.Errorf("field eip150_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.eip150_hash": + panic(fmt.Errorf("field eip150_hash of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.eip155_block": + panic(fmt.Errorf("field eip155_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.eip158_block": + panic(fmt.Errorf("field eip158_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.byzantium_block": + panic(fmt.Errorf("field byzantium_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.constantinople_block": + panic(fmt.Errorf("field constantinople_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.petersburg_block": + panic(fmt.Errorf("field petersburg_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.istanbul_block": + panic(fmt.Errorf("field istanbul_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.muir_glacier_block": + panic(fmt.Errorf("field muir_glacier_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.berlin_block": + panic(fmt.Errorf("field berlin_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.london_block": + panic(fmt.Errorf("field london_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.arrow_glacier_block": + panic(fmt.Errorf("field arrow_glacier_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.gray_glacier_block": + panic(fmt.Errorf("field gray_glacier_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.merge_netsplit_block": + panic(fmt.Errorf("field merge_netsplit_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.shanghai_block": + panic(fmt.Errorf("field shanghai_block of message os.evm.v1.ChainConfig is not mutable")) + case "os.evm.v1.ChainConfig.cancun_block": + panic(fmt.Errorf("field cancun_block of message os.evm.v1.ChainConfig is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.ChainConfig")) + } + panic(fmt.Errorf("message os.evm.v1.ChainConfig does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ChainConfig) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.ChainConfig.homestead_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.dao_fork_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.dao_fork_support": + return protoreflect.ValueOfBool(false) + case "os.evm.v1.ChainConfig.eip150_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.eip150_hash": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.eip155_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.eip158_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.byzantium_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.constantinople_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.petersburg_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.istanbul_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.muir_glacier_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.berlin_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.london_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.arrow_glacier_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.gray_glacier_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.merge_netsplit_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.shanghai_block": + return protoreflect.ValueOfString("") + case "os.evm.v1.ChainConfig.cancun_block": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.ChainConfig")) + } + panic(fmt.Errorf("message os.evm.v1.ChainConfig does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ChainConfig) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.ChainConfig", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ChainConfig) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ChainConfig) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ChainConfig) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ChainConfig) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ChainConfig) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.HomesteadBlock) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.DaoForkBlock) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.DaoForkSupport { + n += 2 + } + l = len(x.Eip150Block) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Eip150Hash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Eip155Block) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Eip158Block) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ByzantiumBlock) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ConstantinopleBlock) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PetersburgBlock) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.IstanbulBlock) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MuirGlacierBlock) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.BerlinBlock) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.LondonBlock) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + l = len(x.ArrowGlacierBlock) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + l = len(x.GrayGlacierBlock) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + l = len(x.MergeNetsplitBlock) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + l = len(x.ShanghaiBlock) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + l = len(x.CancunBlock) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ChainConfig) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.CancunBlock) > 0 { + i -= len(x.CancunBlock) + copy(dAtA[i:], x.CancunBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CancunBlock))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(x.ShanghaiBlock) > 0 { + i -= len(x.ShanghaiBlock) + copy(dAtA[i:], x.ShanghaiBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ShanghaiBlock))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if len(x.MergeNetsplitBlock) > 0 { + i -= len(x.MergeNetsplitBlock) + copy(dAtA[i:], x.MergeNetsplitBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MergeNetsplitBlock))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if len(x.GrayGlacierBlock) > 0 { + i -= len(x.GrayGlacierBlock) + copy(dAtA[i:], x.GrayGlacierBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GrayGlacierBlock))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if len(x.ArrowGlacierBlock) > 0 { + i -= len(x.ArrowGlacierBlock) + copy(dAtA[i:], x.ArrowGlacierBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ArrowGlacierBlock))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if len(x.LondonBlock) > 0 { + i -= len(x.LondonBlock) + copy(dAtA[i:], x.LondonBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.LondonBlock))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(x.BerlinBlock) > 0 { + i -= len(x.BerlinBlock) + copy(dAtA[i:], x.BerlinBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BerlinBlock))) + i-- + dAtA[i] = 0x6a + } + if len(x.MuirGlacierBlock) > 0 { + i -= len(x.MuirGlacierBlock) + copy(dAtA[i:], x.MuirGlacierBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MuirGlacierBlock))) + i-- + dAtA[i] = 0x62 + } + if len(x.IstanbulBlock) > 0 { + i -= len(x.IstanbulBlock) + copy(dAtA[i:], x.IstanbulBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.IstanbulBlock))) + i-- + dAtA[i] = 0x5a + } + if len(x.PetersburgBlock) > 0 { + i -= len(x.PetersburgBlock) + copy(dAtA[i:], x.PetersburgBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PetersburgBlock))) + i-- + dAtA[i] = 0x52 + } + if len(x.ConstantinopleBlock) > 0 { + i -= len(x.ConstantinopleBlock) + copy(dAtA[i:], x.ConstantinopleBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ConstantinopleBlock))) + i-- + dAtA[i] = 0x4a + } + if len(x.ByzantiumBlock) > 0 { + i -= len(x.ByzantiumBlock) + copy(dAtA[i:], x.ByzantiumBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ByzantiumBlock))) + i-- + dAtA[i] = 0x42 + } + if len(x.Eip158Block) > 0 { + i -= len(x.Eip158Block) + copy(dAtA[i:], x.Eip158Block) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Eip158Block))) + i-- + dAtA[i] = 0x3a + } + if len(x.Eip155Block) > 0 { + i -= len(x.Eip155Block) + copy(dAtA[i:], x.Eip155Block) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Eip155Block))) + i-- + dAtA[i] = 0x32 + } + if len(x.Eip150Hash) > 0 { + i -= len(x.Eip150Hash) + copy(dAtA[i:], x.Eip150Hash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Eip150Hash))) + i-- + dAtA[i] = 0x2a + } + if len(x.Eip150Block) > 0 { + i -= len(x.Eip150Block) + copy(dAtA[i:], x.Eip150Block) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Eip150Block))) + i-- + dAtA[i] = 0x22 + } + if x.DaoForkSupport { + i-- + if x.DaoForkSupport { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(x.DaoForkBlock) > 0 { + i -= len(x.DaoForkBlock) + copy(dAtA[i:], x.DaoForkBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DaoForkBlock))) + i-- + dAtA[i] = 0x12 + } + if len(x.HomesteadBlock) > 0 { + i -= len(x.HomesteadBlock) + copy(dAtA[i:], x.HomesteadBlock) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.HomesteadBlock))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ChainConfig) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ChainConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ChainConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HomesteadBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.HomesteadBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DaoForkBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.DaoForkBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DaoForkSupport", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.DaoForkSupport = bool(v != 0) + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Eip150Block", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Eip150Block = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Eip150Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Eip150Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Eip155Block", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Eip155Block = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Eip158Block", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Eip158Block = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ByzantiumBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ByzantiumBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ConstantinopleBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ConstantinopleBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PetersburgBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.PetersburgBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IstanbulBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.IstanbulBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MuirGlacierBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.MuirGlacierBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BerlinBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.BerlinBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LondonBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.LondonBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ArrowGlacierBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ArrowGlacierBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 20: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GrayGlacierBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GrayGlacierBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MergeNetsplitBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.MergeNetsplitBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 22: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ShanghaiBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ShanghaiBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CancunBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.CancunBlock = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_State protoreflect.MessageDescriptor + fd_State_key protoreflect.FieldDescriptor + fd_State_value protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_evm_proto_init() + md_State = File_os_evm_v1_evm_proto.Messages().ByName("State") + fd_State_key = md_State.Fields().ByName("key") + fd_State_value = md_State.Fields().ByName("value") +} + +var _ protoreflect.Message = (*fastReflection_State)(nil) + +type fastReflection_State State + +func (x *State) ProtoReflect() protoreflect.Message { + return (*fastReflection_State)(x) +} + +func (x *State) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_evm_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_State_messageType fastReflection_State_messageType +var _ protoreflect.MessageType = fastReflection_State_messageType{} + +type fastReflection_State_messageType struct{} + +func (x fastReflection_State_messageType) Zero() protoreflect.Message { + return (*fastReflection_State)(nil) +} +func (x fastReflection_State_messageType) New() protoreflect.Message { + return new(fastReflection_State) +} +func (x fastReflection_State_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_State +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_State) Descriptor() protoreflect.MessageDescriptor { + return md_State +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_State) Type() protoreflect.MessageType { + return _fastReflection_State_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_State) New() protoreflect.Message { + return new(fastReflection_State) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_State) Interface() protoreflect.ProtoMessage { + return (*State)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_State) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Key != "" { + value := protoreflect.ValueOfString(x.Key) + if !f(fd_State_key, value) { + return + } + } + if x.Value != "" { + value := protoreflect.ValueOfString(x.Value) + if !f(fd_State_value, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_State) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.State.key": + return x.Key != "" + case "os.evm.v1.State.value": + return x.Value != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.State")) + } + panic(fmt.Errorf("message os.evm.v1.State does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_State) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.State.key": + x.Key = "" + case "os.evm.v1.State.value": + x.Value = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.State")) + } + panic(fmt.Errorf("message os.evm.v1.State does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_State) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.State.key": + value := x.Key + return protoreflect.ValueOfString(value) + case "os.evm.v1.State.value": + value := x.Value + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.State")) + } + panic(fmt.Errorf("message os.evm.v1.State does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_State) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.State.key": + x.Key = value.Interface().(string) + case "os.evm.v1.State.value": + x.Value = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.State")) + } + panic(fmt.Errorf("message os.evm.v1.State does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_State) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.State.key": + panic(fmt.Errorf("field key of message os.evm.v1.State is not mutable")) + case "os.evm.v1.State.value": + panic(fmt.Errorf("field value of message os.evm.v1.State is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.State")) + } + panic(fmt.Errorf("message os.evm.v1.State does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_State) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.State.key": + return protoreflect.ValueOfString("") + case "os.evm.v1.State.value": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.State")) + } + panic(fmt.Errorf("message os.evm.v1.State does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_State) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.State", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_State) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_State) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_State) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_State) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*State) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Key) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Value) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*State) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Value) > 0 { + i -= len(x.Value) + copy(dAtA[i:], x.Value) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Value))) + i-- + dAtA[i] = 0x12 + } + if len(x.Key) > 0 { + i -= len(x.Key) + copy(dAtA[i:], x.Key) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Key))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*State) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: State: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: State: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_TransactionLogs_2_list)(nil) + +type _TransactionLogs_2_list struct { + list *[]*Log +} + +func (x *_TransactionLogs_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_TransactionLogs_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_TransactionLogs_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Log) + (*x.list)[i] = concreteValue +} + +func (x *_TransactionLogs_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Log) + *x.list = append(*x.list, concreteValue) +} + +func (x *_TransactionLogs_2_list) AppendMutable() protoreflect.Value { + v := new(Log) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_TransactionLogs_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_TransactionLogs_2_list) NewElement() protoreflect.Value { + v := new(Log) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_TransactionLogs_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_TransactionLogs protoreflect.MessageDescriptor + fd_TransactionLogs_hash protoreflect.FieldDescriptor + fd_TransactionLogs_logs protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_evm_proto_init() + md_TransactionLogs = File_os_evm_v1_evm_proto.Messages().ByName("TransactionLogs") + fd_TransactionLogs_hash = md_TransactionLogs.Fields().ByName("hash") + fd_TransactionLogs_logs = md_TransactionLogs.Fields().ByName("logs") +} + +var _ protoreflect.Message = (*fastReflection_TransactionLogs)(nil) + +type fastReflection_TransactionLogs TransactionLogs + +func (x *TransactionLogs) ProtoReflect() protoreflect.Message { + return (*fastReflection_TransactionLogs)(x) +} + +func (x *TransactionLogs) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_evm_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_TransactionLogs_messageType fastReflection_TransactionLogs_messageType +var _ protoreflect.MessageType = fastReflection_TransactionLogs_messageType{} + +type fastReflection_TransactionLogs_messageType struct{} + +func (x fastReflection_TransactionLogs_messageType) Zero() protoreflect.Message { + return (*fastReflection_TransactionLogs)(nil) +} +func (x fastReflection_TransactionLogs_messageType) New() protoreflect.Message { + return new(fastReflection_TransactionLogs) +} +func (x fastReflection_TransactionLogs_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_TransactionLogs +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_TransactionLogs) Descriptor() protoreflect.MessageDescriptor { + return md_TransactionLogs +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_TransactionLogs) Type() protoreflect.MessageType { + return _fastReflection_TransactionLogs_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_TransactionLogs) New() protoreflect.Message { + return new(fastReflection_TransactionLogs) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_TransactionLogs) Interface() protoreflect.ProtoMessage { + return (*TransactionLogs)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_TransactionLogs) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Hash != "" { + value := protoreflect.ValueOfString(x.Hash) + if !f(fd_TransactionLogs_hash, value) { + return + } + } + if len(x.Logs) != 0 { + value := protoreflect.ValueOfList(&_TransactionLogs_2_list{list: &x.Logs}) + if !f(fd_TransactionLogs_logs, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_TransactionLogs) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.TransactionLogs.hash": + return x.Hash != "" + case "os.evm.v1.TransactionLogs.logs": + return len(x.Logs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TransactionLogs")) + } + panic(fmt.Errorf("message os.evm.v1.TransactionLogs does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TransactionLogs) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.TransactionLogs.hash": + x.Hash = "" + case "os.evm.v1.TransactionLogs.logs": + x.Logs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TransactionLogs")) + } + panic(fmt.Errorf("message os.evm.v1.TransactionLogs does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_TransactionLogs) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.TransactionLogs.hash": + value := x.Hash + return protoreflect.ValueOfString(value) + case "os.evm.v1.TransactionLogs.logs": + if len(x.Logs) == 0 { + return protoreflect.ValueOfList(&_TransactionLogs_2_list{}) + } + listValue := &_TransactionLogs_2_list{list: &x.Logs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TransactionLogs")) + } + panic(fmt.Errorf("message os.evm.v1.TransactionLogs does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TransactionLogs) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.TransactionLogs.hash": + x.Hash = value.Interface().(string) + case "os.evm.v1.TransactionLogs.logs": + lv := value.List() + clv := lv.(*_TransactionLogs_2_list) + x.Logs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TransactionLogs")) + } + panic(fmt.Errorf("message os.evm.v1.TransactionLogs does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TransactionLogs) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.TransactionLogs.logs": + if x.Logs == nil { + x.Logs = []*Log{} + } + value := &_TransactionLogs_2_list{list: &x.Logs} + return protoreflect.ValueOfList(value) + case "os.evm.v1.TransactionLogs.hash": + panic(fmt.Errorf("field hash of message os.evm.v1.TransactionLogs is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TransactionLogs")) + } + panic(fmt.Errorf("message os.evm.v1.TransactionLogs does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_TransactionLogs) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.TransactionLogs.hash": + return protoreflect.ValueOfString("") + case "os.evm.v1.TransactionLogs.logs": + list := []*Log{} + return protoreflect.ValueOfList(&_TransactionLogs_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TransactionLogs")) + } + panic(fmt.Errorf("message os.evm.v1.TransactionLogs does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_TransactionLogs) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.TransactionLogs", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_TransactionLogs) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TransactionLogs) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_TransactionLogs) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_TransactionLogs) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*TransactionLogs) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Hash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Logs) > 0 { + for _, e := range x.Logs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*TransactionLogs) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Logs) > 0 { + for iNdEx := len(x.Logs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Logs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.Hash) > 0 { + i -= len(x.Hash) + copy(dAtA[i:], x.Hash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Hash))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*TransactionLogs) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TransactionLogs: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TransactionLogs: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Logs = append(x.Logs, &Log{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Logs[len(x.Logs)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_Log_2_list)(nil) + +type _Log_2_list struct { + list *[]string +} + +func (x *_Log_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Log_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Log_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Log_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Log_2_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Log at list field Topics as it is not of Message kind")) +} + +func (x *_Log_2_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Log_2_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Log_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Log protoreflect.MessageDescriptor + fd_Log_address protoreflect.FieldDescriptor + fd_Log_topics protoreflect.FieldDescriptor + fd_Log_data protoreflect.FieldDescriptor + fd_Log_block_number protoreflect.FieldDescriptor + fd_Log_tx_hash protoreflect.FieldDescriptor + fd_Log_tx_index protoreflect.FieldDescriptor + fd_Log_block_hash protoreflect.FieldDescriptor + fd_Log_index protoreflect.FieldDescriptor + fd_Log_removed protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_evm_proto_init() + md_Log = File_os_evm_v1_evm_proto.Messages().ByName("Log") + fd_Log_address = md_Log.Fields().ByName("address") + fd_Log_topics = md_Log.Fields().ByName("topics") + fd_Log_data = md_Log.Fields().ByName("data") + fd_Log_block_number = md_Log.Fields().ByName("block_number") + fd_Log_tx_hash = md_Log.Fields().ByName("tx_hash") + fd_Log_tx_index = md_Log.Fields().ByName("tx_index") + fd_Log_block_hash = md_Log.Fields().ByName("block_hash") + fd_Log_index = md_Log.Fields().ByName("index") + fd_Log_removed = md_Log.Fields().ByName("removed") +} + +var _ protoreflect.Message = (*fastReflection_Log)(nil) + +type fastReflection_Log Log + +func (x *Log) ProtoReflect() protoreflect.Message { + return (*fastReflection_Log)(x) +} + +func (x *Log) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_evm_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Log_messageType fastReflection_Log_messageType +var _ protoreflect.MessageType = fastReflection_Log_messageType{} + +type fastReflection_Log_messageType struct{} + +func (x fastReflection_Log_messageType) Zero() protoreflect.Message { + return (*fastReflection_Log)(nil) +} +func (x fastReflection_Log_messageType) New() protoreflect.Message { + return new(fastReflection_Log) +} +func (x fastReflection_Log_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Log +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Log) Descriptor() protoreflect.MessageDescriptor { + return md_Log +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Log) Type() protoreflect.MessageType { + return _fastReflection_Log_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Log) New() protoreflect.Message { + return new(fastReflection_Log) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Log) Interface() protoreflect.ProtoMessage { + return (*Log)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Log) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_Log_address, value) { + return + } + } + if len(x.Topics) != 0 { + value := protoreflect.ValueOfList(&_Log_2_list{list: &x.Topics}) + if !f(fd_Log_topics, value) { + return + } + } + if len(x.Data) != 0 { + value := protoreflect.ValueOfBytes(x.Data) + if !f(fd_Log_data, value) { + return + } + } + if x.BlockNumber != uint64(0) { + value := protoreflect.ValueOfUint64(x.BlockNumber) + if !f(fd_Log_block_number, value) { + return + } + } + if x.TxHash != "" { + value := protoreflect.ValueOfString(x.TxHash) + if !f(fd_Log_tx_hash, value) { + return + } + } + if x.TxIndex != uint64(0) { + value := protoreflect.ValueOfUint64(x.TxIndex) + if !f(fd_Log_tx_index, value) { + return + } + } + if x.BlockHash != "" { + value := protoreflect.ValueOfString(x.BlockHash) + if !f(fd_Log_block_hash, value) { + return + } + } + if x.Index != uint64(0) { + value := protoreflect.ValueOfUint64(x.Index) + if !f(fd_Log_index, value) { + return + } + } + if x.Removed != false { + value := protoreflect.ValueOfBool(x.Removed) + if !f(fd_Log_removed, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Log) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.Log.address": + return x.Address != "" + case "os.evm.v1.Log.topics": + return len(x.Topics) != 0 + case "os.evm.v1.Log.data": + return len(x.Data) != 0 + case "os.evm.v1.Log.block_number": + return x.BlockNumber != uint64(0) + case "os.evm.v1.Log.tx_hash": + return x.TxHash != "" + case "os.evm.v1.Log.tx_index": + return x.TxIndex != uint64(0) + case "os.evm.v1.Log.block_hash": + return x.BlockHash != "" + case "os.evm.v1.Log.index": + return x.Index != uint64(0) + case "os.evm.v1.Log.removed": + return x.Removed != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.Log")) + } + panic(fmt.Errorf("message os.evm.v1.Log does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Log) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.Log.address": + x.Address = "" + case "os.evm.v1.Log.topics": + x.Topics = nil + case "os.evm.v1.Log.data": + x.Data = nil + case "os.evm.v1.Log.block_number": + x.BlockNumber = uint64(0) + case "os.evm.v1.Log.tx_hash": + x.TxHash = "" + case "os.evm.v1.Log.tx_index": + x.TxIndex = uint64(0) + case "os.evm.v1.Log.block_hash": + x.BlockHash = "" + case "os.evm.v1.Log.index": + x.Index = uint64(0) + case "os.evm.v1.Log.removed": + x.Removed = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.Log")) + } + panic(fmt.Errorf("message os.evm.v1.Log does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Log) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.Log.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "os.evm.v1.Log.topics": + if len(x.Topics) == 0 { + return protoreflect.ValueOfList(&_Log_2_list{}) + } + listValue := &_Log_2_list{list: &x.Topics} + return protoreflect.ValueOfList(listValue) + case "os.evm.v1.Log.data": + value := x.Data + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.Log.block_number": + value := x.BlockNumber + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.Log.tx_hash": + value := x.TxHash + return protoreflect.ValueOfString(value) + case "os.evm.v1.Log.tx_index": + value := x.TxIndex + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.Log.block_hash": + value := x.BlockHash + return protoreflect.ValueOfString(value) + case "os.evm.v1.Log.index": + value := x.Index + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.Log.removed": + value := x.Removed + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.Log")) + } + panic(fmt.Errorf("message os.evm.v1.Log does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Log) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.Log.address": + x.Address = value.Interface().(string) + case "os.evm.v1.Log.topics": + lv := value.List() + clv := lv.(*_Log_2_list) + x.Topics = *clv.list + case "os.evm.v1.Log.data": + x.Data = value.Bytes() + case "os.evm.v1.Log.block_number": + x.BlockNumber = value.Uint() + case "os.evm.v1.Log.tx_hash": + x.TxHash = value.Interface().(string) + case "os.evm.v1.Log.tx_index": + x.TxIndex = value.Uint() + case "os.evm.v1.Log.block_hash": + x.BlockHash = value.Interface().(string) + case "os.evm.v1.Log.index": + x.Index = value.Uint() + case "os.evm.v1.Log.removed": + x.Removed = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.Log")) + } + panic(fmt.Errorf("message os.evm.v1.Log does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Log) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.Log.topics": + if x.Topics == nil { + x.Topics = []string{} + } + value := &_Log_2_list{list: &x.Topics} + return protoreflect.ValueOfList(value) + case "os.evm.v1.Log.address": + panic(fmt.Errorf("field address of message os.evm.v1.Log is not mutable")) + case "os.evm.v1.Log.data": + panic(fmt.Errorf("field data of message os.evm.v1.Log is not mutable")) + case "os.evm.v1.Log.block_number": + panic(fmt.Errorf("field block_number of message os.evm.v1.Log is not mutable")) + case "os.evm.v1.Log.tx_hash": + panic(fmt.Errorf("field tx_hash of message os.evm.v1.Log is not mutable")) + case "os.evm.v1.Log.tx_index": + panic(fmt.Errorf("field tx_index of message os.evm.v1.Log is not mutable")) + case "os.evm.v1.Log.block_hash": + panic(fmt.Errorf("field block_hash of message os.evm.v1.Log is not mutable")) + case "os.evm.v1.Log.index": + panic(fmt.Errorf("field index of message os.evm.v1.Log is not mutable")) + case "os.evm.v1.Log.removed": + panic(fmt.Errorf("field removed of message os.evm.v1.Log is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.Log")) + } + panic(fmt.Errorf("message os.evm.v1.Log does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Log) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.Log.address": + return protoreflect.ValueOfString("") + case "os.evm.v1.Log.topics": + list := []string{} + return protoreflect.ValueOfList(&_Log_2_list{list: &list}) + case "os.evm.v1.Log.data": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.Log.block_number": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.Log.tx_hash": + return protoreflect.ValueOfString("") + case "os.evm.v1.Log.tx_index": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.Log.block_hash": + return protoreflect.ValueOfString("") + case "os.evm.v1.Log.index": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.Log.removed": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.Log")) + } + panic(fmt.Errorf("message os.evm.v1.Log does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Log) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.Log", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Log) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Log) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Log) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Log) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Log) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Topics) > 0 { + for _, s := range x.Topics { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.Data) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.BlockNumber != 0 { + n += 1 + runtime.Sov(uint64(x.BlockNumber)) + } + l = len(x.TxHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.TxIndex != 0 { + n += 1 + runtime.Sov(uint64(x.TxIndex)) + } + l = len(x.BlockHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Index != 0 { + n += 1 + runtime.Sov(uint64(x.Index)) + } + if x.Removed { + n += 2 + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Log) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Removed { + i-- + if x.Removed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if x.Index != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Index)) + i-- + dAtA[i] = 0x40 + } + if len(x.BlockHash) > 0 { + i -= len(x.BlockHash) + copy(dAtA[i:], x.BlockHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BlockHash))) + i-- + dAtA[i] = 0x3a + } + if x.TxIndex != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TxIndex)) + i-- + dAtA[i] = 0x30 + } + if len(x.TxHash) > 0 { + i -= len(x.TxHash) + copy(dAtA[i:], x.TxHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TxHash))) + i-- + dAtA[i] = 0x2a + } + if x.BlockNumber != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockNumber)) + i-- + dAtA[i] = 0x20 + } + if len(x.Data) > 0 { + i -= len(x.Data) + copy(dAtA[i:], x.Data) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) + i-- + dAtA[i] = 0x1a + } + if len(x.Topics) > 0 { + for iNdEx := len(x.Topics) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Topics[iNdEx]) + copy(dAtA[i:], x.Topics[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Topics[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Log) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Log: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Log: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Topics", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Topics = append(x.Topics, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) + if x.Data == nil { + x.Data = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockNumber", wireType) + } + x.BlockNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BlockNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.TxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TxIndex", wireType) + } + x.TxIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.TxIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + x.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Removed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Removed = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_TxResult protoreflect.MessageDescriptor + fd_TxResult_contract_address protoreflect.FieldDescriptor + fd_TxResult_bloom protoreflect.FieldDescriptor + fd_TxResult_tx_logs protoreflect.FieldDescriptor + fd_TxResult_ret protoreflect.FieldDescriptor + fd_TxResult_reverted protoreflect.FieldDescriptor + fd_TxResult_gas_used protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_evm_proto_init() + md_TxResult = File_os_evm_v1_evm_proto.Messages().ByName("TxResult") + fd_TxResult_contract_address = md_TxResult.Fields().ByName("contract_address") + fd_TxResult_bloom = md_TxResult.Fields().ByName("bloom") + fd_TxResult_tx_logs = md_TxResult.Fields().ByName("tx_logs") + fd_TxResult_ret = md_TxResult.Fields().ByName("ret") + fd_TxResult_reverted = md_TxResult.Fields().ByName("reverted") + fd_TxResult_gas_used = md_TxResult.Fields().ByName("gas_used") +} + +var _ protoreflect.Message = (*fastReflection_TxResult)(nil) + +type fastReflection_TxResult TxResult + +func (x *TxResult) ProtoReflect() protoreflect.Message { + return (*fastReflection_TxResult)(x) +} + +func (x *TxResult) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_evm_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_TxResult_messageType fastReflection_TxResult_messageType +var _ protoreflect.MessageType = fastReflection_TxResult_messageType{} + +type fastReflection_TxResult_messageType struct{} + +func (x fastReflection_TxResult_messageType) Zero() protoreflect.Message { + return (*fastReflection_TxResult)(nil) +} +func (x fastReflection_TxResult_messageType) New() protoreflect.Message { + return new(fastReflection_TxResult) +} +func (x fastReflection_TxResult_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_TxResult +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_TxResult) Descriptor() protoreflect.MessageDescriptor { + return md_TxResult +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_TxResult) Type() protoreflect.MessageType { + return _fastReflection_TxResult_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_TxResult) New() protoreflect.Message { + return new(fastReflection_TxResult) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_TxResult) Interface() protoreflect.ProtoMessage { + return (*TxResult)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_TxResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ContractAddress != "" { + value := protoreflect.ValueOfString(x.ContractAddress) + if !f(fd_TxResult_contract_address, value) { + return + } + } + if len(x.Bloom) != 0 { + value := protoreflect.ValueOfBytes(x.Bloom) + if !f(fd_TxResult_bloom, value) { + return + } + } + if x.TxLogs != nil { + value := protoreflect.ValueOfMessage(x.TxLogs.ProtoReflect()) + if !f(fd_TxResult_tx_logs, value) { + return + } + } + if len(x.Ret) != 0 { + value := protoreflect.ValueOfBytes(x.Ret) + if !f(fd_TxResult_ret, value) { + return + } + } + if x.Reverted != false { + value := protoreflect.ValueOfBool(x.Reverted) + if !f(fd_TxResult_reverted, value) { + return + } + } + if x.GasUsed != uint64(0) { + value := protoreflect.ValueOfUint64(x.GasUsed) + if !f(fd_TxResult_gas_used, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_TxResult) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.TxResult.contract_address": + return x.ContractAddress != "" + case "os.evm.v1.TxResult.bloom": + return len(x.Bloom) != 0 + case "os.evm.v1.TxResult.tx_logs": + return x.TxLogs != nil + case "os.evm.v1.TxResult.ret": + return len(x.Ret) != 0 + case "os.evm.v1.TxResult.reverted": + return x.Reverted != false + case "os.evm.v1.TxResult.gas_used": + return x.GasUsed != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TxResult")) + } + panic(fmt.Errorf("message os.evm.v1.TxResult does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TxResult) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.TxResult.contract_address": + x.ContractAddress = "" + case "os.evm.v1.TxResult.bloom": + x.Bloom = nil + case "os.evm.v1.TxResult.tx_logs": + x.TxLogs = nil + case "os.evm.v1.TxResult.ret": + x.Ret = nil + case "os.evm.v1.TxResult.reverted": + x.Reverted = false + case "os.evm.v1.TxResult.gas_used": + x.GasUsed = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TxResult")) + } + panic(fmt.Errorf("message os.evm.v1.TxResult does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_TxResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.TxResult.contract_address": + value := x.ContractAddress + return protoreflect.ValueOfString(value) + case "os.evm.v1.TxResult.bloom": + value := x.Bloom + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.TxResult.tx_logs": + value := x.TxLogs + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.evm.v1.TxResult.ret": + value := x.Ret + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.TxResult.reverted": + value := x.Reverted + return protoreflect.ValueOfBool(value) + case "os.evm.v1.TxResult.gas_used": + value := x.GasUsed + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TxResult")) + } + panic(fmt.Errorf("message os.evm.v1.TxResult does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TxResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.TxResult.contract_address": + x.ContractAddress = value.Interface().(string) + case "os.evm.v1.TxResult.bloom": + x.Bloom = value.Bytes() + case "os.evm.v1.TxResult.tx_logs": + x.TxLogs = value.Message().Interface().(*TransactionLogs) + case "os.evm.v1.TxResult.ret": + x.Ret = value.Bytes() + case "os.evm.v1.TxResult.reverted": + x.Reverted = value.Bool() + case "os.evm.v1.TxResult.gas_used": + x.GasUsed = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TxResult")) + } + panic(fmt.Errorf("message os.evm.v1.TxResult does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TxResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.TxResult.tx_logs": + if x.TxLogs == nil { + x.TxLogs = new(TransactionLogs) + } + return protoreflect.ValueOfMessage(x.TxLogs.ProtoReflect()) + case "os.evm.v1.TxResult.contract_address": + panic(fmt.Errorf("field contract_address of message os.evm.v1.TxResult is not mutable")) + case "os.evm.v1.TxResult.bloom": + panic(fmt.Errorf("field bloom of message os.evm.v1.TxResult is not mutable")) + case "os.evm.v1.TxResult.ret": + panic(fmt.Errorf("field ret of message os.evm.v1.TxResult is not mutable")) + case "os.evm.v1.TxResult.reverted": + panic(fmt.Errorf("field reverted of message os.evm.v1.TxResult is not mutable")) + case "os.evm.v1.TxResult.gas_used": + panic(fmt.Errorf("field gas_used of message os.evm.v1.TxResult is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TxResult")) + } + panic(fmt.Errorf("message os.evm.v1.TxResult does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_TxResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.TxResult.contract_address": + return protoreflect.ValueOfString("") + case "os.evm.v1.TxResult.bloom": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.TxResult.tx_logs": + m := new(TransactionLogs) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.evm.v1.TxResult.ret": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.TxResult.reverted": + return protoreflect.ValueOfBool(false) + case "os.evm.v1.TxResult.gas_used": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TxResult")) + } + panic(fmt.Errorf("message os.evm.v1.TxResult does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_TxResult) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.TxResult", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_TxResult) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TxResult) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_TxResult) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_TxResult) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*TxResult) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.ContractAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Bloom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.TxLogs != nil { + l = options.Size(x.TxLogs) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Ret) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Reverted { + n += 2 + } + if x.GasUsed != 0 { + n += 1 + runtime.Sov(uint64(x.GasUsed)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*TxResult) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.GasUsed != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.GasUsed)) + i-- + dAtA[i] = 0x30 + } + if x.Reverted { + i-- + if x.Reverted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(x.Ret) > 0 { + i -= len(x.Ret) + copy(dAtA[i:], x.Ret) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Ret))) + i-- + dAtA[i] = 0x22 + } + if x.TxLogs != nil { + encoded, err := options.Marshal(x.TxLogs) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if len(x.Bloom) > 0 { + i -= len(x.Bloom) + copy(dAtA[i:], x.Bloom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bloom))) + i-- + dAtA[i] = 0x12 + } + if len(x.ContractAddress) > 0 { + i -= len(x.ContractAddress) + copy(dAtA[i:], x.ContractAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ContractAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*TxResult) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TxResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TxResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Bloom", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Bloom = append(x.Bloom[:0], dAtA[iNdEx:postIndex]...) + if x.Bloom == nil { + x.Bloom = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TxLogs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.TxLogs == nil { + x.TxLogs = &TransactionLogs{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TxLogs); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Ret", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Ret = append(x.Ret[:0], dAtA[iNdEx:postIndex]...) + if x.Ret == nil { + x.Ret = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Reverted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Reverted = bool(v != 0) + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) + } + x.GasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.GasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_AccessTuple_2_list)(nil) + +type _AccessTuple_2_list struct { + list *[]string +} + +func (x *_AccessTuple_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_AccessTuple_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_AccessTuple_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_AccessTuple_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_AccessTuple_2_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message AccessTuple at list field StorageKeys as it is not of Message kind")) +} + +func (x *_AccessTuple_2_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_AccessTuple_2_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_AccessTuple_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_AccessTuple protoreflect.MessageDescriptor + fd_AccessTuple_address protoreflect.FieldDescriptor + fd_AccessTuple_storage_keys protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_evm_proto_init() + md_AccessTuple = File_os_evm_v1_evm_proto.Messages().ByName("AccessTuple") + fd_AccessTuple_address = md_AccessTuple.Fields().ByName("address") + fd_AccessTuple_storage_keys = md_AccessTuple.Fields().ByName("storage_keys") +} + +var _ protoreflect.Message = (*fastReflection_AccessTuple)(nil) + +type fastReflection_AccessTuple AccessTuple + +func (x *AccessTuple) ProtoReflect() protoreflect.Message { + return (*fastReflection_AccessTuple)(x) +} + +func (x *AccessTuple) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_evm_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_AccessTuple_messageType fastReflection_AccessTuple_messageType +var _ protoreflect.MessageType = fastReflection_AccessTuple_messageType{} + +type fastReflection_AccessTuple_messageType struct{} + +func (x fastReflection_AccessTuple_messageType) Zero() protoreflect.Message { + return (*fastReflection_AccessTuple)(nil) +} +func (x fastReflection_AccessTuple_messageType) New() protoreflect.Message { + return new(fastReflection_AccessTuple) +} +func (x fastReflection_AccessTuple_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AccessTuple +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AccessTuple) Descriptor() protoreflect.MessageDescriptor { + return md_AccessTuple +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_AccessTuple) Type() protoreflect.MessageType { + return _fastReflection_AccessTuple_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AccessTuple) New() protoreflect.Message { + return new(fastReflection_AccessTuple) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AccessTuple) Interface() protoreflect.ProtoMessage { + return (*AccessTuple)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_AccessTuple) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_AccessTuple_address, value) { + return + } + } + if len(x.StorageKeys) != 0 { + value := protoreflect.ValueOfList(&_AccessTuple_2_list{list: &x.StorageKeys}) + if !f(fd_AccessTuple_storage_keys, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_AccessTuple) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.AccessTuple.address": + return x.Address != "" + case "os.evm.v1.AccessTuple.storage_keys": + return len(x.StorageKeys) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessTuple")) + } + panic(fmt.Errorf("message os.evm.v1.AccessTuple does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessTuple) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.AccessTuple.address": + x.Address = "" + case "os.evm.v1.AccessTuple.storage_keys": + x.StorageKeys = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessTuple")) + } + panic(fmt.Errorf("message os.evm.v1.AccessTuple does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_AccessTuple) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.AccessTuple.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "os.evm.v1.AccessTuple.storage_keys": + if len(x.StorageKeys) == 0 { + return protoreflect.ValueOfList(&_AccessTuple_2_list{}) + } + listValue := &_AccessTuple_2_list{list: &x.StorageKeys} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessTuple")) + } + panic(fmt.Errorf("message os.evm.v1.AccessTuple does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessTuple) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.AccessTuple.address": + x.Address = value.Interface().(string) + case "os.evm.v1.AccessTuple.storage_keys": + lv := value.List() + clv := lv.(*_AccessTuple_2_list) + x.StorageKeys = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessTuple")) + } + panic(fmt.Errorf("message os.evm.v1.AccessTuple does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessTuple) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.AccessTuple.storage_keys": + if x.StorageKeys == nil { + x.StorageKeys = []string{} + } + value := &_AccessTuple_2_list{list: &x.StorageKeys} + return protoreflect.ValueOfList(value) + case "os.evm.v1.AccessTuple.address": + panic(fmt.Errorf("field address of message os.evm.v1.AccessTuple is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessTuple")) + } + panic(fmt.Errorf("message os.evm.v1.AccessTuple does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_AccessTuple) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.AccessTuple.address": + return protoreflect.ValueOfString("") + case "os.evm.v1.AccessTuple.storage_keys": + list := []string{} + return protoreflect.ValueOfList(&_AccessTuple_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessTuple")) + } + panic(fmt.Errorf("message os.evm.v1.AccessTuple does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_AccessTuple) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.AccessTuple", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_AccessTuple) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessTuple) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_AccessTuple) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_AccessTuple) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AccessTuple) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.StorageKeys) > 0 { + for _, s := range x.StorageKeys { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*AccessTuple) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.StorageKeys) > 0 { + for iNdEx := len(x.StorageKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.StorageKeys[iNdEx]) + copy(dAtA[i:], x.StorageKeys[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StorageKeys[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*AccessTuple) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccessTuple: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccessTuple: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StorageKeys", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.StorageKeys = append(x.StorageKeys, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_TraceConfig protoreflect.MessageDescriptor + fd_TraceConfig_tracer protoreflect.FieldDescriptor + fd_TraceConfig_timeout protoreflect.FieldDescriptor + fd_TraceConfig_reexec protoreflect.FieldDescriptor + fd_TraceConfig_disable_stack protoreflect.FieldDescriptor + fd_TraceConfig_disable_storage protoreflect.FieldDescriptor + fd_TraceConfig_debug protoreflect.FieldDescriptor + fd_TraceConfig_limit protoreflect.FieldDescriptor + fd_TraceConfig_overrides protoreflect.FieldDescriptor + fd_TraceConfig_enable_memory protoreflect.FieldDescriptor + fd_TraceConfig_enable_return_data protoreflect.FieldDescriptor + fd_TraceConfig_tracer_json_config protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_evm_proto_init() + md_TraceConfig = File_os_evm_v1_evm_proto.Messages().ByName("TraceConfig") + fd_TraceConfig_tracer = md_TraceConfig.Fields().ByName("tracer") + fd_TraceConfig_timeout = md_TraceConfig.Fields().ByName("timeout") + fd_TraceConfig_reexec = md_TraceConfig.Fields().ByName("reexec") + fd_TraceConfig_disable_stack = md_TraceConfig.Fields().ByName("disable_stack") + fd_TraceConfig_disable_storage = md_TraceConfig.Fields().ByName("disable_storage") + fd_TraceConfig_debug = md_TraceConfig.Fields().ByName("debug") + fd_TraceConfig_limit = md_TraceConfig.Fields().ByName("limit") + fd_TraceConfig_overrides = md_TraceConfig.Fields().ByName("overrides") + fd_TraceConfig_enable_memory = md_TraceConfig.Fields().ByName("enable_memory") + fd_TraceConfig_enable_return_data = md_TraceConfig.Fields().ByName("enable_return_data") + fd_TraceConfig_tracer_json_config = md_TraceConfig.Fields().ByName("tracer_json_config") +} + +var _ protoreflect.Message = (*fastReflection_TraceConfig)(nil) + +type fastReflection_TraceConfig TraceConfig + +func (x *TraceConfig) ProtoReflect() protoreflect.Message { + return (*fastReflection_TraceConfig)(x) +} + +func (x *TraceConfig) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_evm_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_TraceConfig_messageType fastReflection_TraceConfig_messageType +var _ protoreflect.MessageType = fastReflection_TraceConfig_messageType{} + +type fastReflection_TraceConfig_messageType struct{} + +func (x fastReflection_TraceConfig_messageType) Zero() protoreflect.Message { + return (*fastReflection_TraceConfig)(nil) +} +func (x fastReflection_TraceConfig_messageType) New() protoreflect.Message { + return new(fastReflection_TraceConfig) +} +func (x fastReflection_TraceConfig_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_TraceConfig +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_TraceConfig) Descriptor() protoreflect.MessageDescriptor { + return md_TraceConfig +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_TraceConfig) Type() protoreflect.MessageType { + return _fastReflection_TraceConfig_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_TraceConfig) New() protoreflect.Message { + return new(fastReflection_TraceConfig) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_TraceConfig) Interface() protoreflect.ProtoMessage { + return (*TraceConfig)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_TraceConfig) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Tracer != "" { + value := protoreflect.ValueOfString(x.Tracer) + if !f(fd_TraceConfig_tracer, value) { + return + } + } + if x.Timeout != "" { + value := protoreflect.ValueOfString(x.Timeout) + if !f(fd_TraceConfig_timeout, value) { + return + } + } + if x.Reexec != uint64(0) { + value := protoreflect.ValueOfUint64(x.Reexec) + if !f(fd_TraceConfig_reexec, value) { + return + } + } + if x.DisableStack != false { + value := protoreflect.ValueOfBool(x.DisableStack) + if !f(fd_TraceConfig_disable_stack, value) { + return + } + } + if x.DisableStorage != false { + value := protoreflect.ValueOfBool(x.DisableStorage) + if !f(fd_TraceConfig_disable_storage, value) { + return + } + } + if x.Debug != false { + value := protoreflect.ValueOfBool(x.Debug) + if !f(fd_TraceConfig_debug, value) { + return + } + } + if x.Limit != int32(0) { + value := protoreflect.ValueOfInt32(x.Limit) + if !f(fd_TraceConfig_limit, value) { + return + } + } + if x.Overrides != nil { + value := protoreflect.ValueOfMessage(x.Overrides.ProtoReflect()) + if !f(fd_TraceConfig_overrides, value) { + return + } + } + if x.EnableMemory != false { + value := protoreflect.ValueOfBool(x.EnableMemory) + if !f(fd_TraceConfig_enable_memory, value) { + return + } + } + if x.EnableReturnData != false { + value := protoreflect.ValueOfBool(x.EnableReturnData) + if !f(fd_TraceConfig_enable_return_data, value) { + return + } + } + if x.TracerJsonConfig != "" { + value := protoreflect.ValueOfString(x.TracerJsonConfig) + if !f(fd_TraceConfig_tracer_json_config, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_TraceConfig) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.TraceConfig.tracer": + return x.Tracer != "" + case "os.evm.v1.TraceConfig.timeout": + return x.Timeout != "" + case "os.evm.v1.TraceConfig.reexec": + return x.Reexec != uint64(0) + case "os.evm.v1.TraceConfig.disable_stack": + return x.DisableStack != false + case "os.evm.v1.TraceConfig.disable_storage": + return x.DisableStorage != false + case "os.evm.v1.TraceConfig.debug": + return x.Debug != false + case "os.evm.v1.TraceConfig.limit": + return x.Limit != int32(0) + case "os.evm.v1.TraceConfig.overrides": + return x.Overrides != nil + case "os.evm.v1.TraceConfig.enable_memory": + return x.EnableMemory != false + case "os.evm.v1.TraceConfig.enable_return_data": + return x.EnableReturnData != false + case "os.evm.v1.TraceConfig.tracer_json_config": + return x.TracerJsonConfig != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TraceConfig")) + } + panic(fmt.Errorf("message os.evm.v1.TraceConfig does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TraceConfig) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.TraceConfig.tracer": + x.Tracer = "" + case "os.evm.v1.TraceConfig.timeout": + x.Timeout = "" + case "os.evm.v1.TraceConfig.reexec": + x.Reexec = uint64(0) + case "os.evm.v1.TraceConfig.disable_stack": + x.DisableStack = false + case "os.evm.v1.TraceConfig.disable_storage": + x.DisableStorage = false + case "os.evm.v1.TraceConfig.debug": + x.Debug = false + case "os.evm.v1.TraceConfig.limit": + x.Limit = int32(0) + case "os.evm.v1.TraceConfig.overrides": + x.Overrides = nil + case "os.evm.v1.TraceConfig.enable_memory": + x.EnableMemory = false + case "os.evm.v1.TraceConfig.enable_return_data": + x.EnableReturnData = false + case "os.evm.v1.TraceConfig.tracer_json_config": + x.TracerJsonConfig = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TraceConfig")) + } + panic(fmt.Errorf("message os.evm.v1.TraceConfig does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_TraceConfig) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.TraceConfig.tracer": + value := x.Tracer + return protoreflect.ValueOfString(value) + case "os.evm.v1.TraceConfig.timeout": + value := x.Timeout + return protoreflect.ValueOfString(value) + case "os.evm.v1.TraceConfig.reexec": + value := x.Reexec + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.TraceConfig.disable_stack": + value := x.DisableStack + return protoreflect.ValueOfBool(value) + case "os.evm.v1.TraceConfig.disable_storage": + value := x.DisableStorage + return protoreflect.ValueOfBool(value) + case "os.evm.v1.TraceConfig.debug": + value := x.Debug + return protoreflect.ValueOfBool(value) + case "os.evm.v1.TraceConfig.limit": + value := x.Limit + return protoreflect.ValueOfInt32(value) + case "os.evm.v1.TraceConfig.overrides": + value := x.Overrides + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.evm.v1.TraceConfig.enable_memory": + value := x.EnableMemory + return protoreflect.ValueOfBool(value) + case "os.evm.v1.TraceConfig.enable_return_data": + value := x.EnableReturnData + return protoreflect.ValueOfBool(value) + case "os.evm.v1.TraceConfig.tracer_json_config": + value := x.TracerJsonConfig + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TraceConfig")) + } + panic(fmt.Errorf("message os.evm.v1.TraceConfig does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TraceConfig) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.TraceConfig.tracer": + x.Tracer = value.Interface().(string) + case "os.evm.v1.TraceConfig.timeout": + x.Timeout = value.Interface().(string) + case "os.evm.v1.TraceConfig.reexec": + x.Reexec = value.Uint() + case "os.evm.v1.TraceConfig.disable_stack": + x.DisableStack = value.Bool() + case "os.evm.v1.TraceConfig.disable_storage": + x.DisableStorage = value.Bool() + case "os.evm.v1.TraceConfig.debug": + x.Debug = value.Bool() + case "os.evm.v1.TraceConfig.limit": + x.Limit = int32(value.Int()) + case "os.evm.v1.TraceConfig.overrides": + x.Overrides = value.Message().Interface().(*ChainConfig) + case "os.evm.v1.TraceConfig.enable_memory": + x.EnableMemory = value.Bool() + case "os.evm.v1.TraceConfig.enable_return_data": + x.EnableReturnData = value.Bool() + case "os.evm.v1.TraceConfig.tracer_json_config": + x.TracerJsonConfig = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TraceConfig")) + } + panic(fmt.Errorf("message os.evm.v1.TraceConfig does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TraceConfig) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.TraceConfig.overrides": + if x.Overrides == nil { + x.Overrides = new(ChainConfig) + } + return protoreflect.ValueOfMessage(x.Overrides.ProtoReflect()) + case "os.evm.v1.TraceConfig.tracer": + panic(fmt.Errorf("field tracer of message os.evm.v1.TraceConfig is not mutable")) + case "os.evm.v1.TraceConfig.timeout": + panic(fmt.Errorf("field timeout of message os.evm.v1.TraceConfig is not mutable")) + case "os.evm.v1.TraceConfig.reexec": + panic(fmt.Errorf("field reexec of message os.evm.v1.TraceConfig is not mutable")) + case "os.evm.v1.TraceConfig.disable_stack": + panic(fmt.Errorf("field disable_stack of message os.evm.v1.TraceConfig is not mutable")) + case "os.evm.v1.TraceConfig.disable_storage": + panic(fmt.Errorf("field disable_storage of message os.evm.v1.TraceConfig is not mutable")) + case "os.evm.v1.TraceConfig.debug": + panic(fmt.Errorf("field debug of message os.evm.v1.TraceConfig is not mutable")) + case "os.evm.v1.TraceConfig.limit": + panic(fmt.Errorf("field limit of message os.evm.v1.TraceConfig is not mutable")) + case "os.evm.v1.TraceConfig.enable_memory": + panic(fmt.Errorf("field enable_memory of message os.evm.v1.TraceConfig is not mutable")) + case "os.evm.v1.TraceConfig.enable_return_data": + panic(fmt.Errorf("field enable_return_data of message os.evm.v1.TraceConfig is not mutable")) + case "os.evm.v1.TraceConfig.tracer_json_config": + panic(fmt.Errorf("field tracer_json_config of message os.evm.v1.TraceConfig is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TraceConfig")) + } + panic(fmt.Errorf("message os.evm.v1.TraceConfig does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_TraceConfig) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.TraceConfig.tracer": + return protoreflect.ValueOfString("") + case "os.evm.v1.TraceConfig.timeout": + return protoreflect.ValueOfString("") + case "os.evm.v1.TraceConfig.reexec": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.TraceConfig.disable_stack": + return protoreflect.ValueOfBool(false) + case "os.evm.v1.TraceConfig.disable_storage": + return protoreflect.ValueOfBool(false) + case "os.evm.v1.TraceConfig.debug": + return protoreflect.ValueOfBool(false) + case "os.evm.v1.TraceConfig.limit": + return protoreflect.ValueOfInt32(int32(0)) + case "os.evm.v1.TraceConfig.overrides": + m := new(ChainConfig) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.evm.v1.TraceConfig.enable_memory": + return protoreflect.ValueOfBool(false) + case "os.evm.v1.TraceConfig.enable_return_data": + return protoreflect.ValueOfBool(false) + case "os.evm.v1.TraceConfig.tracer_json_config": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.TraceConfig")) + } + panic(fmt.Errorf("message os.evm.v1.TraceConfig does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_TraceConfig) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.TraceConfig", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_TraceConfig) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TraceConfig) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_TraceConfig) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_TraceConfig) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*TraceConfig) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Tracer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Timeout) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Reexec != 0 { + n += 1 + runtime.Sov(uint64(x.Reexec)) + } + if x.DisableStack { + n += 2 + } + if x.DisableStorage { + n += 2 + } + if x.Debug { + n += 2 + } + if x.Limit != 0 { + n += 1 + runtime.Sov(uint64(x.Limit)) + } + if x.Overrides != nil { + l = options.Size(x.Overrides) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.EnableMemory { + n += 2 + } + if x.EnableReturnData { + n += 2 + } + l = len(x.TracerJsonConfig) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*TraceConfig) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.TracerJsonConfig) > 0 { + i -= len(x.TracerJsonConfig) + copy(dAtA[i:], x.TracerJsonConfig) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TracerJsonConfig))) + i-- + dAtA[i] = 0x6a + } + if x.EnableReturnData { + i-- + if x.EnableReturnData { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if x.EnableMemory { + i-- + if x.EnableMemory { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if x.Overrides != nil { + encoded, err := options.Marshal(x.Overrides) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x52 + } + if x.Limit != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Limit)) + i-- + dAtA[i] = 0x48 + } + if x.Debug { + i-- + if x.Debug { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if x.DisableStorage { + i-- + if x.DisableStorage { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if x.DisableStack { + i-- + if x.DisableStack { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if x.Reexec != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Reexec)) + i-- + dAtA[i] = 0x18 + } + if len(x.Timeout) > 0 { + i -= len(x.Timeout) + copy(dAtA[i:], x.Timeout) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Timeout))) + i-- + dAtA[i] = 0x12 + } + if len(x.Tracer) > 0 { + i -= len(x.Tracer) + copy(dAtA[i:], x.Tracer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Tracer))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*TraceConfig) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TraceConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TraceConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tracer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Tracer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Timeout = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Reexec", wireType) + } + x.Reexec = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Reexec |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DisableStack", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.DisableStack = bool(v != 0) + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DisableStorage", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.DisableStorage = bool(v != 0) + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Debug", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Debug = bool(v != 0) + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + x.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Limit |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Overrides", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Overrides == nil { + x.Overrides = &ChainConfig{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Overrides); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 11: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EnableMemory", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.EnableMemory = bool(v != 0) + case 12: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EnableReturnData", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.EnableReturnData = bool(v != 0) + case 13: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TracerJsonConfig", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.TracerJsonConfig = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/evm/v1/evm.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// AccessType defines the types of permissions for the operations +type AccessType int32 + +const ( + // ACCESS_TYPE_PERMISSIONLESS does not restrict the operation to anyone + AccessType_ACCESS_TYPE_PERMISSIONLESS AccessType = 0 + // ACCESS_TYPE_RESTRICTED restrict the operation to anyone + AccessType_ACCESS_TYPE_RESTRICTED AccessType = 1 + // ACCESS_TYPE_PERMISSIONED only allows the operation for specific addresses + AccessType_ACCESS_TYPE_PERMISSIONED AccessType = 2 +) + +// Enum value maps for AccessType. +var ( + AccessType_name = map[int32]string{ + 0: "ACCESS_TYPE_PERMISSIONLESS", + 1: "ACCESS_TYPE_RESTRICTED", + 2: "ACCESS_TYPE_PERMISSIONED", + } + AccessType_value = map[string]int32{ + "ACCESS_TYPE_PERMISSIONLESS": 0, + "ACCESS_TYPE_RESTRICTED": 1, + "ACCESS_TYPE_PERMISSIONED": 2, + } +) + +func (x AccessType) Enum() *AccessType { + p := new(AccessType) + *p = x + return p +} + +func (x AccessType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AccessType) Descriptor() protoreflect.EnumDescriptor { + return file_os_evm_v1_evm_proto_enumTypes[0].Descriptor() +} + +func (AccessType) Type() protoreflect.EnumType { + return &file_os_evm_v1_evm_proto_enumTypes[0] +} + +func (x AccessType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AccessType.Descriptor instead. +func (AccessType) EnumDescriptor() ([]byte, []int) { + return file_os_evm_v1_evm_proto_rawDescGZIP(), []int{0} +} + +// Params defines the EVM module parameters +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // evm_denom represents the token denomination used to run the EVM state + // transitions. + EvmDenom string `protobuf:"bytes,1,opt,name=evm_denom,json=evmDenom,proto3" json:"evm_denom,omitempty"` + // extra_eips defines the additional EIPs for the vm.Config + ExtraEips []string `protobuf:"bytes,4,rep,name=extra_eips,json=extraEips,proto3" json:"extra_eips,omitempty"` + // chain_config defines the EVM chain configuration parameters + ChainConfig *ChainConfig `protobuf:"bytes,5,opt,name=chain_config,json=chainConfig,proto3" json:"chain_config,omitempty"` + // allow_unprotected_txs defines if replay-protected (i.e non EIP155 + // signed) transactions can be executed on the state machine. + AllowUnprotectedTxs bool `protobuf:"varint,6,opt,name=allow_unprotected_txs,json=allowUnprotectedTxs,proto3" json:"allow_unprotected_txs,omitempty"` + // evm_channels is the list of channel identifiers from EVM compatible chains + EvmChannels []string `protobuf:"bytes,8,rep,name=evm_channels,json=evmChannels,proto3" json:"evm_channels,omitempty"` + // access_control defines the permission policy of the EVM + AccessControl *AccessControl `protobuf:"bytes,9,opt,name=access_control,json=accessControl,proto3" json:"access_control,omitempty"` + // active_static_precompiles defines the slice of hex addresses of the + // precompiled contracts that are active + ActiveStaticPrecompiles []string `protobuf:"bytes,10,rep,name=active_static_precompiles,json=activeStaticPrecompiles,proto3" json:"active_static_precompiles,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_evm_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_os_evm_v1_evm_proto_rawDescGZIP(), []int{0} +} + +func (x *Params) GetEvmDenom() string { + if x != nil { + return x.EvmDenom + } + return "" +} + +func (x *Params) GetExtraEips() []string { + if x != nil { + return x.ExtraEips + } + return nil +} + +func (x *Params) GetChainConfig() *ChainConfig { + if x != nil { + return x.ChainConfig + } + return nil +} + +func (x *Params) GetAllowUnprotectedTxs() bool { + if x != nil { + return x.AllowUnprotectedTxs + } + return false +} + +func (x *Params) GetEvmChannels() []string { + if x != nil { + return x.EvmChannels + } + return nil +} + +func (x *Params) GetAccessControl() *AccessControl { + if x != nil { + return x.AccessControl + } + return nil +} + +func (x *Params) GetActiveStaticPrecompiles() []string { + if x != nil { + return x.ActiveStaticPrecompiles + } + return nil +} + +// AccessControl defines the permission policy of the EVM +// for creating and calling contracts +type AccessControl struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // create defines the permission policy for creating contracts + Create *AccessControlType `protobuf:"bytes,1,opt,name=create,proto3" json:"create,omitempty"` + // call defines the permission policy for calling contracts + Call *AccessControlType `protobuf:"bytes,2,opt,name=call,proto3" json:"call,omitempty"` +} + +func (x *AccessControl) Reset() { + *x = AccessControl{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_evm_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccessControl) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccessControl) ProtoMessage() {} + +// Deprecated: Use AccessControl.ProtoReflect.Descriptor instead. +func (*AccessControl) Descriptor() ([]byte, []int) { + return file_os_evm_v1_evm_proto_rawDescGZIP(), []int{1} +} + +func (x *AccessControl) GetCreate() *AccessControlType { + if x != nil { + return x.Create + } + return nil +} + +func (x *AccessControl) GetCall() *AccessControlType { + if x != nil { + return x.Call + } + return nil +} + +// AccessControlType defines the permission type for policies +type AccessControlType struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // access_type defines which type of permission is required for the operation + AccessType AccessType `protobuf:"varint,1,opt,name=access_type,json=accessType,proto3,enum=os.evm.v1.AccessType" json:"access_type,omitempty"` + // access_control_list defines defines different things depending on the + // AccessType: + // - ACCESS_TYPE_PERMISSIONLESS: list of addresses that are blocked from + // performing the operation + // - ACCESS_TYPE_RESTRICTED: ignored + // - ACCESS_TYPE_PERMISSIONED: list of addresses that are allowed to perform + // the operation + AccessControlList []string `protobuf:"bytes,2,rep,name=access_control_list,json=accessControlList,proto3" json:"access_control_list,omitempty"` +} + +func (x *AccessControlType) Reset() { + *x = AccessControlType{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_evm_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccessControlType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccessControlType) ProtoMessage() {} + +// Deprecated: Use AccessControlType.ProtoReflect.Descriptor instead. +func (*AccessControlType) Descriptor() ([]byte, []int) { + return file_os_evm_v1_evm_proto_rawDescGZIP(), []int{2} +} + +func (x *AccessControlType) GetAccessType() AccessType { + if x != nil { + return x.AccessType + } + return AccessType_ACCESS_TYPE_PERMISSIONLESS +} + +func (x *AccessControlType) GetAccessControlList() []string { + if x != nil { + return x.AccessControlList + } + return nil +} + +// ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values +// instead of *big.Int. +type ChainConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // homestead_block switch (nil no fork, 0 = already homestead) + HomesteadBlock string `protobuf:"bytes,1,opt,name=homestead_block,json=homesteadBlock,proto3" json:"homestead_block,omitempty"` + // dao_fork_block corresponds to TheDAO hard-fork switch block (nil no fork) + DaoForkBlock string `protobuf:"bytes,2,opt,name=dao_fork_block,json=daoForkBlock,proto3" json:"dao_fork_block,omitempty"` + // dao_fork_support defines whether the nodes supports or opposes the DAO + // hard-fork + DaoForkSupport bool `protobuf:"varint,3,opt,name=dao_fork_support,json=daoForkSupport,proto3" json:"dao_fork_support,omitempty"` + // eip150_block: EIP150 implements the Gas price changes + // (https://github.com/ethereum/EIPs/issues/150) EIP150 HF block (nil no fork) + Eip150Block string `protobuf:"bytes,4,opt,name=eip150_block,json=eip150Block,proto3" json:"eip150_block,omitempty"` + // eip150_hash: EIP150 HF hash (needed for header only clients as only gas + // pricing changed) + Eip150Hash string `protobuf:"bytes,5,opt,name=eip150_hash,json=eip150Hash,proto3" json:"eip150_hash,omitempty"` + // eip155_block: EIP155Block HF block + Eip155Block string `protobuf:"bytes,6,opt,name=eip155_block,json=eip155Block,proto3" json:"eip155_block,omitempty"` + // eip158_block: EIP158 HF block + Eip158Block string `protobuf:"bytes,7,opt,name=eip158_block,json=eip158Block,proto3" json:"eip158_block,omitempty"` + // byzantium_block: Byzantium switch block (nil no fork, 0 = already on + // byzantium) + ByzantiumBlock string `protobuf:"bytes,8,opt,name=byzantium_block,json=byzantiumBlock,proto3" json:"byzantium_block,omitempty"` + // constantinople_block: Constantinople switch block (nil no fork, 0 = already + // activated) + ConstantinopleBlock string `protobuf:"bytes,9,opt,name=constantinople_block,json=constantinopleBlock,proto3" json:"constantinople_block,omitempty"` + // petersburg_block: Petersburg switch block (nil same as Constantinople) + PetersburgBlock string `protobuf:"bytes,10,opt,name=petersburg_block,json=petersburgBlock,proto3" json:"petersburg_block,omitempty"` + // istanbul_block: Istanbul switch block (nil no fork, 0 = already on + // istanbul) + IstanbulBlock string `protobuf:"bytes,11,opt,name=istanbul_block,json=istanbulBlock,proto3" json:"istanbul_block,omitempty"` + // muir_glacier_block: Eip-2384 (bomb delay) switch block (nil no fork, 0 = + // already activated) + MuirGlacierBlock string `protobuf:"bytes,12,opt,name=muir_glacier_block,json=muirGlacierBlock,proto3" json:"muir_glacier_block,omitempty"` + // berlin_block: Berlin switch block (nil = no fork, 0 = already on berlin) + BerlinBlock string `protobuf:"bytes,13,opt,name=berlin_block,json=berlinBlock,proto3" json:"berlin_block,omitempty"` + // london_block: London switch block (nil = no fork, 0 = already on london) + LondonBlock string `protobuf:"bytes,17,opt,name=london_block,json=londonBlock,proto3" json:"london_block,omitempty"` + // arrow_glacier_block: Eip-4345 (bomb delay) switch block (nil = no fork, 0 = + // already activated) + ArrowGlacierBlock string `protobuf:"bytes,18,opt,name=arrow_glacier_block,json=arrowGlacierBlock,proto3" json:"arrow_glacier_block,omitempty"` + // gray_glacier_block: EIP-5133 (bomb delay) switch block (nil = no fork, 0 = + // already activated) + GrayGlacierBlock string `protobuf:"bytes,20,opt,name=gray_glacier_block,json=grayGlacierBlock,proto3" json:"gray_glacier_block,omitempty"` + // merge_netsplit_block: Virtual fork after The Merge to use as a network + // splitter + MergeNetsplitBlock string `protobuf:"bytes,21,opt,name=merge_netsplit_block,json=mergeNetsplitBlock,proto3" json:"merge_netsplit_block,omitempty"` + // shanghai_block switch block (nil = no fork, 0 = already on shanghai) + ShanghaiBlock string `protobuf:"bytes,22,opt,name=shanghai_block,json=shanghaiBlock,proto3" json:"shanghai_block,omitempty"` + // cancun_block switch block (nil = no fork, 0 = already on cancun) + CancunBlock string `protobuf:"bytes,23,opt,name=cancun_block,json=cancunBlock,proto3" json:"cancun_block,omitempty"` +} + +func (x *ChainConfig) Reset() { + *x = ChainConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_evm_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChainConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChainConfig) ProtoMessage() {} + +// Deprecated: Use ChainConfig.ProtoReflect.Descriptor instead. +func (*ChainConfig) Descriptor() ([]byte, []int) { + return file_os_evm_v1_evm_proto_rawDescGZIP(), []int{3} +} + +func (x *ChainConfig) GetHomesteadBlock() string { + if x != nil { + return x.HomesteadBlock + } + return "" +} + +func (x *ChainConfig) GetDaoForkBlock() string { + if x != nil { + return x.DaoForkBlock + } + return "" +} + +func (x *ChainConfig) GetDaoForkSupport() bool { + if x != nil { + return x.DaoForkSupport + } + return false +} + +func (x *ChainConfig) GetEip150Block() string { + if x != nil { + return x.Eip150Block + } + return "" +} + +func (x *ChainConfig) GetEip150Hash() string { + if x != nil { + return x.Eip150Hash + } + return "" +} + +func (x *ChainConfig) GetEip155Block() string { + if x != nil { + return x.Eip155Block + } + return "" +} + +func (x *ChainConfig) GetEip158Block() string { + if x != nil { + return x.Eip158Block + } + return "" +} + +func (x *ChainConfig) GetByzantiumBlock() string { + if x != nil { + return x.ByzantiumBlock + } + return "" +} + +func (x *ChainConfig) GetConstantinopleBlock() string { + if x != nil { + return x.ConstantinopleBlock + } + return "" +} + +func (x *ChainConfig) GetPetersburgBlock() string { + if x != nil { + return x.PetersburgBlock + } + return "" +} + +func (x *ChainConfig) GetIstanbulBlock() string { + if x != nil { + return x.IstanbulBlock + } + return "" +} + +func (x *ChainConfig) GetMuirGlacierBlock() string { + if x != nil { + return x.MuirGlacierBlock + } + return "" +} + +func (x *ChainConfig) GetBerlinBlock() string { + if x != nil { + return x.BerlinBlock + } + return "" +} + +func (x *ChainConfig) GetLondonBlock() string { + if x != nil { + return x.LondonBlock + } + return "" +} + +func (x *ChainConfig) GetArrowGlacierBlock() string { + if x != nil { + return x.ArrowGlacierBlock + } + return "" +} + +func (x *ChainConfig) GetGrayGlacierBlock() string { + if x != nil { + return x.GrayGlacierBlock + } + return "" +} + +func (x *ChainConfig) GetMergeNetsplitBlock() string { + if x != nil { + return x.MergeNetsplitBlock + } + return "" +} + +func (x *ChainConfig) GetShanghaiBlock() string { + if x != nil { + return x.ShanghaiBlock + } + return "" +} + +func (x *ChainConfig) GetCancunBlock() string { + if x != nil { + return x.CancunBlock + } + return "" +} + +// State represents a single Storage key value pair item. +type State struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // key is the stored key + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // value is the stored value for the given key + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *State) Reset() { + *x = State{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_evm_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *State) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*State) ProtoMessage() {} + +// Deprecated: Use State.ProtoReflect.Descriptor instead. +func (*State) Descriptor() ([]byte, []int) { + return file_os_evm_v1_evm_proto_rawDescGZIP(), []int{4} +} + +func (x *State) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *State) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// TransactionLogs define the logs generated from a transaction execution +// with a given hash. It it used for import/export data as transactions are not +// persisted on blockchain state after an upgrade. +type TransactionLogs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // hash of the transaction + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + // logs is an array of Logs for the given transaction hash + Logs []*Log `protobuf:"bytes,2,rep,name=logs,proto3" json:"logs,omitempty"` +} + +func (x *TransactionLogs) Reset() { + *x = TransactionLogs{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_evm_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionLogs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionLogs) ProtoMessage() {} + +// Deprecated: Use TransactionLogs.ProtoReflect.Descriptor instead. +func (*TransactionLogs) Descriptor() ([]byte, []int) { + return file_os_evm_v1_evm_proto_rawDescGZIP(), []int{5} +} + +func (x *TransactionLogs) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + +func (x *TransactionLogs) GetLogs() []*Log { + if x != nil { + return x.Logs + } + return nil +} + +// Log represents an protobuf compatible Ethereum Log that defines a contract +// log event. These events are generated by the LOG opcode and stored/indexed by +// the node. +// +// NOTE: address, topics and data are consensus fields. The rest of the fields +// are derived, i.e. filled in by the nodes, but not secured by consensus. +type Log struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address of the contract that generated the event + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // topics is a list of topics provided by the contract. + Topics []string `protobuf:"bytes,2,rep,name=topics,proto3" json:"topics,omitempty"` + // data which is supplied by the contract, usually ABI-encoded + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + // block_number of the block in which the transaction was included + BlockNumber uint64 `protobuf:"varint,4,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + // tx_hash is the transaction hash + TxHash string `protobuf:"bytes,5,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` + // tx_index of the transaction in the block + TxIndex uint64 `protobuf:"varint,6,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"` + // block_hash of the block in which the transaction was included + BlockHash string `protobuf:"bytes,7,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // index of the log in the block + Index uint64 `protobuf:"varint,8,opt,name=index,proto3" json:"index,omitempty"` + // removed is true if this log was reverted due to a chain + // reorganisation. You must pay attention to this field if you receive logs + // through a filter query. + Removed bool `protobuf:"varint,9,opt,name=removed,proto3" json:"removed,omitempty"` +} + +func (x *Log) Reset() { + *x = Log{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_evm_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Log) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Log) ProtoMessage() {} + +// Deprecated: Use Log.ProtoReflect.Descriptor instead. +func (*Log) Descriptor() ([]byte, []int) { + return file_os_evm_v1_evm_proto_rawDescGZIP(), []int{6} +} + +func (x *Log) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Log) GetTopics() []string { + if x != nil { + return x.Topics + } + return nil +} + +func (x *Log) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *Log) GetBlockNumber() uint64 { + if x != nil { + return x.BlockNumber + } + return 0 +} + +func (x *Log) GetTxHash() string { + if x != nil { + return x.TxHash + } + return "" +} + +func (x *Log) GetTxIndex() uint64 { + if x != nil { + return x.TxIndex + } + return 0 +} + +func (x *Log) GetBlockHash() string { + if x != nil { + return x.BlockHash + } + return "" +} + +func (x *Log) GetIndex() uint64 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *Log) GetRemoved() bool { + if x != nil { + return x.Removed + } + return false +} + +// TxResult stores results of Tx execution. +type TxResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // contract_address contains the ethereum address of the created contract (if + // any). If the state transition is an evm.Call, the contract address will be + // empty. + ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` + // bloom represents the bloom filter bytes + Bloom []byte `protobuf:"bytes,2,opt,name=bloom,proto3" json:"bloom,omitempty"` + // tx_logs contains the transaction hash and the proto-compatible ethereum + // logs. + TxLogs *TransactionLogs `protobuf:"bytes,3,opt,name=tx_logs,json=txLogs,proto3" json:"tx_logs,omitempty"` + // ret defines the bytes from the execution. + Ret []byte `protobuf:"bytes,4,opt,name=ret,proto3" json:"ret,omitempty"` + // reverted flag is set to true when the call has been reverted + Reverted bool `protobuf:"varint,5,opt,name=reverted,proto3" json:"reverted,omitempty"` + // gas_used notes the amount of gas consumed while execution + GasUsed uint64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` +} + +func (x *TxResult) Reset() { + *x = TxResult{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_evm_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TxResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TxResult) ProtoMessage() {} + +// Deprecated: Use TxResult.ProtoReflect.Descriptor instead. +func (*TxResult) Descriptor() ([]byte, []int) { + return file_os_evm_v1_evm_proto_rawDescGZIP(), []int{7} +} + +func (x *TxResult) GetContractAddress() string { + if x != nil { + return x.ContractAddress + } + return "" +} + +func (x *TxResult) GetBloom() []byte { + if x != nil { + return x.Bloom + } + return nil +} + +func (x *TxResult) GetTxLogs() *TransactionLogs { + if x != nil { + return x.TxLogs + } + return nil +} + +func (x *TxResult) GetRet() []byte { + if x != nil { + return x.Ret + } + return nil +} + +func (x *TxResult) GetReverted() bool { + if x != nil { + return x.Reverted + } + return false +} + +func (x *TxResult) GetGasUsed() uint64 { + if x != nil { + return x.GasUsed + } + return 0 +} + +// AccessTuple is the element type of an access list. +type AccessTuple struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address is a hex formatted ethereum address + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // storage_keys are hex formatted hashes of the storage keys + StorageKeys []string `protobuf:"bytes,2,rep,name=storage_keys,json=storageKeys,proto3" json:"storage_keys,omitempty"` +} + +func (x *AccessTuple) Reset() { + *x = AccessTuple{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_evm_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccessTuple) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccessTuple) ProtoMessage() {} + +// Deprecated: Use AccessTuple.ProtoReflect.Descriptor instead. +func (*AccessTuple) Descriptor() ([]byte, []int) { + return file_os_evm_v1_evm_proto_rawDescGZIP(), []int{8} +} + +func (x *AccessTuple) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *AccessTuple) GetStorageKeys() []string { + if x != nil { + return x.StorageKeys + } + return nil +} + +// TraceConfig holds extra parameters to trace functions. +type TraceConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // tracer is a custom javascript tracer + Tracer string `protobuf:"bytes,1,opt,name=tracer,proto3" json:"tracer,omitempty"` + // timeout overrides the default timeout of 5 seconds for JavaScript-based + // tracing calls + Timeout string `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` + // reexec defines the number of blocks the tracer is willing to go back + Reexec uint64 `protobuf:"varint,3,opt,name=reexec,proto3" json:"reexec,omitempty"` + // disable_stack switches stack capture + DisableStack bool `protobuf:"varint,5,opt,name=disable_stack,json=disableStack,proto3" json:"disable_stack,omitempty"` + // disable_storage switches storage capture + DisableStorage bool `protobuf:"varint,6,opt,name=disable_storage,json=disableStorage,proto3" json:"disable_storage,omitempty"` + // debug can be used to print output during capture end + Debug bool `protobuf:"varint,8,opt,name=debug,proto3" json:"debug,omitempty"` + // limit defines the maximum length of output, but zero means unlimited + Limit int32 `protobuf:"varint,9,opt,name=limit,proto3" json:"limit,omitempty"` + // overrides can be used to execute a trace using future fork rules + Overrides *ChainConfig `protobuf:"bytes,10,opt,name=overrides,proto3" json:"overrides,omitempty"` + // enable_memory switches memory capture + EnableMemory bool `protobuf:"varint,11,opt,name=enable_memory,json=enableMemory,proto3" json:"enable_memory,omitempty"` + // enable_return_data switches the capture of return data + EnableReturnData bool `protobuf:"varint,12,opt,name=enable_return_data,json=enableReturnData,proto3" json:"enable_return_data,omitempty"` + // tracer_json_config configures the tracer using a JSON string + TracerJsonConfig string `protobuf:"bytes,13,opt,name=tracer_json_config,json=tracerJsonConfig,proto3" json:"tracer_json_config,omitempty"` +} + +func (x *TraceConfig) Reset() { + *x = TraceConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_evm_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceConfig) ProtoMessage() {} + +// Deprecated: Use TraceConfig.ProtoReflect.Descriptor instead. +func (*TraceConfig) Descriptor() ([]byte, []int) { + return file_os_evm_v1_evm_proto_rawDescGZIP(), []int{9} +} + +func (x *TraceConfig) GetTracer() string { + if x != nil { + return x.Tracer + } + return "" +} + +func (x *TraceConfig) GetTimeout() string { + if x != nil { + return x.Timeout + } + return "" +} + +func (x *TraceConfig) GetReexec() uint64 { + if x != nil { + return x.Reexec + } + return 0 +} + +func (x *TraceConfig) GetDisableStack() bool { + if x != nil { + return x.DisableStack + } + return false +} + +func (x *TraceConfig) GetDisableStorage() bool { + if x != nil { + return x.DisableStorage + } + return false +} + +func (x *TraceConfig) GetDebug() bool { + if x != nil { + return x.Debug + } + return false +} + +func (x *TraceConfig) GetLimit() int32 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *TraceConfig) GetOverrides() *ChainConfig { + if x != nil { + return x.Overrides + } + return nil +} + +func (x *TraceConfig) GetEnableMemory() bool { + if x != nil { + return x.EnableMemory + } + return false +} + +func (x *TraceConfig) GetEnableReturnData() bool { + if x != nil { + return x.EnableReturnData + } + return false +} + +func (x *TraceConfig) GetTracerJsonConfig() string { + if x != nil { + return x.TracerJsonConfig + } + return "" +} + +var File_os_evm_v1_evm_proto protoreflect.FileDescriptor + +var file_os_evm_v1_evm_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x6d, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, + 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x82, 0x04, 0x0a, 0x06, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x31, 0x0a, 0x09, 0x65, 0x76, 0x6d, 0x5f, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x14, 0xf2, 0xde, 0x1f, 0x10, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x65, 0x76, 0x6d, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x52, 0x08, 0x65, + 0x76, 0x6d, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x41, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, + 0x5f, 0x65, 0x69, 0x70, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x42, 0x22, 0xe2, 0xde, 0x1f, + 0x09, 0x45, 0x78, 0x74, 0x72, 0x61, 0x45, 0x49, 0x50, 0x73, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x65, 0x69, 0x70, 0x73, 0x22, 0x52, + 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x45, 0x69, 0x70, 0x73, 0x12, 0x5b, 0x0a, 0x0c, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x20, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, + 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x6c, 0x6c, 0x6f, 0x77, + 0x5f, 0x75, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x78, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x55, 0x6e, 0x70, + 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x54, 0x78, 0x73, 0x12, 0x32, 0x0a, 0x0c, 0x65, + 0x76, 0x6d, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x09, 0x42, 0x0f, 0xe2, 0xde, 0x1f, 0x0b, 0x45, 0x56, 0x4d, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x73, 0x52, 0x0b, 0x65, 0x76, 0x6d, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, + 0x56, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x42, 0x15, 0xc8, 0xde, 0x1f, 0x00, 0xe2, 0xde, 0x1f, 0x0d, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x3a, 0x0a, 0x19, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x5f, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, + 0x69, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, + 0x6c, 0x65, 0x73, 0x3a, 0x17, 0x8a, 0xe7, 0xb0, 0x2a, 0x12, 0x65, 0x76, 0x6d, 0x6f, 0x73, 0x2f, + 0x78, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x4a, 0x04, 0x08, 0x02, + 0x10, 0x03, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x22, 0x83, + 0x01, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x36, 0x0a, 0x04, + 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x73, 0x2e, + 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, + 0x63, 0x61, 0x6c, 0x6c, 0x22, 0xd6, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x5c, 0x0a, 0x0b, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x15, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x42, 0x24, 0xe2, 0xde, 0x1f, 0x0a, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0xf2, 0xde, 0x1f, 0x12, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x52, 0x0a, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x63, 0x0a, 0x13, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x33, 0xe2, 0xde, 0x1f, 0x11, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0xf2, 0xde, 0x1f, 0x1a, + 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x52, 0x11, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xfd, 0x0e, + 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5c, 0x0a, + 0x0f, 0x68, 0x6f, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, + 0x74, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x68, 0x6f, 0x6d, 0x65, 0x73, + 0x74, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0e, 0x68, 0x6f, 0x6d, + 0x65, 0x73, 0x74, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x68, 0x0a, 0x0e, 0x64, + 0x61, 0x6f, 0x5f, 0x66, 0x6f, 0x72, 0x6b, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x42, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, + 0x1f, 0x0c, 0x44, 0x41, 0x4f, 0x46, 0x6f, 0x72, 0x6b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0xf2, 0xde, + 0x1f, 0x15, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, 0x61, 0x6f, 0x5f, 0x66, 0x6f, 0x72, 0x6b, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0c, 0x64, 0x61, 0x6f, 0x46, 0x6f, 0x72, 0x6b, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x57, 0x0a, 0x10, 0x64, 0x61, 0x6f, 0x5f, 0x66, 0x6f, 0x72, + 0x6b, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, + 0x2d, 0xe2, 0xde, 0x1f, 0x0e, 0x44, 0x41, 0x4f, 0x46, 0x6f, 0x72, 0x6b, 0x53, 0x75, 0x70, 0x70, + 0x6f, 0x72, 0x74, 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, 0x61, 0x6f, + 0x5f, 0x66, 0x6f, 0x72, 0x6b, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x52, 0x0e, + 0x64, 0x61, 0x6f, 0x46, 0x6f, 0x72, 0x6b, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x62, + 0x0a, 0x0c, 0x65, 0x69, 0x70, 0x31, 0x35, 0x30, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x3f, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, + 0xde, 0x1f, 0x0b, 0x45, 0x49, 0x50, 0x31, 0x35, 0x30, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0xf2, 0xde, + 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x65, 0x69, 0x70, 0x31, 0x35, 0x30, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0b, 0x65, 0x69, 0x70, 0x31, 0x35, 0x30, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x49, 0x0a, 0x0b, 0x65, 0x69, 0x70, 0x31, 0x35, 0x30, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x28, 0xe2, 0xde, 0x1f, 0x0a, 0x45, 0x49, 0x50, + 0x31, 0x35, 0x30, 0x48, 0x61, 0x73, 0x68, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, + 0x22, 0x62, 0x79, 0x7a, 0x61, 0x6e, 0x74, 0x69, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x22, 0x52, 0x0a, 0x65, 0x69, 0x70, 0x31, 0x35, 0x30, 0x48, 0x61, 0x73, 0x68, 0x12, 0x62, 0x0a, + 0x0c, 0x65, 0x69, 0x70, 0x31, 0x35, 0x35, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x3f, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, + 0x1f, 0x0b, 0x45, 0x49, 0x50, 0x31, 0x35, 0x35, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0xf2, 0xde, 0x1f, + 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x65, 0x69, 0x70, 0x31, 0x35, 0x35, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0b, 0x65, 0x69, 0x70, 0x31, 0x35, 0x35, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x62, 0x0a, 0x0c, 0x65, 0x69, 0x70, 0x31, 0x35, 0x38, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3f, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, + 0x6e, 0x74, 0xe2, 0xde, 0x1f, 0x0b, 0x45, 0x49, 0x50, 0x31, 0x35, 0x38, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0xf2, 0xde, 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x65, 0x69, 0x70, 0x31, 0x35, + 0x38, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0b, 0x65, 0x69, 0x70, 0x31, 0x35, 0x38, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x5c, 0x0a, 0x0f, 0x62, 0x79, 0x7a, 0x61, 0x6e, 0x74, 0x69, + 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, + 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x62, 0x79, 0x7a, 0x61, 0x6e, 0x74, 0x69, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x22, 0x52, 0x0e, 0x62, 0x79, 0x7a, 0x61, 0x6e, 0x74, 0x69, 0x75, 0x6d, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x6b, 0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, + 0x6e, 0x6f, 0x70, 0x6c, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x38, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x1b, + 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x6e, + 0x6f, 0x70, 0x6c, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x13, 0x63, 0x6f, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x6e, 0x6f, 0x70, 0x6c, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x12, 0x5f, 0x0a, 0x10, 0x70, 0x65, 0x74, 0x65, 0x72, 0x73, 0x62, 0x75, 0x72, 0x67, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0xda, 0xde, 0x1f, 0x15, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x62, 0x75, 0x72, 0x67, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, + 0x52, 0x0f, 0x70, 0x65, 0x74, 0x65, 0x72, 0x73, 0x62, 0x75, 0x72, 0x67, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x59, 0x0a, 0x0e, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xda, 0xde, 0x1f, 0x15, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x15, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x69, 0x73, + 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0d, 0x69, + 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x64, 0x0a, 0x12, + 0x6d, 0x75, 0x69, 0x72, 0x5f, 0x67, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, + 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x19, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x75, 0x69, + 0x72, 0x5f, 0x67, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, + 0x52, 0x10, 0x6d, 0x75, 0x69, 0x72, 0x47, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x53, 0x0a, 0x0c, 0x62, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, + 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x62, 0x65, 0x72, + 0x6c, 0x69, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0b, 0x62, 0x65, 0x72, 0x6c, + 0x69, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x53, 0x0a, 0x0c, 0x6c, 0x6f, 0x6e, 0x64, 0x6f, + 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xda, + 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x6c, 0x6f, 0x6e, 0x64, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, + 0x0b, 0x6c, 0x6f, 0x6e, 0x64, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x67, 0x0a, 0x13, + 0x61, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x67, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x42, 0x37, 0xda, 0xde, 0x1f, 0x15, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x72, + 0x72, 0x6f, 0x77, 0x5f, 0x67, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x22, 0x52, 0x11, 0x61, 0x72, 0x72, 0x6f, 0x77, 0x47, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x64, 0x0a, 0x12, 0x67, 0x72, 0x61, 0x79, 0x5f, 0x67, 0x6c, + 0x61, 0x63, 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x14, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x36, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x19, + 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x67, 0x72, 0x61, 0x79, 0x5f, 0x67, 0x6c, 0x61, 0x63, 0x69, + 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x10, 0x67, 0x72, 0x61, 0x79, 0x47, + 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x6a, 0x0a, 0x14, 0x6d, + 0x65, 0x72, 0x67, 0x65, 0x5f, 0x6e, 0x65, 0x74, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x42, 0x38, 0xda, 0xde, 0x1f, 0x15, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x1b, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x65, + 0x72, 0x67, 0x65, 0x5f, 0x6e, 0x65, 0x74, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x22, 0x52, 0x12, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x4e, 0x65, 0x74, 0x73, 0x70, 0x6c, + 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x59, 0x0a, 0x0e, 0x73, 0x68, 0x61, 0x6e, 0x67, + 0x68, 0x61, 0x69, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x32, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x15, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x22, 0x52, 0x0d, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x53, 0x0a, 0x0c, 0x63, 0x61, 0x6e, 0x63, 0x75, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, + 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x61, 0x6e, + 0x63, 0x75, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0b, 0x63, 0x61, 0x6e, 0x63, + 0x75, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4a, 0x04, 0x08, 0x0e, 0x10, 0x0f, 0x4a, 0x04, 0x08, + 0x0f, 0x10, 0x10, 0x4a, 0x04, 0x08, 0x10, 0x10, 0x11, 0x4a, 0x04, 0x08, 0x13, 0x10, 0x14, 0x52, + 0x0d, 0x79, 0x6f, 0x6c, 0x6f, 0x5f, 0x76, 0x33, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x0b, + 0x65, 0x77, 0x61, 0x73, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x0e, 0x63, 0x61, 0x74, + 0x61, 0x6c, 0x79, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x10, 0x6d, 0x65, 0x72, + 0x67, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6b, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x2f, 0x0a, + 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x49, + 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x22, 0xca, 0x02, 0x0a, 0x03, 0x4c, 0x6f, + 0x67, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x74, + 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x6f, 0x70, + 0x69, 0x63, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0f, 0xea, + 0xde, 0x1f, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x0b, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x07, 0x74, + 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xea, 0xde, + 0x1f, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, + 0x68, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2f, 0x0a, 0x08, 0x74, 0x78, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xea, 0xde, 0x1f, + 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x52, 0x07, 0x74, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2c, 0x0a, 0x0a, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, + 0xea, 0xde, 0x1f, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x22, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x6c, 0x6f, 0x67, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x18, 0x0a, 0x07, + 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x89, 0x02, 0x0a, 0x08, 0x54, 0x78, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x46, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xf2, + 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, + 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x6f, + 0x6d, 0x12, 0x50, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x73, 0x42, 0x1b, + 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x74, 0x78, + 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x74, 0x78, 0x4c, + 0x6f, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x03, 0x72, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x65, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x65, + 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x3a, 0x04, 0x88, 0xa0, + 0x1f, 0x00, 0x22, 0x61, 0x0a, 0x0b, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x75, 0x70, 0x6c, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x32, 0x0a, 0x0c, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4b, 0x65, + 0x79, 0x73, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x3a, + 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x99, 0x04, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x12, 0x18, 0x0a, + 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x65, 0x78, 0x65, + 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x72, 0x65, 0x65, 0x78, 0x65, 0x63, 0x12, + 0x35, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x42, 0x10, 0xea, 0xde, 0x1f, 0x0c, 0x64, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x12, 0x3b, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, + 0x12, 0xea, 0xde, 0x1f, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x34, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, + 0x72, 0x69, 0x64, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, 0x10, 0xea, 0xde, + 0x1f, 0x0c, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x0c, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x12, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x10, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x10, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x3e, 0x0a, 0x12, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xea, 0xde, + 0x1f, 0x0c, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x4a, 0x73, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x52, 0x0e, 0x64, 0x69, + 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x13, 0x64, 0x69, + 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x2a, 0xc0, 0x01, 0x0a, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x3c, 0x0a, 0x1a, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x4c, 0x45, 0x53, 0x53, 0x10, 0x00, + 0x1a, 0x1c, 0x8a, 0x9d, 0x20, 0x18, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, + 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x6c, 0x65, 0x73, 0x73, 0x12, 0x34, + 0x0a, 0x16, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, + 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x18, 0x8a, 0x9d, 0x20, 0x14, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, + 0x63, 0x74, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x18, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x44, + 0x10, 0x02, 0x1a, 0x1a, 0x8a, 0x9d, 0x20, 0x16, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, + 0x70, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x1a, 0x04, + 0x88, 0xa3, 0x1e, 0x00, 0x42, 0x81, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x2e, + 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x45, 0x76, 0x6d, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x65, + 0x76, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x45, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x73, 0x2e, + 0x45, 0x76, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4f, 0x73, 0x3a, + 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_evm_v1_evm_proto_rawDescOnce sync.Once + file_os_evm_v1_evm_proto_rawDescData = file_os_evm_v1_evm_proto_rawDesc +) + +func file_os_evm_v1_evm_proto_rawDescGZIP() []byte { + file_os_evm_v1_evm_proto_rawDescOnce.Do(func() { + file_os_evm_v1_evm_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_evm_v1_evm_proto_rawDescData) + }) + return file_os_evm_v1_evm_proto_rawDescData +} + +var file_os_evm_v1_evm_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_os_evm_v1_evm_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_os_evm_v1_evm_proto_goTypes = []interface{}{ + (AccessType)(0), // 0: os.evm.v1.AccessType + (*Params)(nil), // 1: os.evm.v1.Params + (*AccessControl)(nil), // 2: os.evm.v1.AccessControl + (*AccessControlType)(nil), // 3: os.evm.v1.AccessControlType + (*ChainConfig)(nil), // 4: os.evm.v1.ChainConfig + (*State)(nil), // 5: os.evm.v1.State + (*TransactionLogs)(nil), // 6: os.evm.v1.TransactionLogs + (*Log)(nil), // 7: os.evm.v1.Log + (*TxResult)(nil), // 8: os.evm.v1.TxResult + (*AccessTuple)(nil), // 9: os.evm.v1.AccessTuple + (*TraceConfig)(nil), // 10: os.evm.v1.TraceConfig +} +var file_os_evm_v1_evm_proto_depIdxs = []int32{ + 4, // 0: os.evm.v1.Params.chain_config:type_name -> os.evm.v1.ChainConfig + 2, // 1: os.evm.v1.Params.access_control:type_name -> os.evm.v1.AccessControl + 3, // 2: os.evm.v1.AccessControl.create:type_name -> os.evm.v1.AccessControlType + 3, // 3: os.evm.v1.AccessControl.call:type_name -> os.evm.v1.AccessControlType + 0, // 4: os.evm.v1.AccessControlType.access_type:type_name -> os.evm.v1.AccessType + 7, // 5: os.evm.v1.TransactionLogs.logs:type_name -> os.evm.v1.Log + 6, // 6: os.evm.v1.TxResult.tx_logs:type_name -> os.evm.v1.TransactionLogs + 4, // 7: os.evm.v1.TraceConfig.overrides:type_name -> os.evm.v1.ChainConfig + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_os_evm_v1_evm_proto_init() } +func file_os_evm_v1_evm_proto_init() { + if File_os_evm_v1_evm_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_os_evm_v1_evm_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_evm_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccessControl); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_evm_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccessControlType); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_evm_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChainConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_evm_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*State); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_evm_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransactionLogs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_evm_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Log); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_evm_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_evm_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccessTuple); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_evm_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_evm_v1_evm_proto_rawDesc, + NumEnums: 1, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_evm_v1_evm_proto_goTypes, + DependencyIndexes: file_os_evm_v1_evm_proto_depIdxs, + EnumInfos: file_os_evm_v1_evm_proto_enumTypes, + MessageInfos: file_os_evm_v1_evm_proto_msgTypes, + }.Build() + File_os_evm_v1_evm_proto = out.File + file_os_evm_v1_evm_proto_rawDesc = nil + file_os_evm_v1_evm_proto_goTypes = nil + file_os_evm_v1_evm_proto_depIdxs = nil +} diff --git a/api/os/evm/v1/genesis.pulsar.go b/api/os/evm/v1/genesis.pulsar.go new file mode 100644 index 00000000..bfb580ee --- /dev/null +++ b/api/os/evm/v1/genesis.pulsar.go @@ -0,0 +1,1448 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package evmv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_GenesisState_1_list)(nil) + +type _GenesisState_1_list struct { + list *[]*GenesisAccount +} + +func (x *_GenesisState_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GenesisAccount) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GenesisAccount) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_1_list) AppendMutable() protoreflect.Value { + v := new(GenesisAccount) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_1_list) NewElement() protoreflect.Value { + v := new(GenesisAccount) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_accounts protoreflect.FieldDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_genesis_proto_init() + md_GenesisState = File_os_evm_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_accounts = md_GenesisState.Fields().ByName("accounts") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Accounts) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_1_list{list: &x.Accounts}) + if !f(fd_GenesisState_accounts, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.GenesisState.accounts": + return len(x.Accounts) != 0 + case "os.evm.v1.GenesisState.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.GenesisState")) + } + panic(fmt.Errorf("message os.evm.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.GenesisState.accounts": + x.Accounts = nil + case "os.evm.v1.GenesisState.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.GenesisState")) + } + panic(fmt.Errorf("message os.evm.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.GenesisState.accounts": + if len(x.Accounts) == 0 { + return protoreflect.ValueOfList(&_GenesisState_1_list{}) + } + listValue := &_GenesisState_1_list{list: &x.Accounts} + return protoreflect.ValueOfList(listValue) + case "os.evm.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.GenesisState")) + } + panic(fmt.Errorf("message os.evm.v1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.GenesisState.accounts": + lv := value.List() + clv := lv.(*_GenesisState_1_list) + x.Accounts = *clv.list + case "os.evm.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.GenesisState")) + } + panic(fmt.Errorf("message os.evm.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.GenesisState.accounts": + if x.Accounts == nil { + x.Accounts = []*GenesisAccount{} + } + value := &_GenesisState_1_list{list: &x.Accounts} + return protoreflect.ValueOfList(value) + case "os.evm.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.GenesisState")) + } + panic(fmt.Errorf("message os.evm.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.GenesisState.accounts": + list := []*GenesisAccount{} + return protoreflect.ValueOfList(&_GenesisState_1_list{list: &list}) + case "os.evm.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.GenesisState")) + } + panic(fmt.Errorf("message os.evm.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Accounts) > 0 { + for _, e := range x.Accounts { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Accounts) > 0 { + for iNdEx := len(x.Accounts) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Accounts[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Accounts = append(x.Accounts, &GenesisAccount{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Accounts[len(x.Accounts)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_GenesisAccount_3_list)(nil) + +type _GenesisAccount_3_list struct { + list *[]*State +} + +func (x *_GenesisAccount_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisAccount_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisAccount_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*State) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisAccount_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*State) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisAccount_3_list) AppendMutable() protoreflect.Value { + v := new(State) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisAccount_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisAccount_3_list) NewElement() protoreflect.Value { + v := new(State) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisAccount_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisAccount protoreflect.MessageDescriptor + fd_GenesisAccount_address protoreflect.FieldDescriptor + fd_GenesisAccount_code protoreflect.FieldDescriptor + fd_GenesisAccount_storage protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_genesis_proto_init() + md_GenesisAccount = File_os_evm_v1_genesis_proto.Messages().ByName("GenesisAccount") + fd_GenesisAccount_address = md_GenesisAccount.Fields().ByName("address") + fd_GenesisAccount_code = md_GenesisAccount.Fields().ByName("code") + fd_GenesisAccount_storage = md_GenesisAccount.Fields().ByName("storage") +} + +var _ protoreflect.Message = (*fastReflection_GenesisAccount)(nil) + +type fastReflection_GenesisAccount GenesisAccount + +func (x *GenesisAccount) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisAccount)(x) +} + +func (x *GenesisAccount) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_genesis_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisAccount_messageType fastReflection_GenesisAccount_messageType +var _ protoreflect.MessageType = fastReflection_GenesisAccount_messageType{} + +type fastReflection_GenesisAccount_messageType struct{} + +func (x fastReflection_GenesisAccount_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisAccount)(nil) +} +func (x fastReflection_GenesisAccount_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisAccount) +} +func (x fastReflection_GenesisAccount_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisAccount +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisAccount) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisAccount +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisAccount) Type() protoreflect.MessageType { + return _fastReflection_GenesisAccount_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisAccount) New() protoreflect.Message { + return new(fastReflection_GenesisAccount) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisAccount) Interface() protoreflect.ProtoMessage { + return (*GenesisAccount)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_GenesisAccount_address, value) { + return + } + } + if x.Code != "" { + value := protoreflect.ValueOfString(x.Code) + if !f(fd_GenesisAccount_code, value) { + return + } + } + if len(x.Storage) != 0 { + value := protoreflect.ValueOfList(&_GenesisAccount_3_list{list: &x.Storage}) + if !f(fd_GenesisAccount_storage, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisAccount) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.GenesisAccount.address": + return x.Address != "" + case "os.evm.v1.GenesisAccount.code": + return x.Code != "" + case "os.evm.v1.GenesisAccount.storage": + return len(x.Storage) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.GenesisAccount")) + } + panic(fmt.Errorf("message os.evm.v1.GenesisAccount does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisAccount) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.GenesisAccount.address": + x.Address = "" + case "os.evm.v1.GenesisAccount.code": + x.Code = "" + case "os.evm.v1.GenesisAccount.storage": + x.Storage = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.GenesisAccount")) + } + panic(fmt.Errorf("message os.evm.v1.GenesisAccount does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.GenesisAccount.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "os.evm.v1.GenesisAccount.code": + value := x.Code + return protoreflect.ValueOfString(value) + case "os.evm.v1.GenesisAccount.storage": + if len(x.Storage) == 0 { + return protoreflect.ValueOfList(&_GenesisAccount_3_list{}) + } + listValue := &_GenesisAccount_3_list{list: &x.Storage} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.GenesisAccount")) + } + panic(fmt.Errorf("message os.evm.v1.GenesisAccount does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.GenesisAccount.address": + x.Address = value.Interface().(string) + case "os.evm.v1.GenesisAccount.code": + x.Code = value.Interface().(string) + case "os.evm.v1.GenesisAccount.storage": + lv := value.List() + clv := lv.(*_GenesisAccount_3_list) + x.Storage = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.GenesisAccount")) + } + panic(fmt.Errorf("message os.evm.v1.GenesisAccount does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.GenesisAccount.storage": + if x.Storage == nil { + x.Storage = []*State{} + } + value := &_GenesisAccount_3_list{list: &x.Storage} + return protoreflect.ValueOfList(value) + case "os.evm.v1.GenesisAccount.address": + panic(fmt.Errorf("field address of message os.evm.v1.GenesisAccount is not mutable")) + case "os.evm.v1.GenesisAccount.code": + panic(fmt.Errorf("field code of message os.evm.v1.GenesisAccount is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.GenesisAccount")) + } + panic(fmt.Errorf("message os.evm.v1.GenesisAccount does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.GenesisAccount.address": + return protoreflect.ValueOfString("") + case "os.evm.v1.GenesisAccount.code": + return protoreflect.ValueOfString("") + case "os.evm.v1.GenesisAccount.storage": + list := []*State{} + return protoreflect.ValueOfList(&_GenesisAccount_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.GenesisAccount")) + } + panic(fmt.Errorf("message os.evm.v1.GenesisAccount does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisAccount) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.GenesisAccount", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisAccount) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisAccount) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisAccount) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisAccount) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisAccount) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Code) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Storage) > 0 { + for _, e := range x.Storage { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisAccount) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Storage) > 0 { + for iNdEx := len(x.Storage) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Storage[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.Code) > 0 { + i -= len(x.Code) + copy(dAtA[i:], x.Code) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Code))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisAccount) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Code = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Storage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Storage = append(x.Storage, &State{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Storage[len(x.Storage)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/evm/v1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the evm module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // accounts is an array containing the ethereum genesis accounts. + Accounts []*GenesisAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` + // params defines all the parameters of the module. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_os_evm_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetAccounts() []*GenesisAccount { + if x != nil { + return x.Accounts + } + return nil +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// GenesisAccount defines an account to be initialized in the genesis state. +// Its main difference between with Geth's GenesisAccount is that it uses a +// custom storage type and that it doesn't contain the private key field. +type GenesisAccount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address defines an ethereum hex formated address of an account + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // code defines the hex bytes of the account code. + Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` + // storage defines the set of state key values for the account. + Storage []*State `protobuf:"bytes,3,rep,name=storage,proto3" json:"storage,omitempty"` +} + +func (x *GenesisAccount) Reset() { + *x = GenesisAccount{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_genesis_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisAccount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisAccount) ProtoMessage() {} + +// Deprecated: Use GenesisAccount.ProtoReflect.Descriptor instead. +func (*GenesisAccount) Descriptor() ([]byte, []int) { + return file_os_evm_v1_genesis_proto_rawDescGZIP(), []int{1} +} + +func (x *GenesisAccount) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *GenesisAccount) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *GenesisAccount) GetStorage() []*State { + if x != nil { + return x.Storage + } + return nil +} + +var File_os_evm_v1_genesis_proto protoreflect.FileDescriptor + +var file_os_evm_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x73, 0x2e, 0x65, 0x76, + 0x6d, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x6f, + 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x6d, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x0e, + 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x40, 0x0a, 0x07, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, + 0x14, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x85, + 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, + 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x6d, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x45, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x73, 0x2e, 0x45, 0x76, + 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x15, 0x4f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4f, 0x73, 0x3a, 0x3a, 0x45, + 0x76, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_evm_v1_genesis_proto_rawDescOnce sync.Once + file_os_evm_v1_genesis_proto_rawDescData = file_os_evm_v1_genesis_proto_rawDesc +) + +func file_os_evm_v1_genesis_proto_rawDescGZIP() []byte { + file_os_evm_v1_genesis_proto_rawDescOnce.Do(func() { + file_os_evm_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_evm_v1_genesis_proto_rawDescData) + }) + return file_os_evm_v1_genesis_proto_rawDescData +} + +var file_os_evm_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_os_evm_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: os.evm.v1.GenesisState + (*GenesisAccount)(nil), // 1: os.evm.v1.GenesisAccount + (*Params)(nil), // 2: os.evm.v1.Params + (*State)(nil), // 3: os.evm.v1.State +} +var file_os_evm_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: os.evm.v1.GenesisState.accounts:type_name -> os.evm.v1.GenesisAccount + 2, // 1: os.evm.v1.GenesisState.params:type_name -> os.evm.v1.Params + 3, // 2: os.evm.v1.GenesisAccount.storage:type_name -> os.evm.v1.State + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_os_evm_v1_genesis_proto_init() } +func file_os_evm_v1_genesis_proto_init() { + if File_os_evm_v1_genesis_proto != nil { + return + } + file_os_evm_v1_evm_proto_init() + if !protoimpl.UnsafeEnabled { + file_os_evm_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_genesis_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisAccount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_evm_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_evm_v1_genesis_proto_goTypes, + DependencyIndexes: file_os_evm_v1_genesis_proto_depIdxs, + MessageInfos: file_os_evm_v1_genesis_proto_msgTypes, + }.Build() + File_os_evm_v1_genesis_proto = out.File + file_os_evm_v1_genesis_proto_rawDesc = nil + file_os_evm_v1_genesis_proto_goTypes = nil + file_os_evm_v1_genesis_proto_depIdxs = nil +} diff --git a/api/os/evm/v1/legacy_tx.go b/api/os/evm/v1/legacy_tx.go new file mode 100644 index 00000000..be363f73 --- /dev/null +++ b/api/os/evm/v1/legacy_tx.go @@ -0,0 +1,45 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package evmv1 + +import ( + "math/big" + + ethtypes "github.com/ethereum/go-ethereum/core/types" + ethutils "github.com/evmos/os/utils/eth" +) + +// GetChainID returns the chain id field from the derived signature values +func (tx *LegacyTx) GetChainID() *big.Int { + v, _, _ := tx.GetRawSignatureValues() + return ethutils.DeriveChainID(v) +} + +// AsEthereumData returns an LegacyTx transaction tx from the proto-formatted +// TxData defined on the Cosmos EVM. +func (tx *LegacyTx) AsEthereumData() ethtypes.TxData { + v, r, s := tx.GetRawSignatureValues() + return ðtypes.LegacyTx{ + Nonce: tx.GetNonce(), + GasPrice: stringToBigInt(tx.GetGasPrice()), + Gas: tx.GetGas(), + To: stringToAddress(tx.GetTo()), + Value: stringToBigInt(tx.GetValue()), + Data: tx.GetData(), + V: v, + R: r, + S: s, + } +} + +// GetRawSignatureValues returns the V, R, S signature values of the transaction. +// The return values should not be modified by the caller. +func (tx *LegacyTx) GetRawSignatureValues() (v, r, s *big.Int) { + return ethutils.RawSignatureValues(tx.V, tx.R, tx.S) +} + +// GetAccessList returns nil +func (tx *LegacyTx) GetAccessList() ethtypes.AccessList { + return nil +} diff --git a/api/os/evm/v1/msg.go b/api/os/evm/v1/msg.go new file mode 100644 index 00000000..4fb830cb --- /dev/null +++ b/api/os/evm/v1/msg.go @@ -0,0 +1,56 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package evmv1 + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + protov2 "google.golang.org/protobuf/proto" +) + +// supportedTxs holds the Ethereum transaction types +// supported by Evmos +var supportedTxs = map[string]TxDataV2{ + "/os.evm.v1.DynamicFeeTx": &DynamicFeeTx{}, + "/os.evm.v1.AccessListTx": &AccessListTx{}, + "/os.evm.v1.LegacyTx": &LegacyTx{}, +} + +// getSender extracts the sender address from the signature values using the latest signer for the given chainID. +func getSender(txData TxDataV2) (common.Address, error) { + signer := ethtypes.LatestSignerForChainID(txData.GetChainID()) + from, err := signer.Sender(ethtypes.NewTx(txData.AsEthereumData())) + if err != nil { + return common.Address{}, err + } + return from, nil +} + +// GetSigners is the custom function to get signers on Ethereum transactions +// Gets the signer's address from the Ethereum tx signature +func GetSigners(msg protov2.Message) ([][]byte, error) { + msgEthTx, ok := msg.(*MsgEthereumTx) + if !ok { + return nil, fmt.Errorf("invalid type, expected MsgEthereumTx and got %T", msg) + } + + txData, found := supportedTxs[msgEthTx.Data.TypeUrl] + if !found { + return nil, fmt.Errorf("invalid TypeUrl %s", msgEthTx.Data.TypeUrl) + } + + // msgEthTx.Data is a message (DynamicFeeTx, LegacyTx or AccessListTx) + if err := msgEthTx.Data.UnmarshalTo(txData); err != nil { + return nil, err + } + + sender, err := getSender(txData) + if err != nil { + return nil, err + } + + return [][]byte{sender.Bytes()}, nil +} diff --git a/api/os/evm/v1/query.pulsar.go b/api/os/evm/v1/query.pulsar.go new file mode 100644 index 00000000..df7335da --- /dev/null +++ b/api/os/evm/v1/query.pulsar.go @@ -0,0 +1,13653 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package evmv1 + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryAccountRequest protoreflect.MessageDescriptor + fd_QueryAccountRequest_address protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryAccountRequest = File_os_evm_v1_query_proto.Messages().ByName("QueryAccountRequest") + fd_QueryAccountRequest_address = md_QueryAccountRequest.Fields().ByName("address") +} + +var _ protoreflect.Message = (*fastReflection_QueryAccountRequest)(nil) + +type fastReflection_QueryAccountRequest QueryAccountRequest + +func (x *QueryAccountRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAccountRequest)(x) +} + +func (x *QueryAccountRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryAccountRequest_messageType fastReflection_QueryAccountRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAccountRequest_messageType{} + +type fastReflection_QueryAccountRequest_messageType struct{} + +func (x fastReflection_QueryAccountRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAccountRequest)(nil) +} +func (x fastReflection_QueryAccountRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAccountRequest) +} +func (x fastReflection_QueryAccountRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAccountRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryAccountRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAccountRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAccountRequest) New() protoreflect.Message { + return new(fastReflection_QueryAccountRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAccountRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAccountRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryAccountRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_QueryAccountRequest_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryAccountRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryAccountRequest.address": + return x.Address != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryAccountRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryAccountRequest.address": + x.Address = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryAccountRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryAccountRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryAccountRequest.address": + value := x.Address + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryAccountRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryAccountRequest.address": + x.Address = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryAccountRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryAccountRequest.address": + panic(fmt.Errorf("field address of message os.evm.v1.QueryAccountRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryAccountRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryAccountRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryAccountRequest.address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryAccountRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryAccountRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryAccountRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryAccountRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryAccountRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryAccountRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAccountRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryAccountRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryAccountRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryAccountResponse protoreflect.MessageDescriptor + fd_QueryAccountResponse_balance protoreflect.FieldDescriptor + fd_QueryAccountResponse_code_hash protoreflect.FieldDescriptor + fd_QueryAccountResponse_nonce protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryAccountResponse = File_os_evm_v1_query_proto.Messages().ByName("QueryAccountResponse") + fd_QueryAccountResponse_balance = md_QueryAccountResponse.Fields().ByName("balance") + fd_QueryAccountResponse_code_hash = md_QueryAccountResponse.Fields().ByName("code_hash") + fd_QueryAccountResponse_nonce = md_QueryAccountResponse.Fields().ByName("nonce") +} + +var _ protoreflect.Message = (*fastReflection_QueryAccountResponse)(nil) + +type fastReflection_QueryAccountResponse QueryAccountResponse + +func (x *QueryAccountResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAccountResponse)(x) +} + +func (x *QueryAccountResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryAccountResponse_messageType fastReflection_QueryAccountResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAccountResponse_messageType{} + +type fastReflection_QueryAccountResponse_messageType struct{} + +func (x fastReflection_QueryAccountResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAccountResponse)(nil) +} +func (x fastReflection_QueryAccountResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAccountResponse) +} +func (x fastReflection_QueryAccountResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAccountResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryAccountResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAccountResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAccountResponse) New() protoreflect.Message { + return new(fastReflection_QueryAccountResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAccountResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAccountResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryAccountResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Balance != "" { + value := protoreflect.ValueOfString(x.Balance) + if !f(fd_QueryAccountResponse_balance, value) { + return + } + } + if x.CodeHash != "" { + value := protoreflect.ValueOfString(x.CodeHash) + if !f(fd_QueryAccountResponse_code_hash, value) { + return + } + } + if x.Nonce != uint64(0) { + value := protoreflect.ValueOfUint64(x.Nonce) + if !f(fd_QueryAccountResponse_nonce, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryAccountResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryAccountResponse.balance": + return x.Balance != "" + case "os.evm.v1.QueryAccountResponse.code_hash": + return x.CodeHash != "" + case "os.evm.v1.QueryAccountResponse.nonce": + return x.Nonce != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryAccountResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryAccountResponse.balance": + x.Balance = "" + case "os.evm.v1.QueryAccountResponse.code_hash": + x.CodeHash = "" + case "os.evm.v1.QueryAccountResponse.nonce": + x.Nonce = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryAccountResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryAccountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryAccountResponse.balance": + value := x.Balance + return protoreflect.ValueOfString(value) + case "os.evm.v1.QueryAccountResponse.code_hash": + value := x.CodeHash + return protoreflect.ValueOfString(value) + case "os.evm.v1.QueryAccountResponse.nonce": + value := x.Nonce + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryAccountResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryAccountResponse.balance": + x.Balance = value.Interface().(string) + case "os.evm.v1.QueryAccountResponse.code_hash": + x.CodeHash = value.Interface().(string) + case "os.evm.v1.QueryAccountResponse.nonce": + x.Nonce = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryAccountResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryAccountResponse.balance": + panic(fmt.Errorf("field balance of message os.evm.v1.QueryAccountResponse is not mutable")) + case "os.evm.v1.QueryAccountResponse.code_hash": + panic(fmt.Errorf("field code_hash of message os.evm.v1.QueryAccountResponse is not mutable")) + case "os.evm.v1.QueryAccountResponse.nonce": + panic(fmt.Errorf("field nonce of message os.evm.v1.QueryAccountResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryAccountResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryAccountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryAccountResponse.balance": + return protoreflect.ValueOfString("") + case "os.evm.v1.QueryAccountResponse.code_hash": + return protoreflect.ValueOfString("") + case "os.evm.v1.QueryAccountResponse.nonce": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryAccountResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryAccountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryAccountResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryAccountResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryAccountResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryAccountResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAccountResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Balance) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CodeHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Nonce != 0 { + n += 1 + runtime.Sov(uint64(x.Nonce)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryAccountResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Nonce != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Nonce)) + i-- + dAtA[i] = 0x18 + } + if len(x.CodeHash) > 0 { + i -= len(x.CodeHash) + copy(dAtA[i:], x.CodeHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CodeHash))) + i-- + dAtA[i] = 0x12 + } + if len(x.Balance) > 0 { + i -= len(x.Balance) + copy(dAtA[i:], x.Balance) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Balance))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryAccountResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Balance = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CodeHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.CodeHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + x.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Nonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryCosmosAccountRequest protoreflect.MessageDescriptor + fd_QueryCosmosAccountRequest_address protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryCosmosAccountRequest = File_os_evm_v1_query_proto.Messages().ByName("QueryCosmosAccountRequest") + fd_QueryCosmosAccountRequest_address = md_QueryCosmosAccountRequest.Fields().ByName("address") +} + +var _ protoreflect.Message = (*fastReflection_QueryCosmosAccountRequest)(nil) + +type fastReflection_QueryCosmosAccountRequest QueryCosmosAccountRequest + +func (x *QueryCosmosAccountRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCosmosAccountRequest)(x) +} + +func (x *QueryCosmosAccountRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryCosmosAccountRequest_messageType fastReflection_QueryCosmosAccountRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryCosmosAccountRequest_messageType{} + +type fastReflection_QueryCosmosAccountRequest_messageType struct{} + +func (x fastReflection_QueryCosmosAccountRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCosmosAccountRequest)(nil) +} +func (x fastReflection_QueryCosmosAccountRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCosmosAccountRequest) +} +func (x fastReflection_QueryCosmosAccountRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCosmosAccountRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCosmosAccountRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCosmosAccountRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryCosmosAccountRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryCosmosAccountRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCosmosAccountRequest) New() protoreflect.Message { + return new(fastReflection_QueryCosmosAccountRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCosmosAccountRequest) Interface() protoreflect.ProtoMessage { + return (*QueryCosmosAccountRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryCosmosAccountRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_QueryCosmosAccountRequest_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryCosmosAccountRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryCosmosAccountRequest.address": + return x.Address != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCosmosAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCosmosAccountRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCosmosAccountRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryCosmosAccountRequest.address": + x.Address = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCosmosAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCosmosAccountRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryCosmosAccountRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryCosmosAccountRequest.address": + value := x.Address + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCosmosAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCosmosAccountRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCosmosAccountRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryCosmosAccountRequest.address": + x.Address = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCosmosAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCosmosAccountRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCosmosAccountRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryCosmosAccountRequest.address": + panic(fmt.Errorf("field address of message os.evm.v1.QueryCosmosAccountRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCosmosAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCosmosAccountRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryCosmosAccountRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryCosmosAccountRequest.address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCosmosAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCosmosAccountRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryCosmosAccountRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryCosmosAccountRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryCosmosAccountRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCosmosAccountRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryCosmosAccountRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryCosmosAccountRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCosmosAccountRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryCosmosAccountRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryCosmosAccountRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCosmosAccountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCosmosAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryCosmosAccountResponse protoreflect.MessageDescriptor + fd_QueryCosmosAccountResponse_cosmos_address protoreflect.FieldDescriptor + fd_QueryCosmosAccountResponse_sequence protoreflect.FieldDescriptor + fd_QueryCosmosAccountResponse_account_number protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryCosmosAccountResponse = File_os_evm_v1_query_proto.Messages().ByName("QueryCosmosAccountResponse") + fd_QueryCosmosAccountResponse_cosmos_address = md_QueryCosmosAccountResponse.Fields().ByName("cosmos_address") + fd_QueryCosmosAccountResponse_sequence = md_QueryCosmosAccountResponse.Fields().ByName("sequence") + fd_QueryCosmosAccountResponse_account_number = md_QueryCosmosAccountResponse.Fields().ByName("account_number") +} + +var _ protoreflect.Message = (*fastReflection_QueryCosmosAccountResponse)(nil) + +type fastReflection_QueryCosmosAccountResponse QueryCosmosAccountResponse + +func (x *QueryCosmosAccountResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCosmosAccountResponse)(x) +} + +func (x *QueryCosmosAccountResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryCosmosAccountResponse_messageType fastReflection_QueryCosmosAccountResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryCosmosAccountResponse_messageType{} + +type fastReflection_QueryCosmosAccountResponse_messageType struct{} + +func (x fastReflection_QueryCosmosAccountResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCosmosAccountResponse)(nil) +} +func (x fastReflection_QueryCosmosAccountResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCosmosAccountResponse) +} +func (x fastReflection_QueryCosmosAccountResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCosmosAccountResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCosmosAccountResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCosmosAccountResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryCosmosAccountResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryCosmosAccountResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCosmosAccountResponse) New() protoreflect.Message { + return new(fastReflection_QueryCosmosAccountResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCosmosAccountResponse) Interface() protoreflect.ProtoMessage { + return (*QueryCosmosAccountResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryCosmosAccountResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CosmosAddress != "" { + value := protoreflect.ValueOfString(x.CosmosAddress) + if !f(fd_QueryCosmosAccountResponse_cosmos_address, value) { + return + } + } + if x.Sequence != uint64(0) { + value := protoreflect.ValueOfUint64(x.Sequence) + if !f(fd_QueryCosmosAccountResponse_sequence, value) { + return + } + } + if x.AccountNumber != uint64(0) { + value := protoreflect.ValueOfUint64(x.AccountNumber) + if !f(fd_QueryCosmosAccountResponse_account_number, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryCosmosAccountResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryCosmosAccountResponse.cosmos_address": + return x.CosmosAddress != "" + case "os.evm.v1.QueryCosmosAccountResponse.sequence": + return x.Sequence != uint64(0) + case "os.evm.v1.QueryCosmosAccountResponse.account_number": + return x.AccountNumber != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCosmosAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCosmosAccountResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCosmosAccountResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryCosmosAccountResponse.cosmos_address": + x.CosmosAddress = "" + case "os.evm.v1.QueryCosmosAccountResponse.sequence": + x.Sequence = uint64(0) + case "os.evm.v1.QueryCosmosAccountResponse.account_number": + x.AccountNumber = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCosmosAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCosmosAccountResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryCosmosAccountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryCosmosAccountResponse.cosmos_address": + value := x.CosmosAddress + return protoreflect.ValueOfString(value) + case "os.evm.v1.QueryCosmosAccountResponse.sequence": + value := x.Sequence + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.QueryCosmosAccountResponse.account_number": + value := x.AccountNumber + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCosmosAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCosmosAccountResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCosmosAccountResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryCosmosAccountResponse.cosmos_address": + x.CosmosAddress = value.Interface().(string) + case "os.evm.v1.QueryCosmosAccountResponse.sequence": + x.Sequence = value.Uint() + case "os.evm.v1.QueryCosmosAccountResponse.account_number": + x.AccountNumber = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCosmosAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCosmosAccountResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCosmosAccountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryCosmosAccountResponse.cosmos_address": + panic(fmt.Errorf("field cosmos_address of message os.evm.v1.QueryCosmosAccountResponse is not mutable")) + case "os.evm.v1.QueryCosmosAccountResponse.sequence": + panic(fmt.Errorf("field sequence of message os.evm.v1.QueryCosmosAccountResponse is not mutable")) + case "os.evm.v1.QueryCosmosAccountResponse.account_number": + panic(fmt.Errorf("field account_number of message os.evm.v1.QueryCosmosAccountResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCosmosAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCosmosAccountResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryCosmosAccountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryCosmosAccountResponse.cosmos_address": + return protoreflect.ValueOfString("") + case "os.evm.v1.QueryCosmosAccountResponse.sequence": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.QueryCosmosAccountResponse.account_number": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCosmosAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCosmosAccountResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryCosmosAccountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryCosmosAccountResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryCosmosAccountResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCosmosAccountResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryCosmosAccountResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryCosmosAccountResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCosmosAccountResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.CosmosAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Sequence != 0 { + n += 1 + runtime.Sov(uint64(x.Sequence)) + } + if x.AccountNumber != 0 { + n += 1 + runtime.Sov(uint64(x.AccountNumber)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryCosmosAccountResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.AccountNumber != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AccountNumber)) + i-- + dAtA[i] = 0x18 + } + if x.Sequence != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Sequence)) + i-- + dAtA[i] = 0x10 + } + if len(x.CosmosAddress) > 0 { + i -= len(x.CosmosAddress) + copy(dAtA[i:], x.CosmosAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CosmosAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryCosmosAccountResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCosmosAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCosmosAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CosmosAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.CosmosAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + x.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) + } + x.AccountNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.AccountNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryValidatorAccountRequest protoreflect.MessageDescriptor + fd_QueryValidatorAccountRequest_cons_address protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryValidatorAccountRequest = File_os_evm_v1_query_proto.Messages().ByName("QueryValidatorAccountRequest") + fd_QueryValidatorAccountRequest_cons_address = md_QueryValidatorAccountRequest.Fields().ByName("cons_address") +} + +var _ protoreflect.Message = (*fastReflection_QueryValidatorAccountRequest)(nil) + +type fastReflection_QueryValidatorAccountRequest QueryValidatorAccountRequest + +func (x *QueryValidatorAccountRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryValidatorAccountRequest)(x) +} + +func (x *QueryValidatorAccountRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryValidatorAccountRequest_messageType fastReflection_QueryValidatorAccountRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryValidatorAccountRequest_messageType{} + +type fastReflection_QueryValidatorAccountRequest_messageType struct{} + +func (x fastReflection_QueryValidatorAccountRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryValidatorAccountRequest)(nil) +} +func (x fastReflection_QueryValidatorAccountRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryValidatorAccountRequest) +} +func (x fastReflection_QueryValidatorAccountRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryValidatorAccountRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryValidatorAccountRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryValidatorAccountRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryValidatorAccountRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryValidatorAccountRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryValidatorAccountRequest) New() protoreflect.Message { + return new(fastReflection_QueryValidatorAccountRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryValidatorAccountRequest) Interface() protoreflect.ProtoMessage { + return (*QueryValidatorAccountRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryValidatorAccountRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ConsAddress != "" { + value := protoreflect.ValueOfString(x.ConsAddress) + if !f(fd_QueryValidatorAccountRequest_cons_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryValidatorAccountRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryValidatorAccountRequest.cons_address": + return x.ConsAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryValidatorAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryValidatorAccountRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryValidatorAccountRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryValidatorAccountRequest.cons_address": + x.ConsAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryValidatorAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryValidatorAccountRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryValidatorAccountRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryValidatorAccountRequest.cons_address": + value := x.ConsAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryValidatorAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryValidatorAccountRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryValidatorAccountRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryValidatorAccountRequest.cons_address": + x.ConsAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryValidatorAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryValidatorAccountRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryValidatorAccountRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryValidatorAccountRequest.cons_address": + panic(fmt.Errorf("field cons_address of message os.evm.v1.QueryValidatorAccountRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryValidatorAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryValidatorAccountRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryValidatorAccountRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryValidatorAccountRequest.cons_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryValidatorAccountRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryValidatorAccountRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryValidatorAccountRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryValidatorAccountRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryValidatorAccountRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryValidatorAccountRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryValidatorAccountRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryValidatorAccountRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryValidatorAccountRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.ConsAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryValidatorAccountRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.ConsAddress) > 0 { + i -= len(x.ConsAddress) + copy(dAtA[i:], x.ConsAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ConsAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryValidatorAccountRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryValidatorAccountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryValidatorAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ConsAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ConsAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryValidatorAccountResponse protoreflect.MessageDescriptor + fd_QueryValidatorAccountResponse_account_address protoreflect.FieldDescriptor + fd_QueryValidatorAccountResponse_sequence protoreflect.FieldDescriptor + fd_QueryValidatorAccountResponse_account_number protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryValidatorAccountResponse = File_os_evm_v1_query_proto.Messages().ByName("QueryValidatorAccountResponse") + fd_QueryValidatorAccountResponse_account_address = md_QueryValidatorAccountResponse.Fields().ByName("account_address") + fd_QueryValidatorAccountResponse_sequence = md_QueryValidatorAccountResponse.Fields().ByName("sequence") + fd_QueryValidatorAccountResponse_account_number = md_QueryValidatorAccountResponse.Fields().ByName("account_number") +} + +var _ protoreflect.Message = (*fastReflection_QueryValidatorAccountResponse)(nil) + +type fastReflection_QueryValidatorAccountResponse QueryValidatorAccountResponse + +func (x *QueryValidatorAccountResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryValidatorAccountResponse)(x) +} + +func (x *QueryValidatorAccountResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryValidatorAccountResponse_messageType fastReflection_QueryValidatorAccountResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryValidatorAccountResponse_messageType{} + +type fastReflection_QueryValidatorAccountResponse_messageType struct{} + +func (x fastReflection_QueryValidatorAccountResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryValidatorAccountResponse)(nil) +} +func (x fastReflection_QueryValidatorAccountResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryValidatorAccountResponse) +} +func (x fastReflection_QueryValidatorAccountResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryValidatorAccountResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryValidatorAccountResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryValidatorAccountResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryValidatorAccountResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryValidatorAccountResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryValidatorAccountResponse) New() protoreflect.Message { + return new(fastReflection_QueryValidatorAccountResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryValidatorAccountResponse) Interface() protoreflect.ProtoMessage { + return (*QueryValidatorAccountResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryValidatorAccountResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AccountAddress != "" { + value := protoreflect.ValueOfString(x.AccountAddress) + if !f(fd_QueryValidatorAccountResponse_account_address, value) { + return + } + } + if x.Sequence != uint64(0) { + value := protoreflect.ValueOfUint64(x.Sequence) + if !f(fd_QueryValidatorAccountResponse_sequence, value) { + return + } + } + if x.AccountNumber != uint64(0) { + value := protoreflect.ValueOfUint64(x.AccountNumber) + if !f(fd_QueryValidatorAccountResponse_account_number, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryValidatorAccountResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryValidatorAccountResponse.account_address": + return x.AccountAddress != "" + case "os.evm.v1.QueryValidatorAccountResponse.sequence": + return x.Sequence != uint64(0) + case "os.evm.v1.QueryValidatorAccountResponse.account_number": + return x.AccountNumber != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryValidatorAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryValidatorAccountResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryValidatorAccountResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryValidatorAccountResponse.account_address": + x.AccountAddress = "" + case "os.evm.v1.QueryValidatorAccountResponse.sequence": + x.Sequence = uint64(0) + case "os.evm.v1.QueryValidatorAccountResponse.account_number": + x.AccountNumber = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryValidatorAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryValidatorAccountResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryValidatorAccountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryValidatorAccountResponse.account_address": + value := x.AccountAddress + return protoreflect.ValueOfString(value) + case "os.evm.v1.QueryValidatorAccountResponse.sequence": + value := x.Sequence + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.QueryValidatorAccountResponse.account_number": + value := x.AccountNumber + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryValidatorAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryValidatorAccountResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryValidatorAccountResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryValidatorAccountResponse.account_address": + x.AccountAddress = value.Interface().(string) + case "os.evm.v1.QueryValidatorAccountResponse.sequence": + x.Sequence = value.Uint() + case "os.evm.v1.QueryValidatorAccountResponse.account_number": + x.AccountNumber = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryValidatorAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryValidatorAccountResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryValidatorAccountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryValidatorAccountResponse.account_address": + panic(fmt.Errorf("field account_address of message os.evm.v1.QueryValidatorAccountResponse is not mutable")) + case "os.evm.v1.QueryValidatorAccountResponse.sequence": + panic(fmt.Errorf("field sequence of message os.evm.v1.QueryValidatorAccountResponse is not mutable")) + case "os.evm.v1.QueryValidatorAccountResponse.account_number": + panic(fmt.Errorf("field account_number of message os.evm.v1.QueryValidatorAccountResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryValidatorAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryValidatorAccountResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryValidatorAccountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryValidatorAccountResponse.account_address": + return protoreflect.ValueOfString("") + case "os.evm.v1.QueryValidatorAccountResponse.sequence": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.QueryValidatorAccountResponse.account_number": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryValidatorAccountResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryValidatorAccountResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryValidatorAccountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryValidatorAccountResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryValidatorAccountResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryValidatorAccountResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryValidatorAccountResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryValidatorAccountResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryValidatorAccountResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.AccountAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Sequence != 0 { + n += 1 + runtime.Sov(uint64(x.Sequence)) + } + if x.AccountNumber != 0 { + n += 1 + runtime.Sov(uint64(x.AccountNumber)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryValidatorAccountResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.AccountNumber != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AccountNumber)) + i-- + dAtA[i] = 0x18 + } + if x.Sequence != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Sequence)) + i-- + dAtA[i] = 0x10 + } + if len(x.AccountAddress) > 0 { + i -= len(x.AccountAddress) + copy(dAtA[i:], x.AccountAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AccountAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryValidatorAccountResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryValidatorAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryValidatorAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AccountAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AccountAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + x.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) + } + x.AccountNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.AccountNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryBalanceRequest protoreflect.MessageDescriptor + fd_QueryBalanceRequest_address protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryBalanceRequest = File_os_evm_v1_query_proto.Messages().ByName("QueryBalanceRequest") + fd_QueryBalanceRequest_address = md_QueryBalanceRequest.Fields().ByName("address") +} + +var _ protoreflect.Message = (*fastReflection_QueryBalanceRequest)(nil) + +type fastReflection_QueryBalanceRequest QueryBalanceRequest + +func (x *QueryBalanceRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryBalanceRequest)(x) +} + +func (x *QueryBalanceRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryBalanceRequest_messageType fastReflection_QueryBalanceRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryBalanceRequest_messageType{} + +type fastReflection_QueryBalanceRequest_messageType struct{} + +func (x fastReflection_QueryBalanceRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryBalanceRequest)(nil) +} +func (x fastReflection_QueryBalanceRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryBalanceRequest) +} +func (x fastReflection_QueryBalanceRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBalanceRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryBalanceRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBalanceRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryBalanceRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryBalanceRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryBalanceRequest) New() protoreflect.Message { + return new(fastReflection_QueryBalanceRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryBalanceRequest) Interface() protoreflect.ProtoMessage { + return (*QueryBalanceRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryBalanceRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_QueryBalanceRequest_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryBalanceRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryBalanceRequest.address": + return x.Address != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBalanceRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBalanceRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBalanceRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryBalanceRequest.address": + x.Address = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBalanceRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBalanceRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryBalanceRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryBalanceRequest.address": + value := x.Address + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBalanceRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBalanceRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBalanceRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryBalanceRequest.address": + x.Address = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBalanceRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBalanceRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBalanceRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryBalanceRequest.address": + panic(fmt.Errorf("field address of message os.evm.v1.QueryBalanceRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBalanceRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBalanceRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryBalanceRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryBalanceRequest.address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBalanceRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBalanceRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryBalanceRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryBalanceRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryBalanceRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBalanceRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryBalanceRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryBalanceRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryBalanceRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryBalanceRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryBalanceRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBalanceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBalanceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryBalanceResponse protoreflect.MessageDescriptor + fd_QueryBalanceResponse_balance protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryBalanceResponse = File_os_evm_v1_query_proto.Messages().ByName("QueryBalanceResponse") + fd_QueryBalanceResponse_balance = md_QueryBalanceResponse.Fields().ByName("balance") +} + +var _ protoreflect.Message = (*fastReflection_QueryBalanceResponse)(nil) + +type fastReflection_QueryBalanceResponse QueryBalanceResponse + +func (x *QueryBalanceResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryBalanceResponse)(x) +} + +func (x *QueryBalanceResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryBalanceResponse_messageType fastReflection_QueryBalanceResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryBalanceResponse_messageType{} + +type fastReflection_QueryBalanceResponse_messageType struct{} + +func (x fastReflection_QueryBalanceResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryBalanceResponse)(nil) +} +func (x fastReflection_QueryBalanceResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryBalanceResponse) +} +func (x fastReflection_QueryBalanceResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBalanceResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryBalanceResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBalanceResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryBalanceResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryBalanceResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryBalanceResponse) New() protoreflect.Message { + return new(fastReflection_QueryBalanceResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryBalanceResponse) Interface() protoreflect.ProtoMessage { + return (*QueryBalanceResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryBalanceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Balance != "" { + value := protoreflect.ValueOfString(x.Balance) + if !f(fd_QueryBalanceResponse_balance, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryBalanceResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryBalanceResponse.balance": + return x.Balance != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBalanceResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBalanceResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBalanceResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryBalanceResponse.balance": + x.Balance = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBalanceResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBalanceResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryBalanceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryBalanceResponse.balance": + value := x.Balance + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBalanceResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBalanceResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBalanceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryBalanceResponse.balance": + x.Balance = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBalanceResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBalanceResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBalanceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryBalanceResponse.balance": + panic(fmt.Errorf("field balance of message os.evm.v1.QueryBalanceResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBalanceResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBalanceResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryBalanceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryBalanceResponse.balance": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBalanceResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBalanceResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryBalanceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryBalanceResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryBalanceResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBalanceResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryBalanceResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryBalanceResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryBalanceResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Balance) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryBalanceResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Balance) > 0 { + i -= len(x.Balance) + copy(dAtA[i:], x.Balance) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Balance))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryBalanceResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBalanceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBalanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Balance = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryStorageRequest protoreflect.MessageDescriptor + fd_QueryStorageRequest_address protoreflect.FieldDescriptor + fd_QueryStorageRequest_key protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryStorageRequest = File_os_evm_v1_query_proto.Messages().ByName("QueryStorageRequest") + fd_QueryStorageRequest_address = md_QueryStorageRequest.Fields().ByName("address") + fd_QueryStorageRequest_key = md_QueryStorageRequest.Fields().ByName("key") +} + +var _ protoreflect.Message = (*fastReflection_QueryStorageRequest)(nil) + +type fastReflection_QueryStorageRequest QueryStorageRequest + +func (x *QueryStorageRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryStorageRequest)(x) +} + +func (x *QueryStorageRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryStorageRequest_messageType fastReflection_QueryStorageRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryStorageRequest_messageType{} + +type fastReflection_QueryStorageRequest_messageType struct{} + +func (x fastReflection_QueryStorageRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryStorageRequest)(nil) +} +func (x fastReflection_QueryStorageRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryStorageRequest) +} +func (x fastReflection_QueryStorageRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryStorageRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryStorageRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryStorageRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryStorageRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryStorageRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryStorageRequest) New() protoreflect.Message { + return new(fastReflection_QueryStorageRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryStorageRequest) Interface() protoreflect.ProtoMessage { + return (*QueryStorageRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryStorageRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_QueryStorageRequest_address, value) { + return + } + } + if x.Key != "" { + value := protoreflect.ValueOfString(x.Key) + if !f(fd_QueryStorageRequest_key, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryStorageRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryStorageRequest.address": + return x.Address != "" + case "os.evm.v1.QueryStorageRequest.key": + return x.Key != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryStorageRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryStorageRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryStorageRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryStorageRequest.address": + x.Address = "" + case "os.evm.v1.QueryStorageRequest.key": + x.Key = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryStorageRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryStorageRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryStorageRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryStorageRequest.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "os.evm.v1.QueryStorageRequest.key": + value := x.Key + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryStorageRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryStorageRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryStorageRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryStorageRequest.address": + x.Address = value.Interface().(string) + case "os.evm.v1.QueryStorageRequest.key": + x.Key = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryStorageRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryStorageRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryStorageRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryStorageRequest.address": + panic(fmt.Errorf("field address of message os.evm.v1.QueryStorageRequest is not mutable")) + case "os.evm.v1.QueryStorageRequest.key": + panic(fmt.Errorf("field key of message os.evm.v1.QueryStorageRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryStorageRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryStorageRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryStorageRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryStorageRequest.address": + return protoreflect.ValueOfString("") + case "os.evm.v1.QueryStorageRequest.key": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryStorageRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryStorageRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryStorageRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryStorageRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryStorageRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryStorageRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryStorageRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryStorageRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryStorageRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Key) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryStorageRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Key) > 0 { + i -= len(x.Key) + copy(dAtA[i:], x.Key) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Key))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryStorageRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryStorageRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryStorageRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryStorageResponse protoreflect.MessageDescriptor + fd_QueryStorageResponse_value protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryStorageResponse = File_os_evm_v1_query_proto.Messages().ByName("QueryStorageResponse") + fd_QueryStorageResponse_value = md_QueryStorageResponse.Fields().ByName("value") +} + +var _ protoreflect.Message = (*fastReflection_QueryStorageResponse)(nil) + +type fastReflection_QueryStorageResponse QueryStorageResponse + +func (x *QueryStorageResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryStorageResponse)(x) +} + +func (x *QueryStorageResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryStorageResponse_messageType fastReflection_QueryStorageResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryStorageResponse_messageType{} + +type fastReflection_QueryStorageResponse_messageType struct{} + +func (x fastReflection_QueryStorageResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryStorageResponse)(nil) +} +func (x fastReflection_QueryStorageResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryStorageResponse) +} +func (x fastReflection_QueryStorageResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryStorageResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryStorageResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryStorageResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryStorageResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryStorageResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryStorageResponse) New() protoreflect.Message { + return new(fastReflection_QueryStorageResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryStorageResponse) Interface() protoreflect.ProtoMessage { + return (*QueryStorageResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryStorageResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Value != "" { + value := protoreflect.ValueOfString(x.Value) + if !f(fd_QueryStorageResponse_value, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryStorageResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryStorageResponse.value": + return x.Value != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryStorageResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryStorageResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryStorageResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryStorageResponse.value": + x.Value = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryStorageResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryStorageResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryStorageResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryStorageResponse.value": + value := x.Value + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryStorageResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryStorageResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryStorageResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryStorageResponse.value": + x.Value = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryStorageResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryStorageResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryStorageResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryStorageResponse.value": + panic(fmt.Errorf("field value of message os.evm.v1.QueryStorageResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryStorageResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryStorageResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryStorageResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryStorageResponse.value": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryStorageResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryStorageResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryStorageResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryStorageResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryStorageResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryStorageResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryStorageResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryStorageResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryStorageResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Value) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryStorageResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Value) > 0 { + i -= len(x.Value) + copy(dAtA[i:], x.Value) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Value))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryStorageResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryStorageResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryStorageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryCodeRequest protoreflect.MessageDescriptor + fd_QueryCodeRequest_address protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryCodeRequest = File_os_evm_v1_query_proto.Messages().ByName("QueryCodeRequest") + fd_QueryCodeRequest_address = md_QueryCodeRequest.Fields().ByName("address") +} + +var _ protoreflect.Message = (*fastReflection_QueryCodeRequest)(nil) + +type fastReflection_QueryCodeRequest QueryCodeRequest + +func (x *QueryCodeRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCodeRequest)(x) +} + +func (x *QueryCodeRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryCodeRequest_messageType fastReflection_QueryCodeRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryCodeRequest_messageType{} + +type fastReflection_QueryCodeRequest_messageType struct{} + +func (x fastReflection_QueryCodeRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCodeRequest)(nil) +} +func (x fastReflection_QueryCodeRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCodeRequest) +} +func (x fastReflection_QueryCodeRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCodeRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCodeRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCodeRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryCodeRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryCodeRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCodeRequest) New() protoreflect.Message { + return new(fastReflection_QueryCodeRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCodeRequest) Interface() protoreflect.ProtoMessage { + return (*QueryCodeRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryCodeRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_QueryCodeRequest_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryCodeRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryCodeRequest.address": + return x.Address != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCodeRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCodeRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCodeRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryCodeRequest.address": + x.Address = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCodeRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCodeRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryCodeRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryCodeRequest.address": + value := x.Address + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCodeRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCodeRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCodeRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryCodeRequest.address": + x.Address = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCodeRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCodeRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCodeRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryCodeRequest.address": + panic(fmt.Errorf("field address of message os.evm.v1.QueryCodeRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCodeRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCodeRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryCodeRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryCodeRequest.address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCodeRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCodeRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryCodeRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryCodeRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryCodeRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCodeRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryCodeRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryCodeRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCodeRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryCodeRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryCodeRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCodeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCodeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryCodeResponse protoreflect.MessageDescriptor + fd_QueryCodeResponse_code protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryCodeResponse = File_os_evm_v1_query_proto.Messages().ByName("QueryCodeResponse") + fd_QueryCodeResponse_code = md_QueryCodeResponse.Fields().ByName("code") +} + +var _ protoreflect.Message = (*fastReflection_QueryCodeResponse)(nil) + +type fastReflection_QueryCodeResponse QueryCodeResponse + +func (x *QueryCodeResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCodeResponse)(x) +} + +func (x *QueryCodeResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryCodeResponse_messageType fastReflection_QueryCodeResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryCodeResponse_messageType{} + +type fastReflection_QueryCodeResponse_messageType struct{} + +func (x fastReflection_QueryCodeResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCodeResponse)(nil) +} +func (x fastReflection_QueryCodeResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCodeResponse) +} +func (x fastReflection_QueryCodeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCodeResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCodeResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCodeResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryCodeResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryCodeResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCodeResponse) New() protoreflect.Message { + return new(fastReflection_QueryCodeResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCodeResponse) Interface() protoreflect.ProtoMessage { + return (*QueryCodeResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryCodeResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Code) != 0 { + value := protoreflect.ValueOfBytes(x.Code) + if !f(fd_QueryCodeResponse_code, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryCodeResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryCodeResponse.code": + return len(x.Code) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCodeResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCodeResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCodeResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryCodeResponse.code": + x.Code = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCodeResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCodeResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryCodeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryCodeResponse.code": + value := x.Code + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCodeResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCodeResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCodeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryCodeResponse.code": + x.Code = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCodeResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCodeResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCodeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryCodeResponse.code": + panic(fmt.Errorf("field code of message os.evm.v1.QueryCodeResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCodeResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCodeResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryCodeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryCodeResponse.code": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryCodeResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryCodeResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryCodeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryCodeResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryCodeResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCodeResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryCodeResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryCodeResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCodeResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Code) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryCodeResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Code) > 0 { + i -= len(x.Code) + copy(dAtA[i:], x.Code) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Code))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryCodeResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCodeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCodeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Code = append(x.Code[:0], dAtA[iNdEx:postIndex]...) + if x.Code == nil { + x.Code = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryTxLogsRequest protoreflect.MessageDescriptor + fd_QueryTxLogsRequest_hash protoreflect.FieldDescriptor + fd_QueryTxLogsRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryTxLogsRequest = File_os_evm_v1_query_proto.Messages().ByName("QueryTxLogsRequest") + fd_QueryTxLogsRequest_hash = md_QueryTxLogsRequest.Fields().ByName("hash") + fd_QueryTxLogsRequest_pagination = md_QueryTxLogsRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryTxLogsRequest)(nil) + +type fastReflection_QueryTxLogsRequest QueryTxLogsRequest + +func (x *QueryTxLogsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryTxLogsRequest)(x) +} + +func (x *QueryTxLogsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryTxLogsRequest_messageType fastReflection_QueryTxLogsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryTxLogsRequest_messageType{} + +type fastReflection_QueryTxLogsRequest_messageType struct{} + +func (x fastReflection_QueryTxLogsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryTxLogsRequest)(nil) +} +func (x fastReflection_QueryTxLogsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryTxLogsRequest) +} +func (x fastReflection_QueryTxLogsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTxLogsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryTxLogsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTxLogsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryTxLogsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryTxLogsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryTxLogsRequest) New() protoreflect.Message { + return new(fastReflection_QueryTxLogsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryTxLogsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryTxLogsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryTxLogsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Hash != "" { + value := protoreflect.ValueOfString(x.Hash) + if !f(fd_QueryTxLogsRequest_hash, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryTxLogsRequest_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryTxLogsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryTxLogsRequest.hash": + return x.Hash != "" + case "os.evm.v1.QueryTxLogsRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTxLogsRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTxLogsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTxLogsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryTxLogsRequest.hash": + x.Hash = "" + case "os.evm.v1.QueryTxLogsRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTxLogsRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTxLogsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryTxLogsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryTxLogsRequest.hash": + value := x.Hash + return protoreflect.ValueOfString(value) + case "os.evm.v1.QueryTxLogsRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTxLogsRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTxLogsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTxLogsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryTxLogsRequest.hash": + x.Hash = value.Interface().(string) + case "os.evm.v1.QueryTxLogsRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTxLogsRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTxLogsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTxLogsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryTxLogsRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + case "os.evm.v1.QueryTxLogsRequest.hash": + panic(fmt.Errorf("field hash of message os.evm.v1.QueryTxLogsRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTxLogsRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTxLogsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryTxLogsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryTxLogsRequest.hash": + return protoreflect.ValueOfString("") + case "os.evm.v1.QueryTxLogsRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTxLogsRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTxLogsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryTxLogsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryTxLogsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryTxLogsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTxLogsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryTxLogsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryTxLogsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryTxLogsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Hash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryTxLogsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Hash) > 0 { + i -= len(x.Hash) + copy(dAtA[i:], x.Hash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Hash))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryTxLogsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTxLogsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTxLogsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryTxLogsResponse_1_list)(nil) + +type _QueryTxLogsResponse_1_list struct { + list *[]*Log +} + +func (x *_QueryTxLogsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryTxLogsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryTxLogsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Log) + (*x.list)[i] = concreteValue +} + +func (x *_QueryTxLogsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Log) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryTxLogsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Log) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryTxLogsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryTxLogsResponse_1_list) NewElement() protoreflect.Value { + v := new(Log) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryTxLogsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryTxLogsResponse protoreflect.MessageDescriptor + fd_QueryTxLogsResponse_logs protoreflect.FieldDescriptor + fd_QueryTxLogsResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryTxLogsResponse = File_os_evm_v1_query_proto.Messages().ByName("QueryTxLogsResponse") + fd_QueryTxLogsResponse_logs = md_QueryTxLogsResponse.Fields().ByName("logs") + fd_QueryTxLogsResponse_pagination = md_QueryTxLogsResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryTxLogsResponse)(nil) + +type fastReflection_QueryTxLogsResponse QueryTxLogsResponse + +func (x *QueryTxLogsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryTxLogsResponse)(x) +} + +func (x *QueryTxLogsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryTxLogsResponse_messageType fastReflection_QueryTxLogsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryTxLogsResponse_messageType{} + +type fastReflection_QueryTxLogsResponse_messageType struct{} + +func (x fastReflection_QueryTxLogsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryTxLogsResponse)(nil) +} +func (x fastReflection_QueryTxLogsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryTxLogsResponse) +} +func (x fastReflection_QueryTxLogsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTxLogsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryTxLogsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTxLogsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryTxLogsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryTxLogsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryTxLogsResponse) New() protoreflect.Message { + return new(fastReflection_QueryTxLogsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryTxLogsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryTxLogsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryTxLogsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Logs) != 0 { + value := protoreflect.ValueOfList(&_QueryTxLogsResponse_1_list{list: &x.Logs}) + if !f(fd_QueryTxLogsResponse_logs, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryTxLogsResponse_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryTxLogsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryTxLogsResponse.logs": + return len(x.Logs) != 0 + case "os.evm.v1.QueryTxLogsResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTxLogsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTxLogsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTxLogsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryTxLogsResponse.logs": + x.Logs = nil + case "os.evm.v1.QueryTxLogsResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTxLogsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTxLogsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryTxLogsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryTxLogsResponse.logs": + if len(x.Logs) == 0 { + return protoreflect.ValueOfList(&_QueryTxLogsResponse_1_list{}) + } + listValue := &_QueryTxLogsResponse_1_list{list: &x.Logs} + return protoreflect.ValueOfList(listValue) + case "os.evm.v1.QueryTxLogsResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTxLogsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTxLogsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTxLogsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryTxLogsResponse.logs": + lv := value.List() + clv := lv.(*_QueryTxLogsResponse_1_list) + x.Logs = *clv.list + case "os.evm.v1.QueryTxLogsResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTxLogsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTxLogsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTxLogsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryTxLogsResponse.logs": + if x.Logs == nil { + x.Logs = []*Log{} + } + value := &_QueryTxLogsResponse_1_list{list: &x.Logs} + return protoreflect.ValueOfList(value) + case "os.evm.v1.QueryTxLogsResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTxLogsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTxLogsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryTxLogsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryTxLogsResponse.logs": + list := []*Log{} + return protoreflect.ValueOfList(&_QueryTxLogsResponse_1_list{list: &list}) + case "os.evm.v1.QueryTxLogsResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTxLogsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTxLogsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryTxLogsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryTxLogsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryTxLogsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTxLogsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryTxLogsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryTxLogsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryTxLogsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Logs) > 0 { + for _, e := range x.Logs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryTxLogsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Logs) > 0 { + for iNdEx := len(x.Logs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Logs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryTxLogsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTxLogsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTxLogsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Logs = append(x.Logs, &Log{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Logs[len(x.Logs)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryParamsRequest = File_os_evm_v1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryParamsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryParamsResponse = File_os_evm_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EthCallRequest protoreflect.MessageDescriptor + fd_EthCallRequest_args protoreflect.FieldDescriptor + fd_EthCallRequest_gas_cap protoreflect.FieldDescriptor + fd_EthCallRequest_proposer_address protoreflect.FieldDescriptor + fd_EthCallRequest_chain_id protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_EthCallRequest = File_os_evm_v1_query_proto.Messages().ByName("EthCallRequest") + fd_EthCallRequest_args = md_EthCallRequest.Fields().ByName("args") + fd_EthCallRequest_gas_cap = md_EthCallRequest.Fields().ByName("gas_cap") + fd_EthCallRequest_proposer_address = md_EthCallRequest.Fields().ByName("proposer_address") + fd_EthCallRequest_chain_id = md_EthCallRequest.Fields().ByName("chain_id") +} + +var _ protoreflect.Message = (*fastReflection_EthCallRequest)(nil) + +type fastReflection_EthCallRequest EthCallRequest + +func (x *EthCallRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_EthCallRequest)(x) +} + +func (x *EthCallRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EthCallRequest_messageType fastReflection_EthCallRequest_messageType +var _ protoreflect.MessageType = fastReflection_EthCallRequest_messageType{} + +type fastReflection_EthCallRequest_messageType struct{} + +func (x fastReflection_EthCallRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_EthCallRequest)(nil) +} +func (x fastReflection_EthCallRequest_messageType) New() protoreflect.Message { + return new(fastReflection_EthCallRequest) +} +func (x fastReflection_EthCallRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EthCallRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EthCallRequest) Descriptor() protoreflect.MessageDescriptor { + return md_EthCallRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EthCallRequest) Type() protoreflect.MessageType { + return _fastReflection_EthCallRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EthCallRequest) New() protoreflect.Message { + return new(fastReflection_EthCallRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EthCallRequest) Interface() protoreflect.ProtoMessage { + return (*EthCallRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EthCallRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Args) != 0 { + value := protoreflect.ValueOfBytes(x.Args) + if !f(fd_EthCallRequest_args, value) { + return + } + } + if x.GasCap != uint64(0) { + value := protoreflect.ValueOfUint64(x.GasCap) + if !f(fd_EthCallRequest_gas_cap, value) { + return + } + } + if len(x.ProposerAddress) != 0 { + value := protoreflect.ValueOfBytes(x.ProposerAddress) + if !f(fd_EthCallRequest_proposer_address, value) { + return + } + } + if x.ChainId != int64(0) { + value := protoreflect.ValueOfInt64(x.ChainId) + if !f(fd_EthCallRequest_chain_id, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EthCallRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.EthCallRequest.args": + return len(x.Args) != 0 + case "os.evm.v1.EthCallRequest.gas_cap": + return x.GasCap != uint64(0) + case "os.evm.v1.EthCallRequest.proposer_address": + return len(x.ProposerAddress) != 0 + case "os.evm.v1.EthCallRequest.chain_id": + return x.ChainId != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EthCallRequest")) + } + panic(fmt.Errorf("message os.evm.v1.EthCallRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EthCallRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.EthCallRequest.args": + x.Args = nil + case "os.evm.v1.EthCallRequest.gas_cap": + x.GasCap = uint64(0) + case "os.evm.v1.EthCallRequest.proposer_address": + x.ProposerAddress = nil + case "os.evm.v1.EthCallRequest.chain_id": + x.ChainId = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EthCallRequest")) + } + panic(fmt.Errorf("message os.evm.v1.EthCallRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EthCallRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.EthCallRequest.args": + value := x.Args + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.EthCallRequest.gas_cap": + value := x.GasCap + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.EthCallRequest.proposer_address": + value := x.ProposerAddress + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.EthCallRequest.chain_id": + value := x.ChainId + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EthCallRequest")) + } + panic(fmt.Errorf("message os.evm.v1.EthCallRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EthCallRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.EthCallRequest.args": + x.Args = value.Bytes() + case "os.evm.v1.EthCallRequest.gas_cap": + x.GasCap = value.Uint() + case "os.evm.v1.EthCallRequest.proposer_address": + x.ProposerAddress = value.Bytes() + case "os.evm.v1.EthCallRequest.chain_id": + x.ChainId = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EthCallRequest")) + } + panic(fmt.Errorf("message os.evm.v1.EthCallRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EthCallRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.EthCallRequest.args": + panic(fmt.Errorf("field args of message os.evm.v1.EthCallRequest is not mutable")) + case "os.evm.v1.EthCallRequest.gas_cap": + panic(fmt.Errorf("field gas_cap of message os.evm.v1.EthCallRequest is not mutable")) + case "os.evm.v1.EthCallRequest.proposer_address": + panic(fmt.Errorf("field proposer_address of message os.evm.v1.EthCallRequest is not mutable")) + case "os.evm.v1.EthCallRequest.chain_id": + panic(fmt.Errorf("field chain_id of message os.evm.v1.EthCallRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EthCallRequest")) + } + panic(fmt.Errorf("message os.evm.v1.EthCallRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EthCallRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.EthCallRequest.args": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.EthCallRequest.gas_cap": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.EthCallRequest.proposer_address": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.EthCallRequest.chain_id": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EthCallRequest")) + } + panic(fmt.Errorf("message os.evm.v1.EthCallRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EthCallRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.EthCallRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EthCallRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EthCallRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EthCallRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EthCallRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EthCallRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Args) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.GasCap != 0 { + n += 1 + runtime.Sov(uint64(x.GasCap)) + } + l = len(x.ProposerAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ChainId != 0 { + n += 1 + runtime.Sov(uint64(x.ChainId)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EthCallRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.ChainId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ChainId)) + i-- + dAtA[i] = 0x20 + } + if len(x.ProposerAddress) > 0 { + i -= len(x.ProposerAddress) + copy(dAtA[i:], x.ProposerAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProposerAddress))) + i-- + dAtA[i] = 0x1a + } + if x.GasCap != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.GasCap)) + i-- + dAtA[i] = 0x10 + } + if len(x.Args) > 0 { + i -= len(x.Args) + copy(dAtA[i:], x.Args) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Args))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EthCallRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EthCallRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EthCallRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Args = append(x.Args[:0], dAtA[iNdEx:postIndex]...) + if x.Args == nil { + x.Args = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasCap", wireType) + } + x.GasCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.GasCap |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ProposerAddress = append(x.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if x.ProposerAddress == nil { + x.ProposerAddress = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + x.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EstimateGasResponse protoreflect.MessageDescriptor + fd_EstimateGasResponse_gas protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_EstimateGasResponse = File_os_evm_v1_query_proto.Messages().ByName("EstimateGasResponse") + fd_EstimateGasResponse_gas = md_EstimateGasResponse.Fields().ByName("gas") +} + +var _ protoreflect.Message = (*fastReflection_EstimateGasResponse)(nil) + +type fastReflection_EstimateGasResponse EstimateGasResponse + +func (x *EstimateGasResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_EstimateGasResponse)(x) +} + +func (x *EstimateGasResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EstimateGasResponse_messageType fastReflection_EstimateGasResponse_messageType +var _ protoreflect.MessageType = fastReflection_EstimateGasResponse_messageType{} + +type fastReflection_EstimateGasResponse_messageType struct{} + +func (x fastReflection_EstimateGasResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_EstimateGasResponse)(nil) +} +func (x fastReflection_EstimateGasResponse_messageType) New() protoreflect.Message { + return new(fastReflection_EstimateGasResponse) +} +func (x fastReflection_EstimateGasResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EstimateGasResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EstimateGasResponse) Descriptor() protoreflect.MessageDescriptor { + return md_EstimateGasResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EstimateGasResponse) Type() protoreflect.MessageType { + return _fastReflection_EstimateGasResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EstimateGasResponse) New() protoreflect.Message { + return new(fastReflection_EstimateGasResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EstimateGasResponse) Interface() protoreflect.ProtoMessage { + return (*EstimateGasResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EstimateGasResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Gas != uint64(0) { + value := protoreflect.ValueOfUint64(x.Gas) + if !f(fd_EstimateGasResponse_gas, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EstimateGasResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.EstimateGasResponse.gas": + return x.Gas != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EstimateGasResponse")) + } + panic(fmt.Errorf("message os.evm.v1.EstimateGasResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EstimateGasResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.EstimateGasResponse.gas": + x.Gas = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EstimateGasResponse")) + } + panic(fmt.Errorf("message os.evm.v1.EstimateGasResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EstimateGasResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.EstimateGasResponse.gas": + value := x.Gas + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EstimateGasResponse")) + } + panic(fmt.Errorf("message os.evm.v1.EstimateGasResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EstimateGasResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.EstimateGasResponse.gas": + x.Gas = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EstimateGasResponse")) + } + panic(fmt.Errorf("message os.evm.v1.EstimateGasResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EstimateGasResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.EstimateGasResponse.gas": + panic(fmt.Errorf("field gas of message os.evm.v1.EstimateGasResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EstimateGasResponse")) + } + panic(fmt.Errorf("message os.evm.v1.EstimateGasResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EstimateGasResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.EstimateGasResponse.gas": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.EstimateGasResponse")) + } + panic(fmt.Errorf("message os.evm.v1.EstimateGasResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EstimateGasResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.EstimateGasResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EstimateGasResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EstimateGasResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EstimateGasResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EstimateGasResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EstimateGasResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Gas != 0 { + n += 1 + runtime.Sov(uint64(x.Gas)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EstimateGasResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Gas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Gas)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EstimateGasResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EstimateGasResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EstimateGasResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Gas", wireType) + } + x.Gas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Gas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryTraceTxRequest_4_list)(nil) + +type _QueryTraceTxRequest_4_list struct { + list *[]*MsgEthereumTx +} + +func (x *_QueryTraceTxRequest_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryTraceTxRequest_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryTraceTxRequest_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MsgEthereumTx) + (*x.list)[i] = concreteValue +} + +func (x *_QueryTraceTxRequest_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MsgEthereumTx) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryTraceTxRequest_4_list) AppendMutable() protoreflect.Value { + v := new(MsgEthereumTx) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryTraceTxRequest_4_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryTraceTxRequest_4_list) NewElement() protoreflect.Value { + v := new(MsgEthereumTx) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryTraceTxRequest_4_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryTraceTxRequest protoreflect.MessageDescriptor + fd_QueryTraceTxRequest_msg protoreflect.FieldDescriptor + fd_QueryTraceTxRequest_trace_config protoreflect.FieldDescriptor + fd_QueryTraceTxRequest_predecessors protoreflect.FieldDescriptor + fd_QueryTraceTxRequest_block_number protoreflect.FieldDescriptor + fd_QueryTraceTxRequest_block_hash protoreflect.FieldDescriptor + fd_QueryTraceTxRequest_block_time protoreflect.FieldDescriptor + fd_QueryTraceTxRequest_proposer_address protoreflect.FieldDescriptor + fd_QueryTraceTxRequest_chain_id protoreflect.FieldDescriptor + fd_QueryTraceTxRequest_block_max_gas protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryTraceTxRequest = File_os_evm_v1_query_proto.Messages().ByName("QueryTraceTxRequest") + fd_QueryTraceTxRequest_msg = md_QueryTraceTxRequest.Fields().ByName("msg") + fd_QueryTraceTxRequest_trace_config = md_QueryTraceTxRequest.Fields().ByName("trace_config") + fd_QueryTraceTxRequest_predecessors = md_QueryTraceTxRequest.Fields().ByName("predecessors") + fd_QueryTraceTxRequest_block_number = md_QueryTraceTxRequest.Fields().ByName("block_number") + fd_QueryTraceTxRequest_block_hash = md_QueryTraceTxRequest.Fields().ByName("block_hash") + fd_QueryTraceTxRequest_block_time = md_QueryTraceTxRequest.Fields().ByName("block_time") + fd_QueryTraceTxRequest_proposer_address = md_QueryTraceTxRequest.Fields().ByName("proposer_address") + fd_QueryTraceTxRequest_chain_id = md_QueryTraceTxRequest.Fields().ByName("chain_id") + fd_QueryTraceTxRequest_block_max_gas = md_QueryTraceTxRequest.Fields().ByName("block_max_gas") +} + +var _ protoreflect.Message = (*fastReflection_QueryTraceTxRequest)(nil) + +type fastReflection_QueryTraceTxRequest QueryTraceTxRequest + +func (x *QueryTraceTxRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryTraceTxRequest)(x) +} + +func (x *QueryTraceTxRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryTraceTxRequest_messageType fastReflection_QueryTraceTxRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryTraceTxRequest_messageType{} + +type fastReflection_QueryTraceTxRequest_messageType struct{} + +func (x fastReflection_QueryTraceTxRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryTraceTxRequest)(nil) +} +func (x fastReflection_QueryTraceTxRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryTraceTxRequest) +} +func (x fastReflection_QueryTraceTxRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTraceTxRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryTraceTxRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTraceTxRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryTraceTxRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryTraceTxRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryTraceTxRequest) New() protoreflect.Message { + return new(fastReflection_QueryTraceTxRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryTraceTxRequest) Interface() protoreflect.ProtoMessage { + return (*QueryTraceTxRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryTraceTxRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Msg != nil { + value := protoreflect.ValueOfMessage(x.Msg.ProtoReflect()) + if !f(fd_QueryTraceTxRequest_msg, value) { + return + } + } + if x.TraceConfig != nil { + value := protoreflect.ValueOfMessage(x.TraceConfig.ProtoReflect()) + if !f(fd_QueryTraceTxRequest_trace_config, value) { + return + } + } + if len(x.Predecessors) != 0 { + value := protoreflect.ValueOfList(&_QueryTraceTxRequest_4_list{list: &x.Predecessors}) + if !f(fd_QueryTraceTxRequest_predecessors, value) { + return + } + } + if x.BlockNumber != int64(0) { + value := protoreflect.ValueOfInt64(x.BlockNumber) + if !f(fd_QueryTraceTxRequest_block_number, value) { + return + } + } + if x.BlockHash != "" { + value := protoreflect.ValueOfString(x.BlockHash) + if !f(fd_QueryTraceTxRequest_block_hash, value) { + return + } + } + if x.BlockTime != nil { + value := protoreflect.ValueOfMessage(x.BlockTime.ProtoReflect()) + if !f(fd_QueryTraceTxRequest_block_time, value) { + return + } + } + if len(x.ProposerAddress) != 0 { + value := protoreflect.ValueOfBytes(x.ProposerAddress) + if !f(fd_QueryTraceTxRequest_proposer_address, value) { + return + } + } + if x.ChainId != int64(0) { + value := protoreflect.ValueOfInt64(x.ChainId) + if !f(fd_QueryTraceTxRequest_chain_id, value) { + return + } + } + if x.BlockMaxGas != int64(0) { + value := protoreflect.ValueOfInt64(x.BlockMaxGas) + if !f(fd_QueryTraceTxRequest_block_max_gas, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryTraceTxRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryTraceTxRequest.msg": + return x.Msg != nil + case "os.evm.v1.QueryTraceTxRequest.trace_config": + return x.TraceConfig != nil + case "os.evm.v1.QueryTraceTxRequest.predecessors": + return len(x.Predecessors) != 0 + case "os.evm.v1.QueryTraceTxRequest.block_number": + return x.BlockNumber != int64(0) + case "os.evm.v1.QueryTraceTxRequest.block_hash": + return x.BlockHash != "" + case "os.evm.v1.QueryTraceTxRequest.block_time": + return x.BlockTime != nil + case "os.evm.v1.QueryTraceTxRequest.proposer_address": + return len(x.ProposerAddress) != 0 + case "os.evm.v1.QueryTraceTxRequest.chain_id": + return x.ChainId != int64(0) + case "os.evm.v1.QueryTraceTxRequest.block_max_gas": + return x.BlockMaxGas != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceTxRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceTxRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceTxRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryTraceTxRequest.msg": + x.Msg = nil + case "os.evm.v1.QueryTraceTxRequest.trace_config": + x.TraceConfig = nil + case "os.evm.v1.QueryTraceTxRequest.predecessors": + x.Predecessors = nil + case "os.evm.v1.QueryTraceTxRequest.block_number": + x.BlockNumber = int64(0) + case "os.evm.v1.QueryTraceTxRequest.block_hash": + x.BlockHash = "" + case "os.evm.v1.QueryTraceTxRequest.block_time": + x.BlockTime = nil + case "os.evm.v1.QueryTraceTxRequest.proposer_address": + x.ProposerAddress = nil + case "os.evm.v1.QueryTraceTxRequest.chain_id": + x.ChainId = int64(0) + case "os.evm.v1.QueryTraceTxRequest.block_max_gas": + x.BlockMaxGas = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceTxRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceTxRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryTraceTxRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryTraceTxRequest.msg": + value := x.Msg + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.evm.v1.QueryTraceTxRequest.trace_config": + value := x.TraceConfig + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.evm.v1.QueryTraceTxRequest.predecessors": + if len(x.Predecessors) == 0 { + return protoreflect.ValueOfList(&_QueryTraceTxRequest_4_list{}) + } + listValue := &_QueryTraceTxRequest_4_list{list: &x.Predecessors} + return protoreflect.ValueOfList(listValue) + case "os.evm.v1.QueryTraceTxRequest.block_number": + value := x.BlockNumber + return protoreflect.ValueOfInt64(value) + case "os.evm.v1.QueryTraceTxRequest.block_hash": + value := x.BlockHash + return protoreflect.ValueOfString(value) + case "os.evm.v1.QueryTraceTxRequest.block_time": + value := x.BlockTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.evm.v1.QueryTraceTxRequest.proposer_address": + value := x.ProposerAddress + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.QueryTraceTxRequest.chain_id": + value := x.ChainId + return protoreflect.ValueOfInt64(value) + case "os.evm.v1.QueryTraceTxRequest.block_max_gas": + value := x.BlockMaxGas + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceTxRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceTxRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceTxRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryTraceTxRequest.msg": + x.Msg = value.Message().Interface().(*MsgEthereumTx) + case "os.evm.v1.QueryTraceTxRequest.trace_config": + x.TraceConfig = value.Message().Interface().(*TraceConfig) + case "os.evm.v1.QueryTraceTxRequest.predecessors": + lv := value.List() + clv := lv.(*_QueryTraceTxRequest_4_list) + x.Predecessors = *clv.list + case "os.evm.v1.QueryTraceTxRequest.block_number": + x.BlockNumber = value.Int() + case "os.evm.v1.QueryTraceTxRequest.block_hash": + x.BlockHash = value.Interface().(string) + case "os.evm.v1.QueryTraceTxRequest.block_time": + x.BlockTime = value.Message().Interface().(*timestamppb.Timestamp) + case "os.evm.v1.QueryTraceTxRequest.proposer_address": + x.ProposerAddress = value.Bytes() + case "os.evm.v1.QueryTraceTxRequest.chain_id": + x.ChainId = value.Int() + case "os.evm.v1.QueryTraceTxRequest.block_max_gas": + x.BlockMaxGas = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceTxRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceTxRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceTxRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryTraceTxRequest.msg": + if x.Msg == nil { + x.Msg = new(MsgEthereumTx) + } + return protoreflect.ValueOfMessage(x.Msg.ProtoReflect()) + case "os.evm.v1.QueryTraceTxRequest.trace_config": + if x.TraceConfig == nil { + x.TraceConfig = new(TraceConfig) + } + return protoreflect.ValueOfMessage(x.TraceConfig.ProtoReflect()) + case "os.evm.v1.QueryTraceTxRequest.predecessors": + if x.Predecessors == nil { + x.Predecessors = []*MsgEthereumTx{} + } + value := &_QueryTraceTxRequest_4_list{list: &x.Predecessors} + return protoreflect.ValueOfList(value) + case "os.evm.v1.QueryTraceTxRequest.block_time": + if x.BlockTime == nil { + x.BlockTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.BlockTime.ProtoReflect()) + case "os.evm.v1.QueryTraceTxRequest.block_number": + panic(fmt.Errorf("field block_number of message os.evm.v1.QueryTraceTxRequest is not mutable")) + case "os.evm.v1.QueryTraceTxRequest.block_hash": + panic(fmt.Errorf("field block_hash of message os.evm.v1.QueryTraceTxRequest is not mutable")) + case "os.evm.v1.QueryTraceTxRequest.proposer_address": + panic(fmt.Errorf("field proposer_address of message os.evm.v1.QueryTraceTxRequest is not mutable")) + case "os.evm.v1.QueryTraceTxRequest.chain_id": + panic(fmt.Errorf("field chain_id of message os.evm.v1.QueryTraceTxRequest is not mutable")) + case "os.evm.v1.QueryTraceTxRequest.block_max_gas": + panic(fmt.Errorf("field block_max_gas of message os.evm.v1.QueryTraceTxRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceTxRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceTxRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryTraceTxRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryTraceTxRequest.msg": + m := new(MsgEthereumTx) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.evm.v1.QueryTraceTxRequest.trace_config": + m := new(TraceConfig) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.evm.v1.QueryTraceTxRequest.predecessors": + list := []*MsgEthereumTx{} + return protoreflect.ValueOfList(&_QueryTraceTxRequest_4_list{list: &list}) + case "os.evm.v1.QueryTraceTxRequest.block_number": + return protoreflect.ValueOfInt64(int64(0)) + case "os.evm.v1.QueryTraceTxRequest.block_hash": + return protoreflect.ValueOfString("") + case "os.evm.v1.QueryTraceTxRequest.block_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.evm.v1.QueryTraceTxRequest.proposer_address": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.QueryTraceTxRequest.chain_id": + return protoreflect.ValueOfInt64(int64(0)) + case "os.evm.v1.QueryTraceTxRequest.block_max_gas": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceTxRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceTxRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryTraceTxRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryTraceTxRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryTraceTxRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceTxRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryTraceTxRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryTraceTxRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryTraceTxRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Msg != nil { + l = options.Size(x.Msg) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.TraceConfig != nil { + l = options.Size(x.TraceConfig) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Predecessors) > 0 { + for _, e := range x.Predecessors { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.BlockNumber != 0 { + n += 1 + runtime.Sov(uint64(x.BlockNumber)) + } + l = len(x.BlockHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.BlockTime != nil { + l = options.Size(x.BlockTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ProposerAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ChainId != 0 { + n += 1 + runtime.Sov(uint64(x.ChainId)) + } + if x.BlockMaxGas != 0 { + n += 1 + runtime.Sov(uint64(x.BlockMaxGas)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryTraceTxRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.BlockMaxGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockMaxGas)) + i-- + dAtA[i] = 0x50 + } + if x.ChainId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ChainId)) + i-- + dAtA[i] = 0x48 + } + if len(x.ProposerAddress) > 0 { + i -= len(x.ProposerAddress) + copy(dAtA[i:], x.ProposerAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProposerAddress))) + i-- + dAtA[i] = 0x42 + } + if x.BlockTime != nil { + encoded, err := options.Marshal(x.BlockTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x3a + } + if len(x.BlockHash) > 0 { + i -= len(x.BlockHash) + copy(dAtA[i:], x.BlockHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BlockHash))) + i-- + dAtA[i] = 0x32 + } + if x.BlockNumber != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockNumber)) + i-- + dAtA[i] = 0x28 + } + if len(x.Predecessors) > 0 { + for iNdEx := len(x.Predecessors) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Predecessors[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x22 + } + } + if x.TraceConfig != nil { + encoded, err := options.Marshal(x.TraceConfig) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if x.Msg != nil { + encoded, err := options.Marshal(x.Msg) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryTraceTxRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTraceTxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTraceTxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Msg == nil { + x.Msg = &MsgEthereumTx{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Msg); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TraceConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.TraceConfig == nil { + x.TraceConfig = &TraceConfig{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TraceConfig); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Predecessors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Predecessors = append(x.Predecessors, &MsgEthereumTx{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Predecessors[len(x.Predecessors)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockNumber", wireType) + } + x.BlockNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BlockNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.BlockTime == nil { + x.BlockTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BlockTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ProposerAddress = append(x.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if x.ProposerAddress == nil { + x.ProposerAddress = []byte{} + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + x.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockMaxGas", wireType) + } + x.BlockMaxGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BlockMaxGas |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryTraceTxResponse protoreflect.MessageDescriptor + fd_QueryTraceTxResponse_data protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryTraceTxResponse = File_os_evm_v1_query_proto.Messages().ByName("QueryTraceTxResponse") + fd_QueryTraceTxResponse_data = md_QueryTraceTxResponse.Fields().ByName("data") +} + +var _ protoreflect.Message = (*fastReflection_QueryTraceTxResponse)(nil) + +type fastReflection_QueryTraceTxResponse QueryTraceTxResponse + +func (x *QueryTraceTxResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryTraceTxResponse)(x) +} + +func (x *QueryTraceTxResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryTraceTxResponse_messageType fastReflection_QueryTraceTxResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryTraceTxResponse_messageType{} + +type fastReflection_QueryTraceTxResponse_messageType struct{} + +func (x fastReflection_QueryTraceTxResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryTraceTxResponse)(nil) +} +func (x fastReflection_QueryTraceTxResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryTraceTxResponse) +} +func (x fastReflection_QueryTraceTxResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTraceTxResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryTraceTxResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTraceTxResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryTraceTxResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryTraceTxResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryTraceTxResponse) New() protoreflect.Message { + return new(fastReflection_QueryTraceTxResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryTraceTxResponse) Interface() protoreflect.ProtoMessage { + return (*QueryTraceTxResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryTraceTxResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Data) != 0 { + value := protoreflect.ValueOfBytes(x.Data) + if !f(fd_QueryTraceTxResponse_data, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryTraceTxResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryTraceTxResponse.data": + return len(x.Data) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceTxResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceTxResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceTxResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryTraceTxResponse.data": + x.Data = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceTxResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceTxResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryTraceTxResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryTraceTxResponse.data": + value := x.Data + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceTxResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceTxResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceTxResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryTraceTxResponse.data": + x.Data = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceTxResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceTxResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceTxResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryTraceTxResponse.data": + panic(fmt.Errorf("field data of message os.evm.v1.QueryTraceTxResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceTxResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceTxResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryTraceTxResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryTraceTxResponse.data": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceTxResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceTxResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryTraceTxResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryTraceTxResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryTraceTxResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceTxResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryTraceTxResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryTraceTxResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryTraceTxResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Data) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryTraceTxResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Data) > 0 { + i -= len(x.Data) + copy(dAtA[i:], x.Data) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryTraceTxResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTraceTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTraceTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) + if x.Data == nil { + x.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryTraceBlockRequest_1_list)(nil) + +type _QueryTraceBlockRequest_1_list struct { + list *[]*MsgEthereumTx +} + +func (x *_QueryTraceBlockRequest_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryTraceBlockRequest_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryTraceBlockRequest_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MsgEthereumTx) + (*x.list)[i] = concreteValue +} + +func (x *_QueryTraceBlockRequest_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MsgEthereumTx) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryTraceBlockRequest_1_list) AppendMutable() protoreflect.Value { + v := new(MsgEthereumTx) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryTraceBlockRequest_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryTraceBlockRequest_1_list) NewElement() protoreflect.Value { + v := new(MsgEthereumTx) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryTraceBlockRequest_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryTraceBlockRequest protoreflect.MessageDescriptor + fd_QueryTraceBlockRequest_txs protoreflect.FieldDescriptor + fd_QueryTraceBlockRequest_trace_config protoreflect.FieldDescriptor + fd_QueryTraceBlockRequest_block_number protoreflect.FieldDescriptor + fd_QueryTraceBlockRequest_block_hash protoreflect.FieldDescriptor + fd_QueryTraceBlockRequest_block_time protoreflect.FieldDescriptor + fd_QueryTraceBlockRequest_proposer_address protoreflect.FieldDescriptor + fd_QueryTraceBlockRequest_chain_id protoreflect.FieldDescriptor + fd_QueryTraceBlockRequest_block_max_gas protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryTraceBlockRequest = File_os_evm_v1_query_proto.Messages().ByName("QueryTraceBlockRequest") + fd_QueryTraceBlockRequest_txs = md_QueryTraceBlockRequest.Fields().ByName("txs") + fd_QueryTraceBlockRequest_trace_config = md_QueryTraceBlockRequest.Fields().ByName("trace_config") + fd_QueryTraceBlockRequest_block_number = md_QueryTraceBlockRequest.Fields().ByName("block_number") + fd_QueryTraceBlockRequest_block_hash = md_QueryTraceBlockRequest.Fields().ByName("block_hash") + fd_QueryTraceBlockRequest_block_time = md_QueryTraceBlockRequest.Fields().ByName("block_time") + fd_QueryTraceBlockRequest_proposer_address = md_QueryTraceBlockRequest.Fields().ByName("proposer_address") + fd_QueryTraceBlockRequest_chain_id = md_QueryTraceBlockRequest.Fields().ByName("chain_id") + fd_QueryTraceBlockRequest_block_max_gas = md_QueryTraceBlockRequest.Fields().ByName("block_max_gas") +} + +var _ protoreflect.Message = (*fastReflection_QueryTraceBlockRequest)(nil) + +type fastReflection_QueryTraceBlockRequest QueryTraceBlockRequest + +func (x *QueryTraceBlockRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryTraceBlockRequest)(x) +} + +func (x *QueryTraceBlockRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryTraceBlockRequest_messageType fastReflection_QueryTraceBlockRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryTraceBlockRequest_messageType{} + +type fastReflection_QueryTraceBlockRequest_messageType struct{} + +func (x fastReflection_QueryTraceBlockRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryTraceBlockRequest)(nil) +} +func (x fastReflection_QueryTraceBlockRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryTraceBlockRequest) +} +func (x fastReflection_QueryTraceBlockRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTraceBlockRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryTraceBlockRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTraceBlockRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryTraceBlockRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryTraceBlockRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryTraceBlockRequest) New() protoreflect.Message { + return new(fastReflection_QueryTraceBlockRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryTraceBlockRequest) Interface() protoreflect.ProtoMessage { + return (*QueryTraceBlockRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryTraceBlockRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Txs) != 0 { + value := protoreflect.ValueOfList(&_QueryTraceBlockRequest_1_list{list: &x.Txs}) + if !f(fd_QueryTraceBlockRequest_txs, value) { + return + } + } + if x.TraceConfig != nil { + value := protoreflect.ValueOfMessage(x.TraceConfig.ProtoReflect()) + if !f(fd_QueryTraceBlockRequest_trace_config, value) { + return + } + } + if x.BlockNumber != int64(0) { + value := protoreflect.ValueOfInt64(x.BlockNumber) + if !f(fd_QueryTraceBlockRequest_block_number, value) { + return + } + } + if x.BlockHash != "" { + value := protoreflect.ValueOfString(x.BlockHash) + if !f(fd_QueryTraceBlockRequest_block_hash, value) { + return + } + } + if x.BlockTime != nil { + value := protoreflect.ValueOfMessage(x.BlockTime.ProtoReflect()) + if !f(fd_QueryTraceBlockRequest_block_time, value) { + return + } + } + if len(x.ProposerAddress) != 0 { + value := protoreflect.ValueOfBytes(x.ProposerAddress) + if !f(fd_QueryTraceBlockRequest_proposer_address, value) { + return + } + } + if x.ChainId != int64(0) { + value := protoreflect.ValueOfInt64(x.ChainId) + if !f(fd_QueryTraceBlockRequest_chain_id, value) { + return + } + } + if x.BlockMaxGas != int64(0) { + value := protoreflect.ValueOfInt64(x.BlockMaxGas) + if !f(fd_QueryTraceBlockRequest_block_max_gas, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryTraceBlockRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryTraceBlockRequest.txs": + return len(x.Txs) != 0 + case "os.evm.v1.QueryTraceBlockRequest.trace_config": + return x.TraceConfig != nil + case "os.evm.v1.QueryTraceBlockRequest.block_number": + return x.BlockNumber != int64(0) + case "os.evm.v1.QueryTraceBlockRequest.block_hash": + return x.BlockHash != "" + case "os.evm.v1.QueryTraceBlockRequest.block_time": + return x.BlockTime != nil + case "os.evm.v1.QueryTraceBlockRequest.proposer_address": + return len(x.ProposerAddress) != 0 + case "os.evm.v1.QueryTraceBlockRequest.chain_id": + return x.ChainId != int64(0) + case "os.evm.v1.QueryTraceBlockRequest.block_max_gas": + return x.BlockMaxGas != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceBlockRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceBlockRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceBlockRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryTraceBlockRequest.txs": + x.Txs = nil + case "os.evm.v1.QueryTraceBlockRequest.trace_config": + x.TraceConfig = nil + case "os.evm.v1.QueryTraceBlockRequest.block_number": + x.BlockNumber = int64(0) + case "os.evm.v1.QueryTraceBlockRequest.block_hash": + x.BlockHash = "" + case "os.evm.v1.QueryTraceBlockRequest.block_time": + x.BlockTime = nil + case "os.evm.v1.QueryTraceBlockRequest.proposer_address": + x.ProposerAddress = nil + case "os.evm.v1.QueryTraceBlockRequest.chain_id": + x.ChainId = int64(0) + case "os.evm.v1.QueryTraceBlockRequest.block_max_gas": + x.BlockMaxGas = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceBlockRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceBlockRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryTraceBlockRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryTraceBlockRequest.txs": + if len(x.Txs) == 0 { + return protoreflect.ValueOfList(&_QueryTraceBlockRequest_1_list{}) + } + listValue := &_QueryTraceBlockRequest_1_list{list: &x.Txs} + return protoreflect.ValueOfList(listValue) + case "os.evm.v1.QueryTraceBlockRequest.trace_config": + value := x.TraceConfig + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.evm.v1.QueryTraceBlockRequest.block_number": + value := x.BlockNumber + return protoreflect.ValueOfInt64(value) + case "os.evm.v1.QueryTraceBlockRequest.block_hash": + value := x.BlockHash + return protoreflect.ValueOfString(value) + case "os.evm.v1.QueryTraceBlockRequest.block_time": + value := x.BlockTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.evm.v1.QueryTraceBlockRequest.proposer_address": + value := x.ProposerAddress + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.QueryTraceBlockRequest.chain_id": + value := x.ChainId + return protoreflect.ValueOfInt64(value) + case "os.evm.v1.QueryTraceBlockRequest.block_max_gas": + value := x.BlockMaxGas + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceBlockRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceBlockRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceBlockRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryTraceBlockRequest.txs": + lv := value.List() + clv := lv.(*_QueryTraceBlockRequest_1_list) + x.Txs = *clv.list + case "os.evm.v1.QueryTraceBlockRequest.trace_config": + x.TraceConfig = value.Message().Interface().(*TraceConfig) + case "os.evm.v1.QueryTraceBlockRequest.block_number": + x.BlockNumber = value.Int() + case "os.evm.v1.QueryTraceBlockRequest.block_hash": + x.BlockHash = value.Interface().(string) + case "os.evm.v1.QueryTraceBlockRequest.block_time": + x.BlockTime = value.Message().Interface().(*timestamppb.Timestamp) + case "os.evm.v1.QueryTraceBlockRequest.proposer_address": + x.ProposerAddress = value.Bytes() + case "os.evm.v1.QueryTraceBlockRequest.chain_id": + x.ChainId = value.Int() + case "os.evm.v1.QueryTraceBlockRequest.block_max_gas": + x.BlockMaxGas = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceBlockRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceBlockRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceBlockRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryTraceBlockRequest.txs": + if x.Txs == nil { + x.Txs = []*MsgEthereumTx{} + } + value := &_QueryTraceBlockRequest_1_list{list: &x.Txs} + return protoreflect.ValueOfList(value) + case "os.evm.v1.QueryTraceBlockRequest.trace_config": + if x.TraceConfig == nil { + x.TraceConfig = new(TraceConfig) + } + return protoreflect.ValueOfMessage(x.TraceConfig.ProtoReflect()) + case "os.evm.v1.QueryTraceBlockRequest.block_time": + if x.BlockTime == nil { + x.BlockTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.BlockTime.ProtoReflect()) + case "os.evm.v1.QueryTraceBlockRequest.block_number": + panic(fmt.Errorf("field block_number of message os.evm.v1.QueryTraceBlockRequest is not mutable")) + case "os.evm.v1.QueryTraceBlockRequest.block_hash": + panic(fmt.Errorf("field block_hash of message os.evm.v1.QueryTraceBlockRequest is not mutable")) + case "os.evm.v1.QueryTraceBlockRequest.proposer_address": + panic(fmt.Errorf("field proposer_address of message os.evm.v1.QueryTraceBlockRequest is not mutable")) + case "os.evm.v1.QueryTraceBlockRequest.chain_id": + panic(fmt.Errorf("field chain_id of message os.evm.v1.QueryTraceBlockRequest is not mutable")) + case "os.evm.v1.QueryTraceBlockRequest.block_max_gas": + panic(fmt.Errorf("field block_max_gas of message os.evm.v1.QueryTraceBlockRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceBlockRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceBlockRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryTraceBlockRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryTraceBlockRequest.txs": + list := []*MsgEthereumTx{} + return protoreflect.ValueOfList(&_QueryTraceBlockRequest_1_list{list: &list}) + case "os.evm.v1.QueryTraceBlockRequest.trace_config": + m := new(TraceConfig) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.evm.v1.QueryTraceBlockRequest.block_number": + return protoreflect.ValueOfInt64(int64(0)) + case "os.evm.v1.QueryTraceBlockRequest.block_hash": + return protoreflect.ValueOfString("") + case "os.evm.v1.QueryTraceBlockRequest.block_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.evm.v1.QueryTraceBlockRequest.proposer_address": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.QueryTraceBlockRequest.chain_id": + return protoreflect.ValueOfInt64(int64(0)) + case "os.evm.v1.QueryTraceBlockRequest.block_max_gas": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceBlockRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceBlockRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryTraceBlockRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryTraceBlockRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryTraceBlockRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceBlockRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryTraceBlockRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryTraceBlockRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryTraceBlockRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Txs) > 0 { + for _, e := range x.Txs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.TraceConfig != nil { + l = options.Size(x.TraceConfig) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.BlockNumber != 0 { + n += 1 + runtime.Sov(uint64(x.BlockNumber)) + } + l = len(x.BlockHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.BlockTime != nil { + l = options.Size(x.BlockTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ProposerAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ChainId != 0 { + n += 1 + runtime.Sov(uint64(x.ChainId)) + } + if x.BlockMaxGas != 0 { + n += 1 + runtime.Sov(uint64(x.BlockMaxGas)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryTraceBlockRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.BlockMaxGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockMaxGas)) + i-- + dAtA[i] = 0x50 + } + if x.ChainId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ChainId)) + i-- + dAtA[i] = 0x48 + } + if len(x.ProposerAddress) > 0 { + i -= len(x.ProposerAddress) + copy(dAtA[i:], x.ProposerAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProposerAddress))) + i-- + dAtA[i] = 0x42 + } + if x.BlockTime != nil { + encoded, err := options.Marshal(x.BlockTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x3a + } + if len(x.BlockHash) > 0 { + i -= len(x.BlockHash) + copy(dAtA[i:], x.BlockHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BlockHash))) + i-- + dAtA[i] = 0x32 + } + if x.BlockNumber != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockNumber)) + i-- + dAtA[i] = 0x28 + } + if x.TraceConfig != nil { + encoded, err := options.Marshal(x.TraceConfig) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if len(x.Txs) > 0 { + for iNdEx := len(x.Txs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Txs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryTraceBlockRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTraceBlockRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTraceBlockRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Txs = append(x.Txs, &MsgEthereumTx{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Txs[len(x.Txs)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TraceConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.TraceConfig == nil { + x.TraceConfig = &TraceConfig{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TraceConfig); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockNumber", wireType) + } + x.BlockNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BlockNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.BlockTime == nil { + x.BlockTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BlockTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ProposerAddress = append(x.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if x.ProposerAddress == nil { + x.ProposerAddress = []byte{} + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + x.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockMaxGas", wireType) + } + x.BlockMaxGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BlockMaxGas |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryTraceBlockResponse protoreflect.MessageDescriptor + fd_QueryTraceBlockResponse_data protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryTraceBlockResponse = File_os_evm_v1_query_proto.Messages().ByName("QueryTraceBlockResponse") + fd_QueryTraceBlockResponse_data = md_QueryTraceBlockResponse.Fields().ByName("data") +} + +var _ protoreflect.Message = (*fastReflection_QueryTraceBlockResponse)(nil) + +type fastReflection_QueryTraceBlockResponse QueryTraceBlockResponse + +func (x *QueryTraceBlockResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryTraceBlockResponse)(x) +} + +func (x *QueryTraceBlockResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryTraceBlockResponse_messageType fastReflection_QueryTraceBlockResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryTraceBlockResponse_messageType{} + +type fastReflection_QueryTraceBlockResponse_messageType struct{} + +func (x fastReflection_QueryTraceBlockResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryTraceBlockResponse)(nil) +} +func (x fastReflection_QueryTraceBlockResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryTraceBlockResponse) +} +func (x fastReflection_QueryTraceBlockResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTraceBlockResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryTraceBlockResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryTraceBlockResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryTraceBlockResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryTraceBlockResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryTraceBlockResponse) New() protoreflect.Message { + return new(fastReflection_QueryTraceBlockResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryTraceBlockResponse) Interface() protoreflect.ProtoMessage { + return (*QueryTraceBlockResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryTraceBlockResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Data) != 0 { + value := protoreflect.ValueOfBytes(x.Data) + if !f(fd_QueryTraceBlockResponse_data, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryTraceBlockResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryTraceBlockResponse.data": + return len(x.Data) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceBlockResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceBlockResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceBlockResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryTraceBlockResponse.data": + x.Data = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceBlockResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceBlockResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryTraceBlockResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryTraceBlockResponse.data": + value := x.Data + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceBlockResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceBlockResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceBlockResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryTraceBlockResponse.data": + x.Data = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceBlockResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceBlockResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceBlockResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryTraceBlockResponse.data": + panic(fmt.Errorf("field data of message os.evm.v1.QueryTraceBlockResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceBlockResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceBlockResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryTraceBlockResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryTraceBlockResponse.data": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryTraceBlockResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryTraceBlockResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryTraceBlockResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryTraceBlockResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryTraceBlockResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryTraceBlockResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryTraceBlockResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryTraceBlockResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryTraceBlockResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Data) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryTraceBlockResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Data) > 0 { + i -= len(x.Data) + copy(dAtA[i:], x.Data) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryTraceBlockResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTraceBlockResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryTraceBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) + if x.Data == nil { + x.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryBaseFeeRequest protoreflect.MessageDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryBaseFeeRequest = File_os_evm_v1_query_proto.Messages().ByName("QueryBaseFeeRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryBaseFeeRequest)(nil) + +type fastReflection_QueryBaseFeeRequest QueryBaseFeeRequest + +func (x *QueryBaseFeeRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryBaseFeeRequest)(x) +} + +func (x *QueryBaseFeeRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryBaseFeeRequest_messageType fastReflection_QueryBaseFeeRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryBaseFeeRequest_messageType{} + +type fastReflection_QueryBaseFeeRequest_messageType struct{} + +func (x fastReflection_QueryBaseFeeRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryBaseFeeRequest)(nil) +} +func (x fastReflection_QueryBaseFeeRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryBaseFeeRequest) +} +func (x fastReflection_QueryBaseFeeRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBaseFeeRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryBaseFeeRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBaseFeeRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryBaseFeeRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryBaseFeeRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryBaseFeeRequest) New() protoreflect.Message { + return new(fastReflection_QueryBaseFeeRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryBaseFeeRequest) Interface() protoreflect.ProtoMessage { + return (*QueryBaseFeeRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryBaseFeeRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryBaseFeeRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBaseFeeRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBaseFeeRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBaseFeeRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBaseFeeRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryBaseFeeRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBaseFeeRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBaseFeeRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBaseFeeRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBaseFeeRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBaseFeeRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBaseFeeRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryBaseFeeRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBaseFeeRequest")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBaseFeeRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryBaseFeeRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryBaseFeeRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryBaseFeeRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryBaseFeeRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryBaseFeeRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryBaseFeeRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryBaseFeeRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryBaseFeeRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBaseFeeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBaseFeeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryBaseFeeResponse protoreflect.MessageDescriptor + fd_QueryBaseFeeResponse_base_fee protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_query_proto_init() + md_QueryBaseFeeResponse = File_os_evm_v1_query_proto.Messages().ByName("QueryBaseFeeResponse") + fd_QueryBaseFeeResponse_base_fee = md_QueryBaseFeeResponse.Fields().ByName("base_fee") +} + +var _ protoreflect.Message = (*fastReflection_QueryBaseFeeResponse)(nil) + +type fastReflection_QueryBaseFeeResponse QueryBaseFeeResponse + +func (x *QueryBaseFeeResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryBaseFeeResponse)(x) +} + +func (x *QueryBaseFeeResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_query_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryBaseFeeResponse_messageType fastReflection_QueryBaseFeeResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryBaseFeeResponse_messageType{} + +type fastReflection_QueryBaseFeeResponse_messageType struct{} + +func (x fastReflection_QueryBaseFeeResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryBaseFeeResponse)(nil) +} +func (x fastReflection_QueryBaseFeeResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryBaseFeeResponse) +} +func (x fastReflection_QueryBaseFeeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBaseFeeResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryBaseFeeResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBaseFeeResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryBaseFeeResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryBaseFeeResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryBaseFeeResponse) New() protoreflect.Message { + return new(fastReflection_QueryBaseFeeResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryBaseFeeResponse) Interface() protoreflect.ProtoMessage { + return (*QueryBaseFeeResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryBaseFeeResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BaseFee != "" { + value := protoreflect.ValueOfString(x.BaseFee) + if !f(fd_QueryBaseFeeResponse_base_fee, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryBaseFeeResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.QueryBaseFeeResponse.base_fee": + return x.BaseFee != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBaseFeeResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBaseFeeResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.QueryBaseFeeResponse.base_fee": + x.BaseFee = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBaseFeeResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBaseFeeResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryBaseFeeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.QueryBaseFeeResponse.base_fee": + value := x.BaseFee + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBaseFeeResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBaseFeeResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.QueryBaseFeeResponse.base_fee": + x.BaseFee = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBaseFeeResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBaseFeeResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryBaseFeeResponse.base_fee": + panic(fmt.Errorf("field base_fee of message os.evm.v1.QueryBaseFeeResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBaseFeeResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBaseFeeResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryBaseFeeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.QueryBaseFeeResponse.base_fee": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.QueryBaseFeeResponse")) + } + panic(fmt.Errorf("message os.evm.v1.QueryBaseFeeResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryBaseFeeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.QueryBaseFeeResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryBaseFeeResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryBaseFeeResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryBaseFeeResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryBaseFeeResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.BaseFee) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryBaseFeeResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.BaseFee) > 0 { + i -= len(x.BaseFee) + copy(dAtA[i:], x.BaseFee) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BaseFee))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryBaseFeeResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBaseFeeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBaseFeeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.BaseFee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/evm/v1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryAccountRequest is the request type for the Query/Account RPC method. +type QueryAccountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address is the ethereum hex address to query the account for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *QueryAccountRequest) Reset() { + *x = QueryAccountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAccountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAccountRequest) ProtoMessage() {} + +// Deprecated: Use QueryAccountRequest.ProtoReflect.Descriptor instead. +func (*QueryAccountRequest) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{0} +} + +func (x *QueryAccountRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +// QueryAccountResponse is the response type for the Query/Account RPC method. +type QueryAccountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // balance is the balance of the EVM denomination. + Balance string `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` + // code_hash is the hex-formatted code bytes from the EOA. + CodeHash string `protobuf:"bytes,2,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty"` + // nonce is the account's sequence number. + Nonce uint64 `protobuf:"varint,3,opt,name=nonce,proto3" json:"nonce,omitempty"` +} + +func (x *QueryAccountResponse) Reset() { + *x = QueryAccountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAccountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAccountResponse) ProtoMessage() {} + +// Deprecated: Use QueryAccountResponse.ProtoReflect.Descriptor instead. +func (*QueryAccountResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryAccountResponse) GetBalance() string { + if x != nil { + return x.Balance + } + return "" +} + +func (x *QueryAccountResponse) GetCodeHash() string { + if x != nil { + return x.CodeHash + } + return "" +} + +func (x *QueryAccountResponse) GetNonce() uint64 { + if x != nil { + return x.Nonce + } + return 0 +} + +// QueryCosmosAccountRequest is the request type for the Query/CosmosAccount RPC +// method. +type QueryCosmosAccountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address is the ethereum hex address to query the account for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *QueryCosmosAccountRequest) Reset() { + *x = QueryCosmosAccountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCosmosAccountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCosmosAccountRequest) ProtoMessage() {} + +// Deprecated: Use QueryCosmosAccountRequest.ProtoReflect.Descriptor instead. +func (*QueryCosmosAccountRequest) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryCosmosAccountRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +// QueryCosmosAccountResponse is the response type for the Query/CosmosAccount +// RPC method. +type QueryCosmosAccountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // cosmos_address is the cosmos address of the account. + CosmosAddress string `protobuf:"bytes,1,opt,name=cosmos_address,json=cosmosAddress,proto3" json:"cosmos_address,omitempty"` + // sequence is the account's sequence number. + Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` + // account_number is the account number + AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` +} + +func (x *QueryCosmosAccountResponse) Reset() { + *x = QueryCosmosAccountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCosmosAccountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCosmosAccountResponse) ProtoMessage() {} + +// Deprecated: Use QueryCosmosAccountResponse.ProtoReflect.Descriptor instead. +func (*QueryCosmosAccountResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryCosmosAccountResponse) GetCosmosAddress() string { + if x != nil { + return x.CosmosAddress + } + return "" +} + +func (x *QueryCosmosAccountResponse) GetSequence() uint64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *QueryCosmosAccountResponse) GetAccountNumber() uint64 { + if x != nil { + return x.AccountNumber + } + return 0 +} + +// QueryValidatorAccountRequest is the request type for the +// Query/ValidatorAccount RPC method. +type QueryValidatorAccountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // cons_address is the validator cons address to query the account for. + ConsAddress string `protobuf:"bytes,1,opt,name=cons_address,json=consAddress,proto3" json:"cons_address,omitempty"` +} + +func (x *QueryValidatorAccountRequest) Reset() { + *x = QueryValidatorAccountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryValidatorAccountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryValidatorAccountRequest) ProtoMessage() {} + +// Deprecated: Use QueryValidatorAccountRequest.ProtoReflect.Descriptor instead. +func (*QueryValidatorAccountRequest) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryValidatorAccountRequest) GetConsAddress() string { + if x != nil { + return x.ConsAddress + } + return "" +} + +// QueryValidatorAccountResponse is the response type for the +// Query/ValidatorAccount RPC method. +type QueryValidatorAccountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // account_address is the cosmos address of the account in bech32 format. + AccountAddress string `protobuf:"bytes,1,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` + // sequence is the account's sequence number. + Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` + // account_number is the account number + AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` +} + +func (x *QueryValidatorAccountResponse) Reset() { + *x = QueryValidatorAccountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryValidatorAccountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryValidatorAccountResponse) ProtoMessage() {} + +// Deprecated: Use QueryValidatorAccountResponse.ProtoReflect.Descriptor instead. +func (*QueryValidatorAccountResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryValidatorAccountResponse) GetAccountAddress() string { + if x != nil { + return x.AccountAddress + } + return "" +} + +func (x *QueryValidatorAccountResponse) GetSequence() uint64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *QueryValidatorAccountResponse) GetAccountNumber() uint64 { + if x != nil { + return x.AccountNumber + } + return 0 +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method. +type QueryBalanceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address is the ethereum hex address to query the balance for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *QueryBalanceRequest) Reset() { + *x = QueryBalanceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryBalanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryBalanceRequest) ProtoMessage() {} + +// Deprecated: Use QueryBalanceRequest.ProtoReflect.Descriptor instead. +func (*QueryBalanceRequest) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryBalanceRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +// QueryBalanceResponse is the response type for the Query/Balance RPC method. +type QueryBalanceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // balance is the balance of the EVM denomination. + Balance string `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` +} + +func (x *QueryBalanceResponse) Reset() { + *x = QueryBalanceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryBalanceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryBalanceResponse) ProtoMessage() {} + +// Deprecated: Use QueryBalanceResponse.ProtoReflect.Descriptor instead. +func (*QueryBalanceResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryBalanceResponse) GetBalance() string { + if x != nil { + return x.Balance + } + return "" +} + +// QueryStorageRequest is the request type for the Query/Storage RPC method. +type QueryStorageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address is the ethereum hex address to query the storage state for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // key defines the key of the storage state + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *QueryStorageRequest) Reset() { + *x = QueryStorageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryStorageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryStorageRequest) ProtoMessage() {} + +// Deprecated: Use QueryStorageRequest.ProtoReflect.Descriptor instead. +func (*QueryStorageRequest) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{8} +} + +func (x *QueryStorageRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *QueryStorageRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +// QueryStorageResponse is the response type for the Query/Storage RPC +// method. +type QueryStorageResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // value defines the storage state value hash associated with the given key. + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *QueryStorageResponse) Reset() { + *x = QueryStorageResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryStorageResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryStorageResponse) ProtoMessage() {} + +// Deprecated: Use QueryStorageResponse.ProtoReflect.Descriptor instead. +func (*QueryStorageResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{9} +} + +func (x *QueryStorageResponse) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// QueryCodeRequest is the request type for the Query/Code RPC method. +type QueryCodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address is the ethereum hex address to query the code for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *QueryCodeRequest) Reset() { + *x = QueryCodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCodeRequest) ProtoMessage() {} + +// Deprecated: Use QueryCodeRequest.ProtoReflect.Descriptor instead. +func (*QueryCodeRequest) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{10} +} + +func (x *QueryCodeRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +// QueryCodeResponse is the response type for the Query/Code RPC +// method. +type QueryCodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // code represents the code bytes from an ethereum address. + Code []byte `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` +} + +func (x *QueryCodeResponse) Reset() { + *x = QueryCodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCodeResponse) ProtoMessage() {} + +// Deprecated: Use QueryCodeResponse.ProtoReflect.Descriptor instead. +func (*QueryCodeResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{11} +} + +func (x *QueryCodeResponse) GetCode() []byte { + if x != nil { + return x.Code + } + return nil +} + +// QueryTxLogsRequest is the request type for the Query/TxLogs RPC method. +type QueryTxLogsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // hash is the ethereum transaction hex hash to query the logs for. + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *v1beta1.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryTxLogsRequest) Reset() { + *x = QueryTxLogsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryTxLogsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryTxLogsRequest) ProtoMessage() {} + +// Deprecated: Use QueryTxLogsRequest.ProtoReflect.Descriptor instead. +func (*QueryTxLogsRequest) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{12} +} + +func (x *QueryTxLogsRequest) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + +func (x *QueryTxLogsRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryTxLogsResponse is the response type for the Query/TxLogs RPC method. +type QueryTxLogsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // logs represents the ethereum logs generated from the given transaction. + Logs []*Log `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"` + // pagination defines the pagination in the response. + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryTxLogsResponse) Reset() { + *x = QueryTxLogsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryTxLogsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryTxLogsResponse) ProtoMessage() {} + +// Deprecated: Use QueryTxLogsResponse.ProtoReflect.Descriptor instead. +func (*QueryTxLogsResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{13} +} + +func (x *QueryTxLogsResponse) GetLogs() []*Log { + if x != nil { + return x.Logs + } + return nil +} + +func (x *QueryTxLogsResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryParamsRequest defines the request type for querying x/evm parameters. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{14} +} + +// QueryParamsResponse defines the response type for querying x/evm parameters. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params define the evm module parameters. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{15} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// EthCallRequest defines EthCall request +type EthCallRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // args uses the same json format as the json rpc api. + Args []byte `protobuf:"bytes,1,opt,name=args,proto3" json:"args,omitempty"` + // gas_cap defines the default gas cap to be used + GasCap uint64 `protobuf:"varint,2,opt,name=gas_cap,json=gasCap,proto3" json:"gas_cap,omitempty"` + // proposer_address of the requested block in hex format + ProposerAddress []byte `protobuf:"bytes,3,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` + // chain_id is the eip155 chain id parsed from the requested block header + ChainId int64 `protobuf:"varint,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (x *EthCallRequest) Reset() { + *x = EthCallRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EthCallRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EthCallRequest) ProtoMessage() {} + +// Deprecated: Use EthCallRequest.ProtoReflect.Descriptor instead. +func (*EthCallRequest) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{16} +} + +func (x *EthCallRequest) GetArgs() []byte { + if x != nil { + return x.Args + } + return nil +} + +func (x *EthCallRequest) GetGasCap() uint64 { + if x != nil { + return x.GasCap + } + return 0 +} + +func (x *EthCallRequest) GetProposerAddress() []byte { + if x != nil { + return x.ProposerAddress + } + return nil +} + +func (x *EthCallRequest) GetChainId() int64 { + if x != nil { + return x.ChainId + } + return 0 +} + +// EstimateGasResponse defines EstimateGas response +type EstimateGasResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // gas returns the estimated gas + Gas uint64 `protobuf:"varint,1,opt,name=gas,proto3" json:"gas,omitempty"` +} + +func (x *EstimateGasResponse) Reset() { + *x = EstimateGasResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EstimateGasResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EstimateGasResponse) ProtoMessage() {} + +// Deprecated: Use EstimateGasResponse.ProtoReflect.Descriptor instead. +func (*EstimateGasResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{17} +} + +func (x *EstimateGasResponse) GetGas() uint64 { + if x != nil { + return x.Gas + } + return 0 +} + +// QueryTraceTxRequest defines TraceTx request +type QueryTraceTxRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // msg is the MsgEthereumTx for the requested transaction + Msg *MsgEthereumTx `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` + // trace_config holds extra parameters to trace functions. + TraceConfig *TraceConfig `protobuf:"bytes,3,opt,name=trace_config,json=traceConfig,proto3" json:"trace_config,omitempty"` + // predecessors is an array of transactions included in the same block + // need to be replayed first to get correct context for tracing. + Predecessors []*MsgEthereumTx `protobuf:"bytes,4,rep,name=predecessors,proto3" json:"predecessors,omitempty"` + // block_number of requested transaction + BlockNumber int64 `protobuf:"varint,5,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + // block_hash of requested transaction + BlockHash string `protobuf:"bytes,6,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // block_time of requested transaction + BlockTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=block_time,json=blockTime,proto3" json:"block_time,omitempty"` + // proposer_address is the proposer of the requested block + ProposerAddress []byte `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` + // chain_id is the eip155 chain id parsed from the requested block header + ChainId int64 `protobuf:"varint,9,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // block_max_gas of the block of the requested transaction + BlockMaxGas int64 `protobuf:"varint,10,opt,name=block_max_gas,json=blockMaxGas,proto3" json:"block_max_gas,omitempty"` +} + +func (x *QueryTraceTxRequest) Reset() { + *x = QueryTraceTxRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryTraceTxRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryTraceTxRequest) ProtoMessage() {} + +// Deprecated: Use QueryTraceTxRequest.ProtoReflect.Descriptor instead. +func (*QueryTraceTxRequest) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{18} +} + +func (x *QueryTraceTxRequest) GetMsg() *MsgEthereumTx { + if x != nil { + return x.Msg + } + return nil +} + +func (x *QueryTraceTxRequest) GetTraceConfig() *TraceConfig { + if x != nil { + return x.TraceConfig + } + return nil +} + +func (x *QueryTraceTxRequest) GetPredecessors() []*MsgEthereumTx { + if x != nil { + return x.Predecessors + } + return nil +} + +func (x *QueryTraceTxRequest) GetBlockNumber() int64 { + if x != nil { + return x.BlockNumber + } + return 0 +} + +func (x *QueryTraceTxRequest) GetBlockHash() string { + if x != nil { + return x.BlockHash + } + return "" +} + +func (x *QueryTraceTxRequest) GetBlockTime() *timestamppb.Timestamp { + if x != nil { + return x.BlockTime + } + return nil +} + +func (x *QueryTraceTxRequest) GetProposerAddress() []byte { + if x != nil { + return x.ProposerAddress + } + return nil +} + +func (x *QueryTraceTxRequest) GetChainId() int64 { + if x != nil { + return x.ChainId + } + return 0 +} + +func (x *QueryTraceTxRequest) GetBlockMaxGas() int64 { + if x != nil { + return x.BlockMaxGas + } + return 0 +} + +// QueryTraceTxResponse defines TraceTx response +type QueryTraceTxResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // data is the response serialized in bytes + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *QueryTraceTxResponse) Reset() { + *x = QueryTraceTxResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryTraceTxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryTraceTxResponse) ProtoMessage() {} + +// Deprecated: Use QueryTraceTxResponse.ProtoReflect.Descriptor instead. +func (*QueryTraceTxResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{19} +} + +func (x *QueryTraceTxResponse) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// QueryTraceBlockRequest defines TraceTx request +type QueryTraceBlockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // txs is an array of messages in the block + Txs []*MsgEthereumTx `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` + // trace_config holds extra parameters to trace functions. + TraceConfig *TraceConfig `protobuf:"bytes,3,opt,name=trace_config,json=traceConfig,proto3" json:"trace_config,omitempty"` + // block_number of the traced block + BlockNumber int64 `protobuf:"varint,5,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + // block_hash (hex) of the traced block + BlockHash string `protobuf:"bytes,6,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // block_time of the traced block + BlockTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=block_time,json=blockTime,proto3" json:"block_time,omitempty"` + // proposer_address is the address of the requested block + ProposerAddress []byte `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` + // chain_id is the eip155 chain id parsed from the requested block header + ChainId int64 `protobuf:"varint,9,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // block_max_gas of the traced block + BlockMaxGas int64 `protobuf:"varint,10,opt,name=block_max_gas,json=blockMaxGas,proto3" json:"block_max_gas,omitempty"` +} + +func (x *QueryTraceBlockRequest) Reset() { + *x = QueryTraceBlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryTraceBlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryTraceBlockRequest) ProtoMessage() {} + +// Deprecated: Use QueryTraceBlockRequest.ProtoReflect.Descriptor instead. +func (*QueryTraceBlockRequest) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{20} +} + +func (x *QueryTraceBlockRequest) GetTxs() []*MsgEthereumTx { + if x != nil { + return x.Txs + } + return nil +} + +func (x *QueryTraceBlockRequest) GetTraceConfig() *TraceConfig { + if x != nil { + return x.TraceConfig + } + return nil +} + +func (x *QueryTraceBlockRequest) GetBlockNumber() int64 { + if x != nil { + return x.BlockNumber + } + return 0 +} + +func (x *QueryTraceBlockRequest) GetBlockHash() string { + if x != nil { + return x.BlockHash + } + return "" +} + +func (x *QueryTraceBlockRequest) GetBlockTime() *timestamppb.Timestamp { + if x != nil { + return x.BlockTime + } + return nil +} + +func (x *QueryTraceBlockRequest) GetProposerAddress() []byte { + if x != nil { + return x.ProposerAddress + } + return nil +} + +func (x *QueryTraceBlockRequest) GetChainId() int64 { + if x != nil { + return x.ChainId + } + return 0 +} + +func (x *QueryTraceBlockRequest) GetBlockMaxGas() int64 { + if x != nil { + return x.BlockMaxGas + } + return 0 +} + +// QueryTraceBlockResponse defines TraceBlock response +type QueryTraceBlockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // data is the response serialized in bytes + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *QueryTraceBlockResponse) Reset() { + *x = QueryTraceBlockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryTraceBlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryTraceBlockResponse) ProtoMessage() {} + +// Deprecated: Use QueryTraceBlockResponse.ProtoReflect.Descriptor instead. +func (*QueryTraceBlockResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{21} +} + +func (x *QueryTraceBlockResponse) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// QueryBaseFeeRequest defines the request type for querying the EIP1559 base +// fee. +type QueryBaseFeeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryBaseFeeRequest) Reset() { + *x = QueryBaseFeeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryBaseFeeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryBaseFeeRequest) ProtoMessage() {} + +// Deprecated: Use QueryBaseFeeRequest.ProtoReflect.Descriptor instead. +func (*QueryBaseFeeRequest) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{22} +} + +// QueryBaseFeeResponse returns the EIP1559 base fee. +type QueryBaseFeeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // base_fee is the EIP1559 base fee + BaseFee string `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3" json:"base_fee,omitempty"` +} + +func (x *QueryBaseFeeResponse) Reset() { + *x = QueryBaseFeeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_query_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryBaseFeeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryBaseFeeResponse) ProtoMessage() {} + +// Deprecated: Use QueryBaseFeeResponse.ProtoReflect.Descriptor instead. +func (*QueryBaseFeeResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_query_proto_rawDescGZIP(), []int{23} +} + +func (x *QueryBaseFeeResponse) GetBaseFee() string { + if x != nil { + return x.BaseFee + } + return "" +} + +var File_os_evm_v1_query_proto protoreflect.FileDescriptor + +var file_os_evm_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, + 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, + 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, + 0x31, 0x2f, 0x65, 0x76, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x6f, 0x73, 0x2f, + 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x39, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x63, 0x0a, 0x14, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, + 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, + 0x3f, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, + 0x22, 0x86, 0x01, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, + 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x4b, 0x0a, 0x1c, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, + 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x08, 0x88, 0xa0, + 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x8b, 0x01, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, + 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x22, 0x39, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, + 0x30, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x22, 0x4b, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x2c, + 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x36, 0x0a, 0x10, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, + 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x27, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x7a, 0x0a, + 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x78, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, + 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x82, 0x01, 0x0a, 0x13, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x54, 0x78, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, + 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x14, + 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x4b, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x73, + 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, + 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x22, 0xb7, 0x01, 0x0a, 0x0e, 0x45, 0x74, 0x68, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x61, 0x73, 0x5f, + 0x63, 0x61, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x67, 0x61, 0x73, 0x43, 0x61, + 0x70, 0x12, 0x5d, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x32, 0xfa, 0xde, 0x1f, + 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, + 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x22, 0x27, 0x0a, 0x13, 0x45, + 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, 0x61, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x03, 0x67, 0x61, 0x73, 0x22, 0xf4, 0x03, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, + 0x61, 0x63, 0x65, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x03, + 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x73, 0x2e, 0x65, + 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x54, 0x78, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x39, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x3c, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x64, 0x65, 0x63, 0x65, 0x73, 0x73, + 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x73, 0x2e, 0x65, + 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x54, 0x78, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x64, 0x65, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, + 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x48, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x5d, 0x0a, + 0x10, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x32, 0xfa, 0xde, 0x1f, 0x2e, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x43, 0x6f, 0x6e, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x47, 0x61, 0x73, 0x4a, 0x04, 0x08, 0x02, 0x10, + 0x03, 0x52, 0x08, 0x74, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x2a, 0x0a, 0x14, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x63, 0x65, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa9, 0x03, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x54, 0x72, 0x61, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x52, 0x03, 0x74, 0x78, 0x73, 0x12, 0x39, + 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, + 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0b, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x48, 0x0a, 0x0a, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, + 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x5d, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x32, 0xfa, 0xde, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, + 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x61, 0x73, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x61, 0x78, + 0x47, 0x61, 0x73, 0x22, 0x2d, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x63, + 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x22, 0x15, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x73, 0x65, 0x46, + 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4c, 0x0a, 0x14, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x42, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x34, 0x0a, 0x08, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x19, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, + 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x32, 0x93, 0x0b, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x73, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x6f, + 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, + 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x65, 0x76, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, + 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x8c, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, + 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, + 0x65, 0x76, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x9d, 0x01, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x6f, 0x73, 0x2e, + 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x76, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, + 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x73, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x74, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x1e, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1f, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x65, 0x76, 0x6d, 0x6f, + 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x79, 0x0a, 0x07, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, + 0x25, 0x2f, 0x65, 0x76, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, + 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x68, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, + 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6f, 0x73, + 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1f, 0x12, 0x1d, 0x2f, 0x65, 0x76, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, + 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, + 0x12, 0x65, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x2e, 0x6f, 0x73, 0x2e, + 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x73, 0x2e, 0x65, + 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x16, 0x12, 0x14, 0x2f, 0x65, 0x76, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x66, 0x0a, 0x07, 0x45, 0x74, 0x68, 0x43, 0x61, + 0x6c, 0x6c, 0x12, 0x19, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x74, 0x68, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, + 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x65, 0x76, 0x6d, 0x6f, 0x73, 0x2f, + 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x74, 0x68, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x12, + 0x6c, 0x0a, 0x0b, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, 0x61, 0x73, 0x12, 0x19, + 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x43, 0x61, + 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x73, 0x2e, 0x65, + 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, 0x61, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1c, 0x12, 0x1a, 0x2f, 0x65, 0x76, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, + 0x2f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x5f, 0x67, 0x61, 0x73, 0x12, 0x6a, 0x0a, + 0x07, 0x54, 0x72, 0x61, 0x63, 0x65, 0x54, 0x78, 0x12, 0x1e, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x63, 0x65, 0x54, + 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x63, 0x65, 0x54, + 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x18, 0x12, 0x16, 0x2f, 0x65, 0x76, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, + 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x78, 0x12, 0x76, 0x0a, 0x0a, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x21, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x63, 0x65, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6f, 0x73, 0x2e, + 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x63, + 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x65, 0x76, 0x6d, 0x6f, 0x73, 0x2f, 0x65, + 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x6a, 0x0a, 0x07, 0x42, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x12, 0x1e, 0x2e, 0x6f, + 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, + 0x73, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, + 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, + 0x73, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x65, 0x76, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, + 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x42, 0x83, 0x01, + 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x42, + 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x6d, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x4f, 0x45, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x73, 0x2e, 0x45, 0x76, 0x6d, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x09, 0x4f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, + 0x4f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_evm_v1_query_proto_rawDescOnce sync.Once + file_os_evm_v1_query_proto_rawDescData = file_os_evm_v1_query_proto_rawDesc +) + +func file_os_evm_v1_query_proto_rawDescGZIP() []byte { + file_os_evm_v1_query_proto_rawDescOnce.Do(func() { + file_os_evm_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_evm_v1_query_proto_rawDescData) + }) + return file_os_evm_v1_query_proto_rawDescData +} + +var file_os_evm_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_os_evm_v1_query_proto_goTypes = []interface{}{ + (*QueryAccountRequest)(nil), // 0: os.evm.v1.QueryAccountRequest + (*QueryAccountResponse)(nil), // 1: os.evm.v1.QueryAccountResponse + (*QueryCosmosAccountRequest)(nil), // 2: os.evm.v1.QueryCosmosAccountRequest + (*QueryCosmosAccountResponse)(nil), // 3: os.evm.v1.QueryCosmosAccountResponse + (*QueryValidatorAccountRequest)(nil), // 4: os.evm.v1.QueryValidatorAccountRequest + (*QueryValidatorAccountResponse)(nil), // 5: os.evm.v1.QueryValidatorAccountResponse + (*QueryBalanceRequest)(nil), // 6: os.evm.v1.QueryBalanceRequest + (*QueryBalanceResponse)(nil), // 7: os.evm.v1.QueryBalanceResponse + (*QueryStorageRequest)(nil), // 8: os.evm.v1.QueryStorageRequest + (*QueryStorageResponse)(nil), // 9: os.evm.v1.QueryStorageResponse + (*QueryCodeRequest)(nil), // 10: os.evm.v1.QueryCodeRequest + (*QueryCodeResponse)(nil), // 11: os.evm.v1.QueryCodeResponse + (*QueryTxLogsRequest)(nil), // 12: os.evm.v1.QueryTxLogsRequest + (*QueryTxLogsResponse)(nil), // 13: os.evm.v1.QueryTxLogsResponse + (*QueryParamsRequest)(nil), // 14: os.evm.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 15: os.evm.v1.QueryParamsResponse + (*EthCallRequest)(nil), // 16: os.evm.v1.EthCallRequest + (*EstimateGasResponse)(nil), // 17: os.evm.v1.EstimateGasResponse + (*QueryTraceTxRequest)(nil), // 18: os.evm.v1.QueryTraceTxRequest + (*QueryTraceTxResponse)(nil), // 19: os.evm.v1.QueryTraceTxResponse + (*QueryTraceBlockRequest)(nil), // 20: os.evm.v1.QueryTraceBlockRequest + (*QueryTraceBlockResponse)(nil), // 21: os.evm.v1.QueryTraceBlockResponse + (*QueryBaseFeeRequest)(nil), // 22: os.evm.v1.QueryBaseFeeRequest + (*QueryBaseFeeResponse)(nil), // 23: os.evm.v1.QueryBaseFeeResponse + (*v1beta1.PageRequest)(nil), // 24: cosmos.base.query.v1beta1.PageRequest + (*Log)(nil), // 25: os.evm.v1.Log + (*v1beta1.PageResponse)(nil), // 26: cosmos.base.query.v1beta1.PageResponse + (*Params)(nil), // 27: os.evm.v1.Params + (*MsgEthereumTx)(nil), // 28: os.evm.v1.MsgEthereumTx + (*TraceConfig)(nil), // 29: os.evm.v1.TraceConfig + (*timestamppb.Timestamp)(nil), // 30: google.protobuf.Timestamp + (*MsgEthereumTxResponse)(nil), // 31: os.evm.v1.MsgEthereumTxResponse +} +var file_os_evm_v1_query_proto_depIdxs = []int32{ + 24, // 0: os.evm.v1.QueryTxLogsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 25, // 1: os.evm.v1.QueryTxLogsResponse.logs:type_name -> os.evm.v1.Log + 26, // 2: os.evm.v1.QueryTxLogsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 27, // 3: os.evm.v1.QueryParamsResponse.params:type_name -> os.evm.v1.Params + 28, // 4: os.evm.v1.QueryTraceTxRequest.msg:type_name -> os.evm.v1.MsgEthereumTx + 29, // 5: os.evm.v1.QueryTraceTxRequest.trace_config:type_name -> os.evm.v1.TraceConfig + 28, // 6: os.evm.v1.QueryTraceTxRequest.predecessors:type_name -> os.evm.v1.MsgEthereumTx + 30, // 7: os.evm.v1.QueryTraceTxRequest.block_time:type_name -> google.protobuf.Timestamp + 28, // 8: os.evm.v1.QueryTraceBlockRequest.txs:type_name -> os.evm.v1.MsgEthereumTx + 29, // 9: os.evm.v1.QueryTraceBlockRequest.trace_config:type_name -> os.evm.v1.TraceConfig + 30, // 10: os.evm.v1.QueryTraceBlockRequest.block_time:type_name -> google.protobuf.Timestamp + 0, // 11: os.evm.v1.Query.Account:input_type -> os.evm.v1.QueryAccountRequest + 2, // 12: os.evm.v1.Query.CosmosAccount:input_type -> os.evm.v1.QueryCosmosAccountRequest + 4, // 13: os.evm.v1.Query.ValidatorAccount:input_type -> os.evm.v1.QueryValidatorAccountRequest + 6, // 14: os.evm.v1.Query.Balance:input_type -> os.evm.v1.QueryBalanceRequest + 8, // 15: os.evm.v1.Query.Storage:input_type -> os.evm.v1.QueryStorageRequest + 10, // 16: os.evm.v1.Query.Code:input_type -> os.evm.v1.QueryCodeRequest + 14, // 17: os.evm.v1.Query.Params:input_type -> os.evm.v1.QueryParamsRequest + 16, // 18: os.evm.v1.Query.EthCall:input_type -> os.evm.v1.EthCallRequest + 16, // 19: os.evm.v1.Query.EstimateGas:input_type -> os.evm.v1.EthCallRequest + 18, // 20: os.evm.v1.Query.TraceTx:input_type -> os.evm.v1.QueryTraceTxRequest + 20, // 21: os.evm.v1.Query.TraceBlock:input_type -> os.evm.v1.QueryTraceBlockRequest + 22, // 22: os.evm.v1.Query.BaseFee:input_type -> os.evm.v1.QueryBaseFeeRequest + 1, // 23: os.evm.v1.Query.Account:output_type -> os.evm.v1.QueryAccountResponse + 3, // 24: os.evm.v1.Query.CosmosAccount:output_type -> os.evm.v1.QueryCosmosAccountResponse + 5, // 25: os.evm.v1.Query.ValidatorAccount:output_type -> os.evm.v1.QueryValidatorAccountResponse + 7, // 26: os.evm.v1.Query.Balance:output_type -> os.evm.v1.QueryBalanceResponse + 9, // 27: os.evm.v1.Query.Storage:output_type -> os.evm.v1.QueryStorageResponse + 11, // 28: os.evm.v1.Query.Code:output_type -> os.evm.v1.QueryCodeResponse + 15, // 29: os.evm.v1.Query.Params:output_type -> os.evm.v1.QueryParamsResponse + 31, // 30: os.evm.v1.Query.EthCall:output_type -> os.evm.v1.MsgEthereumTxResponse + 17, // 31: os.evm.v1.Query.EstimateGas:output_type -> os.evm.v1.EstimateGasResponse + 19, // 32: os.evm.v1.Query.TraceTx:output_type -> os.evm.v1.QueryTraceTxResponse + 21, // 33: os.evm.v1.Query.TraceBlock:output_type -> os.evm.v1.QueryTraceBlockResponse + 23, // 34: os.evm.v1.Query.BaseFee:output_type -> os.evm.v1.QueryBaseFeeResponse + 23, // [23:35] is the sub-list for method output_type + 11, // [11:23] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_os_evm_v1_query_proto_init() } +func file_os_evm_v1_query_proto_init() { + if File_os_evm_v1_query_proto != nil { + return + } + file_os_evm_v1_evm_proto_init() + file_os_evm_v1_tx_proto_init() + if !protoimpl.UnsafeEnabled { + file_os_evm_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAccountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAccountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCosmosAccountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCosmosAccountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryValidatorAccountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryValidatorAccountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryBalanceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryBalanceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryStorageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryStorageResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryTxLogsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryTxLogsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EthCallRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EstimateGasResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryTraceTxRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryTraceTxResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryTraceBlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryTraceBlockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryBaseFeeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_query_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryBaseFeeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_evm_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 24, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_os_evm_v1_query_proto_goTypes, + DependencyIndexes: file_os_evm_v1_query_proto_depIdxs, + MessageInfos: file_os_evm_v1_query_proto_msgTypes, + }.Build() + File_os_evm_v1_query_proto = out.File + file_os_evm_v1_query_proto_rawDesc = nil + file_os_evm_v1_query_proto_goTypes = nil + file_os_evm_v1_query_proto_depIdxs = nil +} diff --git a/api/os/evm/v1/query_grpc.pb.go b/api/os/evm/v1/query_grpc.pb.go new file mode 100644 index 00000000..ecfa6f83 --- /dev/null +++ b/api/os/evm/v1/query_grpc.pb.go @@ -0,0 +1,553 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: os/evm/v1/query.proto + +package evmv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_Account_FullMethodName = "/os.evm.v1.Query/Account" + Query_CosmosAccount_FullMethodName = "/os.evm.v1.Query/CosmosAccount" + Query_ValidatorAccount_FullMethodName = "/os.evm.v1.Query/ValidatorAccount" + Query_Balance_FullMethodName = "/os.evm.v1.Query/Balance" + Query_Storage_FullMethodName = "/os.evm.v1.Query/Storage" + Query_Code_FullMethodName = "/os.evm.v1.Query/Code" + Query_Params_FullMethodName = "/os.evm.v1.Query/Params" + Query_EthCall_FullMethodName = "/os.evm.v1.Query/EthCall" + Query_EstimateGas_FullMethodName = "/os.evm.v1.Query/EstimateGas" + Query_TraceTx_FullMethodName = "/os.evm.v1.Query/TraceTx" + Query_TraceBlock_FullMethodName = "/os.evm.v1.Query/TraceBlock" + Query_BaseFee_FullMethodName = "/os.evm.v1.Query/BaseFee" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + // Account queries an Ethereum account. + Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) + // CosmosAccount queries an Ethereum account's Cosmos Address. + CosmosAccount(ctx context.Context, in *QueryCosmosAccountRequest, opts ...grpc.CallOption) (*QueryCosmosAccountResponse, error) + // ValidatorAccount queries an Ethereum account's from a validator consensus + // Address. + ValidatorAccount(ctx context.Context, in *QueryValidatorAccountRequest, opts ...grpc.CallOption) (*QueryValidatorAccountResponse, error) + // Balance queries the balance of a the EVM denomination for a single + // account. + Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) + // Storage queries the balance of all coins for a single account. + Storage(ctx context.Context, in *QueryStorageRequest, opts ...grpc.CallOption) (*QueryStorageResponse, error) + // Code queries the balance of all coins for a single account. + Code(ctx context.Context, in *QueryCodeRequest, opts ...grpc.CallOption) (*QueryCodeResponse, error) + // Params queries the parameters of x/evm module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // EthCall implements the `eth_call` rpc api + EthCall(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) + // EstimateGas implements the `eth_estimateGas` rpc api + EstimateGas(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*EstimateGasResponse, error) + // TraceTx implements the `debug_traceTransaction` rpc api + TraceTx(ctx context.Context, in *QueryTraceTxRequest, opts ...grpc.CallOption) (*QueryTraceTxResponse, error) + // TraceBlock implements the `debug_traceBlockByNumber` and + // `debug_traceBlockByHash` rpc api + TraceBlock(ctx context.Context, in *QueryTraceBlockRequest, opts ...grpc.CallOption) (*QueryTraceBlockResponse, error) + // BaseFee queries the base fee of the parent block of the current block, + // it's similar to feemarket module's method, but also checks london hardfork + // status. + BaseFee(ctx context.Context, in *QueryBaseFeeRequest, opts ...grpc.CallOption) (*QueryBaseFeeResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) { + out := new(QueryAccountResponse) + err := c.cc.Invoke(ctx, Query_Account_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CosmosAccount(ctx context.Context, in *QueryCosmosAccountRequest, opts ...grpc.CallOption) (*QueryCosmosAccountResponse, error) { + out := new(QueryCosmosAccountResponse) + err := c.cc.Invoke(ctx, Query_CosmosAccount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ValidatorAccount(ctx context.Context, in *QueryValidatorAccountRequest, opts ...grpc.CallOption) (*QueryValidatorAccountResponse, error) { + out := new(QueryValidatorAccountResponse) + err := c.cc.Invoke(ctx, Query_ValidatorAccount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) { + out := new(QueryBalanceResponse) + err := c.cc.Invoke(ctx, Query_Balance_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Storage(ctx context.Context, in *QueryStorageRequest, opts ...grpc.CallOption) (*QueryStorageResponse, error) { + out := new(QueryStorageResponse) + err := c.cc.Invoke(ctx, Query_Storage_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Code(ctx context.Context, in *QueryCodeRequest, opts ...grpc.CallOption) (*QueryCodeResponse, error) { + out := new(QueryCodeResponse) + err := c.cc.Invoke(ctx, Query_Code_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) EthCall(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) { + out := new(MsgEthereumTxResponse) + err := c.cc.Invoke(ctx, Query_EthCall_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) EstimateGas(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*EstimateGasResponse, error) { + out := new(EstimateGasResponse) + err := c.cc.Invoke(ctx, Query_EstimateGas_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TraceTx(ctx context.Context, in *QueryTraceTxRequest, opts ...grpc.CallOption) (*QueryTraceTxResponse, error) { + out := new(QueryTraceTxResponse) + err := c.cc.Invoke(ctx, Query_TraceTx_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TraceBlock(ctx context.Context, in *QueryTraceBlockRequest, opts ...grpc.CallOption) (*QueryTraceBlockResponse, error) { + out := new(QueryTraceBlockResponse) + err := c.cc.Invoke(ctx, Query_TraceBlock_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BaseFee(ctx context.Context, in *QueryBaseFeeRequest, opts ...grpc.CallOption) (*QueryBaseFeeResponse, error) { + out := new(QueryBaseFeeResponse) + err := c.cc.Invoke(ctx, Query_BaseFee_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // Account queries an Ethereum account. + Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) + // CosmosAccount queries an Ethereum account's Cosmos Address. + CosmosAccount(context.Context, *QueryCosmosAccountRequest) (*QueryCosmosAccountResponse, error) + // ValidatorAccount queries an Ethereum account's from a validator consensus + // Address. + ValidatorAccount(context.Context, *QueryValidatorAccountRequest) (*QueryValidatorAccountResponse, error) + // Balance queries the balance of a the EVM denomination for a single + // account. + Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) + // Storage queries the balance of all coins for a single account. + Storage(context.Context, *QueryStorageRequest) (*QueryStorageResponse, error) + // Code queries the balance of all coins for a single account. + Code(context.Context, *QueryCodeRequest) (*QueryCodeResponse, error) + // Params queries the parameters of x/evm module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // EthCall implements the `eth_call` rpc api + EthCall(context.Context, *EthCallRequest) (*MsgEthereumTxResponse, error) + // EstimateGas implements the `eth_estimateGas` rpc api + EstimateGas(context.Context, *EthCallRequest) (*EstimateGasResponse, error) + // TraceTx implements the `debug_traceTransaction` rpc api + TraceTx(context.Context, *QueryTraceTxRequest) (*QueryTraceTxResponse, error) + // TraceBlock implements the `debug_traceBlockByNumber` and + // `debug_traceBlockByHash` rpc api + TraceBlock(context.Context, *QueryTraceBlockRequest) (*QueryTraceBlockResponse, error) + // BaseFee queries the base fee of the parent block of the current block, + // it's similar to feemarket module's method, but also checks london hardfork + // status. + BaseFee(context.Context, *QueryBaseFeeRequest) (*QueryBaseFeeResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Account not implemented") +} +func (UnimplementedQueryServer) CosmosAccount(context.Context, *QueryCosmosAccountRequest) (*QueryCosmosAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CosmosAccount not implemented") +} +func (UnimplementedQueryServer) ValidatorAccount(context.Context, *QueryValidatorAccountRequest) (*QueryValidatorAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorAccount not implemented") +} +func (UnimplementedQueryServer) Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented") +} +func (UnimplementedQueryServer) Storage(context.Context, *QueryStorageRequest) (*QueryStorageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Storage not implemented") +} +func (UnimplementedQueryServer) Code(context.Context, *QueryCodeRequest) (*QueryCodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Code not implemented") +} +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) EthCall(context.Context, *EthCallRequest) (*MsgEthereumTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EthCall not implemented") +} +func (UnimplementedQueryServer) EstimateGas(context.Context, *EthCallRequest) (*EstimateGasResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EstimateGas not implemented") +} +func (UnimplementedQueryServer) TraceTx(context.Context, *QueryTraceTxRequest) (*QueryTraceTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TraceTx not implemented") +} +func (UnimplementedQueryServer) TraceBlock(context.Context, *QueryTraceBlockRequest) (*QueryTraceBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TraceBlock not implemented") +} +func (UnimplementedQueryServer) BaseFee(context.Context, *QueryBaseFeeRequest) (*QueryBaseFeeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BaseFee not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Account(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Account_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Account(ctx, req.(*QueryAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CosmosAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCosmosAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CosmosAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_CosmosAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CosmosAccount(ctx, req.(*QueryCosmosAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ValidatorAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ValidatorAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ValidatorAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ValidatorAccount(ctx, req.(*QueryValidatorAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBalanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Balance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Balance_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Balance(ctx, req.(*QueryBalanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Storage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryStorageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Storage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Storage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Storage(ctx, req.(*QueryStorageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Code_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Code(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Code_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Code(ctx, req.(*QueryCodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_EthCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EthCallRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EthCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_EthCall_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EthCall(ctx, req.(*EthCallRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_EstimateGas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EthCallRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EstimateGas(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_EstimateGas_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EstimateGas(ctx, req.(*EthCallRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TraceTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTraceTxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TraceTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_TraceTx_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TraceTx(ctx, req.(*QueryTraceTxRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TraceBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTraceBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TraceBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_TraceBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TraceBlock(ctx, req.(*QueryTraceBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BaseFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBaseFeeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BaseFee(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_BaseFee_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BaseFee(ctx, req.(*QueryBaseFeeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "os.evm.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Account", + Handler: _Query_Account_Handler, + }, + { + MethodName: "CosmosAccount", + Handler: _Query_CosmosAccount_Handler, + }, + { + MethodName: "ValidatorAccount", + Handler: _Query_ValidatorAccount_Handler, + }, + { + MethodName: "Balance", + Handler: _Query_Balance_Handler, + }, + { + MethodName: "Storage", + Handler: _Query_Storage_Handler, + }, + { + MethodName: "Code", + Handler: _Query_Code_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "EthCall", + Handler: _Query_EthCall_Handler, + }, + { + MethodName: "EstimateGas", + Handler: _Query_EstimateGas_Handler, + }, + { + MethodName: "TraceTx", + Handler: _Query_TraceTx_Handler, + }, + { + MethodName: "TraceBlock", + Handler: _Query_TraceBlock_Handler, + }, + { + MethodName: "BaseFee", + Handler: _Query_BaseFee_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "os/evm/v1/query.proto", +} diff --git a/api/os/evm/v1/tx.pulsar.go b/api/os/evm/v1/tx.pulsar.go new file mode 100644 index 00000000..2a2d3204 --- /dev/null +++ b/api/os/evm/v1/tx.pulsar.go @@ -0,0 +1,6723 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package evmv1 + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/msg/v1" + binary "encoding/binary" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + io "io" + math "math" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgEthereumTx protoreflect.MessageDescriptor + fd_MsgEthereumTx_data protoreflect.FieldDescriptor + fd_MsgEthereumTx_size protoreflect.FieldDescriptor + fd_MsgEthereumTx_hash protoreflect.FieldDescriptor + fd_MsgEthereumTx_from protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_tx_proto_init() + md_MsgEthereumTx = File_os_evm_v1_tx_proto.Messages().ByName("MsgEthereumTx") + fd_MsgEthereumTx_data = md_MsgEthereumTx.Fields().ByName("data") + fd_MsgEthereumTx_size = md_MsgEthereumTx.Fields().ByName("size") + fd_MsgEthereumTx_hash = md_MsgEthereumTx.Fields().ByName("hash") + fd_MsgEthereumTx_from = md_MsgEthereumTx.Fields().ByName("from") +} + +var _ protoreflect.Message = (*fastReflection_MsgEthereumTx)(nil) + +type fastReflection_MsgEthereumTx MsgEthereumTx + +func (x *MsgEthereumTx) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgEthereumTx)(x) +} + +func (x *MsgEthereumTx) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgEthereumTx_messageType fastReflection_MsgEthereumTx_messageType +var _ protoreflect.MessageType = fastReflection_MsgEthereumTx_messageType{} + +type fastReflection_MsgEthereumTx_messageType struct{} + +func (x fastReflection_MsgEthereumTx_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgEthereumTx)(nil) +} +func (x fastReflection_MsgEthereumTx_messageType) New() protoreflect.Message { + return new(fastReflection_MsgEthereumTx) +} +func (x fastReflection_MsgEthereumTx_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEthereumTx +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgEthereumTx) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEthereumTx +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgEthereumTx) Type() protoreflect.MessageType { + return _fastReflection_MsgEthereumTx_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgEthereumTx) New() protoreflect.Message { + return new(fastReflection_MsgEthereumTx) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgEthereumTx) Interface() protoreflect.ProtoMessage { + return (*MsgEthereumTx)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgEthereumTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Data != nil { + value := protoreflect.ValueOfMessage(x.Data.ProtoReflect()) + if !f(fd_MsgEthereumTx_data, value) { + return + } + } + if x.Size != float64(0) || math.Signbit(x.Size) { + value := protoreflect.ValueOfFloat64(x.Size) + if !f(fd_MsgEthereumTx_size, value) { + return + } + } + if x.Hash != "" { + value := protoreflect.ValueOfString(x.Hash) + if !f(fd_MsgEthereumTx_hash, value) { + return + } + } + if x.From != "" { + value := protoreflect.ValueOfString(x.From) + if !f(fd_MsgEthereumTx_from, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgEthereumTx) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.MsgEthereumTx.data": + return x.Data != nil + case "os.evm.v1.MsgEthereumTx.size": + return x.Size != float64(0) || math.Signbit(x.Size) + case "os.evm.v1.MsgEthereumTx.hash": + return x.Hash != "" + case "os.evm.v1.MsgEthereumTx.from": + return x.From != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.MsgEthereumTx does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEthereumTx) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.MsgEthereumTx.data": + x.Data = nil + case "os.evm.v1.MsgEthereumTx.size": + x.Size = float64(0) + case "os.evm.v1.MsgEthereumTx.hash": + x.Hash = "" + case "os.evm.v1.MsgEthereumTx.from": + x.From = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.MsgEthereumTx does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgEthereumTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.MsgEthereumTx.data": + value := x.Data + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.evm.v1.MsgEthereumTx.size": + value := x.Size + return protoreflect.ValueOfFloat64(value) + case "os.evm.v1.MsgEthereumTx.hash": + value := x.Hash + return protoreflect.ValueOfString(value) + case "os.evm.v1.MsgEthereumTx.from": + value := x.From + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.MsgEthereumTx does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEthereumTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.MsgEthereumTx.data": + x.Data = value.Message().Interface().(*anypb.Any) + case "os.evm.v1.MsgEthereumTx.size": + x.Size = value.Float() + case "os.evm.v1.MsgEthereumTx.hash": + x.Hash = value.Interface().(string) + case "os.evm.v1.MsgEthereumTx.from": + x.From = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.MsgEthereumTx does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEthereumTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.MsgEthereumTx.data": + if x.Data == nil { + x.Data = new(anypb.Any) + } + return protoreflect.ValueOfMessage(x.Data.ProtoReflect()) + case "os.evm.v1.MsgEthereumTx.size": + panic(fmt.Errorf("field size of message os.evm.v1.MsgEthereumTx is not mutable")) + case "os.evm.v1.MsgEthereumTx.hash": + panic(fmt.Errorf("field hash of message os.evm.v1.MsgEthereumTx is not mutable")) + case "os.evm.v1.MsgEthereumTx.from": + panic(fmt.Errorf("field from of message os.evm.v1.MsgEthereumTx is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.MsgEthereumTx does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgEthereumTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.MsgEthereumTx.data": + m := new(anypb.Any) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.evm.v1.MsgEthereumTx.size": + return protoreflect.ValueOfFloat64(float64(0)) + case "os.evm.v1.MsgEthereumTx.hash": + return protoreflect.ValueOfString("") + case "os.evm.v1.MsgEthereumTx.from": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.MsgEthereumTx does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgEthereumTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.MsgEthereumTx", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgEthereumTx) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEthereumTx) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgEthereumTx) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgEthereumTx) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgEthereumTx) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Data != nil { + l = options.Size(x.Data) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Size != 0 || math.Signbit(x.Size) { + n += 9 + } + l = len(x.Hash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.From) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgEthereumTx) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.From) > 0 { + i -= len(x.From) + copy(dAtA[i:], x.From) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.From))) + i-- + dAtA[i] = 0x22 + } + if len(x.Hash) > 0 { + i -= len(x.Hash) + copy(dAtA[i:], x.Hash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Hash))) + i-- + dAtA[i] = 0x1a + } + if x.Size != 0 || math.Signbit(x.Size) { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(x.Size)))) + i-- + dAtA[i] = 0x11 + } + if x.Data != nil { + encoded, err := options.Marshal(x.Data) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgEthereumTx) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEthereumTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEthereumTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Data == nil { + x.Data = &anypb.Any{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Data); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 1 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + x.Size = float64(math.Float64frombits(v)) + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_LegacyTx protoreflect.MessageDescriptor + fd_LegacyTx_nonce protoreflect.FieldDescriptor + fd_LegacyTx_gas_price protoreflect.FieldDescriptor + fd_LegacyTx_gas protoreflect.FieldDescriptor + fd_LegacyTx_to protoreflect.FieldDescriptor + fd_LegacyTx_value protoreflect.FieldDescriptor + fd_LegacyTx_data protoreflect.FieldDescriptor + fd_LegacyTx_v protoreflect.FieldDescriptor + fd_LegacyTx_r protoreflect.FieldDescriptor + fd_LegacyTx_s protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_tx_proto_init() + md_LegacyTx = File_os_evm_v1_tx_proto.Messages().ByName("LegacyTx") + fd_LegacyTx_nonce = md_LegacyTx.Fields().ByName("nonce") + fd_LegacyTx_gas_price = md_LegacyTx.Fields().ByName("gas_price") + fd_LegacyTx_gas = md_LegacyTx.Fields().ByName("gas") + fd_LegacyTx_to = md_LegacyTx.Fields().ByName("to") + fd_LegacyTx_value = md_LegacyTx.Fields().ByName("value") + fd_LegacyTx_data = md_LegacyTx.Fields().ByName("data") + fd_LegacyTx_v = md_LegacyTx.Fields().ByName("v") + fd_LegacyTx_r = md_LegacyTx.Fields().ByName("r") + fd_LegacyTx_s = md_LegacyTx.Fields().ByName("s") +} + +var _ protoreflect.Message = (*fastReflection_LegacyTx)(nil) + +type fastReflection_LegacyTx LegacyTx + +func (x *LegacyTx) ProtoReflect() protoreflect.Message { + return (*fastReflection_LegacyTx)(x) +} + +func (x *LegacyTx) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_LegacyTx_messageType fastReflection_LegacyTx_messageType +var _ protoreflect.MessageType = fastReflection_LegacyTx_messageType{} + +type fastReflection_LegacyTx_messageType struct{} + +func (x fastReflection_LegacyTx_messageType) Zero() protoreflect.Message { + return (*fastReflection_LegacyTx)(nil) +} +func (x fastReflection_LegacyTx_messageType) New() protoreflect.Message { + return new(fastReflection_LegacyTx) +} +func (x fastReflection_LegacyTx_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_LegacyTx +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_LegacyTx) Descriptor() protoreflect.MessageDescriptor { + return md_LegacyTx +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_LegacyTx) Type() protoreflect.MessageType { + return _fastReflection_LegacyTx_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_LegacyTx) New() protoreflect.Message { + return new(fastReflection_LegacyTx) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_LegacyTx) Interface() protoreflect.ProtoMessage { + return (*LegacyTx)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_LegacyTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Nonce != uint64(0) { + value := protoreflect.ValueOfUint64(x.Nonce) + if !f(fd_LegacyTx_nonce, value) { + return + } + } + if x.GasPrice != "" { + value := protoreflect.ValueOfString(x.GasPrice) + if !f(fd_LegacyTx_gas_price, value) { + return + } + } + if x.Gas != uint64(0) { + value := protoreflect.ValueOfUint64(x.Gas) + if !f(fd_LegacyTx_gas, value) { + return + } + } + if x.To != "" { + value := protoreflect.ValueOfString(x.To) + if !f(fd_LegacyTx_to, value) { + return + } + } + if x.Value != "" { + value := protoreflect.ValueOfString(x.Value) + if !f(fd_LegacyTx_value, value) { + return + } + } + if len(x.Data) != 0 { + value := protoreflect.ValueOfBytes(x.Data) + if !f(fd_LegacyTx_data, value) { + return + } + } + if len(x.V) != 0 { + value := protoreflect.ValueOfBytes(x.V) + if !f(fd_LegacyTx_v, value) { + return + } + } + if len(x.R) != 0 { + value := protoreflect.ValueOfBytes(x.R) + if !f(fd_LegacyTx_r, value) { + return + } + } + if len(x.S) != 0 { + value := protoreflect.ValueOfBytes(x.S) + if !f(fd_LegacyTx_s, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_LegacyTx) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.LegacyTx.nonce": + return x.Nonce != uint64(0) + case "os.evm.v1.LegacyTx.gas_price": + return x.GasPrice != "" + case "os.evm.v1.LegacyTx.gas": + return x.Gas != uint64(0) + case "os.evm.v1.LegacyTx.to": + return x.To != "" + case "os.evm.v1.LegacyTx.value": + return x.Value != "" + case "os.evm.v1.LegacyTx.data": + return len(x.Data) != 0 + case "os.evm.v1.LegacyTx.v": + return len(x.V) != 0 + case "os.evm.v1.LegacyTx.r": + return len(x.R) != 0 + case "os.evm.v1.LegacyTx.s": + return len(x.S) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.LegacyTx")) + } + panic(fmt.Errorf("message os.evm.v1.LegacyTx does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_LegacyTx) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.LegacyTx.nonce": + x.Nonce = uint64(0) + case "os.evm.v1.LegacyTx.gas_price": + x.GasPrice = "" + case "os.evm.v1.LegacyTx.gas": + x.Gas = uint64(0) + case "os.evm.v1.LegacyTx.to": + x.To = "" + case "os.evm.v1.LegacyTx.value": + x.Value = "" + case "os.evm.v1.LegacyTx.data": + x.Data = nil + case "os.evm.v1.LegacyTx.v": + x.V = nil + case "os.evm.v1.LegacyTx.r": + x.R = nil + case "os.evm.v1.LegacyTx.s": + x.S = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.LegacyTx")) + } + panic(fmt.Errorf("message os.evm.v1.LegacyTx does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_LegacyTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.LegacyTx.nonce": + value := x.Nonce + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.LegacyTx.gas_price": + value := x.GasPrice + return protoreflect.ValueOfString(value) + case "os.evm.v1.LegacyTx.gas": + value := x.Gas + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.LegacyTx.to": + value := x.To + return protoreflect.ValueOfString(value) + case "os.evm.v1.LegacyTx.value": + value := x.Value + return protoreflect.ValueOfString(value) + case "os.evm.v1.LegacyTx.data": + value := x.Data + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.LegacyTx.v": + value := x.V + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.LegacyTx.r": + value := x.R + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.LegacyTx.s": + value := x.S + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.LegacyTx")) + } + panic(fmt.Errorf("message os.evm.v1.LegacyTx does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_LegacyTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.LegacyTx.nonce": + x.Nonce = value.Uint() + case "os.evm.v1.LegacyTx.gas_price": + x.GasPrice = value.Interface().(string) + case "os.evm.v1.LegacyTx.gas": + x.Gas = value.Uint() + case "os.evm.v1.LegacyTx.to": + x.To = value.Interface().(string) + case "os.evm.v1.LegacyTx.value": + x.Value = value.Interface().(string) + case "os.evm.v1.LegacyTx.data": + x.Data = value.Bytes() + case "os.evm.v1.LegacyTx.v": + x.V = value.Bytes() + case "os.evm.v1.LegacyTx.r": + x.R = value.Bytes() + case "os.evm.v1.LegacyTx.s": + x.S = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.LegacyTx")) + } + panic(fmt.Errorf("message os.evm.v1.LegacyTx does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_LegacyTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.LegacyTx.nonce": + panic(fmt.Errorf("field nonce of message os.evm.v1.LegacyTx is not mutable")) + case "os.evm.v1.LegacyTx.gas_price": + panic(fmt.Errorf("field gas_price of message os.evm.v1.LegacyTx is not mutable")) + case "os.evm.v1.LegacyTx.gas": + panic(fmt.Errorf("field gas of message os.evm.v1.LegacyTx is not mutable")) + case "os.evm.v1.LegacyTx.to": + panic(fmt.Errorf("field to of message os.evm.v1.LegacyTx is not mutable")) + case "os.evm.v1.LegacyTx.value": + panic(fmt.Errorf("field value of message os.evm.v1.LegacyTx is not mutable")) + case "os.evm.v1.LegacyTx.data": + panic(fmt.Errorf("field data of message os.evm.v1.LegacyTx is not mutable")) + case "os.evm.v1.LegacyTx.v": + panic(fmt.Errorf("field v of message os.evm.v1.LegacyTx is not mutable")) + case "os.evm.v1.LegacyTx.r": + panic(fmt.Errorf("field r of message os.evm.v1.LegacyTx is not mutable")) + case "os.evm.v1.LegacyTx.s": + panic(fmt.Errorf("field s of message os.evm.v1.LegacyTx is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.LegacyTx")) + } + panic(fmt.Errorf("message os.evm.v1.LegacyTx does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_LegacyTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.LegacyTx.nonce": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.LegacyTx.gas_price": + return protoreflect.ValueOfString("") + case "os.evm.v1.LegacyTx.gas": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.LegacyTx.to": + return protoreflect.ValueOfString("") + case "os.evm.v1.LegacyTx.value": + return protoreflect.ValueOfString("") + case "os.evm.v1.LegacyTx.data": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.LegacyTx.v": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.LegacyTx.r": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.LegacyTx.s": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.LegacyTx")) + } + panic(fmt.Errorf("message os.evm.v1.LegacyTx does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_LegacyTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.LegacyTx", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_LegacyTx) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_LegacyTx) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_LegacyTx) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_LegacyTx) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*LegacyTx) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Nonce != 0 { + n += 1 + runtime.Sov(uint64(x.Nonce)) + } + l = len(x.GasPrice) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Gas != 0 { + n += 1 + runtime.Sov(uint64(x.Gas)) + } + l = len(x.To) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Value) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Data) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.V) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.R) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.S) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*LegacyTx) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.S) > 0 { + i -= len(x.S) + copy(dAtA[i:], x.S) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.S))) + i-- + dAtA[i] = 0x4a + } + if len(x.R) > 0 { + i -= len(x.R) + copy(dAtA[i:], x.R) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.R))) + i-- + dAtA[i] = 0x42 + } + if len(x.V) > 0 { + i -= len(x.V) + copy(dAtA[i:], x.V) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.V))) + i-- + dAtA[i] = 0x3a + } + if len(x.Data) > 0 { + i -= len(x.Data) + copy(dAtA[i:], x.Data) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) + i-- + dAtA[i] = 0x32 + } + if len(x.Value) > 0 { + i -= len(x.Value) + copy(dAtA[i:], x.Value) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Value))) + i-- + dAtA[i] = 0x2a + } + if len(x.To) > 0 { + i -= len(x.To) + copy(dAtA[i:], x.To) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.To))) + i-- + dAtA[i] = 0x22 + } + if x.Gas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Gas)) + i-- + dAtA[i] = 0x18 + } + if len(x.GasPrice) > 0 { + i -= len(x.GasPrice) + copy(dAtA[i:], x.GasPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GasPrice))) + i-- + dAtA[i] = 0x12 + } + if x.Nonce != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Nonce)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*LegacyTx) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: LegacyTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: LegacyTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + x.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Nonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GasPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Gas", wireType) + } + x.Gas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Gas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.To = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) + if x.Data == nil { + x.Data = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field V", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.V = append(x.V[:0], dAtA[iNdEx:postIndex]...) + if x.V == nil { + x.V = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field R", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.R = append(x.R[:0], dAtA[iNdEx:postIndex]...) + if x.R == nil { + x.R = []byte{} + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field S", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.S = append(x.S[:0], dAtA[iNdEx:postIndex]...) + if x.S == nil { + x.S = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_AccessListTx_8_list)(nil) + +type _AccessListTx_8_list struct { + list *[]*AccessTuple +} + +func (x *_AccessListTx_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_AccessListTx_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_AccessListTx_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AccessTuple) + (*x.list)[i] = concreteValue +} + +func (x *_AccessListTx_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AccessTuple) + *x.list = append(*x.list, concreteValue) +} + +func (x *_AccessListTx_8_list) AppendMutable() protoreflect.Value { + v := new(AccessTuple) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_AccessListTx_8_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_AccessListTx_8_list) NewElement() protoreflect.Value { + v := new(AccessTuple) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_AccessListTx_8_list) IsValid() bool { + return x.list != nil +} + +var ( + md_AccessListTx protoreflect.MessageDescriptor + fd_AccessListTx_chain_id protoreflect.FieldDescriptor + fd_AccessListTx_nonce protoreflect.FieldDescriptor + fd_AccessListTx_gas_price protoreflect.FieldDescriptor + fd_AccessListTx_gas protoreflect.FieldDescriptor + fd_AccessListTx_to protoreflect.FieldDescriptor + fd_AccessListTx_value protoreflect.FieldDescriptor + fd_AccessListTx_data protoreflect.FieldDescriptor + fd_AccessListTx_accesses protoreflect.FieldDescriptor + fd_AccessListTx_v protoreflect.FieldDescriptor + fd_AccessListTx_r protoreflect.FieldDescriptor + fd_AccessListTx_s protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_tx_proto_init() + md_AccessListTx = File_os_evm_v1_tx_proto.Messages().ByName("AccessListTx") + fd_AccessListTx_chain_id = md_AccessListTx.Fields().ByName("chain_id") + fd_AccessListTx_nonce = md_AccessListTx.Fields().ByName("nonce") + fd_AccessListTx_gas_price = md_AccessListTx.Fields().ByName("gas_price") + fd_AccessListTx_gas = md_AccessListTx.Fields().ByName("gas") + fd_AccessListTx_to = md_AccessListTx.Fields().ByName("to") + fd_AccessListTx_value = md_AccessListTx.Fields().ByName("value") + fd_AccessListTx_data = md_AccessListTx.Fields().ByName("data") + fd_AccessListTx_accesses = md_AccessListTx.Fields().ByName("accesses") + fd_AccessListTx_v = md_AccessListTx.Fields().ByName("v") + fd_AccessListTx_r = md_AccessListTx.Fields().ByName("r") + fd_AccessListTx_s = md_AccessListTx.Fields().ByName("s") +} + +var _ protoreflect.Message = (*fastReflection_AccessListTx)(nil) + +type fastReflection_AccessListTx AccessListTx + +func (x *AccessListTx) ProtoReflect() protoreflect.Message { + return (*fastReflection_AccessListTx)(x) +} + +func (x *AccessListTx) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_tx_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_AccessListTx_messageType fastReflection_AccessListTx_messageType +var _ protoreflect.MessageType = fastReflection_AccessListTx_messageType{} + +type fastReflection_AccessListTx_messageType struct{} + +func (x fastReflection_AccessListTx_messageType) Zero() protoreflect.Message { + return (*fastReflection_AccessListTx)(nil) +} +func (x fastReflection_AccessListTx_messageType) New() protoreflect.Message { + return new(fastReflection_AccessListTx) +} +func (x fastReflection_AccessListTx_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AccessListTx +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AccessListTx) Descriptor() protoreflect.MessageDescriptor { + return md_AccessListTx +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_AccessListTx) Type() protoreflect.MessageType { + return _fastReflection_AccessListTx_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AccessListTx) New() protoreflect.Message { + return new(fastReflection_AccessListTx) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AccessListTx) Interface() protoreflect.ProtoMessage { + return (*AccessListTx)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_AccessListTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ChainId != "" { + value := protoreflect.ValueOfString(x.ChainId) + if !f(fd_AccessListTx_chain_id, value) { + return + } + } + if x.Nonce != uint64(0) { + value := protoreflect.ValueOfUint64(x.Nonce) + if !f(fd_AccessListTx_nonce, value) { + return + } + } + if x.GasPrice != "" { + value := protoreflect.ValueOfString(x.GasPrice) + if !f(fd_AccessListTx_gas_price, value) { + return + } + } + if x.Gas != uint64(0) { + value := protoreflect.ValueOfUint64(x.Gas) + if !f(fd_AccessListTx_gas, value) { + return + } + } + if x.To != "" { + value := protoreflect.ValueOfString(x.To) + if !f(fd_AccessListTx_to, value) { + return + } + } + if x.Value != "" { + value := protoreflect.ValueOfString(x.Value) + if !f(fd_AccessListTx_value, value) { + return + } + } + if len(x.Data) != 0 { + value := protoreflect.ValueOfBytes(x.Data) + if !f(fd_AccessListTx_data, value) { + return + } + } + if len(x.Accesses) != 0 { + value := protoreflect.ValueOfList(&_AccessListTx_8_list{list: &x.Accesses}) + if !f(fd_AccessListTx_accesses, value) { + return + } + } + if len(x.V) != 0 { + value := protoreflect.ValueOfBytes(x.V) + if !f(fd_AccessListTx_v, value) { + return + } + } + if len(x.R) != 0 { + value := protoreflect.ValueOfBytes(x.R) + if !f(fd_AccessListTx_r, value) { + return + } + } + if len(x.S) != 0 { + value := protoreflect.ValueOfBytes(x.S) + if !f(fd_AccessListTx_s, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_AccessListTx) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.AccessListTx.chain_id": + return x.ChainId != "" + case "os.evm.v1.AccessListTx.nonce": + return x.Nonce != uint64(0) + case "os.evm.v1.AccessListTx.gas_price": + return x.GasPrice != "" + case "os.evm.v1.AccessListTx.gas": + return x.Gas != uint64(0) + case "os.evm.v1.AccessListTx.to": + return x.To != "" + case "os.evm.v1.AccessListTx.value": + return x.Value != "" + case "os.evm.v1.AccessListTx.data": + return len(x.Data) != 0 + case "os.evm.v1.AccessListTx.accesses": + return len(x.Accesses) != 0 + case "os.evm.v1.AccessListTx.v": + return len(x.V) != 0 + case "os.evm.v1.AccessListTx.r": + return len(x.R) != 0 + case "os.evm.v1.AccessListTx.s": + return len(x.S) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessListTx")) + } + panic(fmt.Errorf("message os.evm.v1.AccessListTx does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessListTx) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.AccessListTx.chain_id": + x.ChainId = "" + case "os.evm.v1.AccessListTx.nonce": + x.Nonce = uint64(0) + case "os.evm.v1.AccessListTx.gas_price": + x.GasPrice = "" + case "os.evm.v1.AccessListTx.gas": + x.Gas = uint64(0) + case "os.evm.v1.AccessListTx.to": + x.To = "" + case "os.evm.v1.AccessListTx.value": + x.Value = "" + case "os.evm.v1.AccessListTx.data": + x.Data = nil + case "os.evm.v1.AccessListTx.accesses": + x.Accesses = nil + case "os.evm.v1.AccessListTx.v": + x.V = nil + case "os.evm.v1.AccessListTx.r": + x.R = nil + case "os.evm.v1.AccessListTx.s": + x.S = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessListTx")) + } + panic(fmt.Errorf("message os.evm.v1.AccessListTx does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_AccessListTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.AccessListTx.chain_id": + value := x.ChainId + return protoreflect.ValueOfString(value) + case "os.evm.v1.AccessListTx.nonce": + value := x.Nonce + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.AccessListTx.gas_price": + value := x.GasPrice + return protoreflect.ValueOfString(value) + case "os.evm.v1.AccessListTx.gas": + value := x.Gas + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.AccessListTx.to": + value := x.To + return protoreflect.ValueOfString(value) + case "os.evm.v1.AccessListTx.value": + value := x.Value + return protoreflect.ValueOfString(value) + case "os.evm.v1.AccessListTx.data": + value := x.Data + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.AccessListTx.accesses": + if len(x.Accesses) == 0 { + return protoreflect.ValueOfList(&_AccessListTx_8_list{}) + } + listValue := &_AccessListTx_8_list{list: &x.Accesses} + return protoreflect.ValueOfList(listValue) + case "os.evm.v1.AccessListTx.v": + value := x.V + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.AccessListTx.r": + value := x.R + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.AccessListTx.s": + value := x.S + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessListTx")) + } + panic(fmt.Errorf("message os.evm.v1.AccessListTx does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessListTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.AccessListTx.chain_id": + x.ChainId = value.Interface().(string) + case "os.evm.v1.AccessListTx.nonce": + x.Nonce = value.Uint() + case "os.evm.v1.AccessListTx.gas_price": + x.GasPrice = value.Interface().(string) + case "os.evm.v1.AccessListTx.gas": + x.Gas = value.Uint() + case "os.evm.v1.AccessListTx.to": + x.To = value.Interface().(string) + case "os.evm.v1.AccessListTx.value": + x.Value = value.Interface().(string) + case "os.evm.v1.AccessListTx.data": + x.Data = value.Bytes() + case "os.evm.v1.AccessListTx.accesses": + lv := value.List() + clv := lv.(*_AccessListTx_8_list) + x.Accesses = *clv.list + case "os.evm.v1.AccessListTx.v": + x.V = value.Bytes() + case "os.evm.v1.AccessListTx.r": + x.R = value.Bytes() + case "os.evm.v1.AccessListTx.s": + x.S = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessListTx")) + } + panic(fmt.Errorf("message os.evm.v1.AccessListTx does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessListTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.AccessListTx.accesses": + if x.Accesses == nil { + x.Accesses = []*AccessTuple{} + } + value := &_AccessListTx_8_list{list: &x.Accesses} + return protoreflect.ValueOfList(value) + case "os.evm.v1.AccessListTx.chain_id": + panic(fmt.Errorf("field chain_id of message os.evm.v1.AccessListTx is not mutable")) + case "os.evm.v1.AccessListTx.nonce": + panic(fmt.Errorf("field nonce of message os.evm.v1.AccessListTx is not mutable")) + case "os.evm.v1.AccessListTx.gas_price": + panic(fmt.Errorf("field gas_price of message os.evm.v1.AccessListTx is not mutable")) + case "os.evm.v1.AccessListTx.gas": + panic(fmt.Errorf("field gas of message os.evm.v1.AccessListTx is not mutable")) + case "os.evm.v1.AccessListTx.to": + panic(fmt.Errorf("field to of message os.evm.v1.AccessListTx is not mutable")) + case "os.evm.v1.AccessListTx.value": + panic(fmt.Errorf("field value of message os.evm.v1.AccessListTx is not mutable")) + case "os.evm.v1.AccessListTx.data": + panic(fmt.Errorf("field data of message os.evm.v1.AccessListTx is not mutable")) + case "os.evm.v1.AccessListTx.v": + panic(fmt.Errorf("field v of message os.evm.v1.AccessListTx is not mutable")) + case "os.evm.v1.AccessListTx.r": + panic(fmt.Errorf("field r of message os.evm.v1.AccessListTx is not mutable")) + case "os.evm.v1.AccessListTx.s": + panic(fmt.Errorf("field s of message os.evm.v1.AccessListTx is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessListTx")) + } + panic(fmt.Errorf("message os.evm.v1.AccessListTx does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_AccessListTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.AccessListTx.chain_id": + return protoreflect.ValueOfString("") + case "os.evm.v1.AccessListTx.nonce": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.AccessListTx.gas_price": + return protoreflect.ValueOfString("") + case "os.evm.v1.AccessListTx.gas": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.AccessListTx.to": + return protoreflect.ValueOfString("") + case "os.evm.v1.AccessListTx.value": + return protoreflect.ValueOfString("") + case "os.evm.v1.AccessListTx.data": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.AccessListTx.accesses": + list := []*AccessTuple{} + return protoreflect.ValueOfList(&_AccessListTx_8_list{list: &list}) + case "os.evm.v1.AccessListTx.v": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.AccessListTx.r": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.AccessListTx.s": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.AccessListTx")) + } + panic(fmt.Errorf("message os.evm.v1.AccessListTx does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_AccessListTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.AccessListTx", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_AccessListTx) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AccessListTx) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_AccessListTx) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AccessListTx) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.ChainId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Nonce != 0 { + n += 1 + runtime.Sov(uint64(x.Nonce)) + } + l = len(x.GasPrice) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Gas != 0 { + n += 1 + runtime.Sov(uint64(x.Gas)) + } + l = len(x.To) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Value) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Data) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Accesses) > 0 { + for _, e := range x.Accesses { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.V) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.R) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.S) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*AccessListTx) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.S) > 0 { + i -= len(x.S) + copy(dAtA[i:], x.S) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.S))) + i-- + dAtA[i] = 0x5a + } + if len(x.R) > 0 { + i -= len(x.R) + copy(dAtA[i:], x.R) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.R))) + i-- + dAtA[i] = 0x52 + } + if len(x.V) > 0 { + i -= len(x.V) + copy(dAtA[i:], x.V) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.V))) + i-- + dAtA[i] = 0x4a + } + if len(x.Accesses) > 0 { + for iNdEx := len(x.Accesses) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Accesses[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x42 + } + } + if len(x.Data) > 0 { + i -= len(x.Data) + copy(dAtA[i:], x.Data) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) + i-- + dAtA[i] = 0x3a + } + if len(x.Value) > 0 { + i -= len(x.Value) + copy(dAtA[i:], x.Value) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Value))) + i-- + dAtA[i] = 0x32 + } + if len(x.To) > 0 { + i -= len(x.To) + copy(dAtA[i:], x.To) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.To))) + i-- + dAtA[i] = 0x2a + } + if x.Gas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Gas)) + i-- + dAtA[i] = 0x20 + } + if len(x.GasPrice) > 0 { + i -= len(x.GasPrice) + copy(dAtA[i:], x.GasPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GasPrice))) + i-- + dAtA[i] = 0x1a + } + if x.Nonce != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Nonce)) + i-- + dAtA[i] = 0x10 + } + if len(x.ChainId) > 0 { + i -= len(x.ChainId) + copy(dAtA[i:], x.ChainId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*AccessListTx) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccessListTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccessListTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + x.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Nonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GasPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Gas", wireType) + } + x.Gas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Gas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.To = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) + if x.Data == nil { + x.Data = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Accesses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Accesses = append(x.Accesses, &AccessTuple{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Accesses[len(x.Accesses)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field V", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.V = append(x.V[:0], dAtA[iNdEx:postIndex]...) + if x.V == nil { + x.V = []byte{} + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field R", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.R = append(x.R[:0], dAtA[iNdEx:postIndex]...) + if x.R == nil { + x.R = []byte{} + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field S", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.S = append(x.S[:0], dAtA[iNdEx:postIndex]...) + if x.S == nil { + x.S = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_DynamicFeeTx_9_list)(nil) + +type _DynamicFeeTx_9_list struct { + list *[]*AccessTuple +} + +func (x *_DynamicFeeTx_9_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DynamicFeeTx_9_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DynamicFeeTx_9_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AccessTuple) + (*x.list)[i] = concreteValue +} + +func (x *_DynamicFeeTx_9_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AccessTuple) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DynamicFeeTx_9_list) AppendMutable() protoreflect.Value { + v := new(AccessTuple) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DynamicFeeTx_9_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DynamicFeeTx_9_list) NewElement() protoreflect.Value { + v := new(AccessTuple) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DynamicFeeTx_9_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DynamicFeeTx protoreflect.MessageDescriptor + fd_DynamicFeeTx_chain_id protoreflect.FieldDescriptor + fd_DynamicFeeTx_nonce protoreflect.FieldDescriptor + fd_DynamicFeeTx_gas_tip_cap protoreflect.FieldDescriptor + fd_DynamicFeeTx_gas_fee_cap protoreflect.FieldDescriptor + fd_DynamicFeeTx_gas protoreflect.FieldDescriptor + fd_DynamicFeeTx_to protoreflect.FieldDescriptor + fd_DynamicFeeTx_value protoreflect.FieldDescriptor + fd_DynamicFeeTx_data protoreflect.FieldDescriptor + fd_DynamicFeeTx_accesses protoreflect.FieldDescriptor + fd_DynamicFeeTx_v protoreflect.FieldDescriptor + fd_DynamicFeeTx_r protoreflect.FieldDescriptor + fd_DynamicFeeTx_s protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_tx_proto_init() + md_DynamicFeeTx = File_os_evm_v1_tx_proto.Messages().ByName("DynamicFeeTx") + fd_DynamicFeeTx_chain_id = md_DynamicFeeTx.Fields().ByName("chain_id") + fd_DynamicFeeTx_nonce = md_DynamicFeeTx.Fields().ByName("nonce") + fd_DynamicFeeTx_gas_tip_cap = md_DynamicFeeTx.Fields().ByName("gas_tip_cap") + fd_DynamicFeeTx_gas_fee_cap = md_DynamicFeeTx.Fields().ByName("gas_fee_cap") + fd_DynamicFeeTx_gas = md_DynamicFeeTx.Fields().ByName("gas") + fd_DynamicFeeTx_to = md_DynamicFeeTx.Fields().ByName("to") + fd_DynamicFeeTx_value = md_DynamicFeeTx.Fields().ByName("value") + fd_DynamicFeeTx_data = md_DynamicFeeTx.Fields().ByName("data") + fd_DynamicFeeTx_accesses = md_DynamicFeeTx.Fields().ByName("accesses") + fd_DynamicFeeTx_v = md_DynamicFeeTx.Fields().ByName("v") + fd_DynamicFeeTx_r = md_DynamicFeeTx.Fields().ByName("r") + fd_DynamicFeeTx_s = md_DynamicFeeTx.Fields().ByName("s") +} + +var _ protoreflect.Message = (*fastReflection_DynamicFeeTx)(nil) + +type fastReflection_DynamicFeeTx DynamicFeeTx + +func (x *DynamicFeeTx) ProtoReflect() protoreflect.Message { + return (*fastReflection_DynamicFeeTx)(x) +} + +func (x *DynamicFeeTx) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_tx_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DynamicFeeTx_messageType fastReflection_DynamicFeeTx_messageType +var _ protoreflect.MessageType = fastReflection_DynamicFeeTx_messageType{} + +type fastReflection_DynamicFeeTx_messageType struct{} + +func (x fastReflection_DynamicFeeTx_messageType) Zero() protoreflect.Message { + return (*fastReflection_DynamicFeeTx)(nil) +} +func (x fastReflection_DynamicFeeTx_messageType) New() protoreflect.Message { + return new(fastReflection_DynamicFeeTx) +} +func (x fastReflection_DynamicFeeTx_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DynamicFeeTx +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DynamicFeeTx) Descriptor() protoreflect.MessageDescriptor { + return md_DynamicFeeTx +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_DynamicFeeTx) Type() protoreflect.MessageType { + return _fastReflection_DynamicFeeTx_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DynamicFeeTx) New() protoreflect.Message { + return new(fastReflection_DynamicFeeTx) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DynamicFeeTx) Interface() protoreflect.ProtoMessage { + return (*DynamicFeeTx)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_DynamicFeeTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ChainId != "" { + value := protoreflect.ValueOfString(x.ChainId) + if !f(fd_DynamicFeeTx_chain_id, value) { + return + } + } + if x.Nonce != uint64(0) { + value := protoreflect.ValueOfUint64(x.Nonce) + if !f(fd_DynamicFeeTx_nonce, value) { + return + } + } + if x.GasTipCap != "" { + value := protoreflect.ValueOfString(x.GasTipCap) + if !f(fd_DynamicFeeTx_gas_tip_cap, value) { + return + } + } + if x.GasFeeCap != "" { + value := protoreflect.ValueOfString(x.GasFeeCap) + if !f(fd_DynamicFeeTx_gas_fee_cap, value) { + return + } + } + if x.Gas != uint64(0) { + value := protoreflect.ValueOfUint64(x.Gas) + if !f(fd_DynamicFeeTx_gas, value) { + return + } + } + if x.To != "" { + value := protoreflect.ValueOfString(x.To) + if !f(fd_DynamicFeeTx_to, value) { + return + } + } + if x.Value != "" { + value := protoreflect.ValueOfString(x.Value) + if !f(fd_DynamicFeeTx_value, value) { + return + } + } + if len(x.Data) != 0 { + value := protoreflect.ValueOfBytes(x.Data) + if !f(fd_DynamicFeeTx_data, value) { + return + } + } + if len(x.Accesses) != 0 { + value := protoreflect.ValueOfList(&_DynamicFeeTx_9_list{list: &x.Accesses}) + if !f(fd_DynamicFeeTx_accesses, value) { + return + } + } + if len(x.V) != 0 { + value := protoreflect.ValueOfBytes(x.V) + if !f(fd_DynamicFeeTx_v, value) { + return + } + } + if len(x.R) != 0 { + value := protoreflect.ValueOfBytes(x.R) + if !f(fd_DynamicFeeTx_r, value) { + return + } + } + if len(x.S) != 0 { + value := protoreflect.ValueOfBytes(x.S) + if !f(fd_DynamicFeeTx_s, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_DynamicFeeTx) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.DynamicFeeTx.chain_id": + return x.ChainId != "" + case "os.evm.v1.DynamicFeeTx.nonce": + return x.Nonce != uint64(0) + case "os.evm.v1.DynamicFeeTx.gas_tip_cap": + return x.GasTipCap != "" + case "os.evm.v1.DynamicFeeTx.gas_fee_cap": + return x.GasFeeCap != "" + case "os.evm.v1.DynamicFeeTx.gas": + return x.Gas != uint64(0) + case "os.evm.v1.DynamicFeeTx.to": + return x.To != "" + case "os.evm.v1.DynamicFeeTx.value": + return x.Value != "" + case "os.evm.v1.DynamicFeeTx.data": + return len(x.Data) != 0 + case "os.evm.v1.DynamicFeeTx.accesses": + return len(x.Accesses) != 0 + case "os.evm.v1.DynamicFeeTx.v": + return len(x.V) != 0 + case "os.evm.v1.DynamicFeeTx.r": + return len(x.R) != 0 + case "os.evm.v1.DynamicFeeTx.s": + return len(x.S) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.DynamicFeeTx")) + } + panic(fmt.Errorf("message os.evm.v1.DynamicFeeTx does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DynamicFeeTx) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.DynamicFeeTx.chain_id": + x.ChainId = "" + case "os.evm.v1.DynamicFeeTx.nonce": + x.Nonce = uint64(0) + case "os.evm.v1.DynamicFeeTx.gas_tip_cap": + x.GasTipCap = "" + case "os.evm.v1.DynamicFeeTx.gas_fee_cap": + x.GasFeeCap = "" + case "os.evm.v1.DynamicFeeTx.gas": + x.Gas = uint64(0) + case "os.evm.v1.DynamicFeeTx.to": + x.To = "" + case "os.evm.v1.DynamicFeeTx.value": + x.Value = "" + case "os.evm.v1.DynamicFeeTx.data": + x.Data = nil + case "os.evm.v1.DynamicFeeTx.accesses": + x.Accesses = nil + case "os.evm.v1.DynamicFeeTx.v": + x.V = nil + case "os.evm.v1.DynamicFeeTx.r": + x.R = nil + case "os.evm.v1.DynamicFeeTx.s": + x.S = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.DynamicFeeTx")) + } + panic(fmt.Errorf("message os.evm.v1.DynamicFeeTx does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_DynamicFeeTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.DynamicFeeTx.chain_id": + value := x.ChainId + return protoreflect.ValueOfString(value) + case "os.evm.v1.DynamicFeeTx.nonce": + value := x.Nonce + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.DynamicFeeTx.gas_tip_cap": + value := x.GasTipCap + return protoreflect.ValueOfString(value) + case "os.evm.v1.DynamicFeeTx.gas_fee_cap": + value := x.GasFeeCap + return protoreflect.ValueOfString(value) + case "os.evm.v1.DynamicFeeTx.gas": + value := x.Gas + return protoreflect.ValueOfUint64(value) + case "os.evm.v1.DynamicFeeTx.to": + value := x.To + return protoreflect.ValueOfString(value) + case "os.evm.v1.DynamicFeeTx.value": + value := x.Value + return protoreflect.ValueOfString(value) + case "os.evm.v1.DynamicFeeTx.data": + value := x.Data + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.DynamicFeeTx.accesses": + if len(x.Accesses) == 0 { + return protoreflect.ValueOfList(&_DynamicFeeTx_9_list{}) + } + listValue := &_DynamicFeeTx_9_list{list: &x.Accesses} + return protoreflect.ValueOfList(listValue) + case "os.evm.v1.DynamicFeeTx.v": + value := x.V + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.DynamicFeeTx.r": + value := x.R + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.DynamicFeeTx.s": + value := x.S + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.DynamicFeeTx")) + } + panic(fmt.Errorf("message os.evm.v1.DynamicFeeTx does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DynamicFeeTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.DynamicFeeTx.chain_id": + x.ChainId = value.Interface().(string) + case "os.evm.v1.DynamicFeeTx.nonce": + x.Nonce = value.Uint() + case "os.evm.v1.DynamicFeeTx.gas_tip_cap": + x.GasTipCap = value.Interface().(string) + case "os.evm.v1.DynamicFeeTx.gas_fee_cap": + x.GasFeeCap = value.Interface().(string) + case "os.evm.v1.DynamicFeeTx.gas": + x.Gas = value.Uint() + case "os.evm.v1.DynamicFeeTx.to": + x.To = value.Interface().(string) + case "os.evm.v1.DynamicFeeTx.value": + x.Value = value.Interface().(string) + case "os.evm.v1.DynamicFeeTx.data": + x.Data = value.Bytes() + case "os.evm.v1.DynamicFeeTx.accesses": + lv := value.List() + clv := lv.(*_DynamicFeeTx_9_list) + x.Accesses = *clv.list + case "os.evm.v1.DynamicFeeTx.v": + x.V = value.Bytes() + case "os.evm.v1.DynamicFeeTx.r": + x.R = value.Bytes() + case "os.evm.v1.DynamicFeeTx.s": + x.S = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.DynamicFeeTx")) + } + panic(fmt.Errorf("message os.evm.v1.DynamicFeeTx does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DynamicFeeTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.DynamicFeeTx.accesses": + if x.Accesses == nil { + x.Accesses = []*AccessTuple{} + } + value := &_DynamicFeeTx_9_list{list: &x.Accesses} + return protoreflect.ValueOfList(value) + case "os.evm.v1.DynamicFeeTx.chain_id": + panic(fmt.Errorf("field chain_id of message os.evm.v1.DynamicFeeTx is not mutable")) + case "os.evm.v1.DynamicFeeTx.nonce": + panic(fmt.Errorf("field nonce of message os.evm.v1.DynamicFeeTx is not mutable")) + case "os.evm.v1.DynamicFeeTx.gas_tip_cap": + panic(fmt.Errorf("field gas_tip_cap of message os.evm.v1.DynamicFeeTx is not mutable")) + case "os.evm.v1.DynamicFeeTx.gas_fee_cap": + panic(fmt.Errorf("field gas_fee_cap of message os.evm.v1.DynamicFeeTx is not mutable")) + case "os.evm.v1.DynamicFeeTx.gas": + panic(fmt.Errorf("field gas of message os.evm.v1.DynamicFeeTx is not mutable")) + case "os.evm.v1.DynamicFeeTx.to": + panic(fmt.Errorf("field to of message os.evm.v1.DynamicFeeTx is not mutable")) + case "os.evm.v1.DynamicFeeTx.value": + panic(fmt.Errorf("field value of message os.evm.v1.DynamicFeeTx is not mutable")) + case "os.evm.v1.DynamicFeeTx.data": + panic(fmt.Errorf("field data of message os.evm.v1.DynamicFeeTx is not mutable")) + case "os.evm.v1.DynamicFeeTx.v": + panic(fmt.Errorf("field v of message os.evm.v1.DynamicFeeTx is not mutable")) + case "os.evm.v1.DynamicFeeTx.r": + panic(fmt.Errorf("field r of message os.evm.v1.DynamicFeeTx is not mutable")) + case "os.evm.v1.DynamicFeeTx.s": + panic(fmt.Errorf("field s of message os.evm.v1.DynamicFeeTx is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.DynamicFeeTx")) + } + panic(fmt.Errorf("message os.evm.v1.DynamicFeeTx does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DynamicFeeTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.DynamicFeeTx.chain_id": + return protoreflect.ValueOfString("") + case "os.evm.v1.DynamicFeeTx.nonce": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.DynamicFeeTx.gas_tip_cap": + return protoreflect.ValueOfString("") + case "os.evm.v1.DynamicFeeTx.gas_fee_cap": + return protoreflect.ValueOfString("") + case "os.evm.v1.DynamicFeeTx.gas": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.evm.v1.DynamicFeeTx.to": + return protoreflect.ValueOfString("") + case "os.evm.v1.DynamicFeeTx.value": + return protoreflect.ValueOfString("") + case "os.evm.v1.DynamicFeeTx.data": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.DynamicFeeTx.accesses": + list := []*AccessTuple{} + return protoreflect.ValueOfList(&_DynamicFeeTx_9_list{list: &list}) + case "os.evm.v1.DynamicFeeTx.v": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.DynamicFeeTx.r": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.DynamicFeeTx.s": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.DynamicFeeTx")) + } + panic(fmt.Errorf("message os.evm.v1.DynamicFeeTx does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DynamicFeeTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.DynamicFeeTx", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DynamicFeeTx) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DynamicFeeTx) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DynamicFeeTx) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DynamicFeeTx) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DynamicFeeTx) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.ChainId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Nonce != 0 { + n += 1 + runtime.Sov(uint64(x.Nonce)) + } + l = len(x.GasTipCap) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.GasFeeCap) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Gas != 0 { + n += 1 + runtime.Sov(uint64(x.Gas)) + } + l = len(x.To) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Value) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Data) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Accesses) > 0 { + for _, e := range x.Accesses { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.V) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.R) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.S) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DynamicFeeTx) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.S) > 0 { + i -= len(x.S) + copy(dAtA[i:], x.S) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.S))) + i-- + dAtA[i] = 0x62 + } + if len(x.R) > 0 { + i -= len(x.R) + copy(dAtA[i:], x.R) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.R))) + i-- + dAtA[i] = 0x5a + } + if len(x.V) > 0 { + i -= len(x.V) + copy(dAtA[i:], x.V) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.V))) + i-- + dAtA[i] = 0x52 + } + if len(x.Accesses) > 0 { + for iNdEx := len(x.Accesses) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Accesses[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x4a + } + } + if len(x.Data) > 0 { + i -= len(x.Data) + copy(dAtA[i:], x.Data) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) + i-- + dAtA[i] = 0x42 + } + if len(x.Value) > 0 { + i -= len(x.Value) + copy(dAtA[i:], x.Value) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Value))) + i-- + dAtA[i] = 0x3a + } + if len(x.To) > 0 { + i -= len(x.To) + copy(dAtA[i:], x.To) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.To))) + i-- + dAtA[i] = 0x32 + } + if x.Gas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Gas)) + i-- + dAtA[i] = 0x28 + } + if len(x.GasFeeCap) > 0 { + i -= len(x.GasFeeCap) + copy(dAtA[i:], x.GasFeeCap) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GasFeeCap))) + i-- + dAtA[i] = 0x22 + } + if len(x.GasTipCap) > 0 { + i -= len(x.GasTipCap) + copy(dAtA[i:], x.GasTipCap) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GasTipCap))) + i-- + dAtA[i] = 0x1a + } + if x.Nonce != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Nonce)) + i-- + dAtA[i] = 0x10 + } + if len(x.ChainId) > 0 { + i -= len(x.ChainId) + copy(dAtA[i:], x.ChainId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DynamicFeeTx) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DynamicFeeTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DynamicFeeTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + x.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Nonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasTipCap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GasTipCap = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasFeeCap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GasFeeCap = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Gas", wireType) + } + x.Gas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Gas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.To = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) + if x.Data == nil { + x.Data = []byte{} + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Accesses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Accesses = append(x.Accesses, &AccessTuple{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Accesses[len(x.Accesses)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field V", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.V = append(x.V[:0], dAtA[iNdEx:postIndex]...) + if x.V == nil { + x.V = []byte{} + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field R", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.R = append(x.R[:0], dAtA[iNdEx:postIndex]...) + if x.R == nil { + x.R = []byte{} + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field S", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.S = append(x.S[:0], dAtA[iNdEx:postIndex]...) + if x.S == nil { + x.S = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_ExtensionOptionsEthereumTx protoreflect.MessageDescriptor +) + +func init() { + file_os_evm_v1_tx_proto_init() + md_ExtensionOptionsEthereumTx = File_os_evm_v1_tx_proto.Messages().ByName("ExtensionOptionsEthereumTx") +} + +var _ protoreflect.Message = (*fastReflection_ExtensionOptionsEthereumTx)(nil) + +type fastReflection_ExtensionOptionsEthereumTx ExtensionOptionsEthereumTx + +func (x *ExtensionOptionsEthereumTx) ProtoReflect() protoreflect.Message { + return (*fastReflection_ExtensionOptionsEthereumTx)(x) +} + +func (x *ExtensionOptionsEthereumTx) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_tx_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ExtensionOptionsEthereumTx_messageType fastReflection_ExtensionOptionsEthereumTx_messageType +var _ protoreflect.MessageType = fastReflection_ExtensionOptionsEthereumTx_messageType{} + +type fastReflection_ExtensionOptionsEthereumTx_messageType struct{} + +func (x fastReflection_ExtensionOptionsEthereumTx_messageType) Zero() protoreflect.Message { + return (*fastReflection_ExtensionOptionsEthereumTx)(nil) +} +func (x fastReflection_ExtensionOptionsEthereumTx_messageType) New() protoreflect.Message { + return new(fastReflection_ExtensionOptionsEthereumTx) +} +func (x fastReflection_ExtensionOptionsEthereumTx_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ExtensionOptionsEthereumTx +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ExtensionOptionsEthereumTx) Descriptor() protoreflect.MessageDescriptor { + return md_ExtensionOptionsEthereumTx +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ExtensionOptionsEthereumTx) Type() protoreflect.MessageType { + return _fastReflection_ExtensionOptionsEthereumTx_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ExtensionOptionsEthereumTx) New() protoreflect.Message { + return new(fastReflection_ExtensionOptionsEthereumTx) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ExtensionOptionsEthereumTx) Interface() protoreflect.ProtoMessage { + return (*ExtensionOptionsEthereumTx)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ExtensionOptionsEthereumTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ExtensionOptionsEthereumTx) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.ExtensionOptionsEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtensionOptionsEthereumTx) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.ExtensionOptionsEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ExtensionOptionsEthereumTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.ExtensionOptionsEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.ExtensionOptionsEthereumTx does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtensionOptionsEthereumTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.ExtensionOptionsEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtensionOptionsEthereumTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.ExtensionOptionsEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ExtensionOptionsEthereumTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.ExtensionOptionsEthereumTx")) + } + panic(fmt.Errorf("message os.evm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ExtensionOptionsEthereumTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.ExtensionOptionsEthereumTx", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ExtensionOptionsEthereumTx) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtensionOptionsEthereumTx) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ExtensionOptionsEthereumTx) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ExtensionOptionsEthereumTx) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ExtensionOptionsEthereumTx) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ExtensionOptionsEthereumTx) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ExtensionOptionsEthereumTx) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExtensionOptionsEthereumTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExtensionOptionsEthereumTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_MsgEthereumTxResponse_2_list)(nil) + +type _MsgEthereumTxResponse_2_list struct { + list *[]*Log +} + +func (x *_MsgEthereumTxResponse_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgEthereumTxResponse_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgEthereumTxResponse_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Log) + (*x.list)[i] = concreteValue +} + +func (x *_MsgEthereumTxResponse_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Log) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgEthereumTxResponse_2_list) AppendMutable() protoreflect.Value { + v := new(Log) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgEthereumTxResponse_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgEthereumTxResponse_2_list) NewElement() protoreflect.Value { + v := new(Log) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgEthereumTxResponse_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgEthereumTxResponse protoreflect.MessageDescriptor + fd_MsgEthereumTxResponse_hash protoreflect.FieldDescriptor + fd_MsgEthereumTxResponse_logs protoreflect.FieldDescriptor + fd_MsgEthereumTxResponse_ret protoreflect.FieldDescriptor + fd_MsgEthereumTxResponse_vm_error protoreflect.FieldDescriptor + fd_MsgEthereumTxResponse_gas_used protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_tx_proto_init() + md_MsgEthereumTxResponse = File_os_evm_v1_tx_proto.Messages().ByName("MsgEthereumTxResponse") + fd_MsgEthereumTxResponse_hash = md_MsgEthereumTxResponse.Fields().ByName("hash") + fd_MsgEthereumTxResponse_logs = md_MsgEthereumTxResponse.Fields().ByName("logs") + fd_MsgEthereumTxResponse_ret = md_MsgEthereumTxResponse.Fields().ByName("ret") + fd_MsgEthereumTxResponse_vm_error = md_MsgEthereumTxResponse.Fields().ByName("vm_error") + fd_MsgEthereumTxResponse_gas_used = md_MsgEthereumTxResponse.Fields().ByName("gas_used") +} + +var _ protoreflect.Message = (*fastReflection_MsgEthereumTxResponse)(nil) + +type fastReflection_MsgEthereumTxResponse MsgEthereumTxResponse + +func (x *MsgEthereumTxResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgEthereumTxResponse)(x) +} + +func (x *MsgEthereumTxResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_tx_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgEthereumTxResponse_messageType fastReflection_MsgEthereumTxResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgEthereumTxResponse_messageType{} + +type fastReflection_MsgEthereumTxResponse_messageType struct{} + +func (x fastReflection_MsgEthereumTxResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgEthereumTxResponse)(nil) +} +func (x fastReflection_MsgEthereumTxResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgEthereumTxResponse) +} +func (x fastReflection_MsgEthereumTxResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEthereumTxResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgEthereumTxResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEthereumTxResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgEthereumTxResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgEthereumTxResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgEthereumTxResponse) New() protoreflect.Message { + return new(fastReflection_MsgEthereumTxResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgEthereumTxResponse) Interface() protoreflect.ProtoMessage { + return (*MsgEthereumTxResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgEthereumTxResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Hash != "" { + value := protoreflect.ValueOfString(x.Hash) + if !f(fd_MsgEthereumTxResponse_hash, value) { + return + } + } + if len(x.Logs) != 0 { + value := protoreflect.ValueOfList(&_MsgEthereumTxResponse_2_list{list: &x.Logs}) + if !f(fd_MsgEthereumTxResponse_logs, value) { + return + } + } + if len(x.Ret) != 0 { + value := protoreflect.ValueOfBytes(x.Ret) + if !f(fd_MsgEthereumTxResponse_ret, value) { + return + } + } + if x.VmError != "" { + value := protoreflect.ValueOfString(x.VmError) + if !f(fd_MsgEthereumTxResponse_vm_error, value) { + return + } + } + if x.GasUsed != uint64(0) { + value := protoreflect.ValueOfUint64(x.GasUsed) + if !f(fd_MsgEthereumTxResponse_gas_used, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgEthereumTxResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.MsgEthereumTxResponse.hash": + return x.Hash != "" + case "os.evm.v1.MsgEthereumTxResponse.logs": + return len(x.Logs) != 0 + case "os.evm.v1.MsgEthereumTxResponse.ret": + return len(x.Ret) != 0 + case "os.evm.v1.MsgEthereumTxResponse.vm_error": + return x.VmError != "" + case "os.evm.v1.MsgEthereumTxResponse.gas_used": + return x.GasUsed != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgEthereumTxResponse")) + } + panic(fmt.Errorf("message os.evm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEthereumTxResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.MsgEthereumTxResponse.hash": + x.Hash = "" + case "os.evm.v1.MsgEthereumTxResponse.logs": + x.Logs = nil + case "os.evm.v1.MsgEthereumTxResponse.ret": + x.Ret = nil + case "os.evm.v1.MsgEthereumTxResponse.vm_error": + x.VmError = "" + case "os.evm.v1.MsgEthereumTxResponse.gas_used": + x.GasUsed = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgEthereumTxResponse")) + } + panic(fmt.Errorf("message os.evm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgEthereumTxResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.MsgEthereumTxResponse.hash": + value := x.Hash + return protoreflect.ValueOfString(value) + case "os.evm.v1.MsgEthereumTxResponse.logs": + if len(x.Logs) == 0 { + return protoreflect.ValueOfList(&_MsgEthereumTxResponse_2_list{}) + } + listValue := &_MsgEthereumTxResponse_2_list{list: &x.Logs} + return protoreflect.ValueOfList(listValue) + case "os.evm.v1.MsgEthereumTxResponse.ret": + value := x.Ret + return protoreflect.ValueOfBytes(value) + case "os.evm.v1.MsgEthereumTxResponse.vm_error": + value := x.VmError + return protoreflect.ValueOfString(value) + case "os.evm.v1.MsgEthereumTxResponse.gas_used": + value := x.GasUsed + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgEthereumTxResponse")) + } + panic(fmt.Errorf("message os.evm.v1.MsgEthereumTxResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEthereumTxResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.MsgEthereumTxResponse.hash": + x.Hash = value.Interface().(string) + case "os.evm.v1.MsgEthereumTxResponse.logs": + lv := value.List() + clv := lv.(*_MsgEthereumTxResponse_2_list) + x.Logs = *clv.list + case "os.evm.v1.MsgEthereumTxResponse.ret": + x.Ret = value.Bytes() + case "os.evm.v1.MsgEthereumTxResponse.vm_error": + x.VmError = value.Interface().(string) + case "os.evm.v1.MsgEthereumTxResponse.gas_used": + x.GasUsed = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgEthereumTxResponse")) + } + panic(fmt.Errorf("message os.evm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEthereumTxResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.MsgEthereumTxResponse.logs": + if x.Logs == nil { + x.Logs = []*Log{} + } + value := &_MsgEthereumTxResponse_2_list{list: &x.Logs} + return protoreflect.ValueOfList(value) + case "os.evm.v1.MsgEthereumTxResponse.hash": + panic(fmt.Errorf("field hash of message os.evm.v1.MsgEthereumTxResponse is not mutable")) + case "os.evm.v1.MsgEthereumTxResponse.ret": + panic(fmt.Errorf("field ret of message os.evm.v1.MsgEthereumTxResponse is not mutable")) + case "os.evm.v1.MsgEthereumTxResponse.vm_error": + panic(fmt.Errorf("field vm_error of message os.evm.v1.MsgEthereumTxResponse is not mutable")) + case "os.evm.v1.MsgEthereumTxResponse.gas_used": + panic(fmt.Errorf("field gas_used of message os.evm.v1.MsgEthereumTxResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgEthereumTxResponse")) + } + panic(fmt.Errorf("message os.evm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgEthereumTxResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.MsgEthereumTxResponse.hash": + return protoreflect.ValueOfString("") + case "os.evm.v1.MsgEthereumTxResponse.logs": + list := []*Log{} + return protoreflect.ValueOfList(&_MsgEthereumTxResponse_2_list{list: &list}) + case "os.evm.v1.MsgEthereumTxResponse.ret": + return protoreflect.ValueOfBytes(nil) + case "os.evm.v1.MsgEthereumTxResponse.vm_error": + return protoreflect.ValueOfString("") + case "os.evm.v1.MsgEthereumTxResponse.gas_used": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgEthereumTxResponse")) + } + panic(fmt.Errorf("message os.evm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgEthereumTxResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.MsgEthereumTxResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgEthereumTxResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEthereumTxResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgEthereumTxResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgEthereumTxResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgEthereumTxResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Hash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Logs) > 0 { + for _, e := range x.Logs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.Ret) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.VmError) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.GasUsed != 0 { + n += 1 + runtime.Sov(uint64(x.GasUsed)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgEthereumTxResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.GasUsed != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.GasUsed)) + i-- + dAtA[i] = 0x28 + } + if len(x.VmError) > 0 { + i -= len(x.VmError) + copy(dAtA[i:], x.VmError) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VmError))) + i-- + dAtA[i] = 0x22 + } + if len(x.Ret) > 0 { + i -= len(x.Ret) + copy(dAtA[i:], x.Ret) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Ret))) + i-- + dAtA[i] = 0x1a + } + if len(x.Logs) > 0 { + for iNdEx := len(x.Logs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Logs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.Hash) > 0 { + i -= len(x.Hash) + copy(dAtA[i:], x.Hash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Hash))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgEthereumTxResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEthereumTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEthereumTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Logs = append(x.Logs, &Log{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Logs[len(x.Logs)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Ret", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Ret = append(x.Ret[:0], dAtA[iNdEx:postIndex]...) + if x.Ret == nil { + x.Ret = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VmError", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.VmError = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) + } + x.GasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.GasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_os_evm_v1_tx_proto_init() + md_MsgUpdateParams = File_os_evm_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_tx_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.evm.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "os.evm.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.evm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.evm.v1.MsgUpdateParams.authority": + x.Authority = "" + case "os.evm.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.evm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.evm.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "os.evm.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.evm.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.evm.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "os.evm.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.evm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "os.evm.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message os.evm.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.evm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.evm.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "os.evm.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.evm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.MsgUpdateParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_os_evm_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_os_evm_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_evm_v1_tx_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.evm.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.evm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.evm.v1.MsgUpdateParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/evm/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgEthereumTx encapsulates an Ethereum transaction as an SDK message. +type MsgEthereumTx struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // data is inner transaction data of the Ethereum transaction + Data *anypb.Any `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + // size is the encoded storage size of the transaction (DEPRECATED) + Size float64 `protobuf:"fixed64,2,opt,name=size,proto3" json:"size,omitempty"` + // hash of the transaction in hex format + Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` + // from is the ethereum signer address in hex format. This address value is + // checked against the address derived from the signature (V, R, S) using the + // secp256k1 elliptic curve + From string `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"` +} + +func (x *MsgEthereumTx) Reset() { + *x = MsgEthereumTx{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgEthereumTx) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgEthereumTx) ProtoMessage() {} + +// Deprecated: Use MsgEthereumTx.ProtoReflect.Descriptor instead. +func (*MsgEthereumTx) Descriptor() ([]byte, []int) { + return file_os_evm_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgEthereumTx) GetData() *anypb.Any { + if x != nil { + return x.Data + } + return nil +} + +func (x *MsgEthereumTx) GetSize() float64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *MsgEthereumTx) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + +func (x *MsgEthereumTx) GetFrom() string { + if x != nil { + return x.From + } + return "" +} + +// LegacyTx is the transaction data of regular Ethereum transactions. +// NOTE: All non-protected transactions (i.e non EIP155 signed) will fail if the +// AllowUnprotectedTxs parameter is disabled. +type LegacyTx struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // nonce corresponds to the account nonce (transaction sequence). + Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` + // gas_price defines the value for each gas unit + GasPrice string `protobuf:"bytes,2,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` + // gas defines the gas limit defined for the transaction. + Gas uint64 `protobuf:"varint,3,opt,name=gas,proto3" json:"gas,omitempty"` + // to is the hex formatted address of the recipient + To string `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"` + // value defines the unsigned integer value of the transaction amount. + Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` + // data is the data payload bytes of the transaction. + Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` + // v defines the signature value + V []byte `protobuf:"bytes,7,opt,name=v,proto3" json:"v,omitempty"` + // r defines the signature value + R []byte `protobuf:"bytes,8,opt,name=r,proto3" json:"r,omitempty"` + // s define the signature value + S []byte `protobuf:"bytes,9,opt,name=s,proto3" json:"s,omitempty"` +} + +func (x *LegacyTx) Reset() { + *x = LegacyTx{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LegacyTx) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LegacyTx) ProtoMessage() {} + +// Deprecated: Use LegacyTx.ProtoReflect.Descriptor instead. +func (*LegacyTx) Descriptor() ([]byte, []int) { + return file_os_evm_v1_tx_proto_rawDescGZIP(), []int{1} +} + +func (x *LegacyTx) GetNonce() uint64 { + if x != nil { + return x.Nonce + } + return 0 +} + +func (x *LegacyTx) GetGasPrice() string { + if x != nil { + return x.GasPrice + } + return "" +} + +func (x *LegacyTx) GetGas() uint64 { + if x != nil { + return x.Gas + } + return 0 +} + +func (x *LegacyTx) GetTo() string { + if x != nil { + return x.To + } + return "" +} + +func (x *LegacyTx) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *LegacyTx) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *LegacyTx) GetV() []byte { + if x != nil { + return x.V + } + return nil +} + +func (x *LegacyTx) GetR() []byte { + if x != nil { + return x.R + } + return nil +} + +func (x *LegacyTx) GetS() []byte { + if x != nil { + return x.S + } + return nil +} + +// AccessListTx is the data of EIP-2930 access list transactions. +type AccessListTx struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // chain_id of the destination EVM chain + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // nonce corresponds to the account nonce (transaction sequence). + Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + // gas_price defines the value for each gas unit + GasPrice string `protobuf:"bytes,3,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` + // gas defines the gas limit defined for the transaction. + Gas uint64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` + // to is the recipient address in hex format + To string `protobuf:"bytes,5,opt,name=to,proto3" json:"to,omitempty"` + // value defines the unsigned integer value of the transaction amount. + Value string `protobuf:"bytes,6,opt,name=value,proto3" json:"value,omitempty"` + // data is the data payload bytes of the transaction. + Data []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` + // accesses is an array of access tuples + Accesses []*AccessTuple `protobuf:"bytes,8,rep,name=accesses,proto3" json:"accesses,omitempty"` + // v defines the signature value + V []byte `protobuf:"bytes,9,opt,name=v,proto3" json:"v,omitempty"` + // r defines the signature value + R []byte `protobuf:"bytes,10,opt,name=r,proto3" json:"r,omitempty"` + // s define the signature value + S []byte `protobuf:"bytes,11,opt,name=s,proto3" json:"s,omitempty"` +} + +func (x *AccessListTx) Reset() { + *x = AccessListTx{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccessListTx) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccessListTx) ProtoMessage() {} + +// Deprecated: Use AccessListTx.ProtoReflect.Descriptor instead. +func (*AccessListTx) Descriptor() ([]byte, []int) { + return file_os_evm_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *AccessListTx) GetChainId() string { + if x != nil { + return x.ChainId + } + return "" +} + +func (x *AccessListTx) GetNonce() uint64 { + if x != nil { + return x.Nonce + } + return 0 +} + +func (x *AccessListTx) GetGasPrice() string { + if x != nil { + return x.GasPrice + } + return "" +} + +func (x *AccessListTx) GetGas() uint64 { + if x != nil { + return x.Gas + } + return 0 +} + +func (x *AccessListTx) GetTo() string { + if x != nil { + return x.To + } + return "" +} + +func (x *AccessListTx) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *AccessListTx) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *AccessListTx) GetAccesses() []*AccessTuple { + if x != nil { + return x.Accesses + } + return nil +} + +func (x *AccessListTx) GetV() []byte { + if x != nil { + return x.V + } + return nil +} + +func (x *AccessListTx) GetR() []byte { + if x != nil { + return x.R + } + return nil +} + +func (x *AccessListTx) GetS() []byte { + if x != nil { + return x.S + } + return nil +} + +// DynamicFeeTx is the data of EIP-1559 dynamic fee transactions. +type DynamicFeeTx struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // chain_id of the destination EVM chain + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // nonce corresponds to the account nonce (transaction sequence). + Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + // gas_tip_cap defines the max value for the gas tip + GasTipCap string `protobuf:"bytes,3,opt,name=gas_tip_cap,json=gasTipCap,proto3" json:"gas_tip_cap,omitempty"` + // gas_fee_cap defines the max value for the gas fee + GasFeeCap string `protobuf:"bytes,4,opt,name=gas_fee_cap,json=gasFeeCap,proto3" json:"gas_fee_cap,omitempty"` + // gas defines the gas limit defined for the transaction. + Gas uint64 `protobuf:"varint,5,opt,name=gas,proto3" json:"gas,omitempty"` + // to is the hex formatted address of the recipient + To string `protobuf:"bytes,6,opt,name=to,proto3" json:"to,omitempty"` + // value defines the transaction amount. + Value string `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"` + // data is the data payload bytes of the transaction. + Data []byte `protobuf:"bytes,8,opt,name=data,proto3" json:"data,omitempty"` + // accesses is an array of access tuples + Accesses []*AccessTuple `protobuf:"bytes,9,rep,name=accesses,proto3" json:"accesses,omitempty"` + // v defines the signature value + V []byte `protobuf:"bytes,10,opt,name=v,proto3" json:"v,omitempty"` + // r defines the signature value + R []byte `protobuf:"bytes,11,opt,name=r,proto3" json:"r,omitempty"` + // s define the signature value + S []byte `protobuf:"bytes,12,opt,name=s,proto3" json:"s,omitempty"` +} + +func (x *DynamicFeeTx) Reset() { + *x = DynamicFeeTx{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DynamicFeeTx) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DynamicFeeTx) ProtoMessage() {} + +// Deprecated: Use DynamicFeeTx.ProtoReflect.Descriptor instead. +func (*DynamicFeeTx) Descriptor() ([]byte, []int) { + return file_os_evm_v1_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *DynamicFeeTx) GetChainId() string { + if x != nil { + return x.ChainId + } + return "" +} + +func (x *DynamicFeeTx) GetNonce() uint64 { + if x != nil { + return x.Nonce + } + return 0 +} + +func (x *DynamicFeeTx) GetGasTipCap() string { + if x != nil { + return x.GasTipCap + } + return "" +} + +func (x *DynamicFeeTx) GetGasFeeCap() string { + if x != nil { + return x.GasFeeCap + } + return "" +} + +func (x *DynamicFeeTx) GetGas() uint64 { + if x != nil { + return x.Gas + } + return 0 +} + +func (x *DynamicFeeTx) GetTo() string { + if x != nil { + return x.To + } + return "" +} + +func (x *DynamicFeeTx) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *DynamicFeeTx) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *DynamicFeeTx) GetAccesses() []*AccessTuple { + if x != nil { + return x.Accesses + } + return nil +} + +func (x *DynamicFeeTx) GetV() []byte { + if x != nil { + return x.V + } + return nil +} + +func (x *DynamicFeeTx) GetR() []byte { + if x != nil { + return x.R + } + return nil +} + +func (x *DynamicFeeTx) GetS() []byte { + if x != nil { + return x.S + } + return nil +} + +// ExtensionOptionsEthereumTx is an extension option for ethereum transactions +type ExtensionOptionsEthereumTx struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ExtensionOptionsEthereumTx) Reset() { + *x = ExtensionOptionsEthereumTx{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExtensionOptionsEthereumTx) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtensionOptionsEthereumTx) ProtoMessage() {} + +// Deprecated: Use ExtensionOptionsEthereumTx.ProtoReflect.Descriptor instead. +func (*ExtensionOptionsEthereumTx) Descriptor() ([]byte, []int) { + return file_os_evm_v1_tx_proto_rawDescGZIP(), []int{4} +} + +// MsgEthereumTxResponse defines the Msg/EthereumTx response type. +type MsgEthereumTxResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // hash of the ethereum transaction in hex format. This hash differs from the + // Tendermint sha256 hash of the transaction bytes. See + // https://github.com/tendermint/tendermint/issues/6539 for reference + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + // logs contains the transaction hash and the proto-compatible ethereum + // logs. + Logs []*Log `protobuf:"bytes,2,rep,name=logs,proto3" json:"logs,omitempty"` + // ret is the returned data from evm function (result or data supplied with + // revert opcode) + Ret []byte `protobuf:"bytes,3,opt,name=ret,proto3" json:"ret,omitempty"` + // vm_error is the error returned by vm execution + VmError string `protobuf:"bytes,4,opt,name=vm_error,json=vmError,proto3" json:"vm_error,omitempty"` + // gas_used specifies how much gas was consumed by the transaction + GasUsed uint64 `protobuf:"varint,5,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` +} + +func (x *MsgEthereumTxResponse) Reset() { + *x = MsgEthereumTxResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgEthereumTxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgEthereumTxResponse) ProtoMessage() {} + +// Deprecated: Use MsgEthereumTxResponse.ProtoReflect.Descriptor instead. +func (*MsgEthereumTxResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_tx_proto_rawDescGZIP(), []int{5} +} + +func (x *MsgEthereumTxResponse) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + +func (x *MsgEthereumTxResponse) GetLogs() []*Log { + if x != nil { + return x.Logs + } + return nil +} + +func (x *MsgEthereumTxResponse) GetRet() []byte { + if x != nil { + return x.Ret + } + return nil +} + +func (x *MsgEthereumTxResponse) GetVmError() string { + if x != nil { + return x.VmError + } + return "" +} + +func (x *MsgEthereumTxResponse) GetGasUsed() uint64 { + if x != nil { + return x.GasUsed + } + return 0 +} + +// MsgUpdateParams defines a Msg for updating the x/evm module parameters. +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/evm parameters to update. + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_os_evm_v1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_evm_v1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_os_evm_v1_tx_proto_rawDescGZIP(), []int{7} +} + +var File_os_evm_v1_tx_proto protoreflect.FileDescriptor + +var file_os_evm_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x1a, + 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, + 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, + 0x2f, 0x65, 0x76, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x01, 0x0a, 0x0d, 0x4d, + 0x73, 0x67, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x12, 0x28, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x01, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x01, 0x2d, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xf2, 0xde, 0x1f, 0x07, 0x72, 0x6c, 0x70, 0x3a, 0x22, 0x2d, + 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, + 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, + 0x3a, 0x19, 0x88, 0xa0, 0x1f, 0x00, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x6f, 0x73, 0x2f, 0x4d, 0x73, + 0x67, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x22, 0xa1, 0x02, 0x0a, 0x08, + 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x54, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x36, + 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x19, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x08, 0x67, 0x61, + 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x39, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0xe2, 0xde, 0x1f, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x0c, 0x0a, 0x01, 0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x01, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, + 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x73, 0x3a, + 0x1e, 0x88, 0xa0, 0x1f, 0x00, 0xca, 0xb4, 0x2d, 0x06, 0x54, 0x78, 0x44, 0x61, 0x74, 0x61, 0x8a, + 0xe7, 0xb0, 0x2a, 0x0b, 0x6f, 0x73, 0x2f, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x54, 0x78, 0x22, + 0xd0, 0x03, 0x0a, 0x0c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x78, + 0x12, 0x4a, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x2f, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, 0x1f, + 0x07, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0xea, 0xde, 0x1f, 0x07, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x49, 0x44, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6e, 0x6f, 0x6e, + 0x63, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0x52, 0x08, 0x67, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x03, 0x67, 0x61, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, 0x47, 0x61, 0x73, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x39, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xda, 0xde, 0x1f, 0x15, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, 0x1f, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x59, 0x0a, 0x08, 0x61, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x73, + 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x75, + 0x70, 0x6c, 0x65, 0x42, 0x25, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0a, 0x61, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0xaa, 0xdf, 0x1f, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x4c, 0x69, 0x73, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x65, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x76, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x01, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x72, + 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x73, 0x3a, 0x22, + 0x88, 0xa0, 0x1f, 0x00, 0xca, 0xb4, 0x2d, 0x06, 0x54, 0x78, 0x44, 0x61, 0x74, 0x61, 0x8a, 0xe7, + 0xb0, 0x2a, 0x0f, 0x6f, 0x73, 0x2f, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, + 0x54, 0x78, 0x22, 0x8e, 0x04, 0x0a, 0x0c, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x46, 0x65, + 0x65, 0x54, 0x78, 0x12, 0x4a, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0xe2, 0xde, 0x1f, 0x07, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0xea, 0xde, 0x1f, 0x07, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, + 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x67, 0x61, 0x73, 0x5f, 0x74, 0x69, 0x70, + 0x5f, 0x63, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xda, 0xde, 0x1f, 0x15, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x09, 0x67, 0x61, 0x73, 0x54, 0x69, 0x70, 0x43, 0x61, 0x70, + 0x12, 0x39, 0x0a, 0x0b, 0x67, 0x61, 0x73, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x63, 0x61, 0x70, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0x52, 0x09, 0x67, 0x61, 0x73, 0x46, 0x65, 0x65, 0x43, 0x61, 0x70, 0x12, 0x1e, 0x0a, 0x03, 0x67, + 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, 0x47, 0x61, + 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x74, + 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x39, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xda, 0xde, 0x1f, 0x15, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, 0x1f, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x59, 0x0a, 0x08, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, + 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x75, 0x70, 0x6c, 0x65, 0x42, 0x25, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0a, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0xaa, 0xdf, 0x1f, 0x0a, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x61, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x76, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x01, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, + 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x73, 0x3a, + 0x22, 0x88, 0xa0, 0x1f, 0x00, 0xca, 0xb4, 0x2d, 0x06, 0x54, 0x78, 0x44, 0x61, 0x74, 0x61, 0x8a, + 0xe7, 0xb0, 0x2a, 0x0f, 0x6f, 0x73, 0x2f, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x46, 0x65, + 0x65, 0x54, 0x78, 0x22, 0x22, 0x0a, 0x1a, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, + 0x78, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x9d, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x72, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x76, + 0x6d, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, + 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, + 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, + 0x64, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xac, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x2b, 0x82, 0xe7, 0xb0, 0x2a, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x6f, 0x73, + 0x2f, 0x78, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0xc6, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x68, 0x0a, 0x0a, 0x45, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x12, 0x18, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, + 0x78, 0x1a, 0x20, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x16, 0x2f, 0x6f, 0x73, + 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x5f, 0x74, 0x78, 0x12, 0x4e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x1a, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, + 0x22, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x80, 0x01, 0x0a, 0x0d, 0x63, + 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, + 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x45, 0x58, 0xaa, + 0x02, 0x09, 0x4f, 0x73, 0x2e, 0x45, 0x76, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4f, 0x73, + 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x73, 0x5c, 0x45, 0x76, 0x6d, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x0b, 0x4f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_evm_v1_tx_proto_rawDescOnce sync.Once + file_os_evm_v1_tx_proto_rawDescData = file_os_evm_v1_tx_proto_rawDesc +) + +func file_os_evm_v1_tx_proto_rawDescGZIP() []byte { + file_os_evm_v1_tx_proto_rawDescOnce.Do(func() { + file_os_evm_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_evm_v1_tx_proto_rawDescData) + }) + return file_os_evm_v1_tx_proto_rawDescData +} + +var file_os_evm_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_os_evm_v1_tx_proto_goTypes = []interface{}{ + (*MsgEthereumTx)(nil), // 0: os.evm.v1.MsgEthereumTx + (*LegacyTx)(nil), // 1: os.evm.v1.LegacyTx + (*AccessListTx)(nil), // 2: os.evm.v1.AccessListTx + (*DynamicFeeTx)(nil), // 3: os.evm.v1.DynamicFeeTx + (*ExtensionOptionsEthereumTx)(nil), // 4: os.evm.v1.ExtensionOptionsEthereumTx + (*MsgEthereumTxResponse)(nil), // 5: os.evm.v1.MsgEthereumTxResponse + (*MsgUpdateParams)(nil), // 6: os.evm.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 7: os.evm.v1.MsgUpdateParamsResponse + (*anypb.Any)(nil), // 8: google.protobuf.Any + (*AccessTuple)(nil), // 9: os.evm.v1.AccessTuple + (*Log)(nil), // 10: os.evm.v1.Log + (*Params)(nil), // 11: os.evm.v1.Params +} +var file_os_evm_v1_tx_proto_depIdxs = []int32{ + 8, // 0: os.evm.v1.MsgEthereumTx.data:type_name -> google.protobuf.Any + 9, // 1: os.evm.v1.AccessListTx.accesses:type_name -> os.evm.v1.AccessTuple + 9, // 2: os.evm.v1.DynamicFeeTx.accesses:type_name -> os.evm.v1.AccessTuple + 10, // 3: os.evm.v1.MsgEthereumTxResponse.logs:type_name -> os.evm.v1.Log + 11, // 4: os.evm.v1.MsgUpdateParams.params:type_name -> os.evm.v1.Params + 0, // 5: os.evm.v1.Msg.EthereumTx:input_type -> os.evm.v1.MsgEthereumTx + 6, // 6: os.evm.v1.Msg.UpdateParams:input_type -> os.evm.v1.MsgUpdateParams + 5, // 7: os.evm.v1.Msg.EthereumTx:output_type -> os.evm.v1.MsgEthereumTxResponse + 7, // 8: os.evm.v1.Msg.UpdateParams:output_type -> os.evm.v1.MsgUpdateParamsResponse + 7, // [7:9] is the sub-list for method output_type + 5, // [5:7] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_os_evm_v1_tx_proto_init() } +func file_os_evm_v1_tx_proto_init() { + if File_os_evm_v1_tx_proto != nil { + return + } + file_os_evm_v1_evm_proto_init() + if !protoimpl.UnsafeEnabled { + file_os_evm_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgEthereumTx); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LegacyTx); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccessListTx); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DynamicFeeTx); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExtensionOptionsEthereumTx); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgEthereumTxResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_evm_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_evm_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_os_evm_v1_tx_proto_goTypes, + DependencyIndexes: file_os_evm_v1_tx_proto_depIdxs, + MessageInfos: file_os_evm_v1_tx_proto_msgTypes, + }.Build() + File_os_evm_v1_tx_proto = out.File + file_os_evm_v1_tx_proto_rawDesc = nil + file_os_evm_v1_tx_proto_goTypes = nil + file_os_evm_v1_tx_proto_depIdxs = nil +} diff --git a/api/os/evm/v1/tx_data.go b/api/os/evm/v1/tx_data.go new file mode 100644 index 00000000..d87d0566 --- /dev/null +++ b/api/os/evm/v1/tx_data.go @@ -0,0 +1,47 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) +package evmv1 + +import ( + "math/big" + + sdkmath "cosmossdk.io/math" + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "google.golang.org/protobuf/reflect/protoreflect" +) + +var ( + _ TxDataV2 = &LegacyTx{} + _ TxDataV2 = &AccessListTx{} + _ TxDataV2 = &DynamicFeeTx{} +) + +// TxDataV2 implements the Ethereum transaction tx structure. It is used +// solely to define the custom logic for getting signers on Ethereum transactions. +type TxDataV2 interface { + GetChainID() *big.Int + AsEthereumData() ethtypes.TxData + + ProtoReflect() protoreflect.Message +} + +// helper function to parse string to bigInt +func stringToBigInt(str string) *big.Int { + if str == "" { + return nil + } + res, ok := sdkmath.NewIntFromString(str) + if !ok { + return nil + } + return res.BigInt() +} + +func stringToAddress(toStr string) *common.Address { + if toStr == "" { + return nil + } + addr := common.HexToAddress(toStr) + return &addr +} diff --git a/api/os/evm/v1/tx_grpc.pb.go b/api/os/evm/v1/tx_grpc.pb.go new file mode 100644 index 00000000..77a20b43 --- /dev/null +++ b/api/os/evm/v1/tx_grpc.pb.go @@ -0,0 +1,157 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: os/evm/v1/tx.proto + +package evmv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_EthereumTx_FullMethodName = "/os.evm.v1.Msg/EthereumTx" + Msg_UpdateParams_FullMethodName = "/os.evm.v1.Msg/UpdateParams" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // EthereumTx defines a method submitting Ethereum transactions. + EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) + // UpdateParams defined a governance operation for updating the x/evm module + // parameters. The authority is hard-coded to the Cosmos SDK x/gov module + // account + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) { + out := new(MsgEthereumTxResponse) + err := c.cc.Invoke(ctx, Msg_EthereumTx_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // EthereumTx defines a method submitting Ethereum transactions. + EthereumTx(context.Context, *MsgEthereumTx) (*MsgEthereumTxResponse, error) + // UpdateParams defined a governance operation for updating the x/evm module + // parameters. The authority is hard-coded to the Cosmos SDK x/gov module + // account + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) EthereumTx(context.Context, *MsgEthereumTx) (*MsgEthereumTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EthereumTx not implemented") +} +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_EthereumTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEthereumTx) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EthereumTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_EthereumTx_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EthereumTx(ctx, req.(*MsgEthereumTx)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "os.evm.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EthereumTx", + Handler: _Msg_EthereumTx_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "os/evm/v1/tx.proto", +} diff --git a/api/os/feemarket/v1/events.pulsar.go b/api/os/feemarket/v1/events.pulsar.go new file mode 100644 index 00000000..a215cb4f --- /dev/null +++ b/api/os/feemarket/v1/events.pulsar.go @@ -0,0 +1,1119 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package feemarketv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_EventFeeMarket protoreflect.MessageDescriptor + fd_EventFeeMarket_base_fee protoreflect.FieldDescriptor +) + +func init() { + file_os_feemarket_v1_events_proto_init() + md_EventFeeMarket = File_os_feemarket_v1_events_proto.Messages().ByName("EventFeeMarket") + fd_EventFeeMarket_base_fee = md_EventFeeMarket.Fields().ByName("base_fee") +} + +var _ protoreflect.Message = (*fastReflection_EventFeeMarket)(nil) + +type fastReflection_EventFeeMarket EventFeeMarket + +func (x *EventFeeMarket) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventFeeMarket)(x) +} + +func (x *EventFeeMarket) slowProtoReflect() protoreflect.Message { + mi := &file_os_feemarket_v1_events_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventFeeMarket_messageType fastReflection_EventFeeMarket_messageType +var _ protoreflect.MessageType = fastReflection_EventFeeMarket_messageType{} + +type fastReflection_EventFeeMarket_messageType struct{} + +func (x fastReflection_EventFeeMarket_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventFeeMarket)(nil) +} +func (x fastReflection_EventFeeMarket_messageType) New() protoreflect.Message { + return new(fastReflection_EventFeeMarket) +} +func (x fastReflection_EventFeeMarket_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventFeeMarket +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventFeeMarket) Descriptor() protoreflect.MessageDescriptor { + return md_EventFeeMarket +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventFeeMarket) Type() protoreflect.MessageType { + return _fastReflection_EventFeeMarket_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventFeeMarket) New() protoreflect.Message { + return new(fastReflection_EventFeeMarket) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventFeeMarket) Interface() protoreflect.ProtoMessage { + return (*EventFeeMarket)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventFeeMarket) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BaseFee != "" { + value := protoreflect.ValueOfString(x.BaseFee) + if !f(fd_EventFeeMarket_base_fee, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventFeeMarket) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.feemarket.v1.EventFeeMarket.base_fee": + return x.BaseFee != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.EventFeeMarket")) + } + panic(fmt.Errorf("message os.feemarket.v1.EventFeeMarket does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventFeeMarket) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.feemarket.v1.EventFeeMarket.base_fee": + x.BaseFee = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.EventFeeMarket")) + } + panic(fmt.Errorf("message os.feemarket.v1.EventFeeMarket does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventFeeMarket) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.feemarket.v1.EventFeeMarket.base_fee": + value := x.BaseFee + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.EventFeeMarket")) + } + panic(fmt.Errorf("message os.feemarket.v1.EventFeeMarket does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventFeeMarket) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.feemarket.v1.EventFeeMarket.base_fee": + x.BaseFee = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.EventFeeMarket")) + } + panic(fmt.Errorf("message os.feemarket.v1.EventFeeMarket does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventFeeMarket) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.EventFeeMarket.base_fee": + panic(fmt.Errorf("field base_fee of message os.feemarket.v1.EventFeeMarket is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.EventFeeMarket")) + } + panic(fmt.Errorf("message os.feemarket.v1.EventFeeMarket does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventFeeMarket) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.EventFeeMarket.base_fee": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.EventFeeMarket")) + } + panic(fmt.Errorf("message os.feemarket.v1.EventFeeMarket does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventFeeMarket) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.feemarket.v1.EventFeeMarket", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventFeeMarket) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventFeeMarket) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventFeeMarket) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventFeeMarket) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventFeeMarket) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.BaseFee) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventFeeMarket) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.BaseFee) > 0 { + i -= len(x.BaseFee) + copy(dAtA[i:], x.BaseFee) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BaseFee))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventFeeMarket) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventFeeMarket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventFeeMarket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.BaseFee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventBlockGas protoreflect.MessageDescriptor + fd_EventBlockGas_height protoreflect.FieldDescriptor + fd_EventBlockGas_amount protoreflect.FieldDescriptor +) + +func init() { + file_os_feemarket_v1_events_proto_init() + md_EventBlockGas = File_os_feemarket_v1_events_proto.Messages().ByName("EventBlockGas") + fd_EventBlockGas_height = md_EventBlockGas.Fields().ByName("height") + fd_EventBlockGas_amount = md_EventBlockGas.Fields().ByName("amount") +} + +var _ protoreflect.Message = (*fastReflection_EventBlockGas)(nil) + +type fastReflection_EventBlockGas EventBlockGas + +func (x *EventBlockGas) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventBlockGas)(x) +} + +func (x *EventBlockGas) slowProtoReflect() protoreflect.Message { + mi := &file_os_feemarket_v1_events_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventBlockGas_messageType fastReflection_EventBlockGas_messageType +var _ protoreflect.MessageType = fastReflection_EventBlockGas_messageType{} + +type fastReflection_EventBlockGas_messageType struct{} + +func (x fastReflection_EventBlockGas_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventBlockGas)(nil) +} +func (x fastReflection_EventBlockGas_messageType) New() protoreflect.Message { + return new(fastReflection_EventBlockGas) +} +func (x fastReflection_EventBlockGas_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventBlockGas +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventBlockGas) Descriptor() protoreflect.MessageDescriptor { + return md_EventBlockGas +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventBlockGas) Type() protoreflect.MessageType { + return _fastReflection_EventBlockGas_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventBlockGas) New() protoreflect.Message { + return new(fastReflection_EventBlockGas) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventBlockGas) Interface() protoreflect.ProtoMessage { + return (*EventBlockGas)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventBlockGas) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Height != "" { + value := protoreflect.ValueOfString(x.Height) + if !f(fd_EventBlockGas_height, value) { + return + } + } + if x.Amount != "" { + value := protoreflect.ValueOfString(x.Amount) + if !f(fd_EventBlockGas_amount, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventBlockGas) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.feemarket.v1.EventBlockGas.height": + return x.Height != "" + case "os.feemarket.v1.EventBlockGas.amount": + return x.Amount != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.EventBlockGas")) + } + panic(fmt.Errorf("message os.feemarket.v1.EventBlockGas does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventBlockGas) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.feemarket.v1.EventBlockGas.height": + x.Height = "" + case "os.feemarket.v1.EventBlockGas.amount": + x.Amount = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.EventBlockGas")) + } + panic(fmt.Errorf("message os.feemarket.v1.EventBlockGas does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventBlockGas) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.feemarket.v1.EventBlockGas.height": + value := x.Height + return protoreflect.ValueOfString(value) + case "os.feemarket.v1.EventBlockGas.amount": + value := x.Amount + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.EventBlockGas")) + } + panic(fmt.Errorf("message os.feemarket.v1.EventBlockGas does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventBlockGas) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.feemarket.v1.EventBlockGas.height": + x.Height = value.Interface().(string) + case "os.feemarket.v1.EventBlockGas.amount": + x.Amount = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.EventBlockGas")) + } + panic(fmt.Errorf("message os.feemarket.v1.EventBlockGas does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventBlockGas) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.EventBlockGas.height": + panic(fmt.Errorf("field height of message os.feemarket.v1.EventBlockGas is not mutable")) + case "os.feemarket.v1.EventBlockGas.amount": + panic(fmt.Errorf("field amount of message os.feemarket.v1.EventBlockGas is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.EventBlockGas")) + } + panic(fmt.Errorf("message os.feemarket.v1.EventBlockGas does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventBlockGas) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.EventBlockGas.height": + return protoreflect.ValueOfString("") + case "os.feemarket.v1.EventBlockGas.amount": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.EventBlockGas")) + } + panic(fmt.Errorf("message os.feemarket.v1.EventBlockGas does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventBlockGas) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.feemarket.v1.EventBlockGas", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventBlockGas) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventBlockGas) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventBlockGas) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventBlockGas) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventBlockGas) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Height) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Amount) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventBlockGas) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Amount) > 0 { + i -= len(x.Amount) + copy(dAtA[i:], x.Amount) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Amount))) + i-- + dAtA[i] = 0x12 + } + if len(x.Height) > 0 { + i -= len(x.Height) + copy(dAtA[i:], x.Height) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Height))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventBlockGas) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventBlockGas: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventBlockGas: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Height = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/feemarket/v1/events.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EventFeeMarket is the event type for the feemarket module +type EventFeeMarket struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // base_fee for EIP-1559 blocks + BaseFee string `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3" json:"base_fee,omitempty"` +} + +func (x *EventFeeMarket) Reset() { + *x = EventFeeMarket{} + if protoimpl.UnsafeEnabled { + mi := &file_os_feemarket_v1_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventFeeMarket) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventFeeMarket) ProtoMessage() {} + +// Deprecated: Use EventFeeMarket.ProtoReflect.Descriptor instead. +func (*EventFeeMarket) Descriptor() ([]byte, []int) { + return file_os_feemarket_v1_events_proto_rawDescGZIP(), []int{0} +} + +func (x *EventFeeMarket) GetBaseFee() string { + if x != nil { + return x.BaseFee + } + return "" +} + +// EventBlockGas defines an Ethereum block gas event +type EventBlockGas struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // height of the block + Height string `protobuf:"bytes,1,opt,name=height,proto3" json:"height,omitempty"` + // amount of gas wanted by the block + Amount string `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *EventBlockGas) Reset() { + *x = EventBlockGas{} + if protoimpl.UnsafeEnabled { + mi := &file_os_feemarket_v1_events_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventBlockGas) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventBlockGas) ProtoMessage() {} + +// Deprecated: Use EventBlockGas.ProtoReflect.Descriptor instead. +func (*EventBlockGas) Descriptor() ([]byte, []int) { + return file_os_feemarket_v1_events_proto_rawDescGZIP(), []int{1} +} + +func (x *EventBlockGas) GetHeight() string { + if x != nil { + return x.Height + } + return "" +} + +func (x *EventBlockGas) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +var File_os_feemarket_v1_events_proto protoreflect.FileDescriptor + +var file_os_feemarket_v1_events_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, + 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x22, + 0x2b, 0x0a, 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x22, 0x3f, 0x0a, 0x0d, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x47, 0x61, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0xae, 0x01, + 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x46, 0x58, 0xaa, 0x02, 0x0f, 0x4f, 0x73, 0x2e, 0x46, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x4f, 0x73, 0x5c, + 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x4f, + 0x73, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x4f, 0x73, 0x3a, + 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_feemarket_v1_events_proto_rawDescOnce sync.Once + file_os_feemarket_v1_events_proto_rawDescData = file_os_feemarket_v1_events_proto_rawDesc +) + +func file_os_feemarket_v1_events_proto_rawDescGZIP() []byte { + file_os_feemarket_v1_events_proto_rawDescOnce.Do(func() { + file_os_feemarket_v1_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_feemarket_v1_events_proto_rawDescData) + }) + return file_os_feemarket_v1_events_proto_rawDescData +} + +var file_os_feemarket_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_os_feemarket_v1_events_proto_goTypes = []interface{}{ + (*EventFeeMarket)(nil), // 0: os.feemarket.v1.EventFeeMarket + (*EventBlockGas)(nil), // 1: os.feemarket.v1.EventBlockGas +} +var file_os_feemarket_v1_events_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_os_feemarket_v1_events_proto_init() } +func file_os_feemarket_v1_events_proto_init() { + if File_os_feemarket_v1_events_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_os_feemarket_v1_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventFeeMarket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_feemarket_v1_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventBlockGas); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_feemarket_v1_events_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_feemarket_v1_events_proto_goTypes, + DependencyIndexes: file_os_feemarket_v1_events_proto_depIdxs, + MessageInfos: file_os_feemarket_v1_events_proto_msgTypes, + }.Build() + File_os_feemarket_v1_events_proto = out.File + file_os_feemarket_v1_events_proto_rawDesc = nil + file_os_feemarket_v1_events_proto_goTypes = nil + file_os_feemarket_v1_events_proto_depIdxs = nil +} diff --git a/api/os/feemarket/v1/feemarket.pulsar.go b/api/os/feemarket/v1/feemarket.pulsar.go new file mode 100644 index 00000000..81eefba1 --- /dev/null +++ b/api/os/feemarket/v1/feemarket.pulsar.go @@ -0,0 +1,989 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package feemarketv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_no_base_fee protoreflect.FieldDescriptor + fd_Params_base_fee_change_denominator protoreflect.FieldDescriptor + fd_Params_elasticity_multiplier protoreflect.FieldDescriptor + fd_Params_enable_height protoreflect.FieldDescriptor + fd_Params_base_fee protoreflect.FieldDescriptor + fd_Params_min_gas_price protoreflect.FieldDescriptor + fd_Params_min_gas_multiplier protoreflect.FieldDescriptor +) + +func init() { + file_os_feemarket_v1_feemarket_proto_init() + md_Params = File_os_feemarket_v1_feemarket_proto.Messages().ByName("Params") + fd_Params_no_base_fee = md_Params.Fields().ByName("no_base_fee") + fd_Params_base_fee_change_denominator = md_Params.Fields().ByName("base_fee_change_denominator") + fd_Params_elasticity_multiplier = md_Params.Fields().ByName("elasticity_multiplier") + fd_Params_enable_height = md_Params.Fields().ByName("enable_height") + fd_Params_base_fee = md_Params.Fields().ByName("base_fee") + fd_Params_min_gas_price = md_Params.Fields().ByName("min_gas_price") + fd_Params_min_gas_multiplier = md_Params.Fields().ByName("min_gas_multiplier") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_os_feemarket_v1_feemarket_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.NoBaseFee != false { + value := protoreflect.ValueOfBool(x.NoBaseFee) + if !f(fd_Params_no_base_fee, value) { + return + } + } + if x.BaseFeeChangeDenominator != uint32(0) { + value := protoreflect.ValueOfUint32(x.BaseFeeChangeDenominator) + if !f(fd_Params_base_fee_change_denominator, value) { + return + } + } + if x.ElasticityMultiplier != uint32(0) { + value := protoreflect.ValueOfUint32(x.ElasticityMultiplier) + if !f(fd_Params_elasticity_multiplier, value) { + return + } + } + if x.EnableHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.EnableHeight) + if !f(fd_Params_enable_height, value) { + return + } + } + if x.BaseFee != "" { + value := protoreflect.ValueOfString(x.BaseFee) + if !f(fd_Params_base_fee, value) { + return + } + } + if x.MinGasPrice != "" { + value := protoreflect.ValueOfString(x.MinGasPrice) + if !f(fd_Params_min_gas_price, value) { + return + } + } + if x.MinGasMultiplier != "" { + value := protoreflect.ValueOfString(x.MinGasMultiplier) + if !f(fd_Params_min_gas_multiplier, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.feemarket.v1.Params.no_base_fee": + return x.NoBaseFee != false + case "os.feemarket.v1.Params.base_fee_change_denominator": + return x.BaseFeeChangeDenominator != uint32(0) + case "os.feemarket.v1.Params.elasticity_multiplier": + return x.ElasticityMultiplier != uint32(0) + case "os.feemarket.v1.Params.enable_height": + return x.EnableHeight != int64(0) + case "os.feemarket.v1.Params.base_fee": + return x.BaseFee != "" + case "os.feemarket.v1.Params.min_gas_price": + return x.MinGasPrice != "" + case "os.feemarket.v1.Params.min_gas_multiplier": + return x.MinGasMultiplier != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.Params")) + } + panic(fmt.Errorf("message os.feemarket.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.feemarket.v1.Params.no_base_fee": + x.NoBaseFee = false + case "os.feemarket.v1.Params.base_fee_change_denominator": + x.BaseFeeChangeDenominator = uint32(0) + case "os.feemarket.v1.Params.elasticity_multiplier": + x.ElasticityMultiplier = uint32(0) + case "os.feemarket.v1.Params.enable_height": + x.EnableHeight = int64(0) + case "os.feemarket.v1.Params.base_fee": + x.BaseFee = "" + case "os.feemarket.v1.Params.min_gas_price": + x.MinGasPrice = "" + case "os.feemarket.v1.Params.min_gas_multiplier": + x.MinGasMultiplier = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.Params")) + } + panic(fmt.Errorf("message os.feemarket.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.feemarket.v1.Params.no_base_fee": + value := x.NoBaseFee + return protoreflect.ValueOfBool(value) + case "os.feemarket.v1.Params.base_fee_change_denominator": + value := x.BaseFeeChangeDenominator + return protoreflect.ValueOfUint32(value) + case "os.feemarket.v1.Params.elasticity_multiplier": + value := x.ElasticityMultiplier + return protoreflect.ValueOfUint32(value) + case "os.feemarket.v1.Params.enable_height": + value := x.EnableHeight + return protoreflect.ValueOfInt64(value) + case "os.feemarket.v1.Params.base_fee": + value := x.BaseFee + return protoreflect.ValueOfString(value) + case "os.feemarket.v1.Params.min_gas_price": + value := x.MinGasPrice + return protoreflect.ValueOfString(value) + case "os.feemarket.v1.Params.min_gas_multiplier": + value := x.MinGasMultiplier + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.Params")) + } + panic(fmt.Errorf("message os.feemarket.v1.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.feemarket.v1.Params.no_base_fee": + x.NoBaseFee = value.Bool() + case "os.feemarket.v1.Params.base_fee_change_denominator": + x.BaseFeeChangeDenominator = uint32(value.Uint()) + case "os.feemarket.v1.Params.elasticity_multiplier": + x.ElasticityMultiplier = uint32(value.Uint()) + case "os.feemarket.v1.Params.enable_height": + x.EnableHeight = value.Int() + case "os.feemarket.v1.Params.base_fee": + x.BaseFee = value.Interface().(string) + case "os.feemarket.v1.Params.min_gas_price": + x.MinGasPrice = value.Interface().(string) + case "os.feemarket.v1.Params.min_gas_multiplier": + x.MinGasMultiplier = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.Params")) + } + panic(fmt.Errorf("message os.feemarket.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.Params.no_base_fee": + panic(fmt.Errorf("field no_base_fee of message os.feemarket.v1.Params is not mutable")) + case "os.feemarket.v1.Params.base_fee_change_denominator": + panic(fmt.Errorf("field base_fee_change_denominator of message os.feemarket.v1.Params is not mutable")) + case "os.feemarket.v1.Params.elasticity_multiplier": + panic(fmt.Errorf("field elasticity_multiplier of message os.feemarket.v1.Params is not mutable")) + case "os.feemarket.v1.Params.enable_height": + panic(fmt.Errorf("field enable_height of message os.feemarket.v1.Params is not mutable")) + case "os.feemarket.v1.Params.base_fee": + panic(fmt.Errorf("field base_fee of message os.feemarket.v1.Params is not mutable")) + case "os.feemarket.v1.Params.min_gas_price": + panic(fmt.Errorf("field min_gas_price of message os.feemarket.v1.Params is not mutable")) + case "os.feemarket.v1.Params.min_gas_multiplier": + panic(fmt.Errorf("field min_gas_multiplier of message os.feemarket.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.Params")) + } + panic(fmt.Errorf("message os.feemarket.v1.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.Params.no_base_fee": + return protoreflect.ValueOfBool(false) + case "os.feemarket.v1.Params.base_fee_change_denominator": + return protoreflect.ValueOfUint32(uint32(0)) + case "os.feemarket.v1.Params.elasticity_multiplier": + return protoreflect.ValueOfUint32(uint32(0)) + case "os.feemarket.v1.Params.enable_height": + return protoreflect.ValueOfInt64(int64(0)) + case "os.feemarket.v1.Params.base_fee": + return protoreflect.ValueOfString("") + case "os.feemarket.v1.Params.min_gas_price": + return protoreflect.ValueOfString("") + case "os.feemarket.v1.Params.min_gas_multiplier": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.Params")) + } + panic(fmt.Errorf("message os.feemarket.v1.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.feemarket.v1.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.NoBaseFee { + n += 2 + } + if x.BaseFeeChangeDenominator != 0 { + n += 1 + runtime.Sov(uint64(x.BaseFeeChangeDenominator)) + } + if x.ElasticityMultiplier != 0 { + n += 1 + runtime.Sov(uint64(x.ElasticityMultiplier)) + } + if x.EnableHeight != 0 { + n += 1 + runtime.Sov(uint64(x.EnableHeight)) + } + l = len(x.BaseFee) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MinGasPrice) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MinGasMultiplier) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.MinGasMultiplier) > 0 { + i -= len(x.MinGasMultiplier) + copy(dAtA[i:], x.MinGasMultiplier) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinGasMultiplier))) + i-- + dAtA[i] = 0x42 + } + if len(x.MinGasPrice) > 0 { + i -= len(x.MinGasPrice) + copy(dAtA[i:], x.MinGasPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinGasPrice))) + i-- + dAtA[i] = 0x3a + } + if len(x.BaseFee) > 0 { + i -= len(x.BaseFee) + copy(dAtA[i:], x.BaseFee) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BaseFee))) + i-- + dAtA[i] = 0x32 + } + if x.EnableHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EnableHeight)) + i-- + dAtA[i] = 0x28 + } + if x.ElasticityMultiplier != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ElasticityMultiplier)) + i-- + dAtA[i] = 0x18 + } + if x.BaseFeeChangeDenominator != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BaseFeeChangeDenominator)) + i-- + dAtA[i] = 0x10 + } + if x.NoBaseFee { + i-- + if x.NoBaseFee { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NoBaseFee", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.NoBaseFee = bool(v != 0) + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BaseFeeChangeDenominator", wireType) + } + x.BaseFeeChangeDenominator = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BaseFeeChangeDenominator |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ElasticityMultiplier", wireType) + } + x.ElasticityMultiplier = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ElasticityMultiplier |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EnableHeight", wireType) + } + x.EnableHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.EnableHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.BaseFee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinGasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.MinGasPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinGasMultiplier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.MinGasMultiplier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/feemarket/v1/feemarket.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Params defines the EVM module parameters +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // no_base_fee forces the EIP-1559 base fee to 0 (needed for 0 price calls) + NoBaseFee bool `protobuf:"varint,1,opt,name=no_base_fee,json=noBaseFee,proto3" json:"no_base_fee,omitempty"` + // base_fee_change_denominator bounds the amount the base fee can change + // between blocks. + BaseFeeChangeDenominator uint32 `protobuf:"varint,2,opt,name=base_fee_change_denominator,json=baseFeeChangeDenominator,proto3" json:"base_fee_change_denominator,omitempty"` + // elasticity_multiplier bounds the maximum gas limit an EIP-1559 block may + // have. + ElasticityMultiplier uint32 `protobuf:"varint,3,opt,name=elasticity_multiplier,json=elasticityMultiplier,proto3" json:"elasticity_multiplier,omitempty"` + // enable_height defines at which block height the base fee calculation is + // enabled. + EnableHeight int64 `protobuf:"varint,5,opt,name=enable_height,json=enableHeight,proto3" json:"enable_height,omitempty"` + // base_fee for EIP-1559 blocks. + BaseFee string `protobuf:"bytes,6,opt,name=base_fee,json=baseFee,proto3" json:"base_fee,omitempty"` + // min_gas_price defines the minimum gas price value for cosmos and eth + // transactions + MinGasPrice string `protobuf:"bytes,7,opt,name=min_gas_price,json=minGasPrice,proto3" json:"min_gas_price,omitempty"` + // min_gas_multiplier bounds the minimum gas used to be charged + // to senders based on gas limit + MinGasMultiplier string `protobuf:"bytes,8,opt,name=min_gas_multiplier,json=minGasMultiplier,proto3" json:"min_gas_multiplier,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_os_feemarket_v1_feemarket_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_os_feemarket_v1_feemarket_proto_rawDescGZIP(), []int{0} +} + +func (x *Params) GetNoBaseFee() bool { + if x != nil { + return x.NoBaseFee + } + return false +} + +func (x *Params) GetBaseFeeChangeDenominator() uint32 { + if x != nil { + return x.BaseFeeChangeDenominator + } + return 0 +} + +func (x *Params) GetElasticityMultiplier() uint32 { + if x != nil { + return x.ElasticityMultiplier + } + return 0 +} + +func (x *Params) GetEnableHeight() int64 { + if x != nil { + return x.EnableHeight + } + return 0 +} + +func (x *Params) GetBaseFee() string { + if x != nil { + return x.BaseFee + } + return "" +} + +func (x *Params) GetMinGasPrice() string { + if x != nil { + return x.MinGasPrice + } + return "" +} + +func (x *Params) GetMinGasMultiplier() string { + if x != nil { + return x.MinGasMultiplier + } + return "" +} + +var File_os_feemarket_v1_feemarket_proto protoreflect.FileDescriptor + +var file_os_feemarket_v1_feemarket_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, + 0x31, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0f, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, + 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xda, 0x03, 0x0a, 0x06, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x0a, 0x0b, 0x6e, 0x6f, 0x5f, 0x62, 0x61, 0x73, + 0x65, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6e, 0x6f, 0x42, + 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x12, 0x3d, 0x0a, 0x1b, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, + 0x65, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x69, + 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x18, 0x62, 0x61, 0x73, + 0x65, 0x46, 0x65, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x69, + 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, + 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x14, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x69, 0x74, 0x79, + 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0c, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, + 0x3d, 0x0a, 0x08, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x22, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x12, 0x4c, + 0x0a, 0x0d, 0x6d, 0x69, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x28, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x0b, 0x6d, 0x69, 0x6e, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x56, 0x0a, 0x12, + 0x6d, 0x69, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x28, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x10, 0x6d, 0x69, 0x6e, 0x47, 0x61, 0x73, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x3a, 0x1a, 0x8a, 0xe7, 0xb0, 0x2a, 0x15, 0x6f, 0x73, 0x2f, 0x78, 0x2f, + 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x52, 0x10, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, + 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x42, 0xb1, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, + 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, + 0x42, 0x0e, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x4f, 0x46, 0x58, 0xaa, 0x02, 0x0f, 0x4f, 0x73, 0x2e, 0x46, 0x65, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x4f, 0x73, 0x5c, 0x46, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x4f, 0x73, 0x5c, + 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x4f, 0x73, 0x3a, 0x3a, 0x46, + 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_feemarket_v1_feemarket_proto_rawDescOnce sync.Once + file_os_feemarket_v1_feemarket_proto_rawDescData = file_os_feemarket_v1_feemarket_proto_rawDesc +) + +func file_os_feemarket_v1_feemarket_proto_rawDescGZIP() []byte { + file_os_feemarket_v1_feemarket_proto_rawDescOnce.Do(func() { + file_os_feemarket_v1_feemarket_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_feemarket_v1_feemarket_proto_rawDescData) + }) + return file_os_feemarket_v1_feemarket_proto_rawDescData +} + +var file_os_feemarket_v1_feemarket_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_os_feemarket_v1_feemarket_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: os.feemarket.v1.Params +} +var file_os_feemarket_v1_feemarket_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_os_feemarket_v1_feemarket_proto_init() } +func file_os_feemarket_v1_feemarket_proto_init() { + if File_os_feemarket_v1_feemarket_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_os_feemarket_v1_feemarket_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_feemarket_v1_feemarket_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_feemarket_v1_feemarket_proto_goTypes, + DependencyIndexes: file_os_feemarket_v1_feemarket_proto_depIdxs, + MessageInfos: file_os_feemarket_v1_feemarket_proto_msgTypes, + }.Build() + File_os_feemarket_v1_feemarket_proto = out.File + file_os_feemarket_v1_feemarket_proto_rawDesc = nil + file_os_feemarket_v1_feemarket_proto_goTypes = nil + file_os_feemarket_v1_feemarket_proto_depIdxs = nil +} diff --git a/api/os/feemarket/v1/genesis.pulsar.go b/api/os/feemarket/v1/genesis.pulsar.go new file mode 100644 index 00000000..b7814444 --- /dev/null +++ b/api/os/feemarket/v1/genesis.pulsar.go @@ -0,0 +1,659 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package feemarketv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_block_gas protoreflect.FieldDescriptor +) + +func init() { + file_os_feemarket_v1_genesis_proto_init() + md_GenesisState = File_os_feemarket_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_block_gas = md_GenesisState.Fields().ByName("block_gas") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_os_feemarket_v1_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } + if x.BlockGas != uint64(0) { + value := protoreflect.ValueOfUint64(x.BlockGas) + if !f(fd_GenesisState_block_gas, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.feemarket.v1.GenesisState.params": + return x.Params != nil + case "os.feemarket.v1.GenesisState.block_gas": + return x.BlockGas != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.GenesisState")) + } + panic(fmt.Errorf("message os.feemarket.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.feemarket.v1.GenesisState.params": + x.Params = nil + case "os.feemarket.v1.GenesisState.block_gas": + x.BlockGas = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.GenesisState")) + } + panic(fmt.Errorf("message os.feemarket.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.feemarket.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "os.feemarket.v1.GenesisState.block_gas": + value := x.BlockGas + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.GenesisState")) + } + panic(fmt.Errorf("message os.feemarket.v1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.feemarket.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + case "os.feemarket.v1.GenesisState.block_gas": + x.BlockGas = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.GenesisState")) + } + panic(fmt.Errorf("message os.feemarket.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "os.feemarket.v1.GenesisState.block_gas": + panic(fmt.Errorf("field block_gas of message os.feemarket.v1.GenesisState is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.GenesisState")) + } + panic(fmt.Errorf("message os.feemarket.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "os.feemarket.v1.GenesisState.block_gas": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.GenesisState")) + } + panic(fmt.Errorf("message os.feemarket.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.feemarket.v1.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.BlockGas != 0 { + n += 1 + runtime.Sov(uint64(x.BlockGas)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.BlockGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockGas)) + i-- + dAtA[i] = 0x18 + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockGas", wireType) + } + x.BlockGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BlockGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/feemarket/v1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the feemarket module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params defines all the parameters of the feemarket module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + // block_gas is the amount of gas wanted on the last block before the upgrade. + // Zero by default. + BlockGas uint64 `protobuf:"varint,3,opt,name=block_gas,json=blockGas,proto3" json:"block_gas,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_os_feemarket_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_os_feemarket_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +func (x *GenesisState) GetBlockGas() uint64 { + if x != nil { + return x.BlockGas + } + return 0 +} + +var File_os_feemarket_v1_genesis_proto protoreflect.FileDescriptor + +var file_os_feemarket_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, + 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0f, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, + 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6f, 0x73, 0x2f, 0x66, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x77, 0x0a, 0x0c, 0x47, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x73, 0x2e, + 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x67, 0x61, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x47, 0x61, 0x73, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x08, 0x62, 0x61, 0x73, 0x65, 0x5f, + 0x66, 0x65, 0x65, 0x42, 0xaf, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x2e, 0x66, + 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, + 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x46, 0x58, 0xaa, + 0x02, 0x0f, 0x4f, 0x73, 0x2e, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x0f, 0x4f, 0x73, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x4f, 0x73, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x11, 0x4f, 0x73, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_feemarket_v1_genesis_proto_rawDescOnce sync.Once + file_os_feemarket_v1_genesis_proto_rawDescData = file_os_feemarket_v1_genesis_proto_rawDesc +) + +func file_os_feemarket_v1_genesis_proto_rawDescGZIP() []byte { + file_os_feemarket_v1_genesis_proto_rawDescOnce.Do(func() { + file_os_feemarket_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_feemarket_v1_genesis_proto_rawDescData) + }) + return file_os_feemarket_v1_genesis_proto_rawDescData +} + +var file_os_feemarket_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_os_feemarket_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: os.feemarket.v1.GenesisState + (*Params)(nil), // 1: os.feemarket.v1.Params +} +var file_os_feemarket_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: os.feemarket.v1.GenesisState.params:type_name -> os.feemarket.v1.Params + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_os_feemarket_v1_genesis_proto_init() } +func file_os_feemarket_v1_genesis_proto_init() { + if File_os_feemarket_v1_genesis_proto != nil { + return + } + file_os_feemarket_v1_feemarket_proto_init() + if !protoimpl.UnsafeEnabled { + file_os_feemarket_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_feemarket_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_feemarket_v1_genesis_proto_goTypes, + DependencyIndexes: file_os_feemarket_v1_genesis_proto_depIdxs, + MessageInfos: file_os_feemarket_v1_genesis_proto_msgTypes, + }.Build() + File_os_feemarket_v1_genesis_proto = out.File + file_os_feemarket_v1_genesis_proto_rawDesc = nil + file_os_feemarket_v1_genesis_proto_goTypes = nil + file_os_feemarket_v1_genesis_proto_depIdxs = nil +} diff --git a/api/os/feemarket/v1/query.pulsar.go b/api/os/feemarket/v1/query.pulsar.go new file mode 100644 index 00000000..b53c4483 --- /dev/null +++ b/api/os/feemarket/v1/query.pulsar.go @@ -0,0 +1,2757 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package feemarketv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_os_feemarket_v1_query_proto_init() + md_QueryParamsRequest = File_os_feemarket_v1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_feemarket_v1_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.feemarket.v1.QueryParamsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_os_feemarket_v1_query_proto_init() + md_QueryParamsResponse = File_os_feemarket_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_feemarket_v1_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.feemarket.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.feemarket.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.feemarket.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.feemarket.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.feemarket.v1.QueryParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryBaseFeeRequest protoreflect.MessageDescriptor +) + +func init() { + file_os_feemarket_v1_query_proto_init() + md_QueryBaseFeeRequest = File_os_feemarket_v1_query_proto.Messages().ByName("QueryBaseFeeRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryBaseFeeRequest)(nil) + +type fastReflection_QueryBaseFeeRequest QueryBaseFeeRequest + +func (x *QueryBaseFeeRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryBaseFeeRequest)(x) +} + +func (x *QueryBaseFeeRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_feemarket_v1_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryBaseFeeRequest_messageType fastReflection_QueryBaseFeeRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryBaseFeeRequest_messageType{} + +type fastReflection_QueryBaseFeeRequest_messageType struct{} + +func (x fastReflection_QueryBaseFeeRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryBaseFeeRequest)(nil) +} +func (x fastReflection_QueryBaseFeeRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryBaseFeeRequest) +} +func (x fastReflection_QueryBaseFeeRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBaseFeeRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryBaseFeeRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBaseFeeRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryBaseFeeRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryBaseFeeRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryBaseFeeRequest) New() protoreflect.Message { + return new(fastReflection_QueryBaseFeeRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryBaseFeeRequest) Interface() protoreflect.ProtoMessage { + return (*QueryBaseFeeRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryBaseFeeRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryBaseFeeRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBaseFeeRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBaseFeeRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBaseFeeRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBaseFeeRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryBaseFeeRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBaseFeeRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBaseFeeRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBaseFeeRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBaseFeeRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBaseFeeRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBaseFeeRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryBaseFeeRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBaseFeeRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBaseFeeRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryBaseFeeRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.feemarket.v1.QueryBaseFeeRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryBaseFeeRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryBaseFeeRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryBaseFeeRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryBaseFeeRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryBaseFeeRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryBaseFeeRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBaseFeeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBaseFeeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryBaseFeeResponse protoreflect.MessageDescriptor + fd_QueryBaseFeeResponse_base_fee protoreflect.FieldDescriptor +) + +func init() { + file_os_feemarket_v1_query_proto_init() + md_QueryBaseFeeResponse = File_os_feemarket_v1_query_proto.Messages().ByName("QueryBaseFeeResponse") + fd_QueryBaseFeeResponse_base_fee = md_QueryBaseFeeResponse.Fields().ByName("base_fee") +} + +var _ protoreflect.Message = (*fastReflection_QueryBaseFeeResponse)(nil) + +type fastReflection_QueryBaseFeeResponse QueryBaseFeeResponse + +func (x *QueryBaseFeeResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryBaseFeeResponse)(x) +} + +func (x *QueryBaseFeeResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_feemarket_v1_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryBaseFeeResponse_messageType fastReflection_QueryBaseFeeResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryBaseFeeResponse_messageType{} + +type fastReflection_QueryBaseFeeResponse_messageType struct{} + +func (x fastReflection_QueryBaseFeeResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryBaseFeeResponse)(nil) +} +func (x fastReflection_QueryBaseFeeResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryBaseFeeResponse) +} +func (x fastReflection_QueryBaseFeeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBaseFeeResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryBaseFeeResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBaseFeeResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryBaseFeeResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryBaseFeeResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryBaseFeeResponse) New() protoreflect.Message { + return new(fastReflection_QueryBaseFeeResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryBaseFeeResponse) Interface() protoreflect.ProtoMessage { + return (*QueryBaseFeeResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryBaseFeeResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BaseFee != "" { + value := protoreflect.ValueOfString(x.BaseFee) + if !f(fd_QueryBaseFeeResponse_base_fee, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryBaseFeeResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.feemarket.v1.QueryBaseFeeResponse.base_fee": + return x.BaseFee != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBaseFeeResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBaseFeeResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.feemarket.v1.QueryBaseFeeResponse.base_fee": + x.BaseFee = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBaseFeeResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBaseFeeResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryBaseFeeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.feemarket.v1.QueryBaseFeeResponse.base_fee": + value := x.BaseFee + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBaseFeeResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBaseFeeResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.feemarket.v1.QueryBaseFeeResponse.base_fee": + x.BaseFee = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBaseFeeResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBaseFeeResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.QueryBaseFeeResponse.base_fee": + panic(fmt.Errorf("field base_fee of message os.feemarket.v1.QueryBaseFeeResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBaseFeeResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBaseFeeResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryBaseFeeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.QueryBaseFeeResponse.base_fee": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBaseFeeResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBaseFeeResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryBaseFeeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.feemarket.v1.QueryBaseFeeResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryBaseFeeResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBaseFeeResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryBaseFeeResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryBaseFeeResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryBaseFeeResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.BaseFee) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryBaseFeeResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.BaseFee) > 0 { + i -= len(x.BaseFee) + copy(dAtA[i:], x.BaseFee) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BaseFee))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryBaseFeeResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBaseFeeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBaseFeeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.BaseFee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryBlockGasRequest protoreflect.MessageDescriptor +) + +func init() { + file_os_feemarket_v1_query_proto_init() + md_QueryBlockGasRequest = File_os_feemarket_v1_query_proto.Messages().ByName("QueryBlockGasRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryBlockGasRequest)(nil) + +type fastReflection_QueryBlockGasRequest QueryBlockGasRequest + +func (x *QueryBlockGasRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryBlockGasRequest)(x) +} + +func (x *QueryBlockGasRequest) slowProtoReflect() protoreflect.Message { + mi := &file_os_feemarket_v1_query_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryBlockGasRequest_messageType fastReflection_QueryBlockGasRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryBlockGasRequest_messageType{} + +type fastReflection_QueryBlockGasRequest_messageType struct{} + +func (x fastReflection_QueryBlockGasRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryBlockGasRequest)(nil) +} +func (x fastReflection_QueryBlockGasRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryBlockGasRequest) +} +func (x fastReflection_QueryBlockGasRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBlockGasRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryBlockGasRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBlockGasRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryBlockGasRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryBlockGasRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryBlockGasRequest) New() protoreflect.Message { + return new(fastReflection_QueryBlockGasRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryBlockGasRequest) Interface() protoreflect.ProtoMessage { + return (*QueryBlockGasRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryBlockGasRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryBlockGasRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBlockGasRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBlockGasRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBlockGasRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBlockGasRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBlockGasRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryBlockGasRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBlockGasRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBlockGasRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBlockGasRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBlockGasRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBlockGasRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBlockGasRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBlockGasRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBlockGasRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryBlockGasRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBlockGasRequest")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBlockGasRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryBlockGasRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.feemarket.v1.QueryBlockGasRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryBlockGasRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBlockGasRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryBlockGasRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryBlockGasRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryBlockGasRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryBlockGasRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryBlockGasRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBlockGasRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBlockGasRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryBlockGasResponse protoreflect.MessageDescriptor + fd_QueryBlockGasResponse_gas protoreflect.FieldDescriptor +) + +func init() { + file_os_feemarket_v1_query_proto_init() + md_QueryBlockGasResponse = File_os_feemarket_v1_query_proto.Messages().ByName("QueryBlockGasResponse") + fd_QueryBlockGasResponse_gas = md_QueryBlockGasResponse.Fields().ByName("gas") +} + +var _ protoreflect.Message = (*fastReflection_QueryBlockGasResponse)(nil) + +type fastReflection_QueryBlockGasResponse QueryBlockGasResponse + +func (x *QueryBlockGasResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryBlockGasResponse)(x) +} + +func (x *QueryBlockGasResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_feemarket_v1_query_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryBlockGasResponse_messageType fastReflection_QueryBlockGasResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryBlockGasResponse_messageType{} + +type fastReflection_QueryBlockGasResponse_messageType struct{} + +func (x fastReflection_QueryBlockGasResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryBlockGasResponse)(nil) +} +func (x fastReflection_QueryBlockGasResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryBlockGasResponse) +} +func (x fastReflection_QueryBlockGasResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBlockGasResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryBlockGasResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBlockGasResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryBlockGasResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryBlockGasResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryBlockGasResponse) New() protoreflect.Message { + return new(fastReflection_QueryBlockGasResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryBlockGasResponse) Interface() protoreflect.ProtoMessage { + return (*QueryBlockGasResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryBlockGasResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Gas != int64(0) { + value := protoreflect.ValueOfInt64(x.Gas) + if !f(fd_QueryBlockGasResponse_gas, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryBlockGasResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.feemarket.v1.QueryBlockGasResponse.gas": + return x.Gas != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBlockGasResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBlockGasResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBlockGasResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.feemarket.v1.QueryBlockGasResponse.gas": + x.Gas = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBlockGasResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBlockGasResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryBlockGasResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.feemarket.v1.QueryBlockGasResponse.gas": + value := x.Gas + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBlockGasResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBlockGasResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBlockGasResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.feemarket.v1.QueryBlockGasResponse.gas": + x.Gas = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBlockGasResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBlockGasResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBlockGasResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.QueryBlockGasResponse.gas": + panic(fmt.Errorf("field gas of message os.feemarket.v1.QueryBlockGasResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBlockGasResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBlockGasResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryBlockGasResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.QueryBlockGasResponse.gas": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.QueryBlockGasResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.QueryBlockGasResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryBlockGasResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.feemarket.v1.QueryBlockGasResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryBlockGasResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryBlockGasResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryBlockGasResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryBlockGasResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryBlockGasResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Gas != 0 { + n += 1 + runtime.Sov(uint64(x.Gas)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryBlockGasResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Gas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Gas)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryBlockGasResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBlockGasResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBlockGasResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Gas", wireType) + } + x.Gas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Gas |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/feemarket/v1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryParamsRequest defines the request type for querying x/evm parameters. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_feemarket_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_os_feemarket_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse defines the response type for querying x/evm parameters. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params define the evm module parameters. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_feemarket_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_os_feemarket_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// QueryBaseFeeRequest defines the request type for querying the EIP1559 base +// fee. +type QueryBaseFeeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryBaseFeeRequest) Reset() { + *x = QueryBaseFeeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_feemarket_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryBaseFeeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryBaseFeeRequest) ProtoMessage() {} + +// Deprecated: Use QueryBaseFeeRequest.ProtoReflect.Descriptor instead. +func (*QueryBaseFeeRequest) Descriptor() ([]byte, []int) { + return file_os_feemarket_v1_query_proto_rawDescGZIP(), []int{2} +} + +// QueryBaseFeeResponse returns the EIP1559 base fee. +type QueryBaseFeeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // base_fee is the EIP1559 base fee + BaseFee string `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3" json:"base_fee,omitempty"` +} + +func (x *QueryBaseFeeResponse) Reset() { + *x = QueryBaseFeeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_feemarket_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryBaseFeeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryBaseFeeResponse) ProtoMessage() {} + +// Deprecated: Use QueryBaseFeeResponse.ProtoReflect.Descriptor instead. +func (*QueryBaseFeeResponse) Descriptor() ([]byte, []int) { + return file_os_feemarket_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryBaseFeeResponse) GetBaseFee() string { + if x != nil { + return x.BaseFee + } + return "" +} + +// QueryBlockGasRequest defines the request type for querying the EIP1559 base +// fee. +type QueryBlockGasRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryBlockGasRequest) Reset() { + *x = QueryBlockGasRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_os_feemarket_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryBlockGasRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryBlockGasRequest) ProtoMessage() {} + +// Deprecated: Use QueryBlockGasRequest.ProtoReflect.Descriptor instead. +func (*QueryBlockGasRequest) Descriptor() ([]byte, []int) { + return file_os_feemarket_v1_query_proto_rawDescGZIP(), []int{4} +} + +// QueryBlockGasResponse returns block gas used for a given height. +type QueryBlockGasResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // gas is the returned block gas + Gas int64 `protobuf:"varint,1,opt,name=gas,proto3" json:"gas,omitempty"` +} + +func (x *QueryBlockGasResponse) Reset() { + *x = QueryBlockGasResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_feemarket_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryBlockGasResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryBlockGasResponse) ProtoMessage() {} + +// Deprecated: Use QueryBlockGasResponse.ProtoReflect.Descriptor instead. +func (*QueryBlockGasResponse) Descriptor() ([]byte, []int) { + return file_os_feemarket_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryBlockGasResponse) GetGas() int64 { + if x != nil { + return x.Gas + } + return 0 +} + +var File_os_feemarket_v1_query_proto protoreflect.FileDescriptor + +var file_os_feemarket_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, + 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x6f, + 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x11, + 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x13, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, + 0x15, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4c, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, + 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, + 0x0a, 0x08, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x19, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x62, 0x61, 0x73, + 0x65, 0x46, 0x65, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x47, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x29, 0x0a, 0x15, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x47, 0x61, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x03, 0x67, 0x61, 0x73, 0x32, 0xf7, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x74, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x6f, 0x73, + 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x24, 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, + 0x2f, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x79, 0x0a, 0x07, 0x42, 0x61, 0x73, 0x65, 0x46, + 0x65, 0x65, 0x12, 0x24, 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x73, 0x65, 0x46, 0x65, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x42, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, + 0x65, 0x65, 0x12, 0x7d, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x47, 0x61, 0x73, 0x12, 0x25, + 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x47, 0x61, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x47, 0x61, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x67, 0x61, + 0x73, 0x42, 0xad, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x46, 0x58, 0xaa, 0x02, 0x0f, 0x4f, 0x73, + 0x2e, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, + 0x4f, 0x73, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1b, 0x4f, 0x73, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, + 0x4f, 0x73, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_feemarket_v1_query_proto_rawDescOnce sync.Once + file_os_feemarket_v1_query_proto_rawDescData = file_os_feemarket_v1_query_proto_rawDesc +) + +func file_os_feemarket_v1_query_proto_rawDescGZIP() []byte { + file_os_feemarket_v1_query_proto_rawDescOnce.Do(func() { + file_os_feemarket_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_feemarket_v1_query_proto_rawDescData) + }) + return file_os_feemarket_v1_query_proto_rawDescData +} + +var file_os_feemarket_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_os_feemarket_v1_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: os.feemarket.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: os.feemarket.v1.QueryParamsResponse + (*QueryBaseFeeRequest)(nil), // 2: os.feemarket.v1.QueryBaseFeeRequest + (*QueryBaseFeeResponse)(nil), // 3: os.feemarket.v1.QueryBaseFeeResponse + (*QueryBlockGasRequest)(nil), // 4: os.feemarket.v1.QueryBlockGasRequest + (*QueryBlockGasResponse)(nil), // 5: os.feemarket.v1.QueryBlockGasResponse + (*Params)(nil), // 6: os.feemarket.v1.Params +} +var file_os_feemarket_v1_query_proto_depIdxs = []int32{ + 6, // 0: os.feemarket.v1.QueryParamsResponse.params:type_name -> os.feemarket.v1.Params + 0, // 1: os.feemarket.v1.Query.Params:input_type -> os.feemarket.v1.QueryParamsRequest + 2, // 2: os.feemarket.v1.Query.BaseFee:input_type -> os.feemarket.v1.QueryBaseFeeRequest + 4, // 3: os.feemarket.v1.Query.BlockGas:input_type -> os.feemarket.v1.QueryBlockGasRequest + 1, // 4: os.feemarket.v1.Query.Params:output_type -> os.feemarket.v1.QueryParamsResponse + 3, // 5: os.feemarket.v1.Query.BaseFee:output_type -> os.feemarket.v1.QueryBaseFeeResponse + 5, // 6: os.feemarket.v1.Query.BlockGas:output_type -> os.feemarket.v1.QueryBlockGasResponse + 4, // [4:7] is the sub-list for method output_type + 1, // [1:4] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_os_feemarket_v1_query_proto_init() } +func file_os_feemarket_v1_query_proto_init() { + if File_os_feemarket_v1_query_proto != nil { + return + } + file_os_feemarket_v1_feemarket_proto_init() + if !protoimpl.UnsafeEnabled { + file_os_feemarket_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_feemarket_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_feemarket_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryBaseFeeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_feemarket_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryBaseFeeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_feemarket_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryBlockGasRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_feemarket_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryBlockGasResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_feemarket_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_os_feemarket_v1_query_proto_goTypes, + DependencyIndexes: file_os_feemarket_v1_query_proto_depIdxs, + MessageInfos: file_os_feemarket_v1_query_proto_msgTypes, + }.Build() + File_os_feemarket_v1_query_proto = out.File + file_os_feemarket_v1_query_proto_rawDesc = nil + file_os_feemarket_v1_query_proto_goTypes = nil + file_os_feemarket_v1_query_proto_depIdxs = nil +} diff --git a/api/os/feemarket/v1/query_grpc.pb.go b/api/os/feemarket/v1/query_grpc.pb.go new file mode 100644 index 00000000..4a82ce34 --- /dev/null +++ b/api/os/feemarket/v1/query_grpc.pb.go @@ -0,0 +1,192 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: os/feemarket/v1/query.proto + +package feemarketv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_Params_FullMethodName = "/os.feemarket.v1.Query/Params" + Query_BaseFee_FullMethodName = "/os.feemarket.v1.Query/BaseFee" + Query_BlockGas_FullMethodName = "/os.feemarket.v1.Query/BlockGas" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + // Params queries the parameters of x/feemarket module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // BaseFee queries the base fee of the parent block of the current block. + BaseFee(ctx context.Context, in *QueryBaseFeeRequest, opts ...grpc.CallOption) (*QueryBaseFeeResponse, error) + // BlockGas queries the gas used at a given block height + BlockGas(ctx context.Context, in *QueryBlockGasRequest, opts ...grpc.CallOption) (*QueryBlockGasResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BaseFee(ctx context.Context, in *QueryBaseFeeRequest, opts ...grpc.CallOption) (*QueryBaseFeeResponse, error) { + out := new(QueryBaseFeeResponse) + err := c.cc.Invoke(ctx, Query_BaseFee_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BlockGas(ctx context.Context, in *QueryBlockGasRequest, opts ...grpc.CallOption) (*QueryBlockGasResponse, error) { + out := new(QueryBlockGasResponse) + err := c.cc.Invoke(ctx, Query_BlockGas_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // Params queries the parameters of x/feemarket module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // BaseFee queries the base fee of the parent block of the current block. + BaseFee(context.Context, *QueryBaseFeeRequest) (*QueryBaseFeeResponse, error) + // BlockGas queries the gas used at a given block height + BlockGas(context.Context, *QueryBlockGasRequest) (*QueryBlockGasResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) BaseFee(context.Context, *QueryBaseFeeRequest) (*QueryBaseFeeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BaseFee not implemented") +} +func (UnimplementedQueryServer) BlockGas(context.Context, *QueryBlockGasRequest) (*QueryBlockGasResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BlockGas not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BaseFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBaseFeeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BaseFee(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_BaseFee_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BaseFee(ctx, req.(*QueryBaseFeeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BlockGas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBlockGasRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BlockGas(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_BlockGas_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BlockGas(ctx, req.(*QueryBlockGasRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "os.feemarket.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "BaseFee", + Handler: _Query_BaseFee_Handler, + }, + { + MethodName: "BlockGas", + Handler: _Query_BlockGas_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "os/feemarket/v1/query.proto", +} diff --git a/api/os/feemarket/v1/tx.pulsar.go b/api/os/feemarket/v1/tx.pulsar.go new file mode 100644 index 00000000..771a1634 --- /dev/null +++ b/api/os/feemarket/v1/tx.pulsar.go @@ -0,0 +1,1091 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package feemarketv1 + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_os_feemarket_v1_tx_proto_init() + md_MsgUpdateParams = File_os_feemarket_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_os_feemarket_v1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.feemarket.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "os.feemarket.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.feemarket.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.feemarket.v1.MsgUpdateParams.authority": + x.Authority = "" + case "os.feemarket.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.feemarket.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.feemarket.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "os.feemarket.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.feemarket.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.feemarket.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "os.feemarket.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.feemarket.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "os.feemarket.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message os.feemarket.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.feemarket.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.feemarket.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "os.feemarket.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message os.feemarket.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.feemarket.v1.MsgUpdateParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_os_feemarket_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_os_feemarket_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_os_feemarket_v1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.feemarket.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message os.feemarket.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.feemarket.v1.MsgUpdateParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/feemarket/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgUpdateParams defines a Msg for updating the x/feemarket module parameters. +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/feemarket parameters to update. + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_os_feemarket_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_os_feemarket_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_os_feemarket_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_os_feemarket_v1_tx_proto_rawDescGZIP(), []int{1} +} + +var File_os_feemarket_v1_tx_proto protoreflect.FileDescriptor + +var file_os_feemarket_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, + 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x6f, 0x73, 0x2e, 0x66, + 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, + 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, + 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb8, 0x01, 0x0a, 0x0f, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3a, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, + 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x3a, 0x31, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1e, 0x6f, 0x73, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, + 0x68, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5a, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x28, 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xaa, 0x01, 0x0a, 0x13, 0x63, 0x6f, + 0x6d, 0x2e, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, + 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, + 0x73, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x66, + 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x46, 0x58, + 0xaa, 0x02, 0x0f, 0x4f, 0x73, 0x2e, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x0f, 0x4f, 0x73, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x4f, 0x73, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x11, 0x4f, 0x73, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_feemarket_v1_tx_proto_rawDescOnce sync.Once + file_os_feemarket_v1_tx_proto_rawDescData = file_os_feemarket_v1_tx_proto_rawDesc +) + +func file_os_feemarket_v1_tx_proto_rawDescGZIP() []byte { + file_os_feemarket_v1_tx_proto_rawDescOnce.Do(func() { + file_os_feemarket_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_feemarket_v1_tx_proto_rawDescData) + }) + return file_os_feemarket_v1_tx_proto_rawDescData +} + +var file_os_feemarket_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_os_feemarket_v1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: os.feemarket.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: os.feemarket.v1.MsgUpdateParamsResponse + (*Params)(nil), // 2: os.feemarket.v1.Params +} +var file_os_feemarket_v1_tx_proto_depIdxs = []int32{ + 2, // 0: os.feemarket.v1.MsgUpdateParams.params:type_name -> os.feemarket.v1.Params + 0, // 1: os.feemarket.v1.Msg.UpdateParams:input_type -> os.feemarket.v1.MsgUpdateParams + 1, // 2: os.feemarket.v1.Msg.UpdateParams:output_type -> os.feemarket.v1.MsgUpdateParamsResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_os_feemarket_v1_tx_proto_init() } +func file_os_feemarket_v1_tx_proto_init() { + if File_os_feemarket_v1_tx_proto != nil { + return + } + file_os_feemarket_v1_feemarket_proto_init() + if !protoimpl.UnsafeEnabled { + file_os_feemarket_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_os_feemarket_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_feemarket_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_os_feemarket_v1_tx_proto_goTypes, + DependencyIndexes: file_os_feemarket_v1_tx_proto_depIdxs, + MessageInfos: file_os_feemarket_v1_tx_proto_msgTypes, + }.Build() + File_os_feemarket_v1_tx_proto = out.File + file_os_feemarket_v1_tx_proto_rawDesc = nil + file_os_feemarket_v1_tx_proto_goTypes = nil + file_os_feemarket_v1_tx_proto_depIdxs = nil +} diff --git a/api/os/feemarket/v1/tx_grpc.pb.go b/api/os/feemarket/v1/tx_grpc.pb.go new file mode 100644 index 00000000..1e42e8dd --- /dev/null +++ b/api/os/feemarket/v1/tx_grpc.pb.go @@ -0,0 +1,118 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: os/feemarket/v1/tx.proto + +package feemarketv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_UpdateParams_FullMethodName = "/os.feemarket.v1.Msg/UpdateParams" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defined a governance operation for updating the x/feemarket + // module parameters. The authority is hard-coded to the Cosmos SDK x/gov + // module account + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // UpdateParams defined a governance operation for updating the x/feemarket + // module parameters. The authority is hard-coded to the Cosmos SDK x/gov + // module account + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "os.feemarket.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "os/feemarket/v1/tx.proto", +} diff --git a/api/os/types/v1/dynamic_fee.pulsar.go b/api/os/types/v1/dynamic_fee.pulsar.go new file mode 100644 index 00000000..93c4180d --- /dev/null +++ b/api/os/types/v1/dynamic_fee.pulsar.go @@ -0,0 +1,581 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package typesv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_ExtensionOptionDynamicFeeTx protoreflect.MessageDescriptor + fd_ExtensionOptionDynamicFeeTx_max_priority_price protoreflect.FieldDescriptor +) + +func init() { + file_os_types_v1_dynamic_fee_proto_init() + md_ExtensionOptionDynamicFeeTx = File_os_types_v1_dynamic_fee_proto.Messages().ByName("ExtensionOptionDynamicFeeTx") + fd_ExtensionOptionDynamicFeeTx_max_priority_price = md_ExtensionOptionDynamicFeeTx.Fields().ByName("max_priority_price") +} + +var _ protoreflect.Message = (*fastReflection_ExtensionOptionDynamicFeeTx)(nil) + +type fastReflection_ExtensionOptionDynamicFeeTx ExtensionOptionDynamicFeeTx + +func (x *ExtensionOptionDynamicFeeTx) ProtoReflect() protoreflect.Message { + return (*fastReflection_ExtensionOptionDynamicFeeTx)(x) +} + +func (x *ExtensionOptionDynamicFeeTx) slowProtoReflect() protoreflect.Message { + mi := &file_os_types_v1_dynamic_fee_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ExtensionOptionDynamicFeeTx_messageType fastReflection_ExtensionOptionDynamicFeeTx_messageType +var _ protoreflect.MessageType = fastReflection_ExtensionOptionDynamicFeeTx_messageType{} + +type fastReflection_ExtensionOptionDynamicFeeTx_messageType struct{} + +func (x fastReflection_ExtensionOptionDynamicFeeTx_messageType) Zero() protoreflect.Message { + return (*fastReflection_ExtensionOptionDynamicFeeTx)(nil) +} +func (x fastReflection_ExtensionOptionDynamicFeeTx_messageType) New() protoreflect.Message { + return new(fastReflection_ExtensionOptionDynamicFeeTx) +} +func (x fastReflection_ExtensionOptionDynamicFeeTx_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ExtensionOptionDynamicFeeTx +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) Descriptor() protoreflect.MessageDescriptor { + return md_ExtensionOptionDynamicFeeTx +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) Type() protoreflect.MessageType { + return _fastReflection_ExtensionOptionDynamicFeeTx_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) New() protoreflect.Message { + return new(fastReflection_ExtensionOptionDynamicFeeTx) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) Interface() protoreflect.ProtoMessage { + return (*ExtensionOptionDynamicFeeTx)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.MaxPriorityPrice != "" { + value := protoreflect.ValueOfString(x.MaxPriorityPrice) + if !f(fd_ExtensionOptionDynamicFeeTx_max_priority_price, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.types.v1.ExtensionOptionDynamicFeeTx.max_priority_price": + return x.MaxPriorityPrice != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.ExtensionOptionDynamicFeeTx")) + } + panic(fmt.Errorf("message os.types.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.types.v1.ExtensionOptionDynamicFeeTx.max_priority_price": + x.MaxPriorityPrice = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.ExtensionOptionDynamicFeeTx")) + } + panic(fmt.Errorf("message os.types.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.types.v1.ExtensionOptionDynamicFeeTx.max_priority_price": + value := x.MaxPriorityPrice + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.ExtensionOptionDynamicFeeTx")) + } + panic(fmt.Errorf("message os.types.v1.ExtensionOptionDynamicFeeTx does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.types.v1.ExtensionOptionDynamicFeeTx.max_priority_price": + x.MaxPriorityPrice = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.ExtensionOptionDynamicFeeTx")) + } + panic(fmt.Errorf("message os.types.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.types.v1.ExtensionOptionDynamicFeeTx.max_priority_price": + panic(fmt.Errorf("field max_priority_price of message os.types.v1.ExtensionOptionDynamicFeeTx is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.ExtensionOptionDynamicFeeTx")) + } + panic(fmt.Errorf("message os.types.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.types.v1.ExtensionOptionDynamicFeeTx.max_priority_price": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.ExtensionOptionDynamicFeeTx")) + } + panic(fmt.Errorf("message os.types.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.types.v1.ExtensionOptionDynamicFeeTx", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ExtensionOptionDynamicFeeTx) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ExtensionOptionDynamicFeeTx) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.MaxPriorityPrice) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ExtensionOptionDynamicFeeTx) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.MaxPriorityPrice) > 0 { + i -= len(x.MaxPriorityPrice) + copy(dAtA[i:], x.MaxPriorityPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MaxPriorityPrice))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ExtensionOptionDynamicFeeTx) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExtensionOptionDynamicFeeTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExtensionOptionDynamicFeeTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxPriorityPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.MaxPriorityPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/types/v1/dynamic_fee.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ExtensionOptionDynamicFeeTx is an extension option that specifies the +// maxPrioPrice for cosmos tx +type ExtensionOptionDynamicFeeTx struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // max_priority_price is the same as `max_priority_fee_per_gas` in eip-1559 + // spec + MaxPriorityPrice string `protobuf:"bytes,1,opt,name=max_priority_price,json=maxPriorityPrice,proto3" json:"max_priority_price,omitempty"` +} + +func (x *ExtensionOptionDynamicFeeTx) Reset() { + *x = ExtensionOptionDynamicFeeTx{} + if protoimpl.UnsafeEnabled { + mi := &file_os_types_v1_dynamic_fee_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExtensionOptionDynamicFeeTx) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtensionOptionDynamicFeeTx) ProtoMessage() {} + +// Deprecated: Use ExtensionOptionDynamicFeeTx.ProtoReflect.Descriptor instead. +func (*ExtensionOptionDynamicFeeTx) Descriptor() ([]byte, []int) { + return file_os_types_v1_dynamic_fee_proto_rawDescGZIP(), []int{0} +} + +func (x *ExtensionOptionDynamicFeeTx) GetMaxPriorityPrice() string { + if x != nil { + return x.MaxPriorityPrice + } + return "" +} + +var File_os_types_v1_dynamic_fee_proto protoreflect.FileDescriptor + +var file_os_types_v1_dynamic_fee_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x6f, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x79, + 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, 0x66, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0b, 0x6f, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, + 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6f, 0x0a, 0x1b, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x46, + 0x65, 0x65, 0x54, 0x78, 0x12, 0x50, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x22, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x42, 0x96, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, + 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x44, 0x79, 0x6e, 0x61, + 0x6d, 0x69, 0x63, 0x46, 0x65, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x6f, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x54, 0x58, 0xaa, 0x02, 0x0b, 0x4f, 0x73, 0x2e, 0x54, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4f, 0x73, 0x5c, 0x54, 0x79, 0x70, + 0x65, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4f, 0x73, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x0d, 0x4f, 0x73, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_types_v1_dynamic_fee_proto_rawDescOnce sync.Once + file_os_types_v1_dynamic_fee_proto_rawDescData = file_os_types_v1_dynamic_fee_proto_rawDesc +) + +func file_os_types_v1_dynamic_fee_proto_rawDescGZIP() []byte { + file_os_types_v1_dynamic_fee_proto_rawDescOnce.Do(func() { + file_os_types_v1_dynamic_fee_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_types_v1_dynamic_fee_proto_rawDescData) + }) + return file_os_types_v1_dynamic_fee_proto_rawDescData +} + +var file_os_types_v1_dynamic_fee_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_os_types_v1_dynamic_fee_proto_goTypes = []interface{}{ + (*ExtensionOptionDynamicFeeTx)(nil), // 0: os.types.v1.ExtensionOptionDynamicFeeTx +} +var file_os_types_v1_dynamic_fee_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_os_types_v1_dynamic_fee_proto_init() } +func file_os_types_v1_dynamic_fee_proto_init() { + if File_os_types_v1_dynamic_fee_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_os_types_v1_dynamic_fee_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExtensionOptionDynamicFeeTx); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_types_v1_dynamic_fee_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_types_v1_dynamic_fee_proto_goTypes, + DependencyIndexes: file_os_types_v1_dynamic_fee_proto_depIdxs, + MessageInfos: file_os_types_v1_dynamic_fee_proto_msgTypes, + }.Build() + File_os_types_v1_dynamic_fee_proto = out.File + file_os_types_v1_dynamic_fee_proto_rawDesc = nil + file_os_types_v1_dynamic_fee_proto_goTypes = nil + file_os_types_v1_dynamic_fee_proto_depIdxs = nil +} diff --git a/api/os/types/v1/indexer.pulsar.go b/api/os/types/v1/indexer.pulsar.go new file mode 100644 index 00000000..6d4dcff4 --- /dev/null +++ b/api/os/types/v1/indexer.pulsar.go @@ -0,0 +1,919 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package typesv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_TxResult protoreflect.MessageDescriptor + fd_TxResult_height protoreflect.FieldDescriptor + fd_TxResult_tx_index protoreflect.FieldDescriptor + fd_TxResult_msg_index protoreflect.FieldDescriptor + fd_TxResult_eth_tx_index protoreflect.FieldDescriptor + fd_TxResult_failed protoreflect.FieldDescriptor + fd_TxResult_gas_used protoreflect.FieldDescriptor + fd_TxResult_cumulative_gas_used protoreflect.FieldDescriptor +) + +func init() { + file_os_types_v1_indexer_proto_init() + md_TxResult = File_os_types_v1_indexer_proto.Messages().ByName("TxResult") + fd_TxResult_height = md_TxResult.Fields().ByName("height") + fd_TxResult_tx_index = md_TxResult.Fields().ByName("tx_index") + fd_TxResult_msg_index = md_TxResult.Fields().ByName("msg_index") + fd_TxResult_eth_tx_index = md_TxResult.Fields().ByName("eth_tx_index") + fd_TxResult_failed = md_TxResult.Fields().ByName("failed") + fd_TxResult_gas_used = md_TxResult.Fields().ByName("gas_used") + fd_TxResult_cumulative_gas_used = md_TxResult.Fields().ByName("cumulative_gas_used") +} + +var _ protoreflect.Message = (*fastReflection_TxResult)(nil) + +type fastReflection_TxResult TxResult + +func (x *TxResult) ProtoReflect() protoreflect.Message { + return (*fastReflection_TxResult)(x) +} + +func (x *TxResult) slowProtoReflect() protoreflect.Message { + mi := &file_os_types_v1_indexer_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_TxResult_messageType fastReflection_TxResult_messageType +var _ protoreflect.MessageType = fastReflection_TxResult_messageType{} + +type fastReflection_TxResult_messageType struct{} + +func (x fastReflection_TxResult_messageType) Zero() protoreflect.Message { + return (*fastReflection_TxResult)(nil) +} +func (x fastReflection_TxResult_messageType) New() protoreflect.Message { + return new(fastReflection_TxResult) +} +func (x fastReflection_TxResult_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_TxResult +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_TxResult) Descriptor() protoreflect.MessageDescriptor { + return md_TxResult +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_TxResult) Type() protoreflect.MessageType { + return _fastReflection_TxResult_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_TxResult) New() protoreflect.Message { + return new(fastReflection_TxResult) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_TxResult) Interface() protoreflect.ProtoMessage { + return (*TxResult)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_TxResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Height != int64(0) { + value := protoreflect.ValueOfInt64(x.Height) + if !f(fd_TxResult_height, value) { + return + } + } + if x.TxIndex != uint32(0) { + value := protoreflect.ValueOfUint32(x.TxIndex) + if !f(fd_TxResult_tx_index, value) { + return + } + } + if x.MsgIndex != uint32(0) { + value := protoreflect.ValueOfUint32(x.MsgIndex) + if !f(fd_TxResult_msg_index, value) { + return + } + } + if x.EthTxIndex != int32(0) { + value := protoreflect.ValueOfInt32(x.EthTxIndex) + if !f(fd_TxResult_eth_tx_index, value) { + return + } + } + if x.Failed != false { + value := protoreflect.ValueOfBool(x.Failed) + if !f(fd_TxResult_failed, value) { + return + } + } + if x.GasUsed != uint64(0) { + value := protoreflect.ValueOfUint64(x.GasUsed) + if !f(fd_TxResult_gas_used, value) { + return + } + } + if x.CumulativeGasUsed != uint64(0) { + value := protoreflect.ValueOfUint64(x.CumulativeGasUsed) + if !f(fd_TxResult_cumulative_gas_used, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_TxResult) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.types.v1.TxResult.height": + return x.Height != int64(0) + case "os.types.v1.TxResult.tx_index": + return x.TxIndex != uint32(0) + case "os.types.v1.TxResult.msg_index": + return x.MsgIndex != uint32(0) + case "os.types.v1.TxResult.eth_tx_index": + return x.EthTxIndex != int32(0) + case "os.types.v1.TxResult.failed": + return x.Failed != false + case "os.types.v1.TxResult.gas_used": + return x.GasUsed != uint64(0) + case "os.types.v1.TxResult.cumulative_gas_used": + return x.CumulativeGasUsed != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.TxResult")) + } + panic(fmt.Errorf("message os.types.v1.TxResult does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TxResult) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.types.v1.TxResult.height": + x.Height = int64(0) + case "os.types.v1.TxResult.tx_index": + x.TxIndex = uint32(0) + case "os.types.v1.TxResult.msg_index": + x.MsgIndex = uint32(0) + case "os.types.v1.TxResult.eth_tx_index": + x.EthTxIndex = int32(0) + case "os.types.v1.TxResult.failed": + x.Failed = false + case "os.types.v1.TxResult.gas_used": + x.GasUsed = uint64(0) + case "os.types.v1.TxResult.cumulative_gas_used": + x.CumulativeGasUsed = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.TxResult")) + } + panic(fmt.Errorf("message os.types.v1.TxResult does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_TxResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.types.v1.TxResult.height": + value := x.Height + return protoreflect.ValueOfInt64(value) + case "os.types.v1.TxResult.tx_index": + value := x.TxIndex + return protoreflect.ValueOfUint32(value) + case "os.types.v1.TxResult.msg_index": + value := x.MsgIndex + return protoreflect.ValueOfUint32(value) + case "os.types.v1.TxResult.eth_tx_index": + value := x.EthTxIndex + return protoreflect.ValueOfInt32(value) + case "os.types.v1.TxResult.failed": + value := x.Failed + return protoreflect.ValueOfBool(value) + case "os.types.v1.TxResult.gas_used": + value := x.GasUsed + return protoreflect.ValueOfUint64(value) + case "os.types.v1.TxResult.cumulative_gas_used": + value := x.CumulativeGasUsed + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.TxResult")) + } + panic(fmt.Errorf("message os.types.v1.TxResult does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TxResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.types.v1.TxResult.height": + x.Height = value.Int() + case "os.types.v1.TxResult.tx_index": + x.TxIndex = uint32(value.Uint()) + case "os.types.v1.TxResult.msg_index": + x.MsgIndex = uint32(value.Uint()) + case "os.types.v1.TxResult.eth_tx_index": + x.EthTxIndex = int32(value.Int()) + case "os.types.v1.TxResult.failed": + x.Failed = value.Bool() + case "os.types.v1.TxResult.gas_used": + x.GasUsed = value.Uint() + case "os.types.v1.TxResult.cumulative_gas_used": + x.CumulativeGasUsed = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.TxResult")) + } + panic(fmt.Errorf("message os.types.v1.TxResult does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TxResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.types.v1.TxResult.height": + panic(fmt.Errorf("field height of message os.types.v1.TxResult is not mutable")) + case "os.types.v1.TxResult.tx_index": + panic(fmt.Errorf("field tx_index of message os.types.v1.TxResult is not mutable")) + case "os.types.v1.TxResult.msg_index": + panic(fmt.Errorf("field msg_index of message os.types.v1.TxResult is not mutable")) + case "os.types.v1.TxResult.eth_tx_index": + panic(fmt.Errorf("field eth_tx_index of message os.types.v1.TxResult is not mutable")) + case "os.types.v1.TxResult.failed": + panic(fmt.Errorf("field failed of message os.types.v1.TxResult is not mutable")) + case "os.types.v1.TxResult.gas_used": + panic(fmt.Errorf("field gas_used of message os.types.v1.TxResult is not mutable")) + case "os.types.v1.TxResult.cumulative_gas_used": + panic(fmt.Errorf("field cumulative_gas_used of message os.types.v1.TxResult is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.TxResult")) + } + panic(fmt.Errorf("message os.types.v1.TxResult does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_TxResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.types.v1.TxResult.height": + return protoreflect.ValueOfInt64(int64(0)) + case "os.types.v1.TxResult.tx_index": + return protoreflect.ValueOfUint32(uint32(0)) + case "os.types.v1.TxResult.msg_index": + return protoreflect.ValueOfUint32(uint32(0)) + case "os.types.v1.TxResult.eth_tx_index": + return protoreflect.ValueOfInt32(int32(0)) + case "os.types.v1.TxResult.failed": + return protoreflect.ValueOfBool(false) + case "os.types.v1.TxResult.gas_used": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.types.v1.TxResult.cumulative_gas_used": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.TxResult")) + } + panic(fmt.Errorf("message os.types.v1.TxResult does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_TxResult) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.types.v1.TxResult", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_TxResult) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TxResult) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_TxResult) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_TxResult) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*TxResult) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Height != 0 { + n += 1 + runtime.Sov(uint64(x.Height)) + } + if x.TxIndex != 0 { + n += 1 + runtime.Sov(uint64(x.TxIndex)) + } + if x.MsgIndex != 0 { + n += 1 + runtime.Sov(uint64(x.MsgIndex)) + } + if x.EthTxIndex != 0 { + n += 1 + runtime.Sov(uint64(x.EthTxIndex)) + } + if x.Failed { + n += 2 + } + if x.GasUsed != 0 { + n += 1 + runtime.Sov(uint64(x.GasUsed)) + } + if x.CumulativeGasUsed != 0 { + n += 1 + runtime.Sov(uint64(x.CumulativeGasUsed)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*TxResult) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.CumulativeGasUsed != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CumulativeGasUsed)) + i-- + dAtA[i] = 0x38 + } + if x.GasUsed != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.GasUsed)) + i-- + dAtA[i] = 0x30 + } + if x.Failed { + i-- + if x.Failed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if x.EthTxIndex != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EthTxIndex)) + i-- + dAtA[i] = 0x20 + } + if x.MsgIndex != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MsgIndex)) + i-- + dAtA[i] = 0x18 + } + if x.TxIndex != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TxIndex)) + i-- + dAtA[i] = 0x10 + } + if x.Height != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Height)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*TxResult) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TxResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TxResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + x.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TxIndex", wireType) + } + x.TxIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.TxIndex |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MsgIndex", wireType) + } + x.MsgIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.MsgIndex |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EthTxIndex", wireType) + } + x.EthTxIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.EthTxIndex |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Failed = bool(v != 0) + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) + } + x.GasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.GasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CumulativeGasUsed", wireType) + } + x.CumulativeGasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.CumulativeGasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/types/v1/indexer.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// TxResult is the value stored in eth tx indexer +type TxResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // height of the blockchain + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + // tx_index of the cosmos transaction + TxIndex uint32 `protobuf:"varint,2,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"` + // msg_index in a batch transaction + MsgIndex uint32 `protobuf:"varint,3,opt,name=msg_index,json=msgIndex,proto3" json:"msg_index,omitempty"` + // eth_tx_index is the index in the list of valid eth tx in the block, + // aka. the transaction list returned by eth_getBlock api. + EthTxIndex int32 `protobuf:"varint,4,opt,name=eth_tx_index,json=ethTxIndex,proto3" json:"eth_tx_index,omitempty"` + // failed is true if the eth transaction did not go succeed + Failed bool `protobuf:"varint,5,opt,name=failed,proto3" json:"failed,omitempty"` + // gas_used by the transaction. If it exceeds the block gas limit, + // it's set to gas limit, which is what's actually deducted by ante handler. + GasUsed uint64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + // cumulative_gas_used specifies the cumulated amount of gas used for all + // processed messages within the current batch transaction. + CumulativeGasUsed uint64 `protobuf:"varint,7,opt,name=cumulative_gas_used,json=cumulativeGasUsed,proto3" json:"cumulative_gas_used,omitempty"` +} + +func (x *TxResult) Reset() { + *x = TxResult{} + if protoimpl.UnsafeEnabled { + mi := &file_os_types_v1_indexer_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TxResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TxResult) ProtoMessage() {} + +// Deprecated: Use TxResult.ProtoReflect.Descriptor instead. +func (*TxResult) Descriptor() ([]byte, []int) { + return file_os_types_v1_indexer_proto_rawDescGZIP(), []int{0} +} + +func (x *TxResult) GetHeight() int64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *TxResult) GetTxIndex() uint32 { + if x != nil { + return x.TxIndex + } + return 0 +} + +func (x *TxResult) GetMsgIndex() uint32 { + if x != nil { + return x.MsgIndex + } + return 0 +} + +func (x *TxResult) GetEthTxIndex() int32 { + if x != nil { + return x.EthTxIndex + } + return 0 +} + +func (x *TxResult) GetFailed() bool { + if x != nil { + return x.Failed + } + return false +} + +func (x *TxResult) GetGasUsed() uint64 { + if x != nil { + return x.GasUsed + } + return 0 +} + +func (x *TxResult) GetCumulativeGasUsed() uint64 { + if x != nil { + return x.CumulativeGasUsed + } + return 0 +} + +var File_os_types_v1_indexer_proto protoreflect.FileDescriptor + +var file_os_types_v1_indexer_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x6f, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6f, 0x73, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe5, + 0x01, 0x0a, 0x08, 0x54, 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x74, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1b, + 0x0a, 0x09, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x08, 0x6d, 0x73, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x0c, 0x65, + 0x74, 0x68, 0x5f, 0x74, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x54, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x0a, + 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, + 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, + 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, + 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, + 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x63, + 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, + 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x42, 0x93, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, + 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x4f, 0x54, 0x58, 0xaa, 0x02, 0x0b, 0x4f, 0x73, 0x2e, 0x54, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4f, 0x73, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4f, 0x73, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x4f, + 0x73, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_types_v1_indexer_proto_rawDescOnce sync.Once + file_os_types_v1_indexer_proto_rawDescData = file_os_types_v1_indexer_proto_rawDesc +) + +func file_os_types_v1_indexer_proto_rawDescGZIP() []byte { + file_os_types_v1_indexer_proto_rawDescOnce.Do(func() { + file_os_types_v1_indexer_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_types_v1_indexer_proto_rawDescData) + }) + return file_os_types_v1_indexer_proto_rawDescData +} + +var file_os_types_v1_indexer_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_os_types_v1_indexer_proto_goTypes = []interface{}{ + (*TxResult)(nil), // 0: os.types.v1.TxResult +} +var file_os_types_v1_indexer_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_os_types_v1_indexer_proto_init() } +func file_os_types_v1_indexer_proto_init() { + if File_os_types_v1_indexer_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_os_types_v1_indexer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_types_v1_indexer_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_types_v1_indexer_proto_goTypes, + DependencyIndexes: file_os_types_v1_indexer_proto_depIdxs, + MessageInfos: file_os_types_v1_indexer_proto_msgTypes, + }.Build() + File_os_types_v1_indexer_proto = out.File + file_os_types_v1_indexer_proto_rawDesc = nil + file_os_types_v1_indexer_proto_goTypes = nil + file_os_types_v1_indexer_proto_depIdxs = nil +} diff --git a/api/os/types/v1/web3.pulsar.go b/api/os/types/v1/web3.pulsar.go new file mode 100644 index 00000000..e5b9ac21 --- /dev/null +++ b/api/os/types/v1/web3.pulsar.go @@ -0,0 +1,720 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package typesv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_ExtensionOptionsWeb3Tx protoreflect.MessageDescriptor + fd_ExtensionOptionsWeb3Tx_typed_data_chain_id protoreflect.FieldDescriptor + fd_ExtensionOptionsWeb3Tx_fee_payer protoreflect.FieldDescriptor + fd_ExtensionOptionsWeb3Tx_fee_payer_sig protoreflect.FieldDescriptor +) + +func init() { + file_os_types_v1_web3_proto_init() + md_ExtensionOptionsWeb3Tx = File_os_types_v1_web3_proto.Messages().ByName("ExtensionOptionsWeb3Tx") + fd_ExtensionOptionsWeb3Tx_typed_data_chain_id = md_ExtensionOptionsWeb3Tx.Fields().ByName("typed_data_chain_id") + fd_ExtensionOptionsWeb3Tx_fee_payer = md_ExtensionOptionsWeb3Tx.Fields().ByName("fee_payer") + fd_ExtensionOptionsWeb3Tx_fee_payer_sig = md_ExtensionOptionsWeb3Tx.Fields().ByName("fee_payer_sig") +} + +var _ protoreflect.Message = (*fastReflection_ExtensionOptionsWeb3Tx)(nil) + +type fastReflection_ExtensionOptionsWeb3Tx ExtensionOptionsWeb3Tx + +func (x *ExtensionOptionsWeb3Tx) ProtoReflect() protoreflect.Message { + return (*fastReflection_ExtensionOptionsWeb3Tx)(x) +} + +func (x *ExtensionOptionsWeb3Tx) slowProtoReflect() protoreflect.Message { + mi := &file_os_types_v1_web3_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ExtensionOptionsWeb3Tx_messageType fastReflection_ExtensionOptionsWeb3Tx_messageType +var _ protoreflect.MessageType = fastReflection_ExtensionOptionsWeb3Tx_messageType{} + +type fastReflection_ExtensionOptionsWeb3Tx_messageType struct{} + +func (x fastReflection_ExtensionOptionsWeb3Tx_messageType) Zero() protoreflect.Message { + return (*fastReflection_ExtensionOptionsWeb3Tx)(nil) +} +func (x fastReflection_ExtensionOptionsWeb3Tx_messageType) New() protoreflect.Message { + return new(fastReflection_ExtensionOptionsWeb3Tx) +} +func (x fastReflection_ExtensionOptionsWeb3Tx_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ExtensionOptionsWeb3Tx +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ExtensionOptionsWeb3Tx) Descriptor() protoreflect.MessageDescriptor { + return md_ExtensionOptionsWeb3Tx +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ExtensionOptionsWeb3Tx) Type() protoreflect.MessageType { + return _fastReflection_ExtensionOptionsWeb3Tx_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ExtensionOptionsWeb3Tx) New() protoreflect.Message { + return new(fastReflection_ExtensionOptionsWeb3Tx) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ExtensionOptionsWeb3Tx) Interface() protoreflect.ProtoMessage { + return (*ExtensionOptionsWeb3Tx)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ExtensionOptionsWeb3Tx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.TypedDataChainId != uint64(0) { + value := protoreflect.ValueOfUint64(x.TypedDataChainId) + if !f(fd_ExtensionOptionsWeb3Tx_typed_data_chain_id, value) { + return + } + } + if x.FeePayer != "" { + value := protoreflect.ValueOfString(x.FeePayer) + if !f(fd_ExtensionOptionsWeb3Tx_fee_payer, value) { + return + } + } + if len(x.FeePayerSig) != 0 { + value := protoreflect.ValueOfBytes(x.FeePayerSig) + if !f(fd_ExtensionOptionsWeb3Tx_fee_payer_sig, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ExtensionOptionsWeb3Tx) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "os.types.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": + return x.TypedDataChainId != uint64(0) + case "os.types.v1.ExtensionOptionsWeb3Tx.fee_payer": + return x.FeePayer != "" + case "os.types.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": + return len(x.FeePayerSig) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.ExtensionOptionsWeb3Tx")) + } + panic(fmt.Errorf("message os.types.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtensionOptionsWeb3Tx) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "os.types.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": + x.TypedDataChainId = uint64(0) + case "os.types.v1.ExtensionOptionsWeb3Tx.fee_payer": + x.FeePayer = "" + case "os.types.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": + x.FeePayerSig = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.ExtensionOptionsWeb3Tx")) + } + panic(fmt.Errorf("message os.types.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ExtensionOptionsWeb3Tx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "os.types.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": + value := x.TypedDataChainId + return protoreflect.ValueOfUint64(value) + case "os.types.v1.ExtensionOptionsWeb3Tx.fee_payer": + value := x.FeePayer + return protoreflect.ValueOfString(value) + case "os.types.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": + value := x.FeePayerSig + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.ExtensionOptionsWeb3Tx")) + } + panic(fmt.Errorf("message os.types.v1.ExtensionOptionsWeb3Tx does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtensionOptionsWeb3Tx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "os.types.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": + x.TypedDataChainId = value.Uint() + case "os.types.v1.ExtensionOptionsWeb3Tx.fee_payer": + x.FeePayer = value.Interface().(string) + case "os.types.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": + x.FeePayerSig = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.ExtensionOptionsWeb3Tx")) + } + panic(fmt.Errorf("message os.types.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtensionOptionsWeb3Tx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.types.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": + panic(fmt.Errorf("field typed_data_chain_id of message os.types.v1.ExtensionOptionsWeb3Tx is not mutable")) + case "os.types.v1.ExtensionOptionsWeb3Tx.fee_payer": + panic(fmt.Errorf("field fee_payer of message os.types.v1.ExtensionOptionsWeb3Tx is not mutable")) + case "os.types.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": + panic(fmt.Errorf("field fee_payer_sig of message os.types.v1.ExtensionOptionsWeb3Tx is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.ExtensionOptionsWeb3Tx")) + } + panic(fmt.Errorf("message os.types.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ExtensionOptionsWeb3Tx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "os.types.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "os.types.v1.ExtensionOptionsWeb3Tx.fee_payer": + return protoreflect.ValueOfString("") + case "os.types.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: os.types.v1.ExtensionOptionsWeb3Tx")) + } + panic(fmt.Errorf("message os.types.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ExtensionOptionsWeb3Tx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in os.types.v1.ExtensionOptionsWeb3Tx", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ExtensionOptionsWeb3Tx) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtensionOptionsWeb3Tx) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ExtensionOptionsWeb3Tx) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ExtensionOptionsWeb3Tx) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ExtensionOptionsWeb3Tx) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.TypedDataChainId != 0 { + n += 1 + runtime.Sov(uint64(x.TypedDataChainId)) + } + l = len(x.FeePayer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.FeePayerSig) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ExtensionOptionsWeb3Tx) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.FeePayerSig) > 0 { + i -= len(x.FeePayerSig) + copy(dAtA[i:], x.FeePayerSig) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FeePayerSig))) + i-- + dAtA[i] = 0x1a + } + if len(x.FeePayer) > 0 { + i -= len(x.FeePayer) + copy(dAtA[i:], x.FeePayer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FeePayer))) + i-- + dAtA[i] = 0x12 + } + if x.TypedDataChainId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TypedDataChainId)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ExtensionOptionsWeb3Tx) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExtensionOptionsWeb3Tx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExtensionOptionsWeb3Tx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TypedDataChainId", wireType) + } + x.TypedDataChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.TypedDataChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FeePayer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.FeePayer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FeePayerSig", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.FeePayerSig = append(x.FeePayerSig[:0], dAtA[iNdEx:postIndex]...) + if x.FeePayerSig == nil { + x.FeePayerSig = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: os/types/v1/web3.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ExtensionOptionsWeb3Tx is an extension option that specifies the typed chain +// id, the fee payer as well as its signature data. +type ExtensionOptionsWeb3Tx struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // typed_data_chain_id is used only in EIP712 Domain and should match + // Ethereum network ID in a Web3 provider (e.g. Metamask). + TypedDataChainId uint64 `protobuf:"varint,1,opt,name=typed_data_chain_id,json=typedDataChainId,proto3" json:"typed_data_chain_id,omitempty"` + // fee_payer is an account address for the fee payer. It will be validated + // during EIP712 signature checking. + FeePayer string `protobuf:"bytes,2,opt,name=fee_payer,json=feePayer,proto3" json:"fee_payer,omitempty"` + // fee_payer_sig is a signature data from the fee paying account, + // allows to perform fee delegation when using EIP712 Domain. + FeePayerSig []byte `protobuf:"bytes,3,opt,name=fee_payer_sig,json=feePayerSig,proto3" json:"fee_payer_sig,omitempty"` +} + +func (x *ExtensionOptionsWeb3Tx) Reset() { + *x = ExtensionOptionsWeb3Tx{} + if protoimpl.UnsafeEnabled { + mi := &file_os_types_v1_web3_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExtensionOptionsWeb3Tx) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtensionOptionsWeb3Tx) ProtoMessage() {} + +// Deprecated: Use ExtensionOptionsWeb3Tx.ProtoReflect.Descriptor instead. +func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int) { + return file_os_types_v1_web3_proto_rawDescGZIP(), []int{0} +} + +func (x *ExtensionOptionsWeb3Tx) GetTypedDataChainId() uint64 { + if x != nil { + return x.TypedDataChainId + } + return 0 +} + +func (x *ExtensionOptionsWeb3Tx) GetFeePayer() string { + if x != nil { + return x.FeePayer + } + return "" +} + +func (x *ExtensionOptionsWeb3Tx) GetFeePayerSig() []byte { + if x != nil { + return x.FeePayerSig + } + return nil +} + +var File_os_types_v1_web3_proto protoreflect.FileDescriptor + +var file_os_types_v1_web3_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x6f, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x65, + 0x62, 0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6f, 0x73, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf5, 0x01, 0x0a, 0x16, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x57, 0x65, 0x62, 0x33, 0x54, 0x78, 0x12, 0x61, 0x0a, 0x13, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x32, 0xe2, 0xde, 0x1f, 0x10, 0x54, 0x79, 0x70, 0x65, 0x64, 0x44, 0x61, + 0x74, 0x61, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0xea, 0xde, 0x1f, 0x1a, 0x74, 0x79, 0x70, + 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x2c, 0x6f, 0x6d, + 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x10, 0x74, 0x79, 0x70, 0x65, 0x64, 0x44, 0x61, + 0x74, 0x61, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x09, 0x66, 0x65, 0x65, + 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x16, 0xea, 0xde, + 0x1f, 0x12, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x52, 0x08, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x12, 0x3d, + 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x19, 0xea, 0xde, 0x1f, 0x15, 0x66, 0x65, 0x65, 0x50, 0x61, + 0x79, 0x65, 0x72, 0x53, 0x69, 0x67, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, + 0x52, 0x0b, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x53, 0x69, 0x67, 0x3a, 0x04, 0x88, + 0xa0, 0x1f, 0x00, 0x42, 0x90, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x57, 0x65, 0x62, 0x33, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x76, 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x54, 0x58, + 0xaa, 0x02, 0x0b, 0x4f, 0x73, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x0b, 0x4f, 0x73, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4f, + 0x73, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x4f, 0x73, 0x3a, 0x3a, 0x54, 0x79, 0x70, + 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_os_types_v1_web3_proto_rawDescOnce sync.Once + file_os_types_v1_web3_proto_rawDescData = file_os_types_v1_web3_proto_rawDesc +) + +func file_os_types_v1_web3_proto_rawDescGZIP() []byte { + file_os_types_v1_web3_proto_rawDescOnce.Do(func() { + file_os_types_v1_web3_proto_rawDescData = protoimpl.X.CompressGZIP(file_os_types_v1_web3_proto_rawDescData) + }) + return file_os_types_v1_web3_proto_rawDescData +} + +var file_os_types_v1_web3_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_os_types_v1_web3_proto_goTypes = []interface{}{ + (*ExtensionOptionsWeb3Tx)(nil), // 0: os.types.v1.ExtensionOptionsWeb3Tx +} +var file_os_types_v1_web3_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_os_types_v1_web3_proto_init() } +func file_os_types_v1_web3_proto_init() { + if File_os_types_v1_web3_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_os_types_v1_web3_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExtensionOptionsWeb3Tx); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_os_types_v1_web3_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_os_types_v1_web3_proto_goTypes, + DependencyIndexes: file_os_types_v1_web3_proto_depIdxs, + MessageInfos: file_os_types_v1_web3_proto_msgTypes, + }.Build() + File_os_types_v1_web3_proto = out.File + file_os_types_v1_web3_proto_rawDesc = nil + file_os_types_v1_web3_proto_goTypes = nil + file_os_types_v1_web3_proto_depIdxs = nil +} diff --git a/client/block/store.go b/client/block/store.go index aa53bfd5..0e79d726 100644 --- a/client/block/store.go +++ b/client/block/store.go @@ -8,10 +8,10 @@ import ( "fmt" "path/filepath" - dbm "github.com/cometbft/cometbft-db" - tmstore "github.com/cometbft/cometbft/proto/tendermint/store" + cmtstore "github.com/cometbft/cometbft/proto/tendermint/store" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/gogoproto/proto" ) @@ -35,7 +35,7 @@ func newStore(rootDir string, backendType dbm.BackendType) (*store, error) { } // state returns the BlockStoreState as loaded from disk. -func (s *store) state() (*tmstore.BlockStoreState, error) { +func (s *store) state() (*cmtstore.BlockStoreState, error) { bytes, err := s.Get(storeKey) if err != nil { return nil, err @@ -45,7 +45,7 @@ func (s *store) state() (*tmstore.BlockStoreState, error) { return nil, errors.New("could not find a BlockStoreState persisted in db") } - var bss tmstore.BlockStoreState + var bss cmtstore.BlockStoreState if err := proto.Unmarshal(bytes, &bss); err != nil { return nil, fmt.Errorf("could not unmarshal bytes: %X", bytes) } diff --git a/client/keys/add.go b/client/keys/add.go index d074828c..9d265bff 100644 --- a/client/keys/add.go +++ b/client/keys/add.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package keys import ( @@ -259,7 +260,7 @@ func printCreate(cmd *cobra.Command, k *keyring.Record, showMnemonic bool, mnemo switch outputFormat { case OutputFormatText: cmd.PrintErrln() - if err := printKeyringRecord(cmd.OutOrStdout(), k, keyring.MkAccKeyOutput, outputFormat); err != nil { + if err := printKeyringRecord(cmd.OutOrStdout(), k, keys.MkAccKeyOutput, outputFormat); err != nil { return err } @@ -272,7 +273,7 @@ func printCreate(cmd *cobra.Command, k *keyring.Record, showMnemonic bool, mnemo } } case OutputFormatJSON: - out, err := keyring.MkAccKeyOutput(k) + out, err := keys.MkAccKeyOutput(k) if err != nil { return err } diff --git a/client/keys/utils.go b/client/keys/utils.go index a996a9bb..91898ae6 100644 --- a/client/keys/utils.go +++ b/client/keys/utils.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package keys import ( @@ -9,6 +10,7 @@ import ( "sigs.k8s.io/yaml" + "github.com/cosmos/cosmos-sdk/client/keys" cryptokeyring "github.com/cosmos/cosmos-sdk/crypto/keyring" ) @@ -18,7 +20,7 @@ const ( OutputFormatJSON = "json" ) -type bechKeyOutFn func(k *cryptokeyring.Record) (cryptokeyring.KeyOutput, error) +type bechKeyOutFn func(k *cryptokeyring.Record) (keys.KeyOutput, error) func printKeyringRecord(w io.Writer, k *cryptokeyring.Record, bechKeyOut bechKeyOutFn, output string) error { ko, err := bechKeyOut(k) @@ -28,7 +30,7 @@ func printKeyringRecord(w io.Writer, k *cryptokeyring.Record, bechKeyOut bechKey switch output { case OutputFormatText: - if err := printTextRecords(w, []cryptokeyring.KeyOutput{ko}); err != nil { + if err := printTextRecords(w, []keys.KeyOutput{ko}); err != nil { return err } @@ -46,7 +48,7 @@ func printKeyringRecord(w io.Writer, k *cryptokeyring.Record, bechKeyOut bechKey return nil } -func printTextRecords(w io.Writer, kos []cryptokeyring.KeyOutput) error { +func printTextRecords(w io.Writer, kos []keys.KeyOutput) error { out, err := yaml.Marshal(&kos) if err != nil { return err diff --git a/cmd/config/opendb.go b/cmd/config/opendb.go index e95fd686..aca13a38 100644 --- a/cmd/config/opendb.go +++ b/cmd/config/opendb.go @@ -9,7 +9,7 @@ package config import ( "path/filepath" - dbm "github.com/cometbft/cometbft-db" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/server/types" ) diff --git a/contracts/hardhat.config.js b/contracts/hardhat.config.js index 5a6dc10e..8dcd414c 100644 --- a/contracts/hardhat.config.js +++ b/contracts/hardhat.config.js @@ -1,6 +1,6 @@ /** @type import('hardhat/config').HardhatUserConfig */ module.exports = { - solidity: '0.8.19', + solidity: '0.8.20', paths: { sources: './solidity' } diff --git a/contracts/solidity/ERC20MinterBurnerDecimals.json b/contracts/solidity/ERC20MinterBurnerDecimals.json index 1f038c92..7e1c5bd8 100644 --- a/contracts/solidity/ERC20MinterBurnerDecimals.json +++ b/contracts/solidity/ERC20MinterBurnerDecimals.json @@ -701,8 +701,8 @@ "type": "function" } ], - "bytecode": "0x60806040523480156200001157600080fd5b5060405162003c3638038062003c368339818101604052810190620000379190620005f6565b828281600590816200004a9190620008db565b5080600690816200005c9190620008db565b5050506000600760006101000a81548160ff0219169083151502179055506200009e6000801b620000926200017b60201b60201c565b6200018360201b60201c565b620000df7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6620000d36200017b60201b60201c565b6200018360201b60201c565b620001207f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a620001146200017b60201b60201c565b6200018360201b60201c565b620001617f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848620001556200017b60201b60201c565b6200018360201b60201c565b62000172816200019960201b60201c565b505050620009c2565b600033905090565b620001958282620001b760201b60201c565b5050565b80600760016101000a81548160ff021916908360ff16021790555050565b620001c98282620001f560201b60201c565b620001f08160016000858152602001908152602001600020620002e660201b90919060201c565b505050565b6200020782826200031e60201b60201c565b620002e257600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550620002876200017b60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000316836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6200038860201b60201c565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60006200039c83836200040260201b60201c565b620003f7578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050620003fc565b600090505b92915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200048e8262000443565b810181811067ffffffffffffffff82111715620004b057620004af62000454565b5b80604052505050565b6000620004c562000425565b9050620004d3828262000483565b919050565b600067ffffffffffffffff821115620004f657620004f562000454565b5b620005018262000443565b9050602081019050919050565b60005b838110156200052e57808201518184015260208101905062000511565b60008484015250505050565b6000620005516200054b84620004d8565b620004b9565b90508281526020810184848401111562000570576200056f6200043e565b5b6200057d8482856200050e565b509392505050565b600082601f8301126200059d576200059c62000439565b5b8151620005af8482602086016200053a565b91505092915050565b600060ff82169050919050565b620005d081620005b8565b8114620005dc57600080fd5b50565b600081519050620005f081620005c5565b92915050565b6000806000606084860312156200061257620006116200042f565b5b600084015167ffffffffffffffff81111562000633576200063262000434565b5b620006418682870162000585565b935050602084015167ffffffffffffffff81111562000665576200066462000434565b5b620006738682870162000585565b92505060406200068686828701620005df565b9150509250925092565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620006e357607f821691505b602082108103620006f957620006f86200069b565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620007637fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000724565b6200076f868362000724565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620007bc620007b6620007b08462000787565b62000791565b62000787565b9050919050565b6000819050919050565b620007d8836200079b565b620007f0620007e782620007c3565b84845462000731565b825550505050565b600090565b62000807620007f8565b62000814818484620007cd565b505050565b5b818110156200083c5762000830600082620007fd565b6001810190506200081a565b5050565b601f8211156200088b576200085581620006ff565b620008608462000714565b8101602085101562000870578190505b620008886200087f8562000714565b83018262000819565b50505b505050565b600082821c905092915050565b6000620008b06000198460080262000890565b1980831691505092915050565b6000620008cb83836200089d565b9150826002028217905092915050565b620008e68262000690565b67ffffffffffffffff81111562000902576200090162000454565b5b6200090e8254620006ca565b6200091b82828562000840565b600060209050601f8311600181146200095357600084156200093e578287015190505b6200094a8582620008bd565b865550620009ba565b601f1984166200096386620006ff565b60005b828110156200098d5784890151825560018201915060208501945060208101905062000966565b86831015620009ad5784890151620009a9601f8916826200089d565b8355505b6001600288020188555050505b505050505050565b61326480620009d26000396000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80635c975abb11610104578063a217fddf116100a2578063d539139311610071578063d53913931461057d578063d547741f1461059b578063dd62ed3e146105b7578063e63ab1e9146105e7576101da565b8063a217fddf146104cf578063a457c2d7146104ed578063a9059cbb1461051d578063ca15c8731461054d576101da565b80638456cb59116100de5780638456cb59146104475780639010d07c1461045157806391d148541461048157806395d89b41146104b1576101da565b80635c975abb146103dd57806370a08231146103fb57806379cc67901461042b576101da565b8063282c51f31161017c578063395093511161014b578063395093511461036b5780633f4ba83a1461039b57806340c10f19146103a557806342966c68146103c1576101da565b8063282c51f3146102f75780632f2ff15d14610315578063313ce5671461033157806336568abe1461034f576101da565b806318160ddd116101b857806318160ddd1461025d5780631cf2c7e21461027b57806323b872dd14610297578063248a9ca3146102c7576101da565b806301ffc9a7146101df57806306fdde031461020f578063095ea7b31461022d575b600080fd5b6101f960048036038101906101f491906120ab565b610605565b60405161020691906120f3565b60405180910390f35b61021761067f565b604051610224919061219e565b60405180910390f35b61024760048036038101906102429190612254565b610711565b60405161025491906120f3565b60405180910390f35b610265610734565b60405161027291906122a3565b60405180910390f35b61029560048036038101906102909190612254565b61073e565b005b6102b160048036038101906102ac91906122be565b6107bc565b6040516102be91906120f3565b60405180910390f35b6102e160048036038101906102dc9190612347565b6107eb565b6040516102ee9190612383565b60405180910390f35b6102ff61080a565b60405161030c9190612383565b60405180910390f35b61032f600480360381019061032a919061239e565b61082e565b005b61033961084f565b60405161034691906123fa565b60405180910390f35b6103696004803603810190610364919061239e565b610866565b005b61038560048036038101906103809190612254565b6108e9565b60405161039291906120f3565b60405180910390f35b6103a3610920565b005b6103bf60048036038101906103ba9190612254565b61099a565b005b6103db60048036038101906103d69190612415565b610a18565b005b6103e5610a2c565b6040516103f291906120f3565b60405180910390f35b61041560048036038101906104109190612442565b610a43565b60405161042291906122a3565b60405180910390f35b61044560048036038101906104409190612254565b610a8c565b005b61044f610aac565b005b61046b6004803603810190610466919061246f565b610b26565b60405161047891906124be565b60405180910390f35b61049b6004803603810190610496919061239e565b610b55565b6040516104a891906120f3565b60405180910390f35b6104b9610bbf565b6040516104c6919061219e565b60405180910390f35b6104d7610c51565b6040516104e49190612383565b60405180910390f35b61050760048036038101906105029190612254565b610c58565b60405161051491906120f3565b60405180910390f35b61053760048036038101906105329190612254565b610ccf565b60405161054491906120f3565b60405180910390f35b61056760048036038101906105629190612347565b610cf2565b60405161057491906122a3565b60405180910390f35b610585610d16565b6040516105929190612383565b60405180910390f35b6105b560048036038101906105b0919061239e565b610d3a565b005b6105d160048036038101906105cc91906124d9565b610d5b565b6040516105de91906122a3565b60405180910390f35b6105ef610de2565b6040516105fc9190612383565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610678575061067782610e06565b5b9050919050565b60606005805461068e90612548565b80601f01602080910402602001604051908101604052809291908181526020018280546106ba90612548565b80156107075780601f106106dc57610100808354040283529160200191610707565b820191906000526020600020905b8154815290600101906020018083116106ea57829003601f168201915b5050505050905090565b60008061071c610e80565b9050610729818585610e88565b600191505092915050565b6000600454905090565b61076f7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84861076a610e80565b610b55565b6107ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a5906125eb565b60405180910390fd5b6107b88282611051565b5050565b6000806107c7610e80565b90506107d4858285611220565b6107df8585856112ac565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b610837826107eb565b61084081611525565b61084a8383611539565b505050565b6000600760019054906101000a900460ff16905090565b61086e610e80565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d29061267d565b60405180910390fd5b6108e5828261156d565b5050565b6000806108f4610e80565b90506109158185856109068589610d5b565b61091091906126cc565b610e88565b600191505092915050565b6109517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61094c610e80565b610b55565b610990576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098790612772565b60405180910390fd5b6109986115a1565b565b6109cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66109c6610e80565b610b55565b610a0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0190612804565b60405180910390fd5b610a148282611604565b5050565b610a29610a23610e80565b82611051565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a9e82610a98610e80565b83611220565b610aa88282611051565b5050565b610add7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610ad8610e80565b610b55565b610b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1390612896565b60405180910390fd5b610b2461175b565b565b6000610b4d82600160008681526020019081526020016000206117be90919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610bce90612548565b80601f0160208091040260200160405190810160405280929190818152602001828054610bfa90612548565b8015610c475780601f10610c1c57610100808354040283529160200191610c47565b820191906000526020600020905b815481529060010190602001808311610c2a57829003601f168201915b5050505050905090565b6000801b81565b600080610c63610e80565b90506000610c718286610d5b565b905083811015610cb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cad90612928565b60405180910390fd5b610cc38286868403610e88565b60019250505092915050565b600080610cda610e80565b9050610ce78185856112ac565b600191505092915050565b6000610d0f600160008481526020019081526020016000206117d8565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610d43826107eb565b610d4c81611525565b610d56838361156d565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610e795750610e78826117ed565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610ef7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eee906129ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610f66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5d90612a4c565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161104491906122a3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b790612ade565b60405180910390fd5b6110cc82600083611857565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611153576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114a90612b70565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161120791906122a3565b60405180910390a361121b83600084611867565b505050565b600061122c8484610d5b565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146112a65781811015611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128f90612bdc565b60405180910390fd5b6112a58484848403610e88565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361131b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131290612c6e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612d00565b60405180910390fd5b611395838383611857565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561141c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141390612d92565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161150c91906122a3565b60405180910390a361151f848484611867565b50505050565b61153681611531610e80565b61186c565b50565b61154382826118f1565b61156881600160008581526020019081526020016000206119d190919063ffffffff16565b505050565b6115778282611a01565b61159c8160016000858152602001908152602001600020611ae290919063ffffffff16565b505050565b6115a9611b12565b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6115ed610e80565b6040516115fa91906124be565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166a90612dfe565b60405180910390fd5b61167f60008383611857565b806004600082825461169191906126cc565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161174391906122a3565b60405180910390a361175760008383611867565b5050565b611763611b5b565b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586117a7610e80565b6040516117b491906124be565b60405180910390a1565b60006117cd8360000183611ba5565b60001c905092915050565b60006117e682600001611bd0565b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b611862838383611be1565b505050565b505050565b6118768282610b55565b6118ed5761188381611c39565b6118918360001c6020611c66565b6040516020016118a2929190612ef2565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e4919061219e565b60405180910390fd5b5050565b6118fb8282610b55565b6119cd57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611972610e80565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b60006119f9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ea2565b905092915050565b611a0b8282610b55565b15611ade57600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611a83610e80565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611b0a836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f12565b905092915050565b611b1a610a2c565b611b59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5090612f78565b60405180910390fd5b565b611b63610a2c565b15611ba3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9a90612fe4565b60405180910390fd5b565b6000826000018281548110611bbd57611bbc613004565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b611bec838383612026565b611bf4610a2c565b15611c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2b906130a5565b60405180910390fd5b505050565b6060611c5f8273ffffffffffffffffffffffffffffffffffffffff16601460ff16611c66565b9050919050565b606060006002836002611c7991906130c5565b611c8391906126cc565b67ffffffffffffffff811115611c9c57611c9b613107565b5b6040519080825280601f01601f191660200182016040528015611cce5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611d0657611d05613004565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611d6a57611d69613004565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611daa91906130c5565b611db491906126cc565b90505b6001811115611e54577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611df657611df5613004565b5b1a60f81b828281518110611e0d57611e0c613004565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611e4d90613136565b9050611db7565b5060008414611e98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8f906131ab565b60405180910390fd5b8091505092915050565b6000611eae838361202b565b611f07578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611f0c565b600090505b92915050565b6000808360010160008481526020019081526020016000205490506000811461201a576000600182611f4491906131cb565b9050600060018660000180549050611f5c91906131cb565b9050818114611fcb576000866000018281548110611f7d57611f7c613004565b5b9060005260206000200154905080876000018481548110611fa157611fa0613004565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480611fdf57611fde6131ff565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050612020565b60009150505b92915050565b505050565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61208881612053565b811461209357600080fd5b50565b6000813590506120a58161207f565b92915050565b6000602082840312156120c1576120c061204e565b5b60006120cf84828501612096565b91505092915050565b60008115159050919050565b6120ed816120d8565b82525050565b600060208201905061210860008301846120e4565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561214857808201518184015260208101905061212d565b60008484015250505050565b6000601f19601f8301169050919050565b60006121708261210e565b61217a8185612119565b935061218a81856020860161212a565b61219381612154565b840191505092915050565b600060208201905081810360008301526121b88184612165565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006121eb826121c0565b9050919050565b6121fb816121e0565b811461220657600080fd5b50565b600081359050612218816121f2565b92915050565b6000819050919050565b6122318161221e565b811461223c57600080fd5b50565b60008135905061224e81612228565b92915050565b6000806040838503121561226b5761226a61204e565b5b600061227985828601612209565b925050602061228a8582860161223f565b9150509250929050565b61229d8161221e565b82525050565b60006020820190506122b86000830184612294565b92915050565b6000806000606084860312156122d7576122d661204e565b5b60006122e586828701612209565b93505060206122f686828701612209565b92505060406123078682870161223f565b9150509250925092565b6000819050919050565b61232481612311565b811461232f57600080fd5b50565b6000813590506123418161231b565b92915050565b60006020828403121561235d5761235c61204e565b5b600061236b84828501612332565b91505092915050565b61237d81612311565b82525050565b60006020820190506123986000830184612374565b92915050565b600080604083850312156123b5576123b461204e565b5b60006123c385828601612332565b92505060206123d485828601612209565b9150509250929050565b600060ff82169050919050565b6123f4816123de565b82525050565b600060208201905061240f60008301846123eb565b92915050565b60006020828403121561242b5761242a61204e565b5b60006124398482850161223f565b91505092915050565b6000602082840312156124585761245761204e565b5b600061246684828501612209565b91505092915050565b600080604083850312156124865761248561204e565b5b600061249485828601612332565b92505060206124a58582860161223f565b9150509250929050565b6124b8816121e0565b82525050565b60006020820190506124d360008301846124af565b92915050565b600080604083850312156124f0576124ef61204e565b5b60006124fe85828601612209565b925050602061250f85828601612209565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061256057607f821691505b60208210810361257357612572612519565b5b50919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f68617665206275726e657220726f6c6520746f206275726e0000000000000000602082015250565b60006125d5603883612119565b91506125e082612579565b604082019050919050565b60006020820190508181036000830152612604816125c8565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612667602f83612119565b91506126728261260b565b604082019050919050565b600060208201905081810360008301526126968161265a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006126d78261221e565b91506126e28361221e565b92508282019050808211156126fa576126f961269d565b5b92915050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f686176652070617573657220726f6c6520746f20756e70617573650000000000602082015250565b600061275c603b83612119565b915061276782612700565b604082019050919050565b6000602082019050818103600083015261278b8161274f565b9050919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f68617665206d696e74657220726f6c6520746f206d696e740000000000000000602082015250565b60006127ee603883612119565b91506127f982612792565b604082019050919050565b6000602082019050818103600083015261281d816127e1565b9050919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f686176652070617573657220726f6c6520746f20706175736500000000000000602082015250565b6000612880603983612119565b915061288b82612824565b604082019050919050565b600060208201905081810360008301526128af81612873565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000612912602583612119565b915061291d826128b6565b604082019050919050565b6000602082019050818103600083015261294181612905565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006129a4602483612119565b91506129af82612948565b604082019050919050565b600060208201905081810360008301526129d381612997565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612a36602283612119565b9150612a41826129da565b604082019050919050565b60006020820190508181036000830152612a6581612a29565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612ac8602183612119565b9150612ad382612a6c565b604082019050919050565b60006020820190508181036000830152612af781612abb565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612b5a602283612119565b9150612b6582612afe565b604082019050919050565b60006020820190508181036000830152612b8981612b4d565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612bc6601d83612119565b9150612bd182612b90565b602082019050919050565b60006020820190508181036000830152612bf581612bb9565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612c58602583612119565b9150612c6382612bfc565b604082019050919050565b60006020820190508181036000830152612c8781612c4b565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612cea602383612119565b9150612cf582612c8e565b604082019050919050565b60006020820190508181036000830152612d1981612cdd565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612d7c602683612119565b9150612d8782612d20565b604082019050919050565b60006020820190508181036000830152612dab81612d6f565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000612de8601f83612119565b9150612df382612db2565b602082019050919050565b60006020820190508181036000830152612e1781612ddb565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612e5f601783612e1e565b9150612e6a82612e29565b601782019050919050565b6000612e808261210e565b612e8a8185612e1e565b9350612e9a81856020860161212a565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612edc601183612e1e565b9150612ee782612ea6565b601182019050919050565b6000612efd82612e52565b9150612f098285612e75565b9150612f1482612ecf565b9150612f208284612e75565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612f62601483612119565b9150612f6d82612f2c565b602082019050919050565b60006020820190508181036000830152612f9181612f55565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000612fce601083612119565b9150612fd982612f98565b602082019050919050565b60006020820190508181036000830152612ffd81612fc1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b600061308f602a83612119565b915061309a82613033565b604082019050919050565b600060208201905081810360008301526130be81613082565b9050919050565b60006130d08261221e565b91506130db8361221e565b92508282026130e98161221e565b91508282048414831517613100576130ff61269d565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006131418261221e565b9150600082036131545761315361269d565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000613195602083612119565b91506131a08261315f565b602082019050919050565b600060208201905081810360008301526131c481613188565b9050919050565b60006131d68261221e565b91506131e18361221e565b92508282039050818111156131f9576131f861269d565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea26469706673582212202785b5706c147f68efd244f3a915643f99325dd1a5c078b9d27ff66861b8c21b64736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80635c975abb11610104578063a217fddf116100a2578063d539139311610071578063d53913931461057d578063d547741f1461059b578063dd62ed3e146105b7578063e63ab1e9146105e7576101da565b8063a217fddf146104cf578063a457c2d7146104ed578063a9059cbb1461051d578063ca15c8731461054d576101da565b80638456cb59116100de5780638456cb59146104475780639010d07c1461045157806391d148541461048157806395d89b41146104b1576101da565b80635c975abb146103dd57806370a08231146103fb57806379cc67901461042b576101da565b8063282c51f31161017c578063395093511161014b578063395093511461036b5780633f4ba83a1461039b57806340c10f19146103a557806342966c68146103c1576101da565b8063282c51f3146102f75780632f2ff15d14610315578063313ce5671461033157806336568abe1461034f576101da565b806318160ddd116101b857806318160ddd1461025d5780631cf2c7e21461027b57806323b872dd14610297578063248a9ca3146102c7576101da565b806301ffc9a7146101df57806306fdde031461020f578063095ea7b31461022d575b600080fd5b6101f960048036038101906101f491906120ab565b610605565b60405161020691906120f3565b60405180910390f35b61021761067f565b604051610224919061219e565b60405180910390f35b61024760048036038101906102429190612254565b610711565b60405161025491906120f3565b60405180910390f35b610265610734565b60405161027291906122a3565b60405180910390f35b61029560048036038101906102909190612254565b61073e565b005b6102b160048036038101906102ac91906122be565b6107bc565b6040516102be91906120f3565b60405180910390f35b6102e160048036038101906102dc9190612347565b6107eb565b6040516102ee9190612383565b60405180910390f35b6102ff61080a565b60405161030c9190612383565b60405180910390f35b61032f600480360381019061032a919061239e565b61082e565b005b61033961084f565b60405161034691906123fa565b60405180910390f35b6103696004803603810190610364919061239e565b610866565b005b61038560048036038101906103809190612254565b6108e9565b60405161039291906120f3565b60405180910390f35b6103a3610920565b005b6103bf60048036038101906103ba9190612254565b61099a565b005b6103db60048036038101906103d69190612415565b610a18565b005b6103e5610a2c565b6040516103f291906120f3565b60405180910390f35b61041560048036038101906104109190612442565b610a43565b60405161042291906122a3565b60405180910390f35b61044560048036038101906104409190612254565b610a8c565b005b61044f610aac565b005b61046b6004803603810190610466919061246f565b610b26565b60405161047891906124be565b60405180910390f35b61049b6004803603810190610496919061239e565b610b55565b6040516104a891906120f3565b60405180910390f35b6104b9610bbf565b6040516104c6919061219e565b60405180910390f35b6104d7610c51565b6040516104e49190612383565b60405180910390f35b61050760048036038101906105029190612254565b610c58565b60405161051491906120f3565b60405180910390f35b61053760048036038101906105329190612254565b610ccf565b60405161054491906120f3565b60405180910390f35b61056760048036038101906105629190612347565b610cf2565b60405161057491906122a3565b60405180910390f35b610585610d16565b6040516105929190612383565b60405180910390f35b6105b560048036038101906105b0919061239e565b610d3a565b005b6105d160048036038101906105cc91906124d9565b610d5b565b6040516105de91906122a3565b60405180910390f35b6105ef610de2565b6040516105fc9190612383565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610678575061067782610e06565b5b9050919050565b60606005805461068e90612548565b80601f01602080910402602001604051908101604052809291908181526020018280546106ba90612548565b80156107075780601f106106dc57610100808354040283529160200191610707565b820191906000526020600020905b8154815290600101906020018083116106ea57829003601f168201915b5050505050905090565b60008061071c610e80565b9050610729818585610e88565b600191505092915050565b6000600454905090565b61076f7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84861076a610e80565b610b55565b6107ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a5906125eb565b60405180910390fd5b6107b88282611051565b5050565b6000806107c7610e80565b90506107d4858285611220565b6107df8585856112ac565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b610837826107eb565b61084081611525565b61084a8383611539565b505050565b6000600760019054906101000a900460ff16905090565b61086e610e80565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d29061267d565b60405180910390fd5b6108e5828261156d565b5050565b6000806108f4610e80565b90506109158185856109068589610d5b565b61091091906126cc565b610e88565b600191505092915050565b6109517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61094c610e80565b610b55565b610990576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098790612772565b60405180910390fd5b6109986115a1565b565b6109cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66109c6610e80565b610b55565b610a0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0190612804565b60405180910390fd5b610a148282611604565b5050565b610a29610a23610e80565b82611051565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a9e82610a98610e80565b83611220565b610aa88282611051565b5050565b610add7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610ad8610e80565b610b55565b610b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1390612896565b60405180910390fd5b610b2461175b565b565b6000610b4d82600160008681526020019081526020016000206117be90919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610bce90612548565b80601f0160208091040260200160405190810160405280929190818152602001828054610bfa90612548565b8015610c475780601f10610c1c57610100808354040283529160200191610c47565b820191906000526020600020905b815481529060010190602001808311610c2a57829003601f168201915b5050505050905090565b6000801b81565b600080610c63610e80565b90506000610c718286610d5b565b905083811015610cb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cad90612928565b60405180910390fd5b610cc38286868403610e88565b60019250505092915050565b600080610cda610e80565b9050610ce78185856112ac565b600191505092915050565b6000610d0f600160008481526020019081526020016000206117d8565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610d43826107eb565b610d4c81611525565b610d56838361156d565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610e795750610e78826117ed565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610ef7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eee906129ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610f66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5d90612a4c565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161104491906122a3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b790612ade565b60405180910390fd5b6110cc82600083611857565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611153576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114a90612b70565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161120791906122a3565b60405180910390a361121b83600084611867565b505050565b600061122c8484610d5b565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146112a65781811015611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128f90612bdc565b60405180910390fd5b6112a58484848403610e88565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361131b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131290612c6e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612d00565b60405180910390fd5b611395838383611857565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561141c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141390612d92565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161150c91906122a3565b60405180910390a361151f848484611867565b50505050565b61153681611531610e80565b61186c565b50565b61154382826118f1565b61156881600160008581526020019081526020016000206119d190919063ffffffff16565b505050565b6115778282611a01565b61159c8160016000858152602001908152602001600020611ae290919063ffffffff16565b505050565b6115a9611b12565b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6115ed610e80565b6040516115fa91906124be565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166a90612dfe565b60405180910390fd5b61167f60008383611857565b806004600082825461169191906126cc565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161174391906122a3565b60405180910390a361175760008383611867565b5050565b611763611b5b565b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586117a7610e80565b6040516117b491906124be565b60405180910390a1565b60006117cd8360000183611ba5565b60001c905092915050565b60006117e682600001611bd0565b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b611862838383611be1565b505050565b505050565b6118768282610b55565b6118ed5761188381611c39565b6118918360001c6020611c66565b6040516020016118a2929190612ef2565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e4919061219e565b60405180910390fd5b5050565b6118fb8282610b55565b6119cd57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611972610e80565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b60006119f9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ea2565b905092915050565b611a0b8282610b55565b15611ade57600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611a83610e80565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611b0a836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f12565b905092915050565b611b1a610a2c565b611b59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5090612f78565b60405180910390fd5b565b611b63610a2c565b15611ba3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9a90612fe4565b60405180910390fd5b565b6000826000018281548110611bbd57611bbc613004565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b611bec838383612026565b611bf4610a2c565b15611c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2b906130a5565b60405180910390fd5b505050565b6060611c5f8273ffffffffffffffffffffffffffffffffffffffff16601460ff16611c66565b9050919050565b606060006002836002611c7991906130c5565b611c8391906126cc565b67ffffffffffffffff811115611c9c57611c9b613107565b5b6040519080825280601f01601f191660200182016040528015611cce5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611d0657611d05613004565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611d6a57611d69613004565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611daa91906130c5565b611db491906126cc565b90505b6001811115611e54577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611df657611df5613004565b5b1a60f81b828281518110611e0d57611e0c613004565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611e4d90613136565b9050611db7565b5060008414611e98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8f906131ab565b60405180910390fd5b8091505092915050565b6000611eae838361202b565b611f07578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611f0c565b600090505b92915050565b6000808360010160008481526020019081526020016000205490506000811461201a576000600182611f4491906131cb565b9050600060018660000180549050611f5c91906131cb565b9050818114611fcb576000866000018281548110611f7d57611f7c613004565b5b9060005260206000200154905080876000018481548110611fa157611fa0613004565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480611fdf57611fde6131ff565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050612020565b60009150505b92915050565b505050565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61208881612053565b811461209357600080fd5b50565b6000813590506120a58161207f565b92915050565b6000602082840312156120c1576120c061204e565b5b60006120cf84828501612096565b91505092915050565b60008115159050919050565b6120ed816120d8565b82525050565b600060208201905061210860008301846120e4565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561214857808201518184015260208101905061212d565b60008484015250505050565b6000601f19601f8301169050919050565b60006121708261210e565b61217a8185612119565b935061218a81856020860161212a565b61219381612154565b840191505092915050565b600060208201905081810360008301526121b88184612165565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006121eb826121c0565b9050919050565b6121fb816121e0565b811461220657600080fd5b50565b600081359050612218816121f2565b92915050565b6000819050919050565b6122318161221e565b811461223c57600080fd5b50565b60008135905061224e81612228565b92915050565b6000806040838503121561226b5761226a61204e565b5b600061227985828601612209565b925050602061228a8582860161223f565b9150509250929050565b61229d8161221e565b82525050565b60006020820190506122b86000830184612294565b92915050565b6000806000606084860312156122d7576122d661204e565b5b60006122e586828701612209565b93505060206122f686828701612209565b92505060406123078682870161223f565b9150509250925092565b6000819050919050565b61232481612311565b811461232f57600080fd5b50565b6000813590506123418161231b565b92915050565b60006020828403121561235d5761235c61204e565b5b600061236b84828501612332565b91505092915050565b61237d81612311565b82525050565b60006020820190506123986000830184612374565b92915050565b600080604083850312156123b5576123b461204e565b5b60006123c385828601612332565b92505060206123d485828601612209565b9150509250929050565b600060ff82169050919050565b6123f4816123de565b82525050565b600060208201905061240f60008301846123eb565b92915050565b60006020828403121561242b5761242a61204e565b5b60006124398482850161223f565b91505092915050565b6000602082840312156124585761245761204e565b5b600061246684828501612209565b91505092915050565b600080604083850312156124865761248561204e565b5b600061249485828601612332565b92505060206124a58582860161223f565b9150509250929050565b6124b8816121e0565b82525050565b60006020820190506124d360008301846124af565b92915050565b600080604083850312156124f0576124ef61204e565b5b60006124fe85828601612209565b925050602061250f85828601612209565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061256057607f821691505b60208210810361257357612572612519565b5b50919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f68617665206275726e657220726f6c6520746f206275726e0000000000000000602082015250565b60006125d5603883612119565b91506125e082612579565b604082019050919050565b60006020820190508181036000830152612604816125c8565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612667602f83612119565b91506126728261260b565b604082019050919050565b600060208201905081810360008301526126968161265a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006126d78261221e565b91506126e28361221e565b92508282019050808211156126fa576126f961269d565b5b92915050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f686176652070617573657220726f6c6520746f20756e70617573650000000000602082015250565b600061275c603b83612119565b915061276782612700565b604082019050919050565b6000602082019050818103600083015261278b8161274f565b9050919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f68617665206d696e74657220726f6c6520746f206d696e740000000000000000602082015250565b60006127ee603883612119565b91506127f982612792565b604082019050919050565b6000602082019050818103600083015261281d816127e1565b9050919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f686176652070617573657220726f6c6520746f20706175736500000000000000602082015250565b6000612880603983612119565b915061288b82612824565b604082019050919050565b600060208201905081810360008301526128af81612873565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000612912602583612119565b915061291d826128b6565b604082019050919050565b6000602082019050818103600083015261294181612905565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006129a4602483612119565b91506129af82612948565b604082019050919050565b600060208201905081810360008301526129d381612997565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612a36602283612119565b9150612a41826129da565b604082019050919050565b60006020820190508181036000830152612a6581612a29565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612ac8602183612119565b9150612ad382612a6c565b604082019050919050565b60006020820190508181036000830152612af781612abb565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612b5a602283612119565b9150612b6582612afe565b604082019050919050565b60006020820190508181036000830152612b8981612b4d565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612bc6601d83612119565b9150612bd182612b90565b602082019050919050565b60006020820190508181036000830152612bf581612bb9565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612c58602583612119565b9150612c6382612bfc565b604082019050919050565b60006020820190508181036000830152612c8781612c4b565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612cea602383612119565b9150612cf582612c8e565b604082019050919050565b60006020820190508181036000830152612d1981612cdd565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612d7c602683612119565b9150612d8782612d20565b604082019050919050565b60006020820190508181036000830152612dab81612d6f565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000612de8601f83612119565b9150612df382612db2565b602082019050919050565b60006020820190508181036000830152612e1781612ddb565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612e5f601783612e1e565b9150612e6a82612e29565b601782019050919050565b6000612e808261210e565b612e8a8185612e1e565b9350612e9a81856020860161212a565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612edc601183612e1e565b9150612ee782612ea6565b601182019050919050565b6000612efd82612e52565b9150612f098285612e75565b9150612f1482612ecf565b9150612f208284612e75565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612f62601483612119565b9150612f6d82612f2c565b602082019050919050565b60006020820190508181036000830152612f9181612f55565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000612fce601083612119565b9150612fd982612f98565b602082019050919050565b60006020820190508181036000830152612ffd81612fc1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b600061308f602a83612119565b915061309a82613033565b604082019050919050565b600060208201905081810360008301526130be81613082565b9050919050565b60006130d08261221e565b91506130db8361221e565b92508282026130e98161221e565b91508282048414831517613100576130ff61269d565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006131418261221e565b9150600082036131545761315361269d565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000613195602083612119565b91506131a08261315f565b602082019050919050565b600060208201905081810360008301526131c481613188565b9050919050565b60006131d68261221e565b91506131e18361221e565b92508282039050818111156131f9576131f861269d565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea26469706673582212202785b5706c147f68efd244f3a915643f99325dd1a5c078b9d27ff66861b8c21b64736f6c63430008130033", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162003c3638038062003c368339818101604052810190620000379190620005f6565b828281600590816200004a9190620008db565b5080600690816200005c9190620008db565b5050506000600760006101000a81548160ff0219169083151502179055506200009e6000801b620000926200017b60201b60201c565b6200018360201b60201c565b620000df7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6620000d36200017b60201b60201c565b6200018360201b60201c565b620001207f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a620001146200017b60201b60201c565b6200018360201b60201c565b620001617f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848620001556200017b60201b60201c565b6200018360201b60201c565b62000172816200019960201b60201c565b505050620009c2565b600033905090565b620001958282620001b760201b60201c565b5050565b80600760016101000a81548160ff021916908360ff16021790555050565b620001c98282620001f560201b60201c565b620001f08160016000858152602001908152602001600020620002e660201b90919060201c565b505050565b6200020782826200031e60201b60201c565b620002e257600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550620002876200017b60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000316836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6200038860201b60201c565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60006200039c83836200040260201b60201c565b620003f7578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050620003fc565b600090505b92915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200048e8262000443565b810181811067ffffffffffffffff82111715620004b057620004af62000454565b5b80604052505050565b6000620004c562000425565b9050620004d3828262000483565b919050565b600067ffffffffffffffff821115620004f657620004f562000454565b5b620005018262000443565b9050602081019050919050565b60005b838110156200052e57808201518184015260208101905062000511565b60008484015250505050565b6000620005516200054b84620004d8565b620004b9565b90508281526020810184848401111562000570576200056f6200043e565b5b6200057d8482856200050e565b509392505050565b600082601f8301126200059d576200059c62000439565b5b8151620005af8482602086016200053a565b91505092915050565b600060ff82169050919050565b620005d081620005b8565b8114620005dc57600080fd5b50565b600081519050620005f081620005c5565b92915050565b6000806000606084860312156200061257620006116200042f565b5b600084015167ffffffffffffffff81111562000633576200063262000434565b5b620006418682870162000585565b935050602084015167ffffffffffffffff81111562000665576200066462000434565b5b620006738682870162000585565b92505060406200068686828701620005df565b9150509250925092565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620006e357607f821691505b602082108103620006f957620006f86200069b565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620007637fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000724565b6200076f868362000724565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620007bc620007b6620007b08462000787565b62000791565b62000787565b9050919050565b6000819050919050565b620007d8836200079b565b620007f0620007e782620007c3565b84845462000731565b825550505050565b600090565b62000807620007f8565b62000814818484620007cd565b505050565b5b818110156200083c5762000830600082620007fd565b6001810190506200081a565b5050565b601f8211156200088b576200085581620006ff565b620008608462000714565b8101602085101562000870578190505b620008886200087f8562000714565b83018262000819565b50505b505050565b600082821c905092915050565b6000620008b06000198460080262000890565b1980831691505092915050565b6000620008cb83836200089d565b9150826002028217905092915050565b620008e68262000690565b67ffffffffffffffff81111562000902576200090162000454565b5b6200090e8254620006ca565b6200091b82828562000840565b600060209050601f8311600181146200095357600084156200093e578287015190505b6200094a8582620008bd565b865550620009ba565b601f1984166200096386620006ff565b60005b828110156200098d5784890151825560018201915060208501945060208101905062000966565b86831015620009ad5784890151620009a9601f8916826200089d565b8355505b6001600288020188555050505b505050505050565b61326480620009d26000396000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80635c975abb11610104578063a217fddf116100a2578063d539139311610071578063d53913931461057d578063d547741f1461059b578063dd62ed3e146105b7578063e63ab1e9146105e7576101da565b8063a217fddf146104cf578063a457c2d7146104ed578063a9059cbb1461051d578063ca15c8731461054d576101da565b80638456cb59116100de5780638456cb59146104475780639010d07c1461045157806391d148541461048157806395d89b41146104b1576101da565b80635c975abb146103dd57806370a08231146103fb57806379cc67901461042b576101da565b8063282c51f31161017c578063395093511161014b578063395093511461036b5780633f4ba83a1461039b57806340c10f19146103a557806342966c68146103c1576101da565b8063282c51f3146102f75780632f2ff15d14610315578063313ce5671461033157806336568abe1461034f576101da565b806318160ddd116101b857806318160ddd1461025d5780631cf2c7e21461027b57806323b872dd14610297578063248a9ca3146102c7576101da565b806301ffc9a7146101df57806306fdde031461020f578063095ea7b31461022d575b600080fd5b6101f960048036038101906101f491906120ab565b610605565b60405161020691906120f3565b60405180910390f35b61021761067f565b604051610224919061219e565b60405180910390f35b61024760048036038101906102429190612254565b610711565b60405161025491906120f3565b60405180910390f35b610265610734565b60405161027291906122a3565b60405180910390f35b61029560048036038101906102909190612254565b61073e565b005b6102b160048036038101906102ac91906122be565b6107bc565b6040516102be91906120f3565b60405180910390f35b6102e160048036038101906102dc9190612347565b6107eb565b6040516102ee9190612383565b60405180910390f35b6102ff61080a565b60405161030c9190612383565b60405180910390f35b61032f600480360381019061032a919061239e565b61082e565b005b61033961084f565b60405161034691906123fa565b60405180910390f35b6103696004803603810190610364919061239e565b610866565b005b61038560048036038101906103809190612254565b6108e9565b60405161039291906120f3565b60405180910390f35b6103a3610920565b005b6103bf60048036038101906103ba9190612254565b61099a565b005b6103db60048036038101906103d69190612415565b610a18565b005b6103e5610a2c565b6040516103f291906120f3565b60405180910390f35b61041560048036038101906104109190612442565b610a43565b60405161042291906122a3565b60405180910390f35b61044560048036038101906104409190612254565b610a8c565b005b61044f610aac565b005b61046b6004803603810190610466919061246f565b610b26565b60405161047891906124be565b60405180910390f35b61049b6004803603810190610496919061239e565b610b55565b6040516104a891906120f3565b60405180910390f35b6104b9610bbf565b6040516104c6919061219e565b60405180910390f35b6104d7610c51565b6040516104e49190612383565b60405180910390f35b61050760048036038101906105029190612254565b610c58565b60405161051491906120f3565b60405180910390f35b61053760048036038101906105329190612254565b610ccf565b60405161054491906120f3565b60405180910390f35b61056760048036038101906105629190612347565b610cf2565b60405161057491906122a3565b60405180910390f35b610585610d16565b6040516105929190612383565b60405180910390f35b6105b560048036038101906105b0919061239e565b610d3a565b005b6105d160048036038101906105cc91906124d9565b610d5b565b6040516105de91906122a3565b60405180910390f35b6105ef610de2565b6040516105fc9190612383565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610678575061067782610e06565b5b9050919050565b60606005805461068e90612548565b80601f01602080910402602001604051908101604052809291908181526020018280546106ba90612548565b80156107075780601f106106dc57610100808354040283529160200191610707565b820191906000526020600020905b8154815290600101906020018083116106ea57829003601f168201915b5050505050905090565b60008061071c610e80565b9050610729818585610e88565b600191505092915050565b6000600454905090565b61076f7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84861076a610e80565b610b55565b6107ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a5906125eb565b60405180910390fd5b6107b88282611051565b5050565b6000806107c7610e80565b90506107d4858285611220565b6107df8585856112ac565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b610837826107eb565b61084081611525565b61084a8383611539565b505050565b6000600760019054906101000a900460ff16905090565b61086e610e80565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d29061267d565b60405180910390fd5b6108e5828261156d565b5050565b6000806108f4610e80565b90506109158185856109068589610d5b565b61091091906126cc565b610e88565b600191505092915050565b6109517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61094c610e80565b610b55565b610990576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098790612772565b60405180910390fd5b6109986115a1565b565b6109cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66109c6610e80565b610b55565b610a0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0190612804565b60405180910390fd5b610a148282611604565b5050565b610a29610a23610e80565b82611051565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a9e82610a98610e80565b83611220565b610aa88282611051565b5050565b610add7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610ad8610e80565b610b55565b610b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1390612896565b60405180910390fd5b610b2461175b565b565b6000610b4d82600160008681526020019081526020016000206117be90919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610bce90612548565b80601f0160208091040260200160405190810160405280929190818152602001828054610bfa90612548565b8015610c475780601f10610c1c57610100808354040283529160200191610c47565b820191906000526020600020905b815481529060010190602001808311610c2a57829003601f168201915b5050505050905090565b6000801b81565b600080610c63610e80565b90506000610c718286610d5b565b905083811015610cb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cad90612928565b60405180910390fd5b610cc38286868403610e88565b60019250505092915050565b600080610cda610e80565b9050610ce78185856112ac565b600191505092915050565b6000610d0f600160008481526020019081526020016000206117d8565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610d43826107eb565b610d4c81611525565b610d56838361156d565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610e795750610e78826117ed565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610ef7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eee906129ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610f66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5d90612a4c565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161104491906122a3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b790612ade565b60405180910390fd5b6110cc82600083611857565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611153576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114a90612b70565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161120791906122a3565b60405180910390a361121b83600084611867565b505050565b600061122c8484610d5b565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146112a65781811015611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128f90612bdc565b60405180910390fd5b6112a58484848403610e88565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361131b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131290612c6e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612d00565b60405180910390fd5b611395838383611857565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561141c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141390612d92565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161150c91906122a3565b60405180910390a361151f848484611867565b50505050565b61153681611531610e80565b61186c565b50565b61154382826118f1565b61156881600160008581526020019081526020016000206119d190919063ffffffff16565b505050565b6115778282611a01565b61159c8160016000858152602001908152602001600020611ae290919063ffffffff16565b505050565b6115a9611b12565b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6115ed610e80565b6040516115fa91906124be565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166a90612dfe565b60405180910390fd5b61167f60008383611857565b806004600082825461169191906126cc565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161174391906122a3565b60405180910390a361175760008383611867565b5050565b611763611b5b565b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586117a7610e80565b6040516117b491906124be565b60405180910390a1565b60006117cd8360000183611ba5565b60001c905092915050565b60006117e682600001611bd0565b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b611862838383611be1565b505050565b505050565b6118768282610b55565b6118ed5761188381611c39565b6118918360001c6020611c66565b6040516020016118a2929190612ef2565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e4919061219e565b60405180910390fd5b5050565b6118fb8282610b55565b6119cd57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611972610e80565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b60006119f9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ea2565b905092915050565b611a0b8282610b55565b15611ade57600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611a83610e80565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611b0a836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f12565b905092915050565b611b1a610a2c565b611b59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5090612f78565b60405180910390fd5b565b611b63610a2c565b15611ba3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9a90612fe4565b60405180910390fd5b565b6000826000018281548110611bbd57611bbc613004565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b611bec838383612026565b611bf4610a2c565b15611c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2b906130a5565b60405180910390fd5b505050565b6060611c5f8273ffffffffffffffffffffffffffffffffffffffff16601460ff16611c66565b9050919050565b606060006002836002611c7991906130c5565b611c8391906126cc565b67ffffffffffffffff811115611c9c57611c9b613107565b5b6040519080825280601f01601f191660200182016040528015611cce5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611d0657611d05613004565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611d6a57611d69613004565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611daa91906130c5565b611db491906126cc565b90505b6001811115611e54577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611df657611df5613004565b5b1a60f81b828281518110611e0d57611e0c613004565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611e4d90613136565b9050611db7565b5060008414611e98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8f906131ab565b60405180910390fd5b8091505092915050565b6000611eae838361202b565b611f07578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611f0c565b600090505b92915050565b6000808360010160008481526020019081526020016000205490506000811461201a576000600182611f4491906131cb565b9050600060018660000180549050611f5c91906131cb565b9050818114611fcb576000866000018281548110611f7d57611f7c613004565b5b9060005260206000200154905080876000018481548110611fa157611fa0613004565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480611fdf57611fde6131ff565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050612020565b60009150505b92915050565b505050565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61208881612053565b811461209357600080fd5b50565b6000813590506120a58161207f565b92915050565b6000602082840312156120c1576120c061204e565b5b60006120cf84828501612096565b91505092915050565b60008115159050919050565b6120ed816120d8565b82525050565b600060208201905061210860008301846120e4565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561214857808201518184015260208101905061212d565b60008484015250505050565b6000601f19601f8301169050919050565b60006121708261210e565b61217a8185612119565b935061218a81856020860161212a565b61219381612154565b840191505092915050565b600060208201905081810360008301526121b88184612165565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006121eb826121c0565b9050919050565b6121fb816121e0565b811461220657600080fd5b50565b600081359050612218816121f2565b92915050565b6000819050919050565b6122318161221e565b811461223c57600080fd5b50565b60008135905061224e81612228565b92915050565b6000806040838503121561226b5761226a61204e565b5b600061227985828601612209565b925050602061228a8582860161223f565b9150509250929050565b61229d8161221e565b82525050565b60006020820190506122b86000830184612294565b92915050565b6000806000606084860312156122d7576122d661204e565b5b60006122e586828701612209565b93505060206122f686828701612209565b92505060406123078682870161223f565b9150509250925092565b6000819050919050565b61232481612311565b811461232f57600080fd5b50565b6000813590506123418161231b565b92915050565b60006020828403121561235d5761235c61204e565b5b600061236b84828501612332565b91505092915050565b61237d81612311565b82525050565b60006020820190506123986000830184612374565b92915050565b600080604083850312156123b5576123b461204e565b5b60006123c385828601612332565b92505060206123d485828601612209565b9150509250929050565b600060ff82169050919050565b6123f4816123de565b82525050565b600060208201905061240f60008301846123eb565b92915050565b60006020828403121561242b5761242a61204e565b5b60006124398482850161223f565b91505092915050565b6000602082840312156124585761245761204e565b5b600061246684828501612209565b91505092915050565b600080604083850312156124865761248561204e565b5b600061249485828601612332565b92505060206124a58582860161223f565b9150509250929050565b6124b8816121e0565b82525050565b60006020820190506124d360008301846124af565b92915050565b600080604083850312156124f0576124ef61204e565b5b60006124fe85828601612209565b925050602061250f85828601612209565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061256057607f821691505b60208210810361257357612572612519565b5b50919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f68617665206275726e657220726f6c6520746f206275726e0000000000000000602082015250565b60006125d5603883612119565b91506125e082612579565b604082019050919050565b60006020820190508181036000830152612604816125c8565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612667602f83612119565b91506126728261260b565b604082019050919050565b600060208201905081810360008301526126968161265a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006126d78261221e565b91506126e28361221e565b92508282019050808211156126fa576126f961269d565b5b92915050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f686176652070617573657220726f6c6520746f20756e70617573650000000000602082015250565b600061275c603b83612119565b915061276782612700565b604082019050919050565b6000602082019050818103600083015261278b8161274f565b9050919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f68617665206d696e74657220726f6c6520746f206d696e740000000000000000602082015250565b60006127ee603883612119565b91506127f982612792565b604082019050919050565b6000602082019050818103600083015261281d816127e1565b9050919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f686176652070617573657220726f6c6520746f20706175736500000000000000602082015250565b6000612880603983612119565b915061288b82612824565b604082019050919050565b600060208201905081810360008301526128af81612873565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000612912602583612119565b915061291d826128b6565b604082019050919050565b6000602082019050818103600083015261294181612905565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006129a4602483612119565b91506129af82612948565b604082019050919050565b600060208201905081810360008301526129d381612997565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612a36602283612119565b9150612a41826129da565b604082019050919050565b60006020820190508181036000830152612a6581612a29565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612ac8602183612119565b9150612ad382612a6c565b604082019050919050565b60006020820190508181036000830152612af781612abb565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612b5a602283612119565b9150612b6582612afe565b604082019050919050565b60006020820190508181036000830152612b8981612b4d565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612bc6601d83612119565b9150612bd182612b90565b602082019050919050565b60006020820190508181036000830152612bf581612bb9565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612c58602583612119565b9150612c6382612bfc565b604082019050919050565b60006020820190508181036000830152612c8781612c4b565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612cea602383612119565b9150612cf582612c8e565b604082019050919050565b60006020820190508181036000830152612d1981612cdd565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612d7c602683612119565b9150612d8782612d20565b604082019050919050565b60006020820190508181036000830152612dab81612d6f565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000612de8601f83612119565b9150612df382612db2565b602082019050919050565b60006020820190508181036000830152612e1781612ddb565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612e5f601783612e1e565b9150612e6a82612e29565b601782019050919050565b6000612e808261210e565b612e8a8185612e1e565b9350612e9a81856020860161212a565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612edc601183612e1e565b9150612ee782612ea6565b601182019050919050565b6000612efd82612e52565b9150612f098285612e75565b9150612f1482612ecf565b9150612f208284612e75565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612f62601483612119565b9150612f6d82612f2c565b602082019050919050565b60006020820190508181036000830152612f9181612f55565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000612fce601083612119565b9150612fd982612f98565b602082019050919050565b60006020820190508181036000830152612ffd81612fc1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b600061308f602a83612119565b915061309a82613033565b604082019050919050565b600060208201905081810360008301526130be81613082565b9050919050565b60006130d08261221e565b91506130db8361221e565b92508282026130e98161221e565b91508282048414831517613100576130ff61269d565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006131418261221e565b9150600082036131545761315361269d565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000613195602083612119565b91506131a08261315f565b602082019050919050565b600060208201905081810360008301526131c481613188565b9050919050565b60006131d68261221e565b91506131e18361221e565b92508282039050818111156131f9576131f861269d565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea264697066735822122085be590fcd27af24982116d9f60fa42a00c725b7ba15ba740f13e78af698fedf64736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80635c975abb11610104578063a217fddf116100a2578063d539139311610071578063d53913931461057d578063d547741f1461059b578063dd62ed3e146105b7578063e63ab1e9146105e7576101da565b8063a217fddf146104cf578063a457c2d7146104ed578063a9059cbb1461051d578063ca15c8731461054d576101da565b80638456cb59116100de5780638456cb59146104475780639010d07c1461045157806391d148541461048157806395d89b41146104b1576101da565b80635c975abb146103dd57806370a08231146103fb57806379cc67901461042b576101da565b8063282c51f31161017c578063395093511161014b578063395093511461036b5780633f4ba83a1461039b57806340c10f19146103a557806342966c68146103c1576101da565b8063282c51f3146102f75780632f2ff15d14610315578063313ce5671461033157806336568abe1461034f576101da565b806318160ddd116101b857806318160ddd1461025d5780631cf2c7e21461027b57806323b872dd14610297578063248a9ca3146102c7576101da565b806301ffc9a7146101df57806306fdde031461020f578063095ea7b31461022d575b600080fd5b6101f960048036038101906101f491906120ab565b610605565b60405161020691906120f3565b60405180910390f35b61021761067f565b604051610224919061219e565b60405180910390f35b61024760048036038101906102429190612254565b610711565b60405161025491906120f3565b60405180910390f35b610265610734565b60405161027291906122a3565b60405180910390f35b61029560048036038101906102909190612254565b61073e565b005b6102b160048036038101906102ac91906122be565b6107bc565b6040516102be91906120f3565b60405180910390f35b6102e160048036038101906102dc9190612347565b6107eb565b6040516102ee9190612383565b60405180910390f35b6102ff61080a565b60405161030c9190612383565b60405180910390f35b61032f600480360381019061032a919061239e565b61082e565b005b61033961084f565b60405161034691906123fa565b60405180910390f35b6103696004803603810190610364919061239e565b610866565b005b61038560048036038101906103809190612254565b6108e9565b60405161039291906120f3565b60405180910390f35b6103a3610920565b005b6103bf60048036038101906103ba9190612254565b61099a565b005b6103db60048036038101906103d69190612415565b610a18565b005b6103e5610a2c565b6040516103f291906120f3565b60405180910390f35b61041560048036038101906104109190612442565b610a43565b60405161042291906122a3565b60405180910390f35b61044560048036038101906104409190612254565b610a8c565b005b61044f610aac565b005b61046b6004803603810190610466919061246f565b610b26565b60405161047891906124be565b60405180910390f35b61049b6004803603810190610496919061239e565b610b55565b6040516104a891906120f3565b60405180910390f35b6104b9610bbf565b6040516104c6919061219e565b60405180910390f35b6104d7610c51565b6040516104e49190612383565b60405180910390f35b61050760048036038101906105029190612254565b610c58565b60405161051491906120f3565b60405180910390f35b61053760048036038101906105329190612254565b610ccf565b60405161054491906120f3565b60405180910390f35b61056760048036038101906105629190612347565b610cf2565b60405161057491906122a3565b60405180910390f35b610585610d16565b6040516105929190612383565b60405180910390f35b6105b560048036038101906105b0919061239e565b610d3a565b005b6105d160048036038101906105cc91906124d9565b610d5b565b6040516105de91906122a3565b60405180910390f35b6105ef610de2565b6040516105fc9190612383565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610678575061067782610e06565b5b9050919050565b60606005805461068e90612548565b80601f01602080910402602001604051908101604052809291908181526020018280546106ba90612548565b80156107075780601f106106dc57610100808354040283529160200191610707565b820191906000526020600020905b8154815290600101906020018083116106ea57829003601f168201915b5050505050905090565b60008061071c610e80565b9050610729818585610e88565b600191505092915050565b6000600454905090565b61076f7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84861076a610e80565b610b55565b6107ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a5906125eb565b60405180910390fd5b6107b88282611051565b5050565b6000806107c7610e80565b90506107d4858285611220565b6107df8585856112ac565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b610837826107eb565b61084081611525565b61084a8383611539565b505050565b6000600760019054906101000a900460ff16905090565b61086e610e80565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d29061267d565b60405180910390fd5b6108e5828261156d565b5050565b6000806108f4610e80565b90506109158185856109068589610d5b565b61091091906126cc565b610e88565b600191505092915050565b6109517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61094c610e80565b610b55565b610990576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098790612772565b60405180910390fd5b6109986115a1565b565b6109cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66109c6610e80565b610b55565b610a0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0190612804565b60405180910390fd5b610a148282611604565b5050565b610a29610a23610e80565b82611051565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a9e82610a98610e80565b83611220565b610aa88282611051565b5050565b610add7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610ad8610e80565b610b55565b610b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1390612896565b60405180910390fd5b610b2461175b565b565b6000610b4d82600160008681526020019081526020016000206117be90919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610bce90612548565b80601f0160208091040260200160405190810160405280929190818152602001828054610bfa90612548565b8015610c475780601f10610c1c57610100808354040283529160200191610c47565b820191906000526020600020905b815481529060010190602001808311610c2a57829003601f168201915b5050505050905090565b6000801b81565b600080610c63610e80565b90506000610c718286610d5b565b905083811015610cb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cad90612928565b60405180910390fd5b610cc38286868403610e88565b60019250505092915050565b600080610cda610e80565b9050610ce78185856112ac565b600191505092915050565b6000610d0f600160008481526020019081526020016000206117d8565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610d43826107eb565b610d4c81611525565b610d56838361156d565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610e795750610e78826117ed565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610ef7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eee906129ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610f66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5d90612a4c565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161104491906122a3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b790612ade565b60405180910390fd5b6110cc82600083611857565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611153576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114a90612b70565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161120791906122a3565b60405180910390a361121b83600084611867565b505050565b600061122c8484610d5b565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146112a65781811015611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128f90612bdc565b60405180910390fd5b6112a58484848403610e88565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361131b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131290612c6e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612d00565b60405180910390fd5b611395838383611857565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561141c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141390612d92565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161150c91906122a3565b60405180910390a361151f848484611867565b50505050565b61153681611531610e80565b61186c565b50565b61154382826118f1565b61156881600160008581526020019081526020016000206119d190919063ffffffff16565b505050565b6115778282611a01565b61159c8160016000858152602001908152602001600020611ae290919063ffffffff16565b505050565b6115a9611b12565b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6115ed610e80565b6040516115fa91906124be565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166a90612dfe565b60405180910390fd5b61167f60008383611857565b806004600082825461169191906126cc565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161174391906122a3565b60405180910390a361175760008383611867565b5050565b611763611b5b565b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586117a7610e80565b6040516117b491906124be565b60405180910390a1565b60006117cd8360000183611ba5565b60001c905092915050565b60006117e682600001611bd0565b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b611862838383611be1565b505050565b505050565b6118768282610b55565b6118ed5761188381611c39565b6118918360001c6020611c66565b6040516020016118a2929190612ef2565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e4919061219e565b60405180910390fd5b5050565b6118fb8282610b55565b6119cd57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611972610e80565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b60006119f9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ea2565b905092915050565b611a0b8282610b55565b15611ade57600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611a83610e80565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611b0a836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f12565b905092915050565b611b1a610a2c565b611b59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5090612f78565b60405180910390fd5b565b611b63610a2c565b15611ba3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9a90612fe4565b60405180910390fd5b565b6000826000018281548110611bbd57611bbc613004565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b611bec838383612026565b611bf4610a2c565b15611c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2b906130a5565b60405180910390fd5b505050565b6060611c5f8273ffffffffffffffffffffffffffffffffffffffff16601460ff16611c66565b9050919050565b606060006002836002611c7991906130c5565b611c8391906126cc565b67ffffffffffffffff811115611c9c57611c9b613107565b5b6040519080825280601f01601f191660200182016040528015611cce5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611d0657611d05613004565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611d6a57611d69613004565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611daa91906130c5565b611db491906126cc565b90505b6001811115611e54577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611df657611df5613004565b5b1a60f81b828281518110611e0d57611e0c613004565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611e4d90613136565b9050611db7565b5060008414611e98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8f906131ab565b60405180910390fd5b8091505092915050565b6000611eae838361202b565b611f07578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611f0c565b600090505b92915050565b6000808360010160008481526020019081526020016000205490506000811461201a576000600182611f4491906131cb565b9050600060018660000180549050611f5c91906131cb565b9050818114611fcb576000866000018281548110611f7d57611f7c613004565b5b9060005260206000200154905080876000018481548110611fa157611fa0613004565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480611fdf57611fde6131ff565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050612020565b60009150505b92915050565b505050565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61208881612053565b811461209357600080fd5b50565b6000813590506120a58161207f565b92915050565b6000602082840312156120c1576120c061204e565b5b60006120cf84828501612096565b91505092915050565b60008115159050919050565b6120ed816120d8565b82525050565b600060208201905061210860008301846120e4565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561214857808201518184015260208101905061212d565b60008484015250505050565b6000601f19601f8301169050919050565b60006121708261210e565b61217a8185612119565b935061218a81856020860161212a565b61219381612154565b840191505092915050565b600060208201905081810360008301526121b88184612165565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006121eb826121c0565b9050919050565b6121fb816121e0565b811461220657600080fd5b50565b600081359050612218816121f2565b92915050565b6000819050919050565b6122318161221e565b811461223c57600080fd5b50565b60008135905061224e81612228565b92915050565b6000806040838503121561226b5761226a61204e565b5b600061227985828601612209565b925050602061228a8582860161223f565b9150509250929050565b61229d8161221e565b82525050565b60006020820190506122b86000830184612294565b92915050565b6000806000606084860312156122d7576122d661204e565b5b60006122e586828701612209565b93505060206122f686828701612209565b92505060406123078682870161223f565b9150509250925092565b6000819050919050565b61232481612311565b811461232f57600080fd5b50565b6000813590506123418161231b565b92915050565b60006020828403121561235d5761235c61204e565b5b600061236b84828501612332565b91505092915050565b61237d81612311565b82525050565b60006020820190506123986000830184612374565b92915050565b600080604083850312156123b5576123b461204e565b5b60006123c385828601612332565b92505060206123d485828601612209565b9150509250929050565b600060ff82169050919050565b6123f4816123de565b82525050565b600060208201905061240f60008301846123eb565b92915050565b60006020828403121561242b5761242a61204e565b5b60006124398482850161223f565b91505092915050565b6000602082840312156124585761245761204e565b5b600061246684828501612209565b91505092915050565b600080604083850312156124865761248561204e565b5b600061249485828601612332565b92505060206124a58582860161223f565b9150509250929050565b6124b8816121e0565b82525050565b60006020820190506124d360008301846124af565b92915050565b600080604083850312156124f0576124ef61204e565b5b60006124fe85828601612209565b925050602061250f85828601612209565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061256057607f821691505b60208210810361257357612572612519565b5b50919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f68617665206275726e657220726f6c6520746f206275726e0000000000000000602082015250565b60006125d5603883612119565b91506125e082612579565b604082019050919050565b60006020820190508181036000830152612604816125c8565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612667602f83612119565b91506126728261260b565b604082019050919050565b600060208201905081810360008301526126968161265a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006126d78261221e565b91506126e28361221e565b92508282019050808211156126fa576126f961269d565b5b92915050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f686176652070617573657220726f6c6520746f20756e70617573650000000000602082015250565b600061275c603b83612119565b915061276782612700565b604082019050919050565b6000602082019050818103600083015261278b8161274f565b9050919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f68617665206d696e74657220726f6c6520746f206d696e740000000000000000602082015250565b60006127ee603883612119565b91506127f982612792565b604082019050919050565b6000602082019050818103600083015261281d816127e1565b9050919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f686176652070617573657220726f6c6520746f20706175736500000000000000602082015250565b6000612880603983612119565b915061288b82612824565b604082019050919050565b600060208201905081810360008301526128af81612873565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000612912602583612119565b915061291d826128b6565b604082019050919050565b6000602082019050818103600083015261294181612905565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006129a4602483612119565b91506129af82612948565b604082019050919050565b600060208201905081810360008301526129d381612997565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612a36602283612119565b9150612a41826129da565b604082019050919050565b60006020820190508181036000830152612a6581612a29565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612ac8602183612119565b9150612ad382612a6c565b604082019050919050565b60006020820190508181036000830152612af781612abb565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612b5a602283612119565b9150612b6582612afe565b604082019050919050565b60006020820190508181036000830152612b8981612b4d565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612bc6601d83612119565b9150612bd182612b90565b602082019050919050565b60006020820190508181036000830152612bf581612bb9565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612c58602583612119565b9150612c6382612bfc565b604082019050919050565b60006020820190508181036000830152612c8781612c4b565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612cea602383612119565b9150612cf582612c8e565b604082019050919050565b60006020820190508181036000830152612d1981612cdd565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612d7c602683612119565b9150612d8782612d20565b604082019050919050565b60006020820190508181036000830152612dab81612d6f565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000612de8601f83612119565b9150612df382612db2565b602082019050919050565b60006020820190508181036000830152612e1781612ddb565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612e5f601783612e1e565b9150612e6a82612e29565b601782019050919050565b6000612e808261210e565b612e8a8185612e1e565b9350612e9a81856020860161212a565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612edc601183612e1e565b9150612ee782612ea6565b601182019050919050565b6000612efd82612e52565b9150612f098285612e75565b9150612f1482612ecf565b9150612f208284612e75565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612f62601483612119565b9150612f6d82612f2c565b602082019050919050565b60006020820190508181036000830152612f9181612f55565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000612fce601083612119565b9150612fd982612f98565b602082019050919050565b60006020820190508181036000830152612ffd81612fc1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b600061308f602a83612119565b915061309a82613033565b604082019050919050565b600060208201905081810360008301526130be81613082565b9050919050565b60006130d08261221e565b91506130db8361221e565b92508282026130e98161221e565b91508282048414831517613100576130ff61269d565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006131418261221e565b9150600082036131545761315361269d565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000613195602083612119565b91506131a08261315f565b602082019050919050565b600060208201905081810360008301526131c481613188565b9050919050565b60006131d68261221e565b91506131e18361221e565b92508282039050818111156131f9576131f861269d565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea264697066735822122085be590fcd27af24982116d9f60fa42a00c725b7ba15ba740f13e78af698fedf64736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/encoding/config.go b/encoding/config.go index ac95b559..2f055f9f 100644 --- a/encoding/config.go +++ b/encoding/config.go @@ -4,35 +4,55 @@ package encoding import ( - "cosmossdk.io/simapp/params" + "cosmossdk.io/x/tx/signing" amino "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/types/module" + sdk "github.com/cosmos/cosmos-sdk/types" + sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" "github.com/cosmos/cosmos-sdk/x/auth/tx" - - evmoscodec "github.com/evmos/os/encoding/codec" + "github.com/cosmos/gogoproto/proto" + enccodec "github.com/evmos/os/encoding/codec" + "github.com/evmos/os/ethereum/eip712" + erc20types "github.com/evmos/os/x/erc20/types" + evmtypes "github.com/evmos/os/x/evm/types" + "google.golang.org/protobuf/reflect/protoreflect" ) -// MakeConfig creates an EncodingConfig for the given basic module manager. -// -// It registers the evmOS codec for Ethereum compatibility as well as -// the module's interfaces. -func MakeConfig(mb module.BasicManager) params.EncodingConfig { +// MakeConfig creates a new EncodingConfig and returns it +func MakeConfig() sdktestutil.TestEncodingConfig { cdc := amino.NewLegacyAmino() - interfaceRegistry := types.NewInterfaceRegistry() + signingOptions := signing.Options{ + AddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), + }, + ValidatorAddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), + }, + CustomGetSigners: map[protoreflect.FullName]signing.GetSignersFunc{ + evmtypes.MsgEthereumTxCustomGetSigner.MsgType: evmtypes.MsgEthereumTxCustomGetSigner.Fn, + erc20types.MsgConvertERC20CustomGetSigner.MsgType: erc20types.MsgConvertERC20CustomGetSigner.Fn, + }, + } + + interfaceRegistry, _ := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ + ProtoFiles: proto.HybridResolver, + SigningOptions: signingOptions, + }) codec := amino.NewProtoCodec(interfaceRegistry) + enccodec.RegisterLegacyAminoCodec(cdc) + enccodec.RegisterInterfaces(interfaceRegistry) - encodingConfig := params.EncodingConfig{ + // This is needed for the EIP712 txs because currently is using + // the deprecated method legacytx.StdSignBytes + legacytx.RegressionTestingAminoCodec = cdc + eip712.SetEncodingConfig(cdc, interfaceRegistry) + + return sdktestutil.TestEncodingConfig{ InterfaceRegistry: interfaceRegistry, Codec: codec, TxConfig: tx.NewTxConfig(codec, tx.DefaultSignModes), Amino: cdc, } - - evmoscodec.RegisterLegacyAminoCodec(encodingConfig.Amino) - mb.RegisterLegacyAminoCodec(encodingConfig.Amino) - evmoscodec.RegisterInterfaces(encodingConfig.InterfaceRegistry) - mb.RegisterInterfaces(encodingConfig.InterfaceRegistry) - - return encodingConfig } diff --git a/encoding/config_test.go b/encoding/config_test.go index 683e324c..251f12d8 100644 --- a/encoding/config_test.go +++ b/encoding/config_test.go @@ -6,7 +6,6 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/evmos/os/encoding" - app "github.com/evmos/os/example_chain" utiltx "github.com/evmos/os/testutil/tx" evmtypes "github.com/evmos/os/x/evm/types" "github.com/stretchr/testify/require" @@ -32,7 +31,7 @@ func TestTxEncoding(t *testing.T) { err := msg.Sign(ethSigner, signer) require.NoError(t, err) - cfg := encoding.MakeConfig(app.ModuleBasics) + cfg := encoding.MakeConfig() _, err = cfg.TxConfig.TxEncoder()(msg) require.Error(t, err, "encoding failed") @@ -40,7 +39,7 @@ func TestTxEncoding(t *testing.T) { // FIXME: transaction hashing is hardcoded on Tendermint: // See https://github.com/cometbft/cometbft/issues/6539 for reference // txHash := msg.AsTransaction().Hash() - // tmTx := tmtypes.Tx(bz) + // tmTx := cmttypes.Tx(bz) // require.Equal(t, txHash.Bytes(), tmTx.Hash()) } diff --git a/ethereum/eip712/eip712_test.go b/ethereum/eip712/eip712_test.go index 2fefd0ef..bd35b131 100644 --- a/ethereum/eip712/eip712_test.go +++ b/ethereum/eip712/eip712_test.go @@ -5,11 +5,15 @@ import ( "fmt" "testing" + chainconfig "github.com/evmos/os/example_chain/osd/config" + "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" - chainparams "cosmossdk.io/simapp/params" + "github.com/cosmos/cosmos-sdk/client" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" txtypes "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" @@ -21,10 +25,8 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" "github.com/evmos/os/crypto/ethsecp256k1" - "github.com/evmos/os/encoding" "github.com/evmos/os/ethereum/eip712" - app "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/integration/os/network" "github.com/stretchr/testify/suite" "github.com/tidwall/gjson" "github.com/tidwall/sjson" @@ -40,7 +42,7 @@ const ( type EIP712TestSuite struct { suite.Suite - config chainparams.EncodingConfig + config sdktestutil.TestEncodingConfig clientCtx client.Context useLegacyEIP712TypedData bool denom string @@ -64,12 +66,12 @@ func TestEIP712TestSuite(t *testing.T) { } func (suite *EIP712TestSuite) SetupTest() { - suite.config = encoding.MakeConfig(app.ModuleBasics) + nw := network.New() + suite.config = nw.GetEncodingConfig() suite.clientCtx = client.Context{}.WithTxConfig(suite.config.TxConfig) - suite.denom = testutil.ExampleAttoDenom + suite.denom = constants.ExampleAttoDenom - sdk.GetConfig().SetBech32PrefixForAccount(testutil.ExampleBech32Prefix, "") - eip712.SetEncodingConfig(suite.config) + sdk.GetConfig().SetBech32PrefixForAccount(chainconfig.Bech32Prefix, "") } // createTestAddress creates random test addresses for messages @@ -158,8 +160,8 @@ func (suite *EIP712TestSuite) TestEIP712() { title: "Succeeds - Standard MsgDelegate", msgs: []sdk.Msg{ stakingtypes.NewMsgDelegate( - suite.createTestAddress(), - sdk.ValAddress(suite.createTestAddress()), + suite.createTestAddress().String(), + sdk.ValAddress(suite.createTestAddress()).String(), suite.makeCoins(suite.denom, math.NewInt(1))[0], ), }, @@ -169,8 +171,8 @@ func (suite *EIP712TestSuite) TestEIP712() { title: "Succeeds - Standard MsgWithdrawDelegationReward", msgs: []sdk.Msg{ distributiontypes.NewMsgWithdrawDelegatorReward( - suite.createTestAddress(), - sdk.ValAddress(suite.createTestAddress()), + suite.createTestAddress().String(), + sdk.ValAddress(suite.createTestAddress()).String(), ), }, expectSuccess: true, @@ -179,13 +181,13 @@ func (suite *EIP712TestSuite) TestEIP712() { title: "Succeeds - Two Single-Signer MsgDelegate", msgs: []sdk.Msg{ stakingtypes.NewMsgDelegate( - params.address, - sdk.ValAddress(suite.createTestAddress()), + params.address.String(), + sdk.ValAddress(suite.createTestAddress()).String(), suite.makeCoins(suite.denom, math.NewInt(1))[0], ), stakingtypes.NewMsgDelegate( - params.address, - sdk.ValAddress(suite.createTestAddress()), + params.address.String(), + sdk.ValAddress(suite.createTestAddress()).String(), suite.makeCoins(suite.denom, math.NewInt(5))[0], ), }, @@ -285,8 +287,8 @@ func (suite *EIP712TestSuite) TestEIP712() { { title: "Fails - Single Message / Multi-Signer", msgs: []sdk.Msg{ - banktypes.NewMsgMultiSend( - []banktypes.Input{ + &banktypes.MsgMultiSend{ + Inputs: []banktypes.Input{ banktypes.NewInput( suite.createTestAddress(), suite.makeCoins(suite.denom, math.NewInt(50)), @@ -296,7 +298,7 @@ func (suite *EIP712TestSuite) TestEIP712() { suite.makeCoins(suite.denom, math.NewInt(50)), ), }, - []banktypes.Output{ + Outputs: []banktypes.Output{ banktypes.NewOutput( suite.createTestAddress(), suite.makeCoins(suite.denom, math.NewInt(50)), @@ -306,7 +308,7 @@ func (suite *EIP712TestSuite) TestEIP712() { suite.makeCoins(suite.denom, math.NewInt(50)), ), }, - ), + }, }, expectSuccess: false, }, @@ -341,7 +343,7 @@ func (suite *EIP712TestSuite) TestEIP712() { err = txBuilder.SetSignatures([]signing.SignatureV2{txSig}...) suite.Require().NoError(err) - chainID := testutil.ExampleChainID + chainID := constants.ExampleChainID if tc.chainID != "" { chainID = tc.chainID } @@ -355,10 +357,12 @@ func (suite *EIP712TestSuite) TestEIP712() { AccountNumber: params.accountNumber, Sequence: params.sequence, PubKey: pubKey, - Address: sdk.MustBech32ifyAddressBytes(testutil.ExampleBech32Prefix, pubKey.Bytes()), + Address: sdk.MustBech32ifyAddressBytes(constants.ExampleBech32Prefix, pubKey.Bytes()), } - bz, err := suite.clientCtx.TxConfig.SignModeHandler().GetSignBytes( + bz, err := authsigning.GetSignBytesAdapter( + suite.clientCtx.CmdContext, + suite.clientCtx.TxConfig.SignModeHandler(), signMode, signerData, txBuilder.GetTx(), @@ -446,17 +450,20 @@ func (suite *EIP712TestSuite) verifyPayloadMapAgainstFlattenedMap(original map[s suite.Require().True(ok) messages, ok := interfaceMessages.([]interface{}) - suite.Require().True(ok) - - // Verify message contents - for i, msg := range messages { - flattenedMsg, ok := flattened[fmt.Sprintf("msg%d", i)] - suite.Require().True(ok) - - flattenedMsgJSON, ok := flattenedMsg.(map[string]interface{}) - suite.Require().True(ok) - - suite.Require().Equal(flattenedMsgJSON, msg) + // If passing an empty msgs array + // the interfaceMessages is nil + // in that case, don't try to iterate the messages + if ok { + // Verify message contents + for i, msg := range messages { + flattenedMsg, ok := flattened[fmt.Sprintf("msg%d", i)] + suite.Require().True(ok) + + flattenedMsgJSON, ok := flattenedMsg.(map[string]interface{}) + suite.Require().True(ok) + + suite.Require().Equal(flattenedMsgJSON, msg) + } } // Verify new payload does not have msgs field diff --git a/ethereum/eip712/encoding.go b/ethereum/eip712/encoding.go index 4a0c853b..66722668 100644 --- a/ethereum/eip712/encoding.go +++ b/ethereum/eip712/encoding.go @@ -7,8 +7,8 @@ import ( "errors" "fmt" - "cosmossdk.io/simapp/params" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" txTypes "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" @@ -25,9 +25,9 @@ var ( // The process of unmarshaling SignDoc bytes into a SignDoc object requires having a codec // populated with all relevant message types. As a result, we must call this method on app // initialization with the app's encoding config. -func SetEncodingConfig(cfg params.EncodingConfig) { - aminoCodec = cfg.Amino - protoCodec = codec.NewProtoCodec(cfg.InterfaceRegistry) +func SetEncodingConfig(cdc *codec.LegacyAmino, interfaceRegistry types.InterfaceRegistry) { + aminoCodec = cdc + protoCodec = codec.NewProtoCodec(interfaceRegistry) } // GetEIP712BytesForMsg returns the EIP-712 object bytes for the given SignDoc bytes by decoding the bytes into @@ -175,8 +175,6 @@ func decodeProtobufSignDoc(signDocBytes []byte) (apitypes.TypedData, error) { Gas: authInfo.Fee.GasLimit, } - tip := authInfo.Tip - // WrapTxToTypedData expects the payload as an Amino Sign Doc signBytes := legacytx.StdSignBytes( signDoc.ChainId, @@ -186,7 +184,6 @@ func decodeProtobufSignDoc(signDocBytes []byte) (apitypes.TypedData, error) { *stdFee, msgs, body.Memo, - tip, ) typedData, err := WrapTxToTypedData( @@ -220,16 +217,20 @@ func validatePayloadMessages(msgs []sdk.Msg) error { var msgSigner sdk.AccAddress for i, m := range msgs { - if len(m.GetSigners()) != 1 { + signers, _, err := protoCodec.GetMsgV1Signers(m) + if err != nil { + return fmt.Errorf("error getting signers. %w", err) + } + if len(signers) != 1 { return errors.New("unable to build EIP-712 payload: expect exactly 1 signer") } if i == 0 { - msgSigner = m.GetSigners()[0] + msgSigner = signers[0] continue } - if !msgSigner.Equals(m.GetSigners()[0]) { + if !msgSigner.Equals(sdk.AccAddress(signers[0])) { return errors.New("unable to build EIP-712 payload: multiple signers detected") } } diff --git a/ethereum/eip712/encoding_legacy.go b/ethereum/eip712/encoding_legacy.go index 8fc539f0..6e929a25 100644 --- a/ethereum/eip712/encoding_legacy.go +++ b/ethereum/eip712/encoding_legacy.go @@ -12,7 +12,7 @@ import ( txTypes "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" apitypes "github.com/ethereum/go-ethereum/signer/core/apitypes" - evmostypes "github.com/evmos/os/types" + ostypes "github.com/evmos/os/types" ) type aminoMessage struct { @@ -89,12 +89,16 @@ func legacyDecodeAminoSignDoc(signDocBytes []byte) (apitypes.TypedData, error) { msg := msgs[0] // By convention, the fee payer is the first address in the list of signers. - feePayer := msg.GetSigners()[0] + signers, _, err := protoCodec.GetMsgV1Signers(msg) + if err != nil { + return apitypes.TypedData{}, err + } + feePayer := signers[0] feeDelegation := &FeeDelegationOptions{ FeePayer: feePayer, } - chainID, err := evmostypes.ParseChainID(aminoDoc.ChainID) + chainID, err := ostypes.ParseChainID(aminoDoc.ChainID) if err != nil { return apitypes.TypedData{}, errors.New("invalid chain ID passed as argument") } @@ -164,7 +168,7 @@ func legacyDecodeProtobufSignDoc(signDocBytes []byte) (apitypes.TypedData, error signerInfo := authInfo.SignerInfos[0] - chainID, err := evmostypes.ParseChainID(signDoc.ChainId) + chainID, err := ostypes.ParseChainID(signDoc.ChainId) if err != nil { return apitypes.TypedData{}, fmt.Errorf("invalid chain ID passed as argument: %w", err) } @@ -174,13 +178,15 @@ func legacyDecodeProtobufSignDoc(signDocBytes []byte) (apitypes.TypedData, error Gas: authInfo.Fee.GasLimit, } - feePayer := msg.GetSigners()[0] + signers, _, err := protoCodec.GetMsgV1Signers(msg) + if err != nil { + return apitypes.TypedData{}, err + } + feePayer := signers[0] feeDelegation := &FeeDelegationOptions{ FeePayer: feePayer, } - tip := authInfo.Tip - // WrapTxToTypedData expects the payload as an Amino Sign Doc signBytes := legacytx.StdSignBytes( signDoc.ChainId, @@ -190,7 +196,6 @@ func legacyDecodeProtobufSignDoc(signDocBytes []byte) (apitypes.TypedData, error *stdFee, msgs, body.Memo, - tip, ) typedData, err := LegacyWrapTxToTypedData( @@ -223,13 +228,17 @@ func legacyValidatePayloadMessages(msgs []sdk.Msg) error { return err } - if len(m.GetSigners()) != 1 { + signers, _, err := protoCodec.GetMsgV1Signers(m) + if err != nil { + return err + } + if len(signers) != 1 { return errors.New("unable to build EIP-712 payload: expect exactly 1 signer") } if i == 0 { msgType = t - msgSigner = m.GetSigners()[0] + msgSigner = signers[0] continue } @@ -237,7 +246,7 @@ func legacyValidatePayloadMessages(msgs []sdk.Msg) error { return errors.New("unable to build EIP-712 payload: different types of messages detected") } - if !msgSigner.Equals(m.GetSigners()[0]) { + if !msgSigner.Equals(sdk.AccAddress(signers[0])) { return errors.New("unable to build EIP-712 payload: multiple signers detected") } } diff --git a/ethereum/eip712/message.go b/ethereum/eip712/message.go index 86988460..46d94abc 100644 --- a/ethereum/eip712/message.go +++ b/ethereum/eip712/message.go @@ -99,6 +99,10 @@ func getPayloadMessages(payload gjson.Result) ([]gjson.Result, error) { return nil, errorsmod.Wrap(errortypes.ErrInvalidRequest, "no messages found in payload, unable to parse") } + if rawMsgs.Type == gjson.Null { + return []gjson.Result{}, nil + } + if !rawMsgs.IsArray() { return nil, errorsmod.Wrap(errortypes.ErrInvalidRequest, "expected type array of messages, cannot parse") } diff --git a/ethereum/eip712/preprocess.go b/ethereum/eip712/preprocess.go index b2bf6d63..390786a6 100644 --- a/ethereum/eip712/preprocess.go +++ b/ethereum/eip712/preprocess.go @@ -1,13 +1,16 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package eip712 import ( "fmt" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cosmoskr "github.com/cosmos/cosmos-sdk/crypto/keyring" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/evmos/os/types" @@ -51,10 +54,17 @@ func PreprocessLedgerTx(chainID string, keyType cosmoskr.KeyType, txBuilder clie return fmt.Errorf("could not parse chain id: %w", err) } + addrCodec := address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), + } + feePayerAddr, err := addrCodec.BytesToString(txBuilder.GetTx().FeePayer()) + if err != nil { + return fmt.Errorf("could not parse feePayer address: %w", err) + } // Add ExtensionOptionsWeb3Tx extension with signature var option *codectypes.Any option, err = codectypes.NewAnyWithValue(&types.ExtensionOptionsWeb3Tx{ - FeePayer: txBuilder.GetTx().FeePayer().String(), + FeePayer: feePayerAddr, TypedDataChainID: chainIDInt.Uint64(), FeePayerSig: sigBytes, }) diff --git a/ethereum/eip712/preprocess_test.go b/ethereum/eip712/preprocess_test.go index b36391f2..34376c66 100644 --- a/ethereum/eip712/preprocess_test.go +++ b/ethereum/eip712/preprocess_test.go @@ -6,19 +6,19 @@ import ( "strings" "testing" + "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/ante" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/evmos/os/encoding" "github.com/evmos/os/ethereum/eip712" - app "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/types" "github.com/stretchr/testify/require" @@ -27,17 +27,16 @@ import ( // Testing Constants var ( // chainID is used in EIP-712 tests. - chainID = testutil.ExampleChainID + chainID = constants.ExampleChainID - // ctx is the default context used in EIP-712 tests. ctx = client.Context{}.WithTxConfig( - encoding.MakeConfig(app.ModuleBasics).TxConfig, + encoding.MakeConfig().TxConfig, ) // feePayerAddress is the address of the fee payer used in EIP-712 tests. feePayerAddress = fmt.Sprintf( "%s17xpfvakm2amg962yls6f84z3kell8c5ljcjw34", - testutil.ExampleBech32Prefix, + constants.ExampleBech32Prefix, ) ) @@ -53,7 +52,7 @@ type TestCaseStruct struct { func TestLedgerPreprocessing(t *testing.T) { // Update bech32 prefix - sdk.GetConfig().SetBech32PrefixForAccount(testutil.ExampleBech32Prefix, "") + sdk.GetConfig().SetBech32PrefixForAccount(constants.ExampleBech32Prefix, "") testCases := []TestCaseStruct{ createBasicTestCase(t), @@ -101,9 +100,16 @@ func TestLedgerPreprocessing(t *testing.T) { // Verify tx fields are unchanged tx := tc.txBuilder.GetTx() - require.Equal(t, tx.FeePayer().String(), tc.expectedFeePayer) + addrCodec := address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), + } + + txFeePayer, err := addrCodec.BytesToString(tx.FeePayer()) + require.NoError(t, err) + + require.Equal(t, txFeePayer, tc.expectedFeePayer) require.Equal(t, tx.GetGas(), tc.expectedGas) - require.Equal(t, tx.GetFee().AmountOf(testutil.ExampleAttoDenom), tc.expectedFee) + require.Equal(t, tx.GetFee().AmountOf(constants.ExampleAttoDenom), tc.expectedFee) require.Equal(t, tx.GetMemo(), tc.expectedMemo) // Verify message is unchanged @@ -201,7 +207,7 @@ func createPopulatedTestCase(t *testing.T) TestCaseStruct { txBuilder.SetFeeAmount(sdk.NewCoins( sdk.NewCoin( - testutil.ExampleAttoDenom, + constants.ExampleAttoDenom, feeAmount, ))) @@ -213,7 +219,7 @@ func createPopulatedTestCase(t *testing.T) TestCaseStruct { ToAddress: "evmos12luku6uxehhak02py4rcz65zu0swh7wjun6msa", Amount: sdk.NewCoins( sdk.NewCoin( - testutil.ExampleAttoDenom, + constants.ExampleAttoDenom, math.NewInt(10000000), ), ), diff --git a/example_chain/ante/cosmos_handler.go b/example_chain/ante/cosmos_handler.go index 1e33f475..1ca92b4c 100644 --- a/example_chain/ante/cosmos_handler.go +++ b/example_chain/ante/cosmos_handler.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/ante" sdkvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante" evmoscosmosante "github.com/evmos/os/ante/cosmos" evmante "github.com/evmos/os/ante/evm" evmtypes "github.com/evmos/os/x/evm/types" diff --git a/example_chain/ante/evm_benchmark_test.go b/example_chain/ante/evm_benchmark_test.go new file mode 100644 index 00000000..43a52cf8 --- /dev/null +++ b/example_chain/ante/evm_benchmark_test.go @@ -0,0 +1,159 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) +package ante_test + +import ( + "fmt" + "math/big" + "testing" + + "cosmossdk.io/errors" + "cosmossdk.io/math" + sdktypes "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/evmos/os/ante" + ethante "github.com/evmos/os/ante/evm" + chainante "github.com/evmos/os/example_chain/ante" + cmmnfactory "github.com/evmos/os/testutil/integration/common/factory" + "github.com/evmos/os/testutil/integration/os/factory" + "github.com/evmos/os/testutil/integration/os/grpc" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" + "github.com/evmos/os/testutil/integration/os/network" + evmostypes "github.com/evmos/os/types" + evmtypes "github.com/evmos/os/x/evm/types" +) + +type benchmarkSuite struct { + network *network.UnitTestNetwork + grpcHandler grpc.Handler + txFactory factory.TxFactory + keyring testkeyring.Keyring +} + +// Setup +var table = []struct { + name string + txType string + simulate bool +}{ + { + "evm_transfer_sim", + "evm_transfer", + true, + }, + { + "evm_transfer", + "evm_transfer", + false, + }, + { + "bank_msg_send_sim", + "bank_msg_send", + true, + }, + { + "bank_msg_send", + "bank_msg_send", + false, + }, +} + +func BenchmarkAnteHandler(b *testing.B) { + keyring := testkeyring.New(2) + + for _, v := range table { + // Reset chain on every tx type to have a clean state + // and a fair benchmark + b.StopTimer() + unitNetwork := network.NewUnitTestNetwork( + network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), + ) + grpcHandler := grpc.NewIntegrationHandler(unitNetwork) + txFactory := factory.New(unitNetwork, grpcHandler) + suite := benchmarkSuite{ + network: unitNetwork, + grpcHandler: grpcHandler, + txFactory: txFactory, + keyring: keyring, + } + + handlerOptions := suite.generateHandlerOptions() + ante := chainante.NewAnteHandler(handlerOptions) + b.StartTimer() + + b.Run(fmt.Sprintf("tx_type_%v", v.name), func(b *testing.B) { + for i := 0; i < b.N; i++ { + // Stop timer while building the tx setup + b.StopTimer() + // Start with a clean block + if err := unitNetwork.NextBlock(); err != nil { + b.Fatal(errors.Wrap(err, "failed to create block")) + } + ctx := unitNetwork.GetContext() + + // Generate fresh tx type + tx, err := suite.generateTxType(v.txType) + if err != nil { + b.Fatal(errors.Wrap(err, "failed to generate tx type")) + } + b.StartTimer() + + // Run benchmark + _, err = ante(ctx, tx, v.simulate) + if err != nil { + b.Fatal(errors.Wrap(err, "failed to run ante handler")) + } + } + }) + } +} + +func (s *benchmarkSuite) generateTxType(txType string) (sdktypes.Tx, error) { + switch txType { + case "evm_transfer": + senderPriv := s.keyring.GetPrivKey(0) + receiver := s.keyring.GetKey(1) + txArgs := evmtypes.EvmTxArgs{ + To: &receiver.Addr, + Amount: big.NewInt(1000), + } + return s.txFactory.GenerateSignedEthTx(senderPriv, txArgs) + case "bank_msg_send": + sender := s.keyring.GetKey(1) + receiver := s.keyring.GetAccAddr(0) + bankmsg := banktypes.NewMsgSend( + sender.AccAddr, + receiver, + sdktypes.NewCoins( + sdktypes.NewCoin( + s.network.GetDenom(), + math.NewInt(1000), + ), + ), + ) + txArgs := cmmnfactory.CosmosTxArgs{Msgs: []sdktypes.Msg{bankmsg}} + return s.txFactory.BuildCosmosTx(sender.Priv, txArgs) + default: + return nil, fmt.Errorf("invalid tx type") + } +} + +func (s *benchmarkSuite) generateHandlerOptions() chainante.HandlerOptions { + encCfg := s.network.GetEncodingConfig() + return chainante.HandlerOptions{ + Cdc: s.network.App.AppCodec(), + AccountKeeper: s.network.App.AccountKeeper, + BankKeeper: s.network.App.BankKeeper, + ExtensionOptionChecker: evmostypes.HasDynamicFeeExtensionOption, + EvmKeeper: s.network.App.EVMKeeper, + StakingKeeper: s.network.App.StakingKeeper, + FeegrantKeeper: s.network.App.FeeGrantKeeper, + DistributionKeeper: s.network.App.DistrKeeper, + IBCKeeper: s.network.App.IBCKeeper, + FeeMarketKeeper: s.network.App.FeeMarketKeeper, + SignModeHandler: encCfg.TxConfig.SignModeHandler(), + SigGasConsumer: ante.SigVerificationGasConsumer, + MaxTxGasWanted: 1_000_000_000, + TxFeeChecker: ethante.NewDynamicFeeChecker(s.network.App.EVMKeeper), + } +} diff --git a/example_chain/ante/evm_handler.go b/example_chain/ante/evm_handler.go index ff1c1e72..2c95a8b1 100644 --- a/example_chain/ante/evm_handler.go +++ b/example_chain/ante/evm_handler.go @@ -248,7 +248,7 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne } // 12. emit events - txIdx := uint64(i) // nosec: G115 + txIdx := uint64(i) //nolint:gosec // G115 evmante.EmitTxHashEvent(ctx, ethMsg, decUtils.BlockTxIndex, txIdx) } diff --git a/example_chain/ante/handler_options.go b/example_chain/ante/handler_options.go index dea77664..9478d6cd 100644 --- a/example_chain/ante/handler_options.go +++ b/example_chain/ante/handler_options.go @@ -5,14 +5,14 @@ package ante import ( errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + txsigning "cosmossdk.io/x/tx/signing" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/ante" - authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" anteinterfaces "github.com/evmos/os/ante/interfaces" evmtypes "github.com/evmos/os/x/evm/types" ) @@ -30,7 +30,7 @@ type HandlerOptions struct { EvmKeeper anteinterfaces.EVMKeeper FeegrantKeeper ante.FeegrantKeeper ExtensionOptionChecker ante.ExtensionOptionChecker - SignModeHandler authsigning.SignModeHandler + SignModeHandler *txsigning.HandlerMap SigGasConsumer func(meter storetypes.GasMeter, sig signing.SignatureV2, params authtypes.Params) error MaxTxGasWanted uint64 TxFeeChecker ante.TxFeeChecker diff --git a/example_chain/ante/handler_options_test.go b/example_chain/ante/handler_options_test.go new file mode 100644 index 00000000..5c100276 --- /dev/null +++ b/example_chain/ante/handler_options_test.go @@ -0,0 +1,186 @@ +package ante_test + +import ( + "testing" + + "github.com/evmos/os/ante" + ethante "github.com/evmos/os/ante/evm" + chainante "github.com/evmos/os/example_chain/ante" + "github.com/evmos/os/testutil/integration/os/network" + "github.com/evmos/os/types" + "github.com/stretchr/testify/require" +) + +func TestValidateHandlerOptions(t *testing.T) { + nw := network.NewUnitTestNetwork() + cases := []struct { + name string + options chainante.HandlerOptions + expPass bool + }{ + { + "fail - empty options", + chainante.HandlerOptions{}, + false, + }, + { + "fail - empty account keeper", + chainante.HandlerOptions{ + Cdc: nw.App.AppCodec(), + AccountKeeper: nil, + }, + false, + }, + { + "fail - empty bank keeper", + chainante.HandlerOptions{ + Cdc: nw.App.AppCodec(), + AccountKeeper: nw.App.AccountKeeper, + BankKeeper: nil, + }, + false, + }, + { + "fail - empty distribution keeper", + chainante.HandlerOptions{ + Cdc: nw.App.AppCodec(), + AccountKeeper: nw.App.AccountKeeper, + BankKeeper: nw.App.BankKeeper, + DistributionKeeper: nil, + + IBCKeeper: nil, + }, + false, + }, + { + "fail - empty IBC keeper", + chainante.HandlerOptions{ + Cdc: nw.App.AppCodec(), + AccountKeeper: nw.App.AccountKeeper, + BankKeeper: nw.App.BankKeeper, + DistributionKeeper: nw.App.DistrKeeper, + + IBCKeeper: nil, + }, + false, + }, + { + "fail - empty staking keeper", + chainante.HandlerOptions{ + Cdc: nw.App.AppCodec(), + AccountKeeper: nw.App.AccountKeeper, + BankKeeper: nw.App.BankKeeper, + DistributionKeeper: nw.App.DistrKeeper, + + IBCKeeper: nw.App.IBCKeeper, + StakingKeeper: nil, + }, + false, + }, + { + "fail - empty fee market keeper", + chainante.HandlerOptions{ + Cdc: nw.App.AppCodec(), + AccountKeeper: nw.App.AccountKeeper, + BankKeeper: nw.App.BankKeeper, + DistributionKeeper: nw.App.DistrKeeper, + + IBCKeeper: nw.App.IBCKeeper, + StakingKeeper: nw.App.StakingKeeper, + FeeMarketKeeper: nil, + }, + false, + }, + { + "fail - empty EVM keeper", + chainante.HandlerOptions{ + Cdc: nw.App.AppCodec(), + AccountKeeper: nw.App.AccountKeeper, + BankKeeper: nw.App.BankKeeper, + DistributionKeeper: nw.App.DistrKeeper, + IBCKeeper: nw.App.IBCKeeper, + StakingKeeper: nw.App.StakingKeeper, + FeeMarketKeeper: nw.App.FeeMarketKeeper, + EvmKeeper: nil, + }, + false, + }, + { + "fail - empty signature gas consumer", + chainante.HandlerOptions{ + Cdc: nw.App.AppCodec(), + AccountKeeper: nw.App.AccountKeeper, + BankKeeper: nw.App.BankKeeper, + DistributionKeeper: nw.App.DistrKeeper, + IBCKeeper: nw.App.IBCKeeper, + StakingKeeper: nw.App.StakingKeeper, + FeeMarketKeeper: nw.App.FeeMarketKeeper, + EvmKeeper: nw.App.EVMKeeper, + SigGasConsumer: nil, + }, + false, + }, + { + "fail - empty signature mode handler", + chainante.HandlerOptions{ + Cdc: nw.App.AppCodec(), + AccountKeeper: nw.App.AccountKeeper, + BankKeeper: nw.App.BankKeeper, + DistributionKeeper: nw.App.DistrKeeper, + IBCKeeper: nw.App.IBCKeeper, + StakingKeeper: nw.App.StakingKeeper, + FeeMarketKeeper: nw.App.FeeMarketKeeper, + EvmKeeper: nw.App.EVMKeeper, + SigGasConsumer: ante.SigVerificationGasConsumer, + SignModeHandler: nil, + }, + false, + }, + { + "fail - empty tx fee checker", + chainante.HandlerOptions{ + Cdc: nw.App.AppCodec(), + AccountKeeper: nw.App.AccountKeeper, + BankKeeper: nw.App.BankKeeper, + DistributionKeeper: nw.App.DistrKeeper, + IBCKeeper: nw.App.IBCKeeper, + StakingKeeper: nw.App.StakingKeeper, + FeeMarketKeeper: nw.App.FeeMarketKeeper, + EvmKeeper: nw.App.EVMKeeper, + SigGasConsumer: ante.SigVerificationGasConsumer, + SignModeHandler: nw.App.GetTxConfig().SignModeHandler(), + TxFeeChecker: nil, + }, + false, + }, + { + "success - default app options", + chainante.HandlerOptions{ + Cdc: nw.App.AppCodec(), + AccountKeeper: nw.App.AccountKeeper, + BankKeeper: nw.App.BankKeeper, + DistributionKeeper: nw.App.DistrKeeper, + ExtensionOptionChecker: types.HasDynamicFeeExtensionOption, + EvmKeeper: nw.App.EVMKeeper, + StakingKeeper: nw.App.StakingKeeper, + FeegrantKeeper: nw.App.FeeGrantKeeper, + IBCKeeper: nw.App.IBCKeeper, + FeeMarketKeeper: nw.App.FeeMarketKeeper, + SignModeHandler: nw.GetEncodingConfig().TxConfig.SignModeHandler(), + SigGasConsumer: ante.SigVerificationGasConsumer, + MaxTxGasWanted: 40000000, + TxFeeChecker: ethante.NewDynamicFeeChecker(nw.App.EVMKeeper), + }, + true, + }, + } + + for _, tc := range cases { + err := tc.options.Validate() + if tc.expPass { + require.NoError(t, err, tc.name) + } else { + require.Error(t, err, tc.name) + } + } +} diff --git a/example_chain/ante/integration_test.go b/example_chain/ante/integration_test.go new file mode 100644 index 00000000..5575b81d --- /dev/null +++ b/example_chain/ante/integration_test.go @@ -0,0 +1,172 @@ +package ante_test + +import ( + sdkmath "cosmossdk.io/math" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/evmos/os/testutil/constants" + commonfactory "github.com/evmos/os/testutil/integration/common/factory" + "github.com/evmos/os/testutil/integration/os/factory" + "github.com/evmos/os/testutil/integration/os/grpc" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" + "github.com/evmos/os/testutil/integration/os/network" + integrationutils "github.com/evmos/os/testutil/integration/os/utils" + testutiltx "github.com/evmos/os/testutil/tx" + + //nolint:revive // dot imports are fine for Ginkgo + . "github.com/onsi/ginkgo/v2" + //nolint:revive // dot imports are fine for Ginkgo + . "github.com/onsi/gomega" +) + +type IntegrationTestSuite struct { + network network.Network + factory factory.TxFactory + grpcHandler grpc.Handler + keyring testkeyring.Keyring +} + +var _ = Describe("when sending a Cosmos transaction", Label("AnteHandler"), Ordered, func() { + var ( + s *IntegrationTestSuite + addr sdk.AccAddress + priv cryptotypes.PrivKey + msg sdk.Msg + ) + + BeforeAll(func() { + keyring := testkeyring.New(3) + + integrationNetwork := network.New( + network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), + ) + grpcHandler := grpc.NewIntegrationHandler(integrationNetwork) + txFactory := factory.New(integrationNetwork, grpcHandler) + s = &IntegrationTestSuite{ + network: integrationNetwork, + factory: txFactory, + grpcHandler: grpcHandler, + keyring: keyring, + } + }) + + Context("and the sender account has enough balance to pay for the transaction cost", Ordered, func() { + var ( + // rewards are the real accrued rewards + rewards sdk.DecCoins + // minExpRewards are the minimun rewards that should be accrued + // for the test case + minExpRewards = sdk.DecCoins{sdk.DecCoin{Amount: sdkmath.LegacyNewDec(1e5), Denom: constants.ExampleAttoDenom}} + delegationCoin = sdk.Coin{Amount: sdkmath.NewInt(1e15), Denom: constants.ExampleAttoDenom} + transferAmt = sdkmath.NewInt(1e14) + ) + + BeforeEach(func() { + key := s.keyring.GetKey(0) + addr = key.AccAddr + priv = key.Priv + + msg = &banktypes.MsgSend{ + FromAddress: addr.String(), + ToAddress: "evmos1dx67l23hz9l0k9hcher8xz04uj7wf3yu26l2yn", + Amount: sdk.Coins{sdk.Coin{Amount: transferAmt, Denom: constants.ExampleAttoDenom}}, + } + + valAddr := s.network.GetValidators()[0].OperatorAddress + err := s.factory.Delegate(priv, valAddr, delegationCoin) + Expect(err).To(BeNil()) + + rewards, err = integrationutils.WaitToAccrueRewards(s.network, s.grpcHandler, addr.String(), minExpRewards) + Expect(err).To(BeNil()) + }) + + It("should succeed & not withdraw any staking rewards", func() { + prevBalanceRes, err := s.grpcHandler.GetBalance(addr, s.network.GetDenom()) + Expect(err).To(BeNil()) + + baseFeeRes, err := s.grpcHandler.GetBaseFee() + Expect(err).To(BeNil()) + Expect(baseFeeRes).ToNot(BeNil(), "baseFeeRes is nil") + + res, err := s.factory.ExecuteCosmosTx( + priv, + commonfactory.CosmosTxArgs{ + Msgs: []sdk.Msg{msg}, + GasPrice: baseFeeRes.BaseFee, + }, + ) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeTrue()) + + // include the tx in a block to update state + err = s.network.NextBlock() + Expect(err).To(BeNil()) + + // fees should be deducted from balance + Expect(baseFeeRes.BaseFee).ToNot(BeNil(), "baseFeeRes.BaseFee is nil") + + feesAmt := sdkmath.NewInt(res.GasWanted).Mul(*baseFeeRes.BaseFee) + balanceRes, err := s.grpcHandler.GetBalance(addr, s.network.GetDenom()) + Expect(err).To(BeNil()) + Expect(balanceRes.Balance.Amount).To(Equal(prevBalanceRes.Balance.Amount.Sub(transferAmt).Sub(feesAmt))) + + rewardsRes, err := s.grpcHandler.GetDelegationTotalRewards(addr.String()) + Expect(err).To(BeNil()) + + // rewards should not be used. Should be more + // than the previous value queried + Expect(rewardsRes.Total.Sub(rewards).IsAllPositive()).To(BeTrue()) + }) + }) + + Context("and the sender account neither has enough balance nor sufficient staking rewards to pay for the transaction cost", func() { + BeforeEach(func() { + addr, priv = testutiltx.NewAccAddressAndKey() + + // this is a new address that does not exist on chain. + // Transfer 1 aevmos to this account so it is + // added on chain + err := s.factory.FundAccount( + s.keyring.GetKey(0), + addr, + sdk.Coins{ + sdk.Coin{ + Amount: sdkmath.NewInt(1), + Denom: constants.ExampleAttoDenom, + }, + }, + ) + Expect(err).To(BeNil()) + // persist the state changes + Expect(s.network.NextBlock()).To(BeNil()) + + msg = &banktypes.MsgSend{ + FromAddress: addr.String(), + ToAddress: "evmos1dx67l23hz9l0k9hcher8xz04uj7wf3yu26l2yn", + Amount: sdk.Coins{sdk.Coin{Amount: sdkmath.NewInt(1e14), Denom: constants.ExampleAttoDenom}}, + } + }) + + It("should fail", func() { + var gas uint64 = 200_000 // specify gas to avoid failing on simulation tx (internal call in the ExecuteCosmosTx if gas not specified) + res, err := s.factory.ExecuteCosmosTx( + priv, + commonfactory.CosmosTxArgs{ + Msgs: []sdk.Msg{msg}, + Gas: &gas, + }, + ) + Expect(res.IsErr()).To(BeTrue()) + Expect(res.GetLog()).To(ContainSubstring("insufficient funds")) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) + }) + + It("should not withdraw any staking rewards", func() { + rewardsRes, err := s.grpcHandler.GetDelegationTotalRewards(addr.String()) + Expect(err).To(BeNil()) + Expect(rewardsRes.Total.Empty()).To(BeTrue()) + }) + }) +}) diff --git a/example_chain/app.go b/example_chain/app.go index aa6382c1..6e61c9e7 100644 --- a/example_chain/app.go +++ b/example_chain/app.go @@ -5,6 +5,7 @@ package example_chain import ( "encoding/json" + "fmt" "io" "maps" "os" @@ -13,14 +14,27 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/client/v2/autocli" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/evidence" + evidencekeeper "cosmossdk.io/x/evidence/keeper" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + feegrantkeeper "cosmossdk.io/x/feegrant/keeper" + feegrantmodule "cosmossdk.io/x/feegrant/module" + "cosmossdk.io/x/upgrade" + upgradekeeper "cosmossdk.io/x/upgrade/keeper" + upgradetypes "cosmossdk.io/x/upgrade/types" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" + "github.com/cosmos/cosmos-sdk/client/grpc/node" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" @@ -29,17 +43,19 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/store/streaming" - storetypes "github.com/cosmos/cosmos-sdk/store/types" testdata_pulsar "github.com/cosmos/cosmos-sdk/testutil/testdata/testpb" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/types/msgservice" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/auth/posthandler" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/authz" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" @@ -47,28 +63,18 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - consensus "github.com/cosmos/cosmos-sdk/x/consensus" + "github.com/cosmos/cosmos-sdk/x/consensus" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" distr "github.com/cosmos/cosmos-sdk/x/distribution" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/mint" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -76,39 +82,34 @@ import ( paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ibctransfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types" + "github.com/cosmos/gogoproto/proto" + "github.com/cosmos/ibc-go/modules/capability" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + ibctransfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v8/modules/core" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" + ibctestingtypes "github.com/cosmos/ibc-go/v8/testing/types" evmosante "github.com/evmos/os/ante" evmosevmante "github.com/evmos/os/ante/evm" - "github.com/evmos/os/encoding" evmosencoding "github.com/evmos/os/encoding" - "github.com/evmos/os/ethereum/eip712" chainante "github.com/evmos/os/example_chain/ante" srvflags "github.com/evmos/os/server/flags" evmostypes "github.com/evmos/os/types" evmosutils "github.com/evmos/os/utils" "github.com/evmos/os/x/erc20" - erc20client "github.com/evmos/os/x/erc20/client" erc20keeper "github.com/evmos/os/x/erc20/keeper" erc20types "github.com/evmos/os/x/erc20/types" "github.com/evmos/os/x/evm" @@ -123,11 +124,23 @@ import ( // NOTE: override ICS20 keeper to support IBC transfers of ERC20 tokens "github.com/evmos/os/x/ibc/transfer" transferkeeper "github.com/evmos/os/x/ibc/transfer/keeper" + + // Force-load the tracer engines to trigger registration due to Go-Ethereum v1.10.15 changes + _ "github.com/evmos/os/x/evm/core/tracers/js" + _ "github.com/evmos/os/x/evm/core/tracers/native" ) func init() { // manually update the power reduction by replacing micro (u) -> atto (a) evmos sdk.DefaultPowerReduction = evmostypes.AttoPowerReduction + + // get the user's home directory + userHomeDir, err := os.UserHomeDir() + if err != nil { + panic(err) + } + + DefaultNodeHome = filepath.Join(userHomeDir, ".osd") } const appName = "os" @@ -136,46 +149,6 @@ var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string - // ModuleBasics defines the module BasicManager is in charge of setting up basic, - // non-dependant module elements, such as codec registration - // and genesis verification. - ModuleBasics = module.NewBasicManager( - auth.AppModuleBasic{}, - genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), - bank.AppModuleBasic{}, - capability.AppModuleBasic{}, - staking.AppModuleBasic{}, - mint.AppModuleBasic{}, - distr.AppModuleBasic{}, - gov.NewAppModuleBasic( - []govclient.ProposalHandler{ - paramsclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, - // evmOS proposals - erc20client.RegisterERC20ProposalHandler, - erc20client.ToggleTokenConversionProposalHandler, - }, - ), - params.AppModuleBasic{}, - slashing.AppModuleBasic{}, - ibc.AppModuleBasic{}, - ibctm.AppModuleBasic{}, - transfer.AppModuleBasic{AppModuleBasic: &ibctransfer.AppModuleBasic{}}, - feegrantmodule.AppModuleBasic{}, - upgrade.AppModuleBasic{}, - evidence.AppModuleBasic{}, - authzmodule.AppModuleBasic{}, - consensus.AppModuleBasic{}, - - // evmOS modules - evm.AppModuleBasic{}, - feemarket.AppModuleBasic{}, - erc20.AppModuleBasic{}, - ) - // module account permissions maccPerms = map[string][]string{ authtypes.FeeCollectorName: nil, @@ -206,8 +179,8 @@ type ExampleChain struct { legacyAmino *codec.LegacyAmino appCodec codec.Codec - txConfig client.TxConfig interfaceRegistry types.InterfaceRegistry + txConfig client.TxConfig // keys to access the substores keys map[string]*storetypes.KVStoreKey @@ -234,7 +207,7 @@ type ExampleChain struct { IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly TransferKeeper transferkeeper.Keeper scopedIBCKeeper capabilitykeeper.ScopedKeeper - scopedTransferKeeper capabilitykeeper.ScopedKeeper + ScopedTransferKeeper capabilitykeeper.ScopedKeeper // evmOS keepers FeeMarketKeeper feemarketkeeper.Keeper @@ -242,7 +215,8 @@ type ExampleChain struct { Erc20Keeper erc20keeper.Keeper // the module manager - ModuleManager *module.Manager + ModuleManager *module.Manager + BasicModuleManager module.BasicManager // simulation manager sm *module.SimulationManager @@ -251,15 +225,6 @@ type ExampleChain struct { configurator module.Configurator } -func init() { - userHomeDir, err := os.UserHomeDir() - if err != nil { - panic(err) - } - - DefaultNodeHome = filepath.Join(userHomeDir, ".osd") -} - // NewExampleApp returns a reference to an initialized ExampleChain. func NewExampleApp( logger log.Logger, @@ -269,9 +234,7 @@ func NewExampleApp( appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *ExampleChain { - encodingConfig := evmosencoding.MakeConfig(ModuleBasics) - - eip712.SetEncodingConfig(encodingConfig) + encodingConfig := evmosencoding.MakeConfig() appCodec := encodingConfig.Codec legacyAmino := encodingConfig.Amino @@ -317,7 +280,7 @@ func NewExampleApp( bApp.SetInterfaceRegistry(interfaceRegistry) bApp.SetTxEncoder(txConfig.TxEncoder()) - keys := sdk.NewKVStoreKeys( + keys := storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey, paramstypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, @@ -329,15 +292,20 @@ func NewExampleApp( evmtypes.StoreKey, feemarkettypes.StoreKey, erc20types.StoreKey, ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey) + memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) // load state streaming if enabled - if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, logger, keys); err != nil { - logger.Error("failed to load state streaming", "err", err) + if err := bApp.RegisterStreamingServices(appOpts, keys); err != nil { + fmt.Printf("failed to load state streaming: %s", err) os.Exit(1) } + // wire up the versiondb's `StreamingService` and `MultiStore`. + if cast.ToBool(appOpts.Get("versiondb.enable")) { + panic("version db not supported in this example chain") + } + app := &ExampleChain{ BaseApp: bApp, legacyAmino: legacyAmino, @@ -351,41 +319,99 @@ func NewExampleApp( app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) + // get authority address + authAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + // set the BaseApp's parameter store - app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamtypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) - bApp.SetParamStore(&app.ConsensusParamsKeeper) + app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), + authAddr, + runtime.EventService{}, + ) + bApp.SetParamStore(app.ConsensusParamsKeeper.ParamsStore) app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) app.scopedIBCKeeper = app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName) - app.scopedTransferKeeper = app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) + app.ScopedTransferKeeper = app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) // Applications that wish to enforce statically created ScopedKeepers should call `Seal` after creating // their scoped modules in `NewApp` with `ScopeToModule` app.CapabilityKeeper.Seal() // add keepers - app.AccountKeeper = authkeeper.NewAccountKeeper(appCodec, keys[authtypes.StoreKey], authtypes.ProtoBaseAccount, maccPerms, sdk.GetConfig().GetBech32AccountAddrPrefix(), authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.AccountKeeper = authkeeper.NewAccountKeeper( + appCodec, runtime.NewKVStoreService(keys[authtypes.StoreKey]), + authtypes.ProtoBaseAccount, maccPerms, + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + sdk.GetConfig().GetBech32AccountAddrPrefix(), + authAddr, + ) app.BankKeeper = bankkeeper.NewBaseKeeper( appCodec, - keys[banktypes.StoreKey], + runtime.NewKVStoreService(keys[banktypes.StoreKey]), app.AccountKeeper, BlockedAddresses(), - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + authAddr, + logger, ) + + // optional: enable sign mode textual by overwriting the default tx config (after setting the bank keeper) + enabledSignModes := append(authtx.DefaultSignModes, signingtypes.SignMode_SIGN_MODE_TEXTUAL) //nolint:gocritic + txConfigOpts := authtx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper), + } + txConfig, err := authtx.NewTxConfigWithOptions( + appCodec, + txConfigOpts, + ) + if err != nil { + panic(err) + } + app.txConfig = txConfig + app.StakingKeeper = stakingkeeper.NewKeeper( - appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + appCodec, + runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), + app.AccountKeeper, + app.BankKeeper, + authAddr, + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), ) - app.MintKeeper = mintkeeper.NewKeeper(appCodec, keys[minttypes.StoreKey], app.StakingKeeper, app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String()) - app.DistrKeeper = distrkeeper.NewKeeper(appCodec, keys[distrtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.StakingKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.MintKeeper = mintkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[minttypes.StoreKey]), + app.StakingKeeper, + app.AccountKeeper, + app.BankKeeper, + authtypes.FeeCollectorName, + authAddr, + ) + + app.DistrKeeper = distrkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[distrtypes.StoreKey]), + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + authtypes.FeeCollectorName, + authAddr, + ) app.SlashingKeeper = slashingkeeper.NewKeeper( - appCodec, legacyAmino, keys[slashingtypes.StoreKey], app.StakingKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + appCodec, + app.LegacyAmino(), + runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), + app.StakingKeeper, + authAddr, ) - app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper) + app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[feegrant.StoreKey]), app.AccountKeeper) // register the staking hooks // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks @@ -393,7 +419,12 @@ func NewExampleApp( stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()), ) - app.AuthzKeeper = authzkeeper.NewKeeper(keys[authzkeeper.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper) + app.AuthzKeeper = authzkeeper.NewKeeper( + runtime.NewKVStoreService(keys[authzkeeper.StoreKey]), + appCodec, + app.MsgServiceRouter(), + app.AccountKeeper, + ) // get skipUpgradeHeights from the app options skipUpgradeHeights := map[int64]bool{} @@ -402,38 +433,36 @@ func NewExampleApp( } homePath := cast.ToString(appOpts.Get(flags.FlagHome)) // set the governance module account as the authority for conducting upgrades - app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.UpgradeKeeper = upgradekeeper.NewKeeper( + skipUpgradeHeights, + runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), + appCodec, + homePath, + app.BaseApp, + authAddr, + ) // Create IBC Keeper app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, keys[ibcexported.StoreKey], app.GetSubspace(ibcexported.ModuleName), app.StakingKeeper, app.UpgradeKeeper, app.scopedIBCKeeper, + appCodec, + keys[ibcexported.StoreKey], + app.GetSubspace(ibcexported.ModuleName), + app.StakingKeeper, + app.UpgradeKeeper, + app.scopedIBCKeeper, + authAddr, ) - // Register the proposal types - // Deprecated: Avoid adding new handlers, instead use the new proposal flow - // by granting the governance module the right to execute the message. - // See: https://docs.cosmos.network/main/modules/gov#proposal-messages - govRouter := govv1beta1.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - // IBC routes - AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). - // ERC-20 route - AddRoute(erc20types.RouterKey, erc20.NewErc20ProposalHandler(&app.Erc20Keeper)) govConfig := govtypes.DefaultConfig() /* Example of setting gov params: govConfig.MaxMetadataLen = 10000 */ govKeeper := govkeeper.NewKeeper( - appCodec, keys[govtypes.StoreKey], app.AccountKeeper, app.BankKeeper, - app.StakingKeeper, app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + appCodec, runtime.NewKVStoreService(keys[govtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, + app.StakingKeeper, app.DistrKeeper, app.MsgServiceRouter(), govConfig, authAddr, ) - // Set legacy router for backwards compatibility with gov v1beta1 - govKeeper.SetLegacyRouter(govRouter) - app.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( // register the governance hooks @@ -442,7 +471,12 @@ func NewExampleApp( // create evidence keeper with router evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, keys[evidencetypes.StoreKey], app.StakingKeeper, app.SlashingKeeper, + appCodec, + runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), + app.StakingKeeper, + app.SlashingKeeper, + app.AccountKeeper.AddressCodec(), + runtime.ProvideCometInfoService(), ) // If evidence needs to be handled for the app, set routes in router here and seal app.EvidenceKeeper = *evidenceKeeper @@ -460,9 +494,13 @@ func NewExampleApp( // NOTE: it's required to set up the EVM keeper before the ERC-20 keeper, because it is used in its instantiation. app.EVMKeeper = evmkeeper.NewKeeper( + // TODO: check why this is not adjusted to use the runtime module methods like SDK native keepers appCodec, keys[evmtypes.StoreKey], tkeys[evmtypes.TransientKey], authtypes.NewModuleAddress(govtypes.ModuleName), - app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.FeeMarketKeeper, + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + app.FeeMarketKeeper, &app.Erc20Keeper, tracer, app.GetSubspace(evmtypes.ModuleName), ) @@ -482,10 +520,11 @@ func NewExampleApp( // instantiate IBC transfer keeper AFTER the ERC-20 keeper to use it in the instantiation app.TransferKeeper = transferkeeper.NewKeeper( appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), - app.IBCKeeper.ChannelKeeper, - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, - app.AccountKeeper, app.BankKeeper, app.scopedTransferKeeper, + nil, // we are passing no ics4 wrapper + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, + app.AccountKeeper, app.BankKeeper, app.ScopedTransferKeeper, app.Erc20Keeper, // Add ERC20 Keeper for ERC20 transfers + authAddr, ) // Override the ICS20 app module @@ -538,8 +577,8 @@ func NewExampleApp( // must be passed by reference here. app.ModuleManager = module.NewManager( genutil.NewAppModule( - app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, - encodingConfig.TxConfig, + app.AccountKeeper, app.StakingKeeper, + app, app.txConfig, ), auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), @@ -547,16 +586,17 @@ func NewExampleApp( feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), - upgrade.NewAppModule(app.UpgradeKeeper), + upgrade.NewAppModule(app.UpgradeKeeper, app.AccountKeeper.AddressCodec()), evidence.NewAppModule(app.EvidenceKeeper), params.NewAppModule(app.ParamsKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), // IBC modules ibc.NewAppModule(app.IBCKeeper), + ibctm.NewAppModule(), transferModule, // evmOS modules evm.NewAppModule(app.EVMKeeper, app.AccountKeeper, app.GetSubspace(evmtypes.ModuleName)), @@ -564,15 +604,39 @@ func NewExampleApp( erc20.NewAppModule(app.Erc20Keeper, app.AccountKeeper, app.GetSubspace(erc20types.ModuleName)), ) + // BasicModuleManager defines the module BasicManager which is in charge of setting up basic, + // non-dependant module elements, such as codec registration and genesis verification. + // By default, it is composed of all the modules from the module manager. + // Additionally, app module basics can be overwritten by passing them as an argument. + app.BasicModuleManager = module.NewBasicManagerFromManager( + app.ModuleManager, + map[string]module.AppModuleBasic{ + genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), + stakingtypes.ModuleName: staking.AppModuleBasic{}, + govtypes.ModuleName: gov.NewAppModuleBasic( + []govclient.ProposalHandler{ + paramsclient.ProposalHandler, + }, + ), + ibctransfertypes.ModuleName: transfer.AppModuleBasic{AppModuleBasic: &ibctransfer.AppModuleBasic{}}, + }, + ) + app.BasicModuleManager.RegisterLegacyAminoCodec(legacyAmino) + app.BasicModuleManager.RegisterInterfaces(interfaceRegistry) + + // NOTE: upgrade module is required to be prioritized + app.ModuleManager.SetOrderPreBlockers( + upgradetypes.ModuleName, + ) + // During begin block slashing happens after distr.BeginBlocker so that // there is nothing left over in the validator fee pool, so as to keep the // CanWithdrawInvariant invariant. // - // NOTE: upgrade module must go first to handle software upgrades. // NOTE: staking module is required if HistoricalEntries param > 0 // NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC) app.ModuleManager.SetOrderBeginBlockers( - upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, + capabilitytypes.ModuleName, minttypes.ModuleName, // IBC modules ibcexported.ModuleName, ibctransfertypes.ModuleName, @@ -580,6 +644,7 @@ func NewExampleApp( // evmOS BeginBlockers evmtypes.ModuleName, erc20types.ModuleName, feemarkettypes.ModuleName, + // TODO: remove no-ops? check if all are no-ops before removing distrtypes.ModuleName, slashingtypes.ModuleName, evidencetypes.ModuleName, stakingtypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, govtypes.ModuleName, genutiltypes.ModuleName, @@ -593,7 +658,7 @@ func NewExampleApp( govtypes.ModuleName, stakingtypes.ModuleName, capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, - // evmOS BeginBlockers + // evmOS EndBlockers evmtypes.ModuleName, erc20types.ModuleName, feemarkettypes.ModuleName, // no-ops @@ -626,8 +691,7 @@ func NewExampleApp( ibctransfertypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, - feegrant.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, - consensusparamtypes.ModuleName, + feegrant.ModuleName, upgradetypes.ModuleName, } app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...) app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...) @@ -636,7 +700,9 @@ func NewExampleApp( // app.ModuleManager.SetOrderMigrations(custom order) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) - app.ModuleManager.RegisterServices(app.configurator) + if err = app.ModuleManager.RegisterServices(app.configurator); err != nil { + panic(fmt.Sprintf("failed to register services in module manager: %s", err.Error())) + } // RegisterUpgradeHandlers is used for registering any on-chain upgrades. // Make sure it's called after `app.ModuleManager` and `app.configurator` are set. @@ -673,9 +739,11 @@ func NewExampleApp( // initialize BaseApp app.SetInitChainer(app.InitChainer) + app.SetPreBlocker(app.PreBlocker) app.SetBeginBlocker(app.BeginBlocker) app.SetEndBlocker(app.EndBlocker) - app.setAnteHandler(encodingConfig.TxConfig, maxGasWanted) + + app.setAnteHandler(app.txConfig, maxGasWanted) // In v0.46, the SDK introduces _postHandlers_. PostHandlers are like // antehandlers, but are run _after_ the `runMsgs` execution. They are also @@ -697,6 +765,19 @@ func NewExampleApp( // upgrade. app.setPostHandler() + // At startup, after all modules have been registered, check that all prot + // annotations are correct. + protoFiles, err := proto.MergedRegistry() + if err != nil { + panic(err) + } + err = msgservice.ValidateProtoAnnotations(protoFiles) + if err != nil { + // TODO: Once we switch to using protoreflect-based antehandlers, we might + // want to panic here instead of logging a warning. + fmt.Fprintln(os.Stderr, err.Error()) + } + if loadLatest { if err := app.LoadLatestVersion(); err != nil { logger.Error("error on loading last version", "err", err) @@ -746,13 +827,17 @@ func (app *ExampleChain) setPostHandler() { func (app *ExampleChain) Name() string { return app.BaseApp.Name() } // BeginBlocker application updates every begin block -func (app *ExampleChain) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.ModuleManager.BeginBlock(ctx, req) +func (app *ExampleChain) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { + return app.ModuleManager.BeginBlock(ctx) } // EndBlocker application updates every end block -func (app *ExampleChain) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.ModuleManager.EndBlock(ctx, req) +func (app *ExampleChain) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) { + return app.ModuleManager.EndBlock(ctx) +} + +func (app *ExampleChain) FinalizeBlock(req *abci.RequestFinalizeBlock) (res *abci.ResponseFinalizeBlock, err error) { + return app.BaseApp.FinalizeBlock(req) } func (a *ExampleChain) Configurator() module.Configurator { @@ -760,15 +845,23 @@ func (a *ExampleChain) Configurator() module.Configurator { } // InitChainer application update at chain initialization -func (app *ExampleChain) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { - var genesisState GenesisState +func (app *ExampleChain) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { + var genesisState evmostypes.GenesisState if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()) + + if err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()); err != nil { + panic(err) + } + return app.ModuleManager.InitGenesis(ctx, app.appCodec, genesisState) } +func (app *ExampleChain) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + return app.ModuleManager.PreBlock(ctx) +} + // LoadHeight loads a particular height func (app *ExampleChain) LoadHeight(height int64) error { return app.LoadVersion(height) @@ -801,8 +894,13 @@ func (app *ExampleChain) TxConfig() client.TxConfig { } // DefaultGenesis returns a default genesis from the registered AppModuleBasic's. +// +// TODO: change all receivers to osApp func (a *ExampleChain) DefaultGenesis() map[string]json.RawMessage { - genesis := ModuleBasics.DefaultGenesis(a.appCodec) + genesis := a.BasicModuleManager.DefaultGenesis(a.appCodec) + + mintGenState := NewMintGenesisState() + genesis[minttypes.ModuleName] = a.appCodec.MustMarshalJSON(mintGenState) evmGenState := NewEVMGenesisState() genesis[evmtypes.ModuleName] = a.appCodec.MustMarshalJSON(evmGenState) @@ -857,13 +955,13 @@ func (app *ExampleChain) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + cmtservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register node gRPC service for grpc-gateway. nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register grpc-gateway routes for all modules. - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + app.BasicModuleManager.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // register swagger API from root so that other applications can override easily if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil { @@ -873,12 +971,12 @@ func (app *ExampleChain) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config. // RegisterTxService implements the Application.RegisterTxService method. func (app *ExampleChain) RegisterTxService(clientCtx client.Context) { - authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) + authtx.RegisterTxService(app.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) } // RegisterTendermintService implements the Application.RegisterTendermintService method. func (app *ExampleChain) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService( + cmtservice.RegisterTendermintService( clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, @@ -886,8 +984,8 @@ func (app *ExampleChain) RegisterTendermintService(clientCtx client.Context) { ) } -func (app *ExampleChain) RegisterNodeService(clientCtx client.Context) { - nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) +func (app *ExampleChain) RegisterNodeService(clientCtx client.Context, cfg config.Config) { + node.RegisterNodeService(clientCtx, app.GRPCQueryRouter(), cfg) } // --------------------------------------------- @@ -921,8 +1019,28 @@ func (app *ExampleChain) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { // GetTxConfig implements the TestingApp interface. func (app *ExampleChain) GetTxConfig() client.TxConfig { - cfg := encoding.MakeConfig(ModuleBasics) - return cfg.TxConfig + return app.txConfig +} + +// AutoCliOpts returns the autocli options for the app. +func (app *ExampleChain) AutoCliOpts() autocli.AppOptions { + modules := make(map[string]appmodule.AppModule, 0) + for _, m := range app.ModuleManager.Modules { + if moduleWithName, ok := m.(module.HasName); ok { + moduleName := moduleWithName.Name() + if appModule, ok := moduleWithName.(appmodule.AppModule); ok { + modules[moduleName] = appModule + } + } + } + + return autocli.AppOptions{ + Modules: modules, + ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.ModuleManager.Modules), + AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), + } } // GetMaccPerms returns a copy of the module account permissions @@ -975,8 +1093,11 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(govtypes.ModuleName) // ibc modules - paramsKeeper.Subspace(ibctransfertypes.ModuleName) - paramsKeeper.Subspace(ibcexported.ModuleName) + keyTable := ibcclienttypes.ParamKeyTable() + keyTable.RegisterParamSet(&ibcconnectiontypes.Params{}) + paramsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable) + paramsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable()) + // TODO: do we need a keytable? copied from Evmos repo // evmOS modules paramsKeeper.Subspace(evmtypes.ModuleName) diff --git a/example_chain/export.go b/example_chain/export.go index 5b27a0af..c13aaf38 100644 --- a/example_chain/export.go +++ b/example_chain/export.go @@ -8,6 +8,8 @@ import ( "fmt" "log" + storetypes "cosmossdk.io/store/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,17 +22,23 @@ import ( // file. func (app *ExampleChain) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContextLegacy(true, tmproto.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. height := app.LastBlockHeight() + 1 if forZeroHeight { height = 0 - app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) + if err := app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs); err != nil { + return servertypes.ExportedApp{}, err + } + } + + genState, err := app.ModuleManager.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + if err != nil { + return servertypes.ExportedApp{}, err } - genState := app.ModuleManager.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err @@ -49,7 +57,7 @@ func (app *ExampleChain) ExportAppStateAndValidators(forZeroHeight bool, jailAll // NOTE zero height genesis is a temporary feature which will be deprecated // // in favour of export at a block height -func (app *ExampleChain) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { +func (app *ExampleChain) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) error { applyAllowedAddrs := false // check if there is a allowed address list @@ -70,13 +78,19 @@ func (app *ExampleChain) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAd /* Handle fee distribution state. */ // withdraw all validator commission - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) + if err := app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, sdk.ValAddress(val.GetOperator())) return false - }) + }); err != nil { + return err + } // withdraw all delegator rewards - dels := app.StakingKeeper.GetAllDelegations(ctx) + dels, err := app.StakingKeeper.GetAllDelegations(ctx) + if err != nil { + return err + } + for _, delegation := range dels { valAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) if err != nil { @@ -99,18 +113,29 @@ func (app *ExampleChain) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAd ctx = ctx.WithBlockHeight(0) // reinitialize all validators - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + err = app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := app.DistrKeeper.GetFeePool(ctx) + scraps, err := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, sdk.ValAddress(val.GetOperator())) + if err != nil { + return true + } + feePool, err := app.DistrKeeper.FeePool.Get(ctx) + if err != nil { + return true + } feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - app.DistrKeeper.SetFeePool(ctx, feePool) - - if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()); err != nil { - panic(err) + err = app.DistrKeeper.FeePool.Set(ctx, feePool) + if err != nil { + return true } - return false + + err = app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, sdk.ValAddress(val.GetOperator())) + // this lets us stop in case there's an error + return err != nil }) + if err != nil { + return err + } // reinitialize all delegations for _, del := range dels { @@ -137,34 +162,51 @@ func (app *ExampleChain) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAd /* Handle staking state. */ // iterate through redelegations, reset creation height - app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { + var iterErr error + if err := app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { for i := range red.Entries { red.Entries[i].CreationHeight = 0 } - app.StakingKeeper.SetRedelegation(ctx, red) + if iterErr = app.StakingKeeper.SetRedelegation(ctx, red); iterErr != nil { + return true + } return false - }) + }); err != nil { + return err + } + + if iterErr != nil { + return iterErr + } // iterate through unbonding delegations, reset creation height - app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { + if err := app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { for i := range ubd.Entries { ubd.Entries[i].CreationHeight = 0 } - app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) + if iterErr = app.StakingKeeper.SetUnbondingDelegation(ctx, ubd); iterErr != nil { + return true + } return false - }) + }); err != nil { + return err + } + + if iterErr != nil { + return iterErr + } // Iterate through validators by power descending, reset bond heights, and // update bond intra-tx counters. store := ctx.KVStore(app.GetKey(stakingtypes.StoreKey)) - iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) counter := int16(0) for ; iter.Valid(); iter.Next() { addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key())) - validator, found := app.StakingKeeper.GetValidator(ctx, addr) - if !found { - panic("expected validator, not found") + validator, err := app.StakingKeeper.GetValidator(ctx, addr) + if err != nil { + return fmt.Errorf("expected validator %s not found. Error: %w", addr, err) } validator.UnbondingHeight = 0 @@ -172,16 +214,18 @@ func (app *ExampleChain) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAd validator.Jailed = true } - app.StakingKeeper.SetValidator(ctx, validator) + if err = app.StakingKeeper.SetValidator(ctx, validator); err != nil { + return err + } counter++ } if err := iter.Close(); err != nil { app.Logger().Error("error while closing the key-value store reverse prefix iterator: ", err) - return + return nil } - _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + _, err = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) if err != nil { log.Fatal(err) } @@ -189,12 +233,22 @@ func (app *ExampleChain) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAd /* Handle slashing state. */ // reset start height on signing infos - app.SlashingKeeper.IterateValidatorSigningInfos( + if err := app.SlashingKeeper.IterateValidatorSigningInfos( ctx, func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { info.StartHeight = 0 - app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) + if iterErr = app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info); iterErr != nil { + return true + } return false }, - ) + ); err != nil { + return err + } + + if iterErr != nil { + return iterErr + } + + return nil } diff --git a/example_chain/genesis.go b/example_chain/genesis.go index c659cf93..a7fcd5f8 100644 --- a/example_chain/genesis.go +++ b/example_chain/genesis.go @@ -6,14 +6,13 @@ package example_chain import ( "encoding/json" - "cosmossdk.io/simapp" - "github.com/evmos/os/encoding" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" erc20types "github.com/evmos/os/x/erc20/types" evmtypes "github.com/evmos/os/x/evm/types" ) // GenesisState of the blockchain is represented here as a map of raw json -// messages key'd by a identifier string. +// messages key'd by an identifier string. // The identifier is used to determine which module genesis information belongs // to so it may be appropriately routed during init chain. // Within this application default genesis information is retrieved from @@ -21,21 +20,6 @@ import ( // object provided to it during init. type GenesisState map[string]json.RawMessage -// NewDefaultGenesisState generates the default state for the application. -func NewDefaultGenesisState() simapp.GenesisState { - encCfg := encoding.MakeConfig(ModuleBasics) - - genesisState := ModuleBasics.DefaultGenesis(encCfg.Codec) - - evmGenState := NewEVMGenesisState() - genesisState[evmtypes.ModuleName] = encCfg.Codec.MustMarshalJSON(evmGenState) - - erc20GenState := NewErc20GenesisState() - genesisState[erc20types.ModuleName] = encCfg.Codec.MustMarshalJSON(erc20GenState) - - return genesisState -} - // NewEVMGenesisState returns the default genesis state for the EVM module. // // NOTE: for the example chain implementation we need to set the default EVM denomination @@ -59,3 +43,13 @@ func NewErc20GenesisState() *erc20types.GenesisState { return erc20GenState } + +// NewMintGenesisState returns the default genesis state for the mint module. +// +// NOTE: for the example chain implementation we are also adding a default minter. +func NewMintGenesisState() *minttypes.GenesisState { + mintGenState := minttypes.DefaultGenesisState() + mintGenState.Params.MintDenom = ExampleChainDenom + + return mintGenState +} diff --git a/example_chain/go.mod b/example_chain/go.mod index 1b8a6799..5062f5ec 100644 --- a/example_chain/go.mod +++ b/example_chain/go.mod @@ -3,45 +3,56 @@ module github.com/evmos/os/example_chain go 1.22.5 require ( - cosmossdk.io/api v0.3.1 + cosmossdk.io/api v0.7.5 + cosmossdk.io/client/v2 v2.0.0-beta.3 + cosmossdk.io/core v0.11.1 cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.4.0 cosmossdk.io/math v1.3.0 - cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d - cosmossdk.io/tools/rosetta v0.2.1 - github.com/cometbft/cometbft v0.37.10 - github.com/cometbft/cometbft-db v0.12.0 - github.com/cosmos/cosmos-sdk v0.47.13 + cosmossdk.io/store v1.1.0 + cosmossdk.io/tools/confix v0.1.2 + cosmossdk.io/x/evidence v0.1.1 + cosmossdk.io/x/feegrant v0.1.1 + cosmossdk.io/x/tx v0.13.4 + cosmossdk.io/x/upgrade v0.1.4 + github.com/cometbft/cometbft v0.38.11 + github.com/cosmos/cosmos-db v1.0.2 + github.com/cosmos/cosmos-sdk v0.50.9 github.com/cosmos/gogoproto v1.7.0 - github.com/cosmos/ibc-go/v7 v7.7.0 + github.com/cosmos/ibc-go/modules/capability v1.0.1 + github.com/cosmos/ibc-go/v8 v8.5.1 github.com/ethereum/go-ethereum v1.11.5 github.com/evmos/os v0.0.0-20240806115830-ab675cc0c776 + github.com/onsi/ginkgo/v2 v2.19.1 + github.com/onsi/gomega v1.34.0 github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 - github.com/spf13/viper v1.18.2 + github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 ) require ( - cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go v0.115.0 // indirect + cloud.google.com/go/auth v0.6.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.3.0 // indirect - cloud.google.com/go/iam v1.1.6 // indirect - cloud.google.com/go/storage v1.38.0 // indirect - cosmossdk.io/core v0.6.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/log v1.3.1 // indirect - filippo.io/edwards25519 v1.0.0 // indirect + cloud.google.com/go/iam v1.1.9 // indirect + cloud.google.com/go/storage v1.41.0 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/depinject v1.0.0 // indirect + cosmossdk.io/x/circuit v0.1.1 // indirect + filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect - github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect - github.com/DataDog/zstd v1.5.2 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.5 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/VictoriaMetrics/fastcache v1.6.0 // indirect - github.com/armon/go-metrics v0.4.1 // indirect github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect github.com/btcsuite/btcd v0.24.2 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/btcutil v1.1.6 // indirect @@ -55,17 +66,16 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect - github.com/confio/ics23/go v0.9.0 // indirect + github.com/cometbft/cometbft-db v0.12.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v0.21.0-alpha.1.0.20230904092046-df3db2d96583 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect - github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect - github.com/creachadair/taskgroup v0.4.2 // indirect + github.com/cosmos/iavl v1.1.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect + github.com/creachadair/atomicfile v0.3.1 // indirect + github.com/creachadair/tomledit v0.0.24 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set v1.8.0 // indirect @@ -73,12 +83,16 @@ require ( github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v4 v4.2.0 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect + github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 // indirect + github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect + github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/getsentry/sentry-go v0.23.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gin-gonic/gin v1.9.1 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect @@ -86,8 +100,9 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/go-stack/stack v1.8.1 // indirect - github.com/gobwas/ws v1.2.1 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -100,35 +115,39 @@ require ( github.com/google/flatbuffers v23.5.26+incompatible // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect + github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.2 // indirect - github.com/gorilla/handlers v1.5.1 // indirect + github.com/googleapis/gax-go/v2 v2.12.5 // indirect + github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.5 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.3.1 // indirect github.com/huandu/skiplist v1.2.0 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -138,30 +157,29 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/runc v1.1.12 // indirect - github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/prometheus/tsdb v0.10.0 // indirect - github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rjeczalik/notify v0.9.3 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.11.0 // indirect - github.com/rs/zerolog v1.32.0 // indirect + github.com/rs/zerolog v1.33.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect @@ -172,7 +190,7 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect github.com/tidwall/gjson v1.17.3 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect @@ -190,26 +208,28 @@ require ( go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect - go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.26.0 // indirect - golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect - golang.org/x/net v0.28.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/net v0.29.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.23.0 // indirect - golang.org/x/term v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/api v0.169.0 // indirect - google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect - google.golang.org/grpc v1.66.0 // indirect + golang.org/x/tools v0.23.0 // indirect + google.golang.org/api v0.186.0 // indirect + google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect + google.golang.org/grpc v1.66.2 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.7 // indirect pgregory.net/rapid v1.1.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect @@ -219,16 +239,19 @@ require ( replace github.com/evmos/os => .. replace ( + // need this replace when importing cosmos/rosetta pkg + cosmossdk.io/core => cosmossdk.io/core v0.11.0 + // need this replace to pick up the store changes (Copy func) in our cosmos-sdk fork + cosmossdk.io/store => github.com/evmos/cosmos-sdk/store v0.0.0-20240718141609-414cbd051fbe + // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // use Cosmos-SDK fork to enable Ledger functionality - github.com/cosmos/cosmos-sdk => github.com/evmos/cosmos-sdk v0.47.13-evmos + github.com/cosmos/cosmos-sdk => github.com/evmos/cosmos-sdk v0.50.9-evmos // use Evmos geth fork github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc4 // Security Advisory https://github.com/advisories/GHSA-h395-qcrw-5vmq github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1 // replace broken goleveldb github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - // need this replace with cosmos-sdk v0.47.11 (more info here https://github.com/cosmos/cosmos-sdk/issues/20159) - golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb ) diff --git a/example_chain/go.sum b/example_chain/go.sum index 4b460beb..da649ba6 100644 --- a/example_chain/go.sum +++ b/example_chain/go.sum @@ -30,8 +30,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= -cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= +cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -46,6 +46,10 @@ cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjby cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/auth v0.6.0 h1:5x+d6b5zdezZ7gmLWD1m/xNjnaQ2YDhmIz/HH3doy1g= +cloud.google.com/go/auth v0.6.0/go.mod h1:b4acV+jLQDyjwm4OXHYjNvRi4jvGBzHWJRtJcy+2P4g= +cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= +cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -107,8 +111,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= -cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/iam v1.1.9 h1:oSkYLVtVme29uGYrOcKcvJRht7cHJpYD09GM9JaR0TE= +cloud.google.com/go/iam v1.1.9/go.mod h1:Nt1eDWNYH9nGQg3d/mY7U1hvfGmsaG9o/kLGoLoLXjQ= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -169,8 +173,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= -cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= +cloud.google.com/go/storage v1.41.0 h1:RusiwatSu6lHeEXe3kglxakAmAbfV+rhtPqA6i8RBx0= +cloud.google.com/go/storage v1.41.0/go.mod h1:J1WCa/Z2FcgdEDuPUY8DxT5I+d9mFKsCepp5vR6Sq80= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -182,34 +186,47 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= -cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= -cosmossdk.io/core v0.6.1 h1:OBy7TI2W+/gyn2z40vVvruK3di+cAluinA6cybFbE7s= -cosmossdk.io/core v0.6.1/go.mod h1:g3MMBCBXtxbDWBURDVnJE7XML4BG5qENhs0gzkcpuFA= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/client/v2 v2.0.0-beta.3 h1:+TTuH0DwQYsUq2JFAl3fDZzKq5gQG7nt3dAattkjFDU= +cosmossdk.io/client/v2 v2.0.0-beta.3/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= -cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= -cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/log v1.4.0 h1:Ttt9d6fQ0GlktwhcysOeNiIjixW7l0rYBocmoXOb11k= +cosmossdk.io/log v1.4.0/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d h1:E/8y0oG3u9hBR8l4F9MtC0LdZIamPCUwUoLlrHrX86I= -cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d/go.mod h1:xbjky3L3DJEylaho6gXplkrMvJ5sFgv+qNX+Nn47bzY= -cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= -cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= +cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= +cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= +cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= +cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= +cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= +cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= +cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= +cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= +cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= -github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= -github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= @@ -240,8 +257,6 @@ github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= @@ -260,6 +275,8 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A= @@ -273,6 +290,7 @@ github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9Ur github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= github.com/btcsuite/btcd/btcutil v1.1.5/go.mod h1:PSZZ4UitpLBWzxGd5VGOrLnmOjtPP/a6HaFo12zMs00= github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ= @@ -286,8 +304,8 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= -github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= @@ -346,13 +364,10 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= -github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.37.10 h1:XPCneZExQC6dEMHl8w5ElcR+5ja6NfsOQ3sXz94MZpU= +github.com/cometbft/cometbft v0.38.11 h1:6bNDUB8/xq4uYonYwIfGc9OqK1ZH4NkdaMmR1LZIJqk= +github.com/cometbft/cometbft v0.38.11/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -361,31 +376,36 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= +github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= -github.com/cosmos/iavl v0.21.0-alpha.1.0.20230904092046-df3db2d96583 h1:3Matt7/LjZiZkIBPalYazOZcw2B05Ch14dU5TJyqJEc= -github.com/cosmos/iavl v0.21.0-alpha.1.0.20230904092046-df3db2d96583/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.7.0 h1:/ndLv4GiAkOaHQKpcoQyoGIZpGpT4d+9kjl5n3DsaVQ= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= +github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= +github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E= +github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs= +github.com/cosmos/ibc-go/v8 v8.5.1/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= -github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= -github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= -github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= -github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= +github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= +github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= +github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= +github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= @@ -423,6 +443,7 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf h1:Yt+4K30SdjOkRoRRm3vYNQgR+/ZIy0RmeUDZo7Y8zeQ= github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= @@ -435,6 +456,8 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= +github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= +github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -446,11 +469,16 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evmos/cosmos-sdk v0.47.13-evmos h1:Vm02nr60JUEwCSHRwXXws0G9xM5pnvl5vj5MsImHS/w= +github.com/evmos/cosmos-sdk v0.50.9-evmos h1:vUTybVFeaISEpklR37buax8w62rWy6EXZh51i4rKb40= +github.com/evmos/cosmos-sdk v0.50.9-evmos/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE= +github.com/evmos/cosmos-sdk/store v0.0.0-20240718141609-414cbd051fbe h1:CKvjP3CcWckOiwffAARb9qe+t0+VWoVDiicYkQMvZfQ= +github.com/evmos/cosmos-sdk/store v0.0.0-20240718141609-414cbd051fbe/go.mod h1:Bm6h8ZkYgVTytHK5vhHOMKw9OHyiumm3b1UbkYIJ/Ug= github.com/evmos/go-ethereum v1.10.26-evmos-rc4 h1:vwDVMScuB2KSu8ze5oWUuxm6v3bMUp6dL3PWvJNJY+I= github.com/evmos/go-ethereum v1.10.26-evmos-rc4/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= @@ -467,8 +495,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= -github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= -github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= @@ -476,6 +504,9 @@ github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -587,6 +618,7 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/flatbuffers v23.5.26+incompatible h1:M9dgRyhJemaM4Sw8+66GHBu8ioaQmyPLg1b8VwK5WJg= +github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -613,8 +645,8 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= -github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= +github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -655,13 +687,13 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= -github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= +github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA= +github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= @@ -681,11 +713,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -697,11 +724,17 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.7.5 h1:dT58k9hQ/vbxNMwoI5+xFYAJuv6152UNvdHokfI5wE4= github.com/hashicorp/go-getter v1.7.5/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -711,6 +744,7 @@ github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdv github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= @@ -718,8 +752,8 @@ github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -728,6 +762,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= @@ -742,6 +778,8 @@ github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXM github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= @@ -754,8 +792,8 @@ github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7Bd github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -786,15 +824,17 @@ github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6 github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= -github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -815,10 +855,14 @@ github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3v github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= @@ -828,12 +872,7 @@ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -875,8 +914,12 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= @@ -918,12 +961,12 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= -github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -944,35 +987,34 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic= github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= -github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= -github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -982,14 +1024,14 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1021,14 +1063,15 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= -github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -1045,6 +1088,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= @@ -1058,8 +1102,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= +github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.17.3 h1:bwWLZU7icoKRG+C+0PNwIKC6FCJO/Q3p2pZvuP0jN94= github.com/tidwall/gjson v1.17.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -1125,8 +1169,8 @@ go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= -go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= -go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= @@ -1138,8 +1182,8 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= -go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -1155,16 +1199,28 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1177,19 +1233,21 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1253,7 +1311,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1280,6 +1339,7 @@ golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1296,6 +1356,7 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1307,6 +1368,7 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1317,6 +1379,7 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1325,6 +1388,7 @@ golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1366,6 +1430,7 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1394,14 +1459,16 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1416,7 +1483,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1430,6 +1498,7 @@ golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1438,7 +1507,9 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1454,6 +1525,7 @@ golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1481,10 +1553,9 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1544,8 +1615,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= -google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= +google.golang.org/api v0.186.0 h1:n2OPp+PPXX0Axh4GuSsL5QL8xQCTb2oDwyzPnQvqUug= +google.golang.org/api v0.186.0/go.mod h1:hvRbBmgoje49RV3xqVXrmP6w93n6ehGgIVPYrGtBFFc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1660,10 +1731,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= -google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGrVb2hFXuQ+ZMbCNdakARIn/aHMmG8= +google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= +google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d h1:Aqf0fiIdUQEj0Gn9mKFFXoQfTTEaNopWpfVyYADxiSg= +google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:Od4k8V1LQSizPRUK4OzZ7TBE/20k+jPczUDAEyvn69Y= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1705,7 +1778,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= +google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1759,7 +1833,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/example_chain/local_node.sh b/example_chain/local_node.sh index de1b382b..1fde9803 100755 --- a/example_chain/local_node.sh +++ b/example_chain/local_node.sh @@ -81,8 +81,8 @@ if [[ $overwrite == "y" || $overwrite == "Y" ]]; then rm -rf "$HOMEDIR" # Set client config - osd config keyring-backend "$KEYRING" --home "$HOMEDIR" - osd config chain-id "$CHAINID" --home "$HOMEDIR" + osd config set client chain-id "$CHAINID" --home "$HOMEDIR" + osd config set client keyring-backend "$KEYRING" --home "$HOMEDIR" # myKey address 0x7cb61d4117ae31a12e393a1cfa3bac666481d02e | os10jmp6sgh4cc6zt3e8gw05wavvejgr5pwjnpcky VAL_KEY="mykey" @@ -165,6 +165,7 @@ if [[ $overwrite == "y" || $overwrite == "Y" ]]; then # Change proposal periods to pass within a reasonable time for local testing sed -i.bak 's/"max_deposit_period": "172800s"/"max_deposit_period": "30s"/g' "$GENESIS" sed -i.bak 's/"voting_period": "172800s"/"voting_period": "30s"/g' "$GENESIS" + sed -i.bak 's/"expedited_voting_period": "86400s"/"expedited_voting_period": "15s"/g' "$GENESIS" # set custom pruning settings sed -i.bak 's/pruning = "default"/pruning = "custom"/g' "$APP_TOML" diff --git a/example_chain/osd/cmd/root.go b/example_chain/osd/cmd/root.go index 6ee3aeca..92f2d14f 100644 --- a/example_chain/osd/cmd/root.go +++ b/example_chain/osd/cmd/root.go @@ -8,14 +8,17 @@ import ( "io" "os" - "cosmossdk.io/simapp/params" - rosettaCmd "cosmossdk.io/tools/rosetta/cmd" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" + "cosmossdk.io/store" + snapshottypes "cosmossdk.io/store/snapshots/types" + storetypes "cosmossdk.io/store/types" + confixcmd "cosmossdk.io/tools/confix/cmd" tmcfg "github.com/cometbft/cometbft/config" - "github.com/cometbft/cometbft/libs/log" + cmtcli "github.com/cometbft/cometbft/libs/cli" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/config" + clientcfg "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/pruning" @@ -24,18 +27,18 @@ import ( sdkserver "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" sdkmempool "github.com/cosmos/cosmos-sdk/types/mempool" + sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/types/tx/signing" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" evmoscmd "github.com/evmos/os/client" evmoscmdconfig "github.com/evmos/os/cmd/config" evmoskeyring "github.com/evmos/os/crypto/keyring" - evmosencoding "github.com/evmos/os/encoding" - evmoseip712 "github.com/evmos/os/ethereum/eip712" "github.com/evmos/os/example_chain" cmdcfg "github.com/evmos/os/example_chain/osd/config" evmosserver "github.com/evmos/os/server" @@ -46,11 +49,30 @@ import ( "github.com/spf13/viper" ) +type emptyAppOptions struct{} + +func (ao emptyAppOptions) Get(_ string) interface{} { return nil } + // NewRootCmd creates a new root command for osd. It is called once in the // main function. func NewRootCmd() *cobra.Command { - // Register SDK encodings as well as eth_secp256k1 and Amino - encodingConfig := evmosencoding.MakeConfig(example_chain.ModuleBasics) + // we "pre"-instantiate the application for getting the injected/configured encoding configuration + // and the CLI options for the modules + // add keyring to autocli opts + tempApp := example_chain.NewExampleApp( + log.NewNopLogger(), + dbm.NewMemDB(), + nil, + true, + emptyAppOptions{}, + ) + + encodingConfig := sdktestutil.TestEncodingConfig{ + InterfaceRegistry: tempApp.InterfaceRegistry(), + Codec: tempApp.AppCodec(), + TxConfig: tempApp.GetTxConfig(), + Amino: tempApp.LegacyAmino(), + } initClientCtx := client.Context{}. WithCodec(encodingConfig.Codec). @@ -58,7 +80,7 @@ func NewRootCmd() *cobra.Command { WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino). WithInput(os.Stdin). - WithAccountRetriever(types.AccountRetriever{}). + WithAccountRetriever(authtypes.AccountRetriever{}). WithBroadcastMode(flags.FlagBroadcastMode). WithHomeDir(example_chain.DefaultNodeHome). WithViper(""). // In simapp, we don't use any prefix for env variables. @@ -66,9 +88,6 @@ func NewRootCmd() *cobra.Command { WithKeyringOptions(evmoskeyring.Option()). WithLedgerHasProtobuf(true) - // add EIP-712 encoding - evmoseip712.SetEncodingConfig(encodingConfig) - rootCmd := &cobra.Command{ Use: "osd", Short: "exemplary evmOS app", @@ -82,11 +101,31 @@ func NewRootCmd() *cobra.Command { return err } - initClientCtx, err = config.ReadFromClientConfig(initClientCtx) + initClientCtx, err = clientcfg.ReadFromClientConfig(initClientCtx) if err != nil { return err } + // This needs to go after ReadFromClientConfig, as that function + // sets the RPC client needed for SIGN_MODE_TEXTUAL. This sign mode + // is only available if the client is online. + if !initClientCtx.Offline { + enabledSignModes := append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) //nolint:gocritic + txConfigOpts := tx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx), + } + txConfig, err := tx.NewTxConfigWithOptions( + initClientCtx.Codec, + txConfigOpts, + ) + if err != nil { + return err + } + + initClientCtx = initClientCtx.WithTxConfig(txConfig) + } + if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { return err } @@ -98,7 +137,15 @@ func NewRootCmd() *cobra.Command { }, } - initRootCmd(rootCmd, encodingConfig) + initRootCmd(rootCmd, tempApp) + + autoCliOpts := tempApp.AutoCliOpts() + initClientCtx, _ = clientcfg.ReadFromClientConfig(initClientCtx) + autoCliOpts.ClientCtx = initClientCtx + + if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { + panic(err) + } return rootCmd } @@ -156,14 +203,19 @@ func InitAppConfig(denom string) (string, interface{}) { return customAppTemplate, customAppConfig } -func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { +func initRootCmd(rootCmd *cobra.Command, osApp *example_chain.ExampleChain) { cfg := sdk.GetConfig() cfg.Seal() rootCmd.AddCommand( - genutilcli.InitCmd(example_chain.ModuleBasics, example_chain.DefaultNodeHome), + genutilcli.InitCmd( + osApp.BasicModuleManager, + example_chain.DefaultNodeHome, + ), + genutilcli.Commands(osApp.TxConfig(), osApp.BasicModuleManager, example_chain.DefaultNodeHome), + cmtcli.NewCompletionCmd(rootCmd, true), debug.Cmd(), - config.Cmd(), + confixcmd.ConfigCommand(), pruning.Cmd(newApp, example_chain.DefaultNodeHome), snapshot.Cmd(newApp), ) @@ -177,12 +229,13 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { ) // add evmOS key commands - rootCmd.AddCommand(evmoscmd.KeyCommands(example_chain.DefaultNodeHome)) + rootCmd.AddCommand( + evmoscmd.KeyCommands(example_chain.DefaultNodeHome), + ) // add keybase, auxiliary RPC, query, genesis, and tx child commands rootCmd.AddCommand( - rpc.StatusCommand(), - genesisCommand(encodingConfig), + sdkserver.StatusCommand(), queryCommand(), txCommand(), ) @@ -193,23 +246,10 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { if err != nil { panic(err) } - - // add rosetta - rootCmd.AddCommand(rosettaCmd.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec)) } func addModuleInitFlags(_ *cobra.Command) {} -// genesisCommand builds genesis-related `simd genesis` command. Users may provide application specific commands as a parameter -func genesisCommand(encodingConfig params.EncodingConfig, cmds ...*cobra.Command) *cobra.Command { - cmd := genutilcli.GenesisCoreCommand(encodingConfig.TxConfig, example_chain.ModuleBasics, example_chain.DefaultNodeHome) - - for _, subCmd := range cmds { - cmd.AddCommand(subCmd) - } - return cmd -} - func queryCommand() *cobra.Command { cmd := &cobra.Command{ Use: "query", @@ -222,14 +262,14 @@ func queryCommand() *cobra.Command { cmd.AddCommand( rpc.QueryEventForTxCmd(), - authcmd.GetAccountCmd(), rpc.ValidatorCommand(), - rpc.BlockCommand(), authcmd.QueryTxsByEventsCmd(), authcmd.QueryTxCmd(), + sdkserver.QueryBlockCmd(), + sdkserver.QueryBlockResultsCmd(), ) - example_chain.ModuleBasics.AddQueryCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") return cmd } @@ -252,10 +292,10 @@ func txCommand() *cobra.Command { authcmd.GetBroadcastCommand(), authcmd.GetEncodeCommand(), authcmd.GetDecodeCommand(), - authcmd.GetAuxToFeeCommand(), + authcmd.GetSimulateCmd(), ) - example_chain.ModuleBasics.AddTxCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") return cmd } @@ -267,7 +307,7 @@ func newApp( traceStore io.Writer, appOpts servertypes.AppOptions, ) servertypes.Application { - var cache sdk.MultiStorePersistentCache + var cache storetypes.MultiStorePersistentCache if cast.ToBool(appOpts.Get(sdkserver.FlagInterBlockCache)) { cache = store.NewCommitKVStoreCacheManager() @@ -309,7 +349,6 @@ func newApp( baseapp.SetSnapshot(snapshotStore, snapshotOptions), baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(sdkserver.FlagIAVLCacheSize))), baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(sdkserver.FlagDisableIAVLFastNode))), - baseapp.SetIAVLLazyLoading(cast.ToBool(appOpts.Get(sdkserver.FlagIAVLLazyLoading))), baseapp.SetChainID(chainID), } diff --git a/example_chain/osd/main.go b/example_chain/osd/main.go index 591af8ae..259265eb 100644 --- a/example_chain/osd/main.go +++ b/example_chain/osd/main.go @@ -4,9 +4,9 @@ package main import ( + "fmt" "os" - "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" sdk "github.com/cosmos/cosmos-sdk/types" examplechain "github.com/evmos/os/example_chain" @@ -20,13 +20,8 @@ func main() { rootCmd := cmd.NewRootCmd() if err := svrcmd.Execute(rootCmd, "osd", examplechain.DefaultNodeHome); err != nil { - switch e := err.(type) { - case server.ErrorCode: - os.Exit(e.Code) - - default: - os.Exit(1) - } + fmt.Fprintln(rootCmd.OutOrStderr(), err) + os.Exit(1) } } diff --git a/example_chain/precompiles.go b/example_chain/precompiles.go index 42752f45..a0ced57c 100644 --- a/example_chain/precompiles.go +++ b/example_chain/precompiles.go @@ -11,7 +11,7 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - channelkeeper "github.com/cosmos/ibc-go/v7/modules/core/04-channel/keeper" + channelkeeper "github.com/cosmos/ibc-go/v8/modules/core/04-channel/keeper" "github.com/ethereum/go-ethereum/common" bankprecompile "github.com/evmos/os/precompiles/bank" "github.com/evmos/os/precompiles/bech32" @@ -27,7 +27,7 @@ import ( const bech32PrecompileBaseGas = 6_000 -// AvailableStaticPrecompiles returns the list of all available static precompiled contracts from evmOS. +// NewAvailableStaticPrecompiles returns the list of all available static precompiled contracts from evmOS. // // NOTE: this should only be used during initialization of the Keeper. func NewAvailableStaticPrecompiles( diff --git a/example_chain/test_helpers.go b/example_chain/test_helpers.go index 7d393d37..574158e1 100644 --- a/example_chain/test_helpers.go +++ b/example_chain/test_helpers.go @@ -6,30 +6,24 @@ package example_chain import ( "encoding/json" "fmt" - "os" "testing" + "cosmossdk.io/log" "cosmossdk.io/math" - dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" - bam "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" - pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" "github.com/cosmos/cosmos-sdk/testutil/mock" - "github.com/cosmos/cosmos-sdk/testutil/network" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + ibctesting "github.com/cosmos/ibc-go/v8/testing" "github.com/evmos/os/cmd/config" chainconfig "github.com/evmos/os/example_chain/osd/config" feemarkettypes "github.com/evmos/os/x/feemarket/types" @@ -69,7 +63,7 @@ func setup(withGenesis bool, invCheckPeriod uint, chainID string) (*ExampleChain } // Setup initializes a new ExampleChain. A Nop logger is set in ExampleChain. -func Setup(t *testing.T, isCheckTx bool, chainID string) *ExampleChain { +func Setup(t *testing.T, chainID string) *ExampleChain { t.Helper() privVal := mock.NewPV() @@ -77,15 +71,15 @@ func Setup(t *testing.T, isCheckTx bool, chainID string) *ExampleChain { require.NoError(t, err) // create validator set with single validator - validator := tmtypes.NewValidator(pubKey, 1) - valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) + validator := cmttypes.NewValidator(pubKey, 1) + valSet := cmttypes.NewValidatorSet([]*cmttypes.Validator{validator}) // generate genesis account senderPrivKey := secp256k1.GenPrivKey() acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0) balance := banktypes.Balance{ Address: acc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000000000000))), + Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000000000000))), } app := SetupWithGenesisValSet(t, chainID, valSet, []authtypes.GenesisAccount{acc}, balance) @@ -97,7 +91,7 @@ func Setup(t *testing.T, isCheckTx bool, chainID string) *ExampleChain { // that also act as delegators. For simplicity, each validator is bonded with a delegation // of one consensus engine unit in the default token of the simapp from first genesis // account. A Nop logger is set in ExampleChain. -func SetupWithGenesisValSet(t *testing.T, chainID string, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *ExampleChain { +func SetupWithGenesisValSet(t *testing.T, chainID string, valSet *cmttypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *ExampleChain { t.Helper() app, genesisState := setup(true, 5, chainID) @@ -108,14 +102,16 @@ func SetupWithGenesisValSet(t *testing.T, chainID string, valSet *tmtypes.Valida require.NoError(t, err) // init chain will set the validator set and initialize the genesis accounts - app.InitChain( - abci.RequestInitChain{ + if _, err = app.InitChain( + &abci.RequestInitChain{ Validators: []abci.ValidatorUpdate{}, ConsensusParams: simtestutil.DefaultConsensusParams, AppStateBytes: stateBytes, ChainId: chainID, }, - ) + ); err != nil { + panic(fmt.Sprintf("app.InitChain failed: %v", err)) + } // NOTE: we are NOT committing the changes here as opposed to the function from simapp // because that would already adjust e.g. the base fee in the params. @@ -124,98 +120,6 @@ func SetupWithGenesisValSet(t *testing.T, chainID string, valSet *tmtypes.Valida return app } -// GenesisStateWithSingleValidator initializes GenesisState with a single validator and genesis accounts -// that also act as delegators. -func GenesisStateWithSingleValidator(t *testing.T, app *ExampleChain) GenesisState { - t.Helper() - - privVal := mock.NewPV() - pubKey, err := privVal.GetPubKey() - require.NoError(t, err) - - // create validator set with single validator - validator := tmtypes.NewValidator(pubKey, 1) - valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) - - // generate genesis account - senderPrivKey := secp256k1.GenPrivKey() - acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0) - balances := []banktypes.Balance{ - { - Address: acc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000000000000))), - }, - } - - genesisState := app.DefaultGenesis() - genesisState, err = simtestutil.GenesisStateWithValSet(app.AppCodec(), genesisState, valSet, []authtypes.GenesisAccount{acc}, balances...) - require.NoError(t, err) - - return genesisState -} - -// AddTestAddrsIncremental constructs and returns accNum amount of accounts with an -// initial balance of accAmt in random order -func AddTestAddrsIncremental(app *ExampleChain, ctx sdk.Context, accNum int, accAmt math.Int) []sdk.AccAddress { - return addTestAddrs(app, ctx, accNum, accAmt, simtestutil.CreateIncrementalAccounts) -} - -func addTestAddrs(app *ExampleChain, ctx sdk.Context, accNum int, accAmt math.Int, strategy simtestutil.GenerateAccountStrategy) []sdk.AccAddress { - testAddrs := strategy(accNum) - - initCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), accAmt)) - - for _, addr := range testAddrs { - initAccountWithCoins(app, ctx, addr, initCoins) - } - - return testAddrs -} - -func initAccountWithCoins(app *ExampleChain, ctx sdk.Context, addr sdk.AccAddress, coins sdk.Coins) { - err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) - if err != nil { - panic(err) - } - - err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, coins) - if err != nil { - panic(err) - } -} - -// NewTestNetworkFixture returns a new simapp AppConstructor for network simulation tests -func NewTestNetworkFixture() network.TestFixture { - dir, err := os.MkdirTemp("", "simapp") - if err != nil { - panic(fmt.Sprintf("failed creating temporary directory: %v", err)) - } - defer os.RemoveAll(dir) - - app := NewExampleApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(dir)) - - appCtr := func(val network.ValidatorI) servertypes.Application { - return NewExampleApp( - val.GetCtx().Logger, dbm.NewMemDB(), nil, true, - simtestutil.NewAppOptionsWithFlagHome(val.GetCtx().Config.RootDir), - bam.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)), - bam.SetMinGasPrices(val.GetAppConfig().MinGasPrices), - bam.SetChainID(val.GetCtx().Viper.GetString(flags.FlagChainID)), - ) - } - - return network.TestFixture{ - AppConstructor: appCtr, - GenesisState: app.DefaultGenesis(), - EncodingConfig: testutil.TestEncodingConfig{ - InterfaceRegistry: app.InterfaceRegistry(), - Codec: app.AppCodec(), - TxConfig: app.TxConfig(), - Amino: app.LegacyAmino(), - }, - } -} - // SetupTestingApp initializes the IBC-go testing application // need to keep this design to comply with the ibctesting SetupTestingApp func // and be able to set the chainID for the tests properly diff --git a/example_chain/testutil/abci.go b/example_chain/testutil/abci.go index 1b5f3257..75008a48 100644 --- a/example_chain/testutil/abci.go +++ b/example_chain/testutil/abci.go @@ -4,18 +4,18 @@ package testutil import ( + "fmt" "time" errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/evmos/os/encoding" app "github.com/evmos/os/example_chain" "github.com/evmos/os/testutil/tx" ) @@ -26,7 +26,7 @@ import ( // 2. DeliverTx // 3. EndBlock // 4. Commit -func Commit(ctx sdk.Context, app *app.ExampleChain, t time.Duration, vs *tmtypes.ValidatorSet) (sdk.Context, error) { +func Commit(ctx sdk.Context, app *app.ExampleChain, t time.Duration, vs *cmttypes.ValidatorSet) (sdk.Context, error) { header, err := commit(ctx, app, t, vs) if err != nil { return ctx, err @@ -38,7 +38,7 @@ func Commit(ctx sdk.Context, app *app.ExampleChain, t time.Duration, vs *tmtypes // CommitAndCreateNewCtx commits a block at a given time creating a ctx with the current settings // This is useful to keep test settings that could be affected by EndBlockers, e.g. // setting a baseFee == 0 and expecting this condition to continue after commit -func CommitAndCreateNewCtx(ctx sdk.Context, app *app.ExampleChain, t time.Duration, vs *tmtypes.ValidatorSet) (sdk.Context, error) { +func CommitAndCreateNewCtx(ctx sdk.Context, app *app.ExampleChain, t time.Duration, vs *cmttypes.ValidatorSet) (sdk.Context, error) { header, err := commit(ctx, app, t, vs) if err != nil { return ctx, err @@ -47,7 +47,7 @@ func CommitAndCreateNewCtx(ctx sdk.Context, app *app.ExampleChain, t time.Durati // NewContext function keeps the multistore // but resets other context fields // GasMeter is set as InfiniteGasMeter - newCtx := app.BaseApp.NewContext(false, header) + newCtx := app.BaseApp.NewContextLegacy(false, header) // set the reseted fields to keep the current ctx settings newCtx = newCtx.WithMinGasPrices(ctx.MinGasPrices()) newCtx = newCtx.WithEventManager(ctx.EventManager()) @@ -64,8 +64,8 @@ func DeliverTx( priv cryptotypes.PrivKey, gasPrice *sdkmath.Int, msgs ...sdk.Msg, -) (abci.ResponseDeliverTx, error) { - txConfig := encoding.MakeConfig(app.ModuleBasics).TxConfig +) (abci.ExecTxResult, error) { + txConfig := exampleApp.GetTxConfig() tx, err := tx.PrepareCosmosTx( ctx, exampleApp, @@ -79,7 +79,7 @@ func DeliverTx( }, ) if err != nil { - return abci.ResponseDeliverTx{}, err + return abci.ExecTxResult{}, err } return BroadcastTxBytes(exampleApp, txConfig.TxEncoder(), tx) } @@ -91,19 +91,19 @@ func DeliverEthTx( exampleApp *app.ExampleChain, priv cryptotypes.PrivKey, msgs ...sdk.Msg, -) (abci.ResponseDeliverTx, error) { - txConfig := encoding.MakeConfig(app.ModuleBasics).TxConfig +) (abci.ExecTxResult, error) { + txConfig := exampleApp.GetTxConfig() tx, err := tx.PrepareEthTx(txConfig, exampleApp, priv, msgs...) if err != nil { - return abci.ResponseDeliverTx{}, err + return abci.ExecTxResult{}, err } res, err := BroadcastTxBytes(exampleApp, txConfig.TxEncoder(), tx) if err != nil { return res, err } - codec := encoding.MakeConfig(app.ModuleBasics).Codec + codec := exampleApp.AppCodec() if _, err := CheckEthTxResponse(res, codec); err != nil { return res, err } @@ -118,17 +118,17 @@ func DeliverEthTxWithoutCheck( exampleApp *app.ExampleChain, priv cryptotypes.PrivKey, msgs ...sdk.Msg, -) (abci.ResponseDeliverTx, error) { - txConfig := encoding.MakeConfig(app.ModuleBasics).TxConfig +) (abci.ExecTxResult, error) { + txConfig := exampleApp.GetTxConfig() tx, err := tx.PrepareEthTx(txConfig, exampleApp, priv, msgs...) if err != nil { - return abci.ResponseDeliverTx{}, err + return abci.ExecTxResult{}, err } res, err := BroadcastTxBytes(exampleApp, txConfig.TxEncoder(), tx) if err != nil { - return abci.ResponseDeliverTx{}, err + return abci.ExecTxResult{}, err } return res, nil @@ -142,7 +142,7 @@ func CheckTx( gasPrice *sdkmath.Int, msgs ...sdk.Msg, ) (abci.ResponseCheckTx, error) { - txConfig := encoding.MakeConfig(app.ModuleBasics).TxConfig + txConfig := exampleApp.GetTxConfig() tx, err := tx.PrepareCosmosTx( ctx, @@ -168,7 +168,7 @@ func CheckEthTx( priv cryptotypes.PrivKey, msgs ...sdk.Msg, ) (abci.ResponseCheckTx, error) { - txConfig := encoding.MakeConfig(app.ModuleBasics).TxConfig + txConfig := exampleApp.GetTxConfig() tx, err := tx.PrepareEthTx(txConfig, exampleApp, priv, msgs...) if err != nil { @@ -178,29 +178,41 @@ func CheckEthTx( } // BroadcastTxBytes encodes a transaction and calls DeliverTx on the app. -func BroadcastTxBytes(app *app.ExampleChain, txEncoder sdk.TxEncoder, tx sdk.Tx) (abci.ResponseDeliverTx, error) { +func BroadcastTxBytes(app *app.ExampleChain, txEncoder sdk.TxEncoder, tx sdk.Tx) (abci.ExecTxResult, error) { // bz are bytes to be broadcasted over the network bz, err := txEncoder(tx) if err != nil { - return abci.ResponseDeliverTx{}, err + return abci.ExecTxResult{}, err } - req := abci.RequestDeliverTx{Tx: bz} - res := app.BaseApp.DeliverTx(req) - if res.Code != 0 { - return abci.ResponseDeliverTx{}, errorsmod.Wrapf(errortypes.ErrInvalidRequest, res.Log) + req := abci.RequestFinalizeBlock{Txs: [][]byte{bz}} + + res, err := app.BaseApp.FinalizeBlock(&req) + if err != nil { + return abci.ExecTxResult{}, err + } + if len(res.TxResults) != 1 { + return abci.ExecTxResult{}, fmt.Errorf("unexpected transaction results. Expected 1, got: %d", len(res.TxResults)) + } + txRes := res.TxResults[0] + if txRes.Code != 0 { + return abci.ExecTxResult{}, errorsmod.Wrapf(errortypes.ErrInvalidRequest, "log: %s", txRes.Log) } - return res, nil + return *txRes, nil } // commit is a private helper function that runs the EndBlocker logic, commits the changes, // updates the header, runs the BeginBlocker function and returns the updated header -func commit(ctx sdk.Context, app *app.ExampleChain, t time.Duration, vs *tmtypes.ValidatorSet) (tmproto.Header, error) { +func commit(ctx sdk.Context, app *app.ExampleChain, t time.Duration, vs *cmttypes.ValidatorSet) (tmproto.Header, error) { header := ctx.BlockHeader() + req := abci.RequestFinalizeBlock{Height: header.Height} if vs != nil { - res := app.EndBlock(abci.RequestEndBlock{Height: header.Height}) + res, err := app.FinalizeBlock(&req) + if err != nil { + return header, err + } nextVals, err := applyValSetChanges(vs, res.ValidatorUpdates) if err != nil { @@ -209,18 +221,22 @@ func commit(ctx sdk.Context, app *app.ExampleChain, t time.Duration, vs *tmtypes header.ValidatorsHash = vs.Hash() header.NextValidatorsHash = nextVals.Hash() } else { - app.EndBlocker(ctx, abci.RequestEndBlock{Height: header.Height}) + if _, err := app.EndBlocker(ctx); err != nil { + return header, err + } } - _ = app.Commit() + if _, err := app.Commit(); err != nil { + return header, err + } header.Height++ header.Time = header.Time.Add(t) header.AppHash = app.LastCommitID().Hash - app.BeginBlock(abci.RequestBeginBlock{ - Header: header, - }) + if _, err := app.BeginBlocker(ctx); err != nil { + return header, err + } return header, nil } @@ -233,18 +249,22 @@ func checkTxBytes(app *app.ExampleChain, txEncoder sdk.TxEncoder, tx sdk.Tx) (ab } req := abci.RequestCheckTx{Tx: bz} - res := app.BaseApp.CheckTx(req) + res, err := app.BaseApp.CheckTx(&req) + if err != nil { + return abci.ResponseCheckTx{}, err + } + if res.Code != 0 { return abci.ResponseCheckTx{}, errorsmod.Wrapf(errortypes.ErrInvalidRequest, res.Log) } - return res, nil + return *res, nil } -// applyValSetChanges takes in tmtypes.ValidatorSet and []abci.ValidatorUpdate and will return a new tmtypes.ValidatorSet which has the +// applyValSetChanges takes in cmttypes.ValidatorSet and []abci.ValidatorUpdate and will return a new cmttypes.ValidatorSet which has the // provided validator updates applied to the provided validator set. -func applyValSetChanges(valSet *tmtypes.ValidatorSet, valUpdates []abci.ValidatorUpdate) (*tmtypes.ValidatorSet, error) { - updates, err := tmtypes.PB2TM.ValidatorUpdates(valUpdates) +func applyValSetChanges(valSet *cmttypes.ValidatorSet, valUpdates []abci.ValidatorUpdate) (*cmttypes.ValidatorSet, error) { + updates, err := cmttypes.PB2TM.ValidatorUpdates(valUpdates) if err != nil { return nil, err } diff --git a/example_chain/testutil/contract.go b/example_chain/testutil/contract.go index cc7f41ff..8771d1b7 100644 --- a/example_chain/testutil/contract.go +++ b/example_chain/testutil/contract.go @@ -105,7 +105,7 @@ func DeployContractWithFactory( exampleApp *exampleapp.ExampleChain, priv cryptotypes.PrivKey, factoryAddress common.Address, -) (common.Address, abci.ResponseDeliverTx, error) { +) (common.Address, abci.ExecTxResult, error) { chainID := exampleApp.EVMKeeper.ChainID() from := common.BytesToAddress(priv.PubKey().Address().Bytes()) factoryNonce := exampleApp.EVMKeeper.GetNonce(ctx, factoryAddress) @@ -122,18 +122,18 @@ func DeployContractWithFactory( res, err := DeliverEthTx(exampleApp, priv, msgEthereumTx) if err != nil { - return common.Address{}, abci.ResponseDeliverTx{}, err + return common.Address{}, abci.ExecTxResult{}, err } if _, err := CheckEthTxResponse(res, exampleApp.AppCodec()); err != nil { - return common.Address{}, abci.ResponseDeliverTx{}, err + return common.Address{}, abci.ExecTxResult{}, err } return crypto.CreateAddress(factoryAddress, factoryNonce), res, err } // CheckEthTxResponse checks that the transaction was executed successfully -func CheckEthTxResponse(r abci.ResponseDeliverTx, cdc codec.Codec) ([]*evm.MsgEthereumTxResponse, error) { +func CheckEthTxResponse(r abci.ExecTxResult, cdc codec.Codec) ([]*evm.MsgEthereumTxResponse, error) { if !r.IsOK() { return nil, fmt.Errorf("tx failed. Code: %d, Logs: %s", r.Code, r.Log) } diff --git a/example_chain/testutil/eth_setup.go b/example_chain/testutil/eth_setup.go index e7e5b21a..736e42a5 100644 --- a/example_chain/testutil/eth_setup.go +++ b/example_chain/testutil/eth_setup.go @@ -7,13 +7,14 @@ import ( "encoding/json" "time" + evmostypes "github.com/evmos/os/types" + + "cosmossdk.io/log" "cosmossdk.io/math" - "cosmossdk.io/simapp" - dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" cmtypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -69,12 +70,12 @@ var EthDefaultConsensusParams = &cmtypes.ConsensusParams{ } // EthSetup initializes a new evmOS application. A Nop logger is set in ExampleChain. -func EthSetup(isCheckTx bool, chainID string, patchGenesis func(*exampleapp.ExampleChain, simapp.GenesisState) simapp.GenesisState) *exampleapp.ExampleChain { +func EthSetup(isCheckTx bool, chainID string, patchGenesis func(*exampleapp.ExampleChain, evmostypes.GenesisState) evmostypes.GenesisState) *exampleapp.ExampleChain { return EthSetupWithDB(isCheckTx, chainID, patchGenesis, dbm.NewMemDB()) } // EthSetupWithDB initializes a new ExampleChain. A Nop logger is set in ExampleChain. -func EthSetupWithDB(isCheckTx bool, chainID string, patchGenesis func(*exampleapp.ExampleChain, simapp.GenesisState) simapp.GenesisState, db dbm.DB) *exampleapp.ExampleChain { +func EthSetupWithDB(isCheckTx bool, chainID string, patchGenesis func(*exampleapp.ExampleChain, evmostypes.GenesisState) evmostypes.GenesisState, db dbm.DB) *exampleapp.ExampleChain { app := exampleapp.NewExampleApp(log.NewNopLogger(), db, nil, @@ -84,7 +85,7 @@ func EthSetupWithDB(isCheckTx bool, chainID string, patchGenesis func(*exampleap ) if !isCheckTx { // init chain must be called to stop deliverState from being nil - genesisState := NewTestGenesisState(app.AppCodec()) + genesisState := NewTestGenesisState(app) if patchGenesis != nil { genesisState = patchGenesis(app, genesisState) } @@ -96,7 +97,7 @@ func EthSetupWithDB(isCheckTx bool, chainID string, patchGenesis func(*exampleap // Initialize the chain app.InitChain( - abci.RequestInitChain{ + &abci.RequestInitChain{ ChainId: chainID, Validators: []abci.ValidatorUpdate{}, ConsensusParams: DefaultConsensusParams, @@ -114,7 +115,7 @@ func EthSetupWithDB(isCheckTx bool, chainID string, patchGenesis func(*exampleap // // TODO: are these different genesis functions necessary or can they all be refactored into one? // there's also other genesis state functions; some like app.DefaultGenesis() or others in test helpers only. -func NewTestGenesisState(codec codec.Codec) simapp.GenesisState { +func NewTestGenesisState(app *exampleapp.ExampleChain) evmostypes.GenesisState { privVal := mock.NewPV() pubKey, err := privVal.GetPubKey() if err != nil { @@ -132,14 +133,14 @@ func NewTestGenesisState(codec codec.Codec) simapp.GenesisState { Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000000000000))), } - genesisState := exampleapp.NewDefaultGenesisState() - return genesisStateWithValSet(codec, genesisState, valSet, []authtypes.GenesisAccount{acc}, balance) + genesisState := app.DefaultGenesis() + return genesisStateWithValSet(app.AppCodec(), genesisState, valSet, []authtypes.GenesisAccount{acc}, balance) } -func genesisStateWithValSet(codec codec.Codec, genesisState simapp.GenesisState, +func genesisStateWithValSet(codec codec.Codec, genesisState evmostypes.GenesisState, valSet *cmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, -) simapp.GenesisState { +) evmostypes.GenesisState { // set genesis accounts authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) genesisState[authtypes.ModuleName] = codec.MustMarshalJSON(authGenesis) @@ -172,7 +173,7 @@ func genesisStateWithValSet(codec codec.Codec, genesisState simapp.GenesisState, MinSelfDelegation: math.ZeroInt(), } validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), math.LegacyOneDec())) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), val.Address.String(), math.LegacyOneDec())) } // set validators and delegations stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations) diff --git a/example_chain/testutil/fund.go b/example_chain/testutil/fund.go index 28d036c3..d0efaba9 100644 --- a/example_chain/testutil/fund.go +++ b/example_chain/testutil/fund.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/constants" ) // FundAccount is a utility function that funds an account by minting and @@ -27,7 +27,7 @@ func FundAccount(ctx sdk.Context, bankKeeper bankkeeper.Keeper, addr sdk.AccAddr // TODO: as per Freddy these methods should be replaced with a bank transfer from a main account, not by minting in the process func FundAccountWithBaseDenom(ctx sdk.Context, bankKeeper bankkeeper.Keeper, addr sdk.AccAddress, amount int64) error { coins := sdk.NewCoins( - sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(amount)), + sdk.NewCoin(constants.ExampleAttoDenom, math.NewInt(amount)), ) return FundAccount(ctx, bankKeeper, addr, coins) } diff --git a/example_chain/testutil/integration.go b/example_chain/testutil/integration.go index 91cc990e..e5c77a40 100644 --- a/example_chain/testutil/integration.go +++ b/example_chain/testutil/integration.go @@ -54,15 +54,15 @@ func Delegate( priv *ethsecp256k1.PrivKey, delegateAmount sdk.Coin, validator stakingtypes.Validator, -) (abci.ResponseDeliverTx, error) { +) (abci.ExecTxResult, error) { accountAddress := sdk.AccAddress(priv.PubKey().Address().Bytes()) val, err := sdk.ValAddressFromBech32(validator.OperatorAddress) if err != nil { - return abci.ResponseDeliverTx{}, err + return abci.ExecTxResult{}, err } - delegateMsg := stakingtypes.NewMsgDelegate(accountAddress, val, delegateAmount) + delegateMsg := stakingtypes.NewMsgDelegate(accountAddress.String(), val.String(), delegateAmount) return DeliverTx(ctx, appEvmos, priv, nil, delegateMsg) } @@ -73,7 +73,7 @@ func Vote( priv *ethsecp256k1.PrivKey, proposalID uint64, voteOption govv1beta1.VoteOption, -) (abci.ResponseDeliverTx, error) { +) (abci.ExecTxResult, error) { accountAddress := sdk.AccAddress(priv.PubKey().Address().Bytes()) voteMsg := govv1beta1.NewMsgVote(accountAddress, proposalID, voteOption) diff --git a/go.mod b/go.mod index 384804c3..b02aa785 100644 --- a/go.mod +++ b/go.mod @@ -3,28 +3,37 @@ module github.com/evmos/os go 1.22.5 require ( + cosmossdk.io/api v0.7.5 + cosmossdk.io/core v0.11.1 cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.4.0 cosmossdk.io/math v1.3.0 - cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d - cosmossdk.io/tools/rosetta v0.2.1 - github.com/armon/go-metrics v0.4.1 + cosmossdk.io/store v1.1.0 + cosmossdk.io/tools/confix v0.1.2 + cosmossdk.io/x/evidence v0.1.1 + cosmossdk.io/x/feegrant v0.1.1 + cosmossdk.io/x/tx v0.13.4 github.com/btcsuite/btcd v0.24.2 github.com/btcsuite/btcd/btcutil v1.1.6 - github.com/cometbft/cometbft v0.37.10 - github.com/cometbft/cometbft-db v0.12.0 + github.com/cometbft/cometbft v0.38.11 + github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/cosmos-sdk v0.47.13 + github.com/cosmos/cosmos-sdk v0.50.9 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.7.0 - github.com/cosmos/ibc-go/v7 v7.7.0 + github.com/cosmos/ibc-go/modules/capability v1.0.1 + github.com/cosmos/ibc-go/v8 v8.5.1 + github.com/creachadair/tomledit v0.0.24 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf github.com/ethereum/go-ethereum v1.11.5 - github.com/evmos/os/example_chain v0.0.0-20240813084209-b051d35c2a55 + github.com/evmos/os/example_chain v0.0.0-20240924163020-b2a4187dad50 + github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.1 github.com/gorilla/websocket v1.5.3 github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/hashicorp/go-metrics v0.5.3 github.com/holiman/uint256 v1.3.1 github.com/improbable-eng/grpc-web v0.15.0 github.com/onsi/ginkgo/v2 v2.19.1 @@ -33,42 +42,47 @@ require ( github.com/rs/cors v1.11.0 github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 - github.com/spf13/viper v1.18.2 + github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 github.com/tidwall/gjson v1.17.3 github.com/tidwall/sjson v1.2.5 github.com/tyler-smith/go-bip39 v1.1.0 github.com/zondax/hid v0.9.2 - golang.org/x/crypto v0.26.0 - golang.org/x/exp v0.0.0-20230905200255-921286631fa9 - golang.org/x/net v0.28.0 - golang.org/x/text v0.17.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 - google.golang.org/grpc v1.66.0 + golang.org/x/crypto v0.27.0 + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 + golang.org/x/net v0.29.0 + golang.org/x/sync v0.8.0 + golang.org/x/text v0.18.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d + google.golang.org/grpc v1.66.2 google.golang.org/protobuf v1.34.2 sigs.k8s.io/yaml v1.4.0 ) require ( - cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go v0.115.0 // indirect + cloud.google.com/go/auth v0.6.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.3.0 // indirect - cloud.google.com/go/iam v1.1.6 // indirect - cloud.google.com/go/storage v1.38.0 // indirect - cosmossdk.io/api v0.3.1 // indirect - cosmossdk.io/core v0.6.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/log v1.3.1 // indirect - filippo.io/edwards25519 v1.0.0 // indirect + cloud.google.com/go/iam v1.1.9 // indirect + cloud.google.com/go/storage v1.41.0 // indirect + cosmossdk.io/client/v2 v2.0.0-beta.3 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/depinject v1.0.0 // indirect + cosmossdk.io/x/circuit v0.1.1 // indirect + cosmossdk.io/x/upgrade v0.1.4 // indirect + filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect - github.com/DataDog/zstd v1.5.2 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.5 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/VictoriaMetrics/fastcache v1.6.0 // indirect github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect @@ -80,15 +94,13 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect - github.com/confio/ics23/go v0.9.0 // indirect + github.com/cometbft/cometbft-db v0.12.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v0.21.0-alpha.1.0.20230904092046-df3db2d96583 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect - github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect - github.com/creachadair/taskgroup v0.4.2 // indirect + github.com/cosmos/iavl v1.1.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect + github.com/creachadair/atomicfile v0.3.1 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/deckarep/golang-set v1.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect @@ -99,9 +111,11 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect + github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/getsentry/sentry-go v0.23.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect @@ -116,7 +130,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/flatbuffers v23.5.26+incompatible // indirect @@ -126,28 +139,30 @@ require ( github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.2 // indirect - github.com/gorilla/handlers v1.5.1 // indirect + github.com/googleapis/gax-go/v2 v2.12.5 // indirect + github.com/gorilla/handlers v1.5.2 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.5 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.7.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/huandu/skiplist v1.2.0 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -158,27 +173,26 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/prometheus/tsdb v0.10.0 // indirect - github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rjeczalik/notify v0.9.3 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect - github.com/rs/zerolog v1.32.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/zerolog v1.33.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect @@ -191,7 +205,7 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect github.com/tklauser/go-sysconf v0.3.11 // indirect @@ -205,37 +219,41 @@ require ( go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect - go.uber.org/multierr v1.10.0 // indirect + go.uber.org/multierr v1.11.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.23.0 // indirect - golang.org/x/term v0.23.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/api v0.169.0 // indirect - google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + golang.org/x/tools v0.23.0 // indirect + google.golang.org/api v0.186.0 // indirect + google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.7 // indirect pgregory.net/rapid v1.1.0 // indirect ) -replace github.com/evmos/os/example_chain => ./example_chain +// // replace for local development +// replace github.com/evmos/os/example_chain => ./example_chain replace ( + // need this replace when importing cosmos/rosetta pkg + cosmossdk.io/core => cosmossdk.io/core v0.11.0 + // need this replace to pick up the store changes (Copy func) in our cosmos-sdk fork + cosmossdk.io/store => github.com/evmos/cosmos-sdk/store v0.0.0-20240718141609-414cbd051fbe + // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // use Cosmos-SDK fork to enable Ledger functionality - github.com/cosmos/cosmos-sdk => github.com/evmos/cosmos-sdk v0.47.13-evmos + github.com/cosmos/cosmos-sdk => github.com/evmos/cosmos-sdk v0.50.9-evmos // use Evmos geth fork github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc4 // Security Advisory https://github.com/advisories/GHSA-h395-qcrw-5vmq github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1 // replace broken goleveldb github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - // need this replace with cosmos-sdk v0.47.11 (more info here https://github.com/cosmos/cosmos-sdk/issues/20159) - golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb ) diff --git a/go.sum b/go.sum index 4829e48c..76e9a011 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= -cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= +cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -46,6 +46,10 @@ cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjby cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/auth v0.6.0 h1:5x+d6b5zdezZ7gmLWD1m/xNjnaQ2YDhmIz/HH3doy1g= +cloud.google.com/go/auth v0.6.0/go.mod h1:b4acV+jLQDyjwm4OXHYjNvRi4jvGBzHWJRtJcy+2P4g= +cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= +cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -107,8 +111,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= -cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/iam v1.1.9 h1:oSkYLVtVme29uGYrOcKcvJRht7cHJpYD09GM9JaR0TE= +cloud.google.com/go/iam v1.1.9/go.mod h1:Nt1eDWNYH9nGQg3d/mY7U1hvfGmsaG9o/kLGoLoLXjQ= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -169,8 +173,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= -cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= +cloud.google.com/go/storage v1.41.0 h1:RusiwatSu6lHeEXe3kglxakAmAbfV+rhtPqA6i8RBx0= +cloud.google.com/go/storage v1.41.0/go.mod h1:J1WCa/Z2FcgdEDuPUY8DxT5I+d9mFKsCepp5vR6Sq80= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -182,34 +186,47 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= -cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= -cosmossdk.io/core v0.6.1 h1:OBy7TI2W+/gyn2z40vVvruK3di+cAluinA6cybFbE7s= -cosmossdk.io/core v0.6.1/go.mod h1:g3MMBCBXtxbDWBURDVnJE7XML4BG5qENhs0gzkcpuFA= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/client/v2 v2.0.0-beta.3 h1:+TTuH0DwQYsUq2JFAl3fDZzKq5gQG7nt3dAattkjFDU= +cosmossdk.io/client/v2 v2.0.0-beta.3/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= -cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= -cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/log v1.4.0 h1:Ttt9d6fQ0GlktwhcysOeNiIjixW7l0rYBocmoXOb11k= +cosmossdk.io/log v1.4.0/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d h1:E/8y0oG3u9hBR8l4F9MtC0LdZIamPCUwUoLlrHrX86I= -cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d/go.mod h1:xbjky3L3DJEylaho6gXplkrMvJ5sFgv+qNX+Nn47bzY= -cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= -cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= +cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= +cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= +cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= +cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= +cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= +cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= +cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= +cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= +cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= -github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= -github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= @@ -240,8 +257,6 @@ github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= @@ -260,6 +275,8 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A= @@ -287,8 +304,8 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= -github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= @@ -347,14 +364,10 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= -github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.37.10 h1:XPCneZExQC6dEMHl8w5ElcR+5ja6NfsOQ3sXz94MZpU= -github.com/cometbft/cometbft v0.37.10/go.mod h1:j0Q3RqrCd+cztWCugs3obbzC4NyHGBPZZjtm/fWV00I= +github.com/cometbft/cometbft v0.38.11 h1:6bNDUB8/xq4uYonYwIfGc9OqK1ZH4NkdaMmR1LZIJqk= +github.com/cometbft/cometbft v0.38.11/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -363,9 +376,10 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= +github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -373,23 +387,25 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v0.21.0-alpha.1.0.20230904092046-df3db2d96583 h1:3Matt7/LjZiZkIBPalYazOZcw2B05Ch14dU5TJyqJEc= -github.com/cosmos/iavl v0.21.0-alpha.1.0.20230904092046-df3db2d96583/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.7.0 h1:/ndLv4GiAkOaHQKpcoQyoGIZpGpT4d+9kjl5n3DsaVQ= -github.com/cosmos/ibc-go/v7 v7.7.0/go.mod h1:zzFhtp9g9RrN/UxXWrdUu5VyonBALCAHujXQCzrZSu8= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= +github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= +github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E= +github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs= +github.com/cosmos/ibc-go/v8 v8.5.1/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= -github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= -github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= -github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= -github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= +github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= +github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= +github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= +github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= @@ -440,6 +456,8 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= +github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= +github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -451,12 +469,18 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evmos/cosmos-sdk v0.47.13-evmos h1:Vm02nr60JUEwCSHRwXXws0G9xM5pnvl5vj5MsImHS/w= -github.com/evmos/cosmos-sdk v0.47.13-evmos/go.mod h1:pYMzhTfKFn9AJB5X64Epwe9NgYk0y3v7XN8Ks5xqWoo= +github.com/evmos/cosmos-sdk v0.50.9-evmos h1:vUTybVFeaISEpklR37buax8w62rWy6EXZh51i4rKb40= +github.com/evmos/cosmos-sdk v0.50.9-evmos/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE= +github.com/evmos/cosmos-sdk/store v0.0.0-20240718141609-414cbd051fbe h1:CKvjP3CcWckOiwffAARb9qe+t0+VWoVDiicYkQMvZfQ= +github.com/evmos/cosmos-sdk/store v0.0.0-20240718141609-414cbd051fbe/go.mod h1:Bm6h8ZkYgVTytHK5vhHOMKw9OHyiumm3b1UbkYIJ/Ug= github.com/evmos/go-ethereum v1.10.26-evmos-rc4 h1:vwDVMScuB2KSu8ze5oWUuxm6v3bMUp6dL3PWvJNJY+I= github.com/evmos/go-ethereum v1.10.26-evmos-rc4/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo= +github.com/evmos/os/example_chain v0.0.0-20240924163020-b2a4187dad50 h1:zWJYHc0WXE5YnuzYJnUzjMwuloxSz5ALCoNSzcuhKsA= +github.com/evmos/os/example_chain v0.0.0-20240924163020-b2a4187dad50/go.mod h1:+SPMqw9wtbWO3jG02uLbLtVVjMHBldmXTN51kxbWqJ8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= @@ -475,8 +499,8 @@ github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= -github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= @@ -484,6 +508,9 @@ github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -622,8 +649,8 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= -github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= +github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -664,13 +691,13 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= -github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= +github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA= +github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= @@ -690,11 +717,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -706,11 +728,17 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.7.5 h1:dT58k9hQ/vbxNMwoI5+xFYAJuv6152UNvdHokfI5wE4= github.com/hashicorp/go-getter v1.7.5/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -728,8 +756,8 @@ github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -738,6 +766,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= @@ -752,6 +782,8 @@ github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXM github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= @@ -764,8 +796,8 @@ github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7Bd github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -796,8 +828,8 @@ github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6 github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= -github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= @@ -827,10 +859,14 @@ github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3v github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= @@ -840,12 +876,7 @@ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -887,8 +918,12 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= @@ -930,12 +965,12 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= -github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -956,35 +991,34 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic= github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= -github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= -github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -994,14 +1028,14 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1040,8 +1074,8 @@ github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3k github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= -github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1060,6 +1094,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= @@ -1073,8 +1108,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= +github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.17.3 h1:bwWLZU7icoKRG+C+0PNwIKC6FCJO/Q3p2pZvuP0jN94= github.com/tidwall/gjson v1.17.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -1140,8 +1175,8 @@ go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= -go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= -go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= @@ -1153,8 +1188,8 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= -go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -1170,17 +1205,28 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1193,19 +1239,21 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1269,8 +1317,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1326,6 +1374,7 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1336,6 +1385,7 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1344,6 +1394,7 @@ golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1385,6 +1436,7 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1413,16 +1465,16 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1437,8 +1489,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1452,6 +1504,7 @@ golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1460,7 +1513,9 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1476,6 +1531,7 @@ golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1503,10 +1559,9 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1566,8 +1621,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= -google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= +google.golang.org/api v0.186.0 h1:n2OPp+PPXX0Axh4GuSsL5QL8xQCTb2oDwyzPnQvqUug= +google.golang.org/api v0.186.0/go.mod h1:hvRbBmgoje49RV3xqVXrmP6w93n6ehGgIVPYrGtBFFc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1682,12 +1737,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= -google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU= -google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGrVb2hFXuQ+ZMbCNdakARIn/aHMmG8= +google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= +google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d h1:Aqf0fiIdUQEj0Gn9mKFFXoQfTTEaNopWpfVyYADxiSg= +google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:Od4k8V1LQSizPRUK4OzZ7TBE/20k+jPczUDAEyvn69Y= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1729,8 +1784,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= -google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= +google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1784,7 +1839,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/go.work b/go.work index c788cbae..f1c98a24 100644 --- a/go.work +++ b/go.work @@ -4,3 +4,5 @@ use ( . example_chain ) + +replace github.com/cosmos/cosmos-sdk => github.com/evmos/cosmos-sdk v0.50.9-evmos diff --git a/go.work.sum b/go.work.sum index 53b2435b..bc61d2cf 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,5 +1,9 @@ +4d63.com/gocheckcompilerdirectives v1.2.1 h1:AHcMYuw56NPjq/2y615IGg2kYkBdTvOaojYCBcRE7MA= +4d63.com/gocheckcompilerdirectives v1.2.1/go.mod h1:yjDJSxmDTtIHHCqX0ufRYZDL6vQtMG7tJdKVeWwsqvs= 4d63.com/gochecknoglobals v0.1.0 h1:zeZSRqj5yCg28tCkIV/z/lWbwvNm5qnKVS15PI8nhD0= 4d63.com/gochecknoglobals v0.1.0/go.mod h1:wfdC5ZjKSPr7CybKEcgJhUOgeAQW1+7WcyK8OvUilfo= +4d63.com/gochecknoglobals v0.2.1 h1:1eiorGsgHOFOuoOiJDy2psSrQbRdIHrlge0IJIkUgDc= +4d63.com/gochecknoglobals v0.2.1/go.mod h1:KRE8wtJB3CXCsb1xy421JfTHIIbmT3U5ruxw2Qu8fSU= cel.dev/expr v0.15.0 h1:O1jzfJCQBfL5BFoYktaxwIhuttaQPsVWerH9/EEKx0w= cel.dev/expr v0.15.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg= cloud.google.com/go v0.0.0-20170206221025-ce650573d812/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= @@ -7,263 +11,526 @@ cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxK cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= +cloud.google.com/go v0.112.2/go.mod h1:iEqjp//KquGIJV/m+Pk3xecgKNhV+ry+vVTsy4TbDms= cloud.google.com/go/accessapproval v1.7.5 h1:uzmAMSgYcnlHa9X9YSQZ4Q1wlfl4NNkZyQgho1Z6p04= cloud.google.com/go/accessapproval v1.7.5/go.mod h1:g88i1ok5dvQ9XJsxpUInWWvUBrIZhyPDPbk4T01OoJ0= +cloud.google.com/go/accessapproval v1.7.8 h1:4P74qfEnwspOs5lEOn6o6lCkleNQfD0b+O/D1kY7hO0= +cloud.google.com/go/accessapproval v1.7.8/go.mod h1:7xkMRHJmgTAb08b6mKdyYTfPBTwiw4XvnI1l+jTvrdk= cloud.google.com/go/accesscontextmanager v1.8.5 h1:2GLNaNu9KRJhJBFTIVRoPwk6xE5mUDgD47abBq4Zp/I= cloud.google.com/go/accesscontextmanager v1.8.5/go.mod h1:TInEhcZ7V9jptGNqN3EzZ5XMhT6ijWxTGjzyETwmL0Q= +cloud.google.com/go/accesscontextmanager v1.8.8 h1:MJuGDYmvtV7lcaQp2NLOTtqRR16V+v/PM+DyvVc1u1w= +cloud.google.com/go/accesscontextmanager v1.8.8/go.mod h1:XmIMhWxcTG9GTEAOBm3geKRKdVxM35FY10FSBS8zaDs= cloud.google.com/go/aiplatform v1.60.0 h1:0cSrii1ZeLr16MbBoocyy5KVnrSdiQ3KN/vtrTe7RqE= cloud.google.com/go/aiplatform v1.60.0/go.mod h1:eTlGuHOahHprZw3Hio5VKmtThIOak5/qy6pzdsqcQnM= +cloud.google.com/go/aiplatform v1.68.0 h1:EPPqgHDJpBZKRvv+OsB3cr0jYz3EL2pZ+802rBPcG8U= +cloud.google.com/go/aiplatform v1.68.0/go.mod h1:105MFA3svHjC3Oazl7yjXAmIR89LKhRAeNdnDKJczME= cloud.google.com/go/analytics v0.23.0 h1:Q+y94XH84jM8SK8O7qiY/PJRexb6n7dRbQ6PiUa4YGM= cloud.google.com/go/analytics v0.23.0/go.mod h1:YPd7Bvik3WS95KBok2gPXDqQPHy08TsCQG6CdUCb+u0= +cloud.google.com/go/analytics v0.23.3 h1:LbZ2MgTv7QqT/E8IQl+cEKQEg/I9nHVdPg2w6HvwILA= +cloud.google.com/go/analytics v0.23.3/go.mod h1:oZsWmFn+JlADKC2gc6/LYXYPh6gx+K14tymvQuT3sS4= cloud.google.com/go/apigateway v1.6.5 h1:sPXnpk+6TneKIrjCjcpX5YGsAKy3PTdpIchoj8/74OE= cloud.google.com/go/apigateway v1.6.5/go.mod h1:6wCwvYRckRQogyDDltpANi3zsCDl6kWi0b4Je+w2UiI= +cloud.google.com/go/apigateway v1.6.8 h1:pLCrbTjAsgIZx2izq7UlA8k8HVAnvuwXpLdL1llZjaA= +cloud.google.com/go/apigateway v1.6.8/go.mod h1:j383LuqwSSi7WFJwQj8zRTsU9vCiR+GkWUHlJ6GerR0= cloud.google.com/go/apigeeconnect v1.6.5 h1:CrfIKv9Go3fh/QfQgisU3MeP90Ww7l/sVGmr3TpECo8= cloud.google.com/go/apigeeconnect v1.6.5/go.mod h1:MEKm3AiT7s11PqTfKE3KZluZA9O91FNysvd3E6SJ6Ow= +cloud.google.com/go/apigeeconnect v1.6.8 h1:5lVElASnQcO6xQ+gLA4HxKJ1/75x/QyPoeGAIbiAQYE= +cloud.google.com/go/apigeeconnect v1.6.8/go.mod h1:+XjRq6uKsjrswBCZf+BCWY7u0gJ9mRP9c34qqGVQBAw= cloud.google.com/go/apigeeregistry v0.8.3 h1:C+QU2K+DzDjk4g074ouwHQGkoff1h5OMQp6sblCVreQ= cloud.google.com/go/apigeeregistry v0.8.3/go.mod h1:aInOWnqF4yMQx8kTjDqHNXjZGh/mxeNlAf52YqtASUs= +cloud.google.com/go/apigeeregistry v0.8.6 h1:C/BG5lrTisXFsoEpwKJtmpxdB934yzGRV49VxTaauW8= +cloud.google.com/go/apigeeregistry v0.8.6/go.mod h1:Pvk3LJqhxKgkTyynwYK7MuJCbkTG0/JbisSazyu77FM= +cloud.google.com/go/apikeys v0.5.0 h1:+77+/BhFuU476/s78kYiWHObxaYBHsC6Us+Gd7W9pJ4= +cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= cloud.google.com/go/appengine v1.8.5 h1:l2SviT44zWQiOv8bPoMBzW0vOcMO22iO0s+nVtVhdts= cloud.google.com/go/appengine v1.8.5/go.mod h1:uHBgNoGLTS5di7BvU25NFDuKa82v0qQLjyMJLuPQrVo= +cloud.google.com/go/appengine v1.8.8 h1:Nzc51iOiW9eqH3Nifc5/MU3qHN618+9DXudXLHiEXfE= +cloud.google.com/go/appengine v1.8.8/go.mod h1:l9QQeNodTtyhYz8Sd3cTZrocgj4y7yap5t6b9XD74HQ= cloud.google.com/go/area120 v0.8.5 h1:vTs08KPLN/iMzTbxpu5ciL06KcsrVPMjz4IwcQyZ4uY= cloud.google.com/go/area120 v0.8.5/go.mod h1:BcoFCbDLZjsfe4EkCnEq1LKvHSK0Ew/zk5UFu6GMyA0= +cloud.google.com/go/area120 v0.8.8 h1:Nzoz79LVCv6LkvJ+uxfBgAzJUvlFl32pQIQB5c/yKds= +cloud.google.com/go/area120 v0.8.8/go.mod h1:L/VYdKO0xpgWvRgVwH4fiGIN2wBuBGHu15bSs1FnSRw= cloud.google.com/go/artifactregistry v1.14.7 h1:W9sVlyb1VRcUf83w7aM3yMsnp4HS4PoyGqYQNG0O5lI= cloud.google.com/go/artifactregistry v1.14.7/go.mod h1:0AUKhzWQzfmeTvT4SjfI4zjot72EMfrkvL9g9aRjnnM= +cloud.google.com/go/artifactregistry v1.14.10 h1:2f8zwDdIU7wPM3915/Q1VMceZj0ALZgQgU57jqKVLNE= +cloud.google.com/go/artifactregistry v1.14.10/go.mod h1:i1jzotcdypXuEx6oG7+y0moY7TWR+wBaOu6VA3fGefU= cloud.google.com/go/asset v1.17.2 h1:xgFnBP3luSbUcC9RWJvb3Zkt+y/wW6PKwPHr3ssnIP8= cloud.google.com/go/asset v1.17.2/go.mod h1:SVbzde67ehddSoKf5uebOD1sYw8Ab/jD/9EIeWg99q4= +cloud.google.com/go/asset v1.19.2 h1:xfcoQJw7TQQ0iAV+RhtwNO80gcBLXFCVbvJlP21aJwM= +cloud.google.com/go/asset v1.19.2/go.mod h1:JJbMl9L3cWvgiBC0vRUl/uUJ1KLJD1zw4pKRsV/wQSI= cloud.google.com/go/assuredworkloads v1.11.5 h1:gCrN3IyvqY3cP0wh2h43d99CgH3G+WYs9CeuFVKChR8= cloud.google.com/go/assuredworkloads v1.11.5/go.mod h1:FKJ3g3ZvkL2D7qtqIGnDufFkHxwIpNM9vtmhvt+6wqk= +cloud.google.com/go/assuredworkloads v1.11.8 h1:3fASwFmEeUokum4LLGwZ5xB1Jh3QHgLkHtEqGpyJag4= +cloud.google.com/go/assuredworkloads v1.11.8/go.mod h1:VDrDAh06vxYbpTJQEcZf9ueXb2S++Bm3F2Tw+liBJBk= +cloud.google.com/go/auth v0.3.0/go.mod h1:lBv6NKTWp8E3LPzmO1TbiiRKc4drLOfHsgmlH9ogv5w= +cloud.google.com/go/auth v0.5.1/go.mod h1:vbZT8GjzDf3AVqCcQmqeeM32U9HBFc32vVVAbwDsa6s= cloud.google.com/go/automl v1.13.5 h1:ijiJy9sYWh75WrqImXsfWc1e3HR3iO+ef9fvW03Ig/4= cloud.google.com/go/automl v1.13.5/go.mod h1:MDw3vLem3yh+SvmSgeYUmUKqyls6NzSumDm9OJ3xJ1Y= +cloud.google.com/go/automl v1.13.8 h1:zo3dYyuUqKltYbdhIG08poncaYTwJdlgLvKYM7QiwTE= +cloud.google.com/go/automl v1.13.8/go.mod h1:8O5i0OHiqRSnucux40rSMOfnBIarGxLMTQMOjpGxbB8= cloud.google.com/go/baremetalsolution v1.2.4 h1:LFydisRmS7hQk9P/YhekwuZGqb45TW4QavcrMToWo5A= cloud.google.com/go/baremetalsolution v1.2.4/go.mod h1:BHCmxgpevw9IEryE99HbYEfxXkAEA3hkMJbYYsHtIuY= +cloud.google.com/go/baremetalsolution v1.2.7 h1:8MlSaPL3BdAlvE9ERayO0JtlxtA3iYa8p+K7LW6J/0Q= +cloud.google.com/go/baremetalsolution v1.2.7/go.mod h1:KvhbjdZzE1SR/GpgsE90pNWiglDY1vjzClYHB3NZseE= cloud.google.com/go/batch v1.8.0 h1:2HK4JerwVaIcCh/lJiHwh6+uswPthiMMWhiSWLELayk= cloud.google.com/go/batch v1.8.0/go.mod h1:k8V7f6VE2Suc0zUM4WtoibNrA6D3dqBpB+++e3vSGYc= +cloud.google.com/go/batch v1.8.8 h1:Ve5iNh24Kc3d5atz+sJ8o8HZrwxkl5fSm11Ve5Jg2f4= +cloud.google.com/go/batch v1.8.8/go.mod h1:PvTk3Rq5mf6RFcQtF9MZEsv9LG9aUjlUuqlq6IJ866o= cloud.google.com/go/beyondcorp v1.0.4 h1:qs0J0O9Ol2h1yA0AU+r7l3hOCPzs2MjE1d6d/kaHIKo= cloud.google.com/go/beyondcorp v1.0.4/go.mod h1:Gx8/Rk2MxrvWfn4WIhHIG1NV7IBfg14pTKv1+EArVcc= +cloud.google.com/go/beyondcorp v1.0.7 h1:rmYOeaeYiD19aiNp56okLDWGgzvz943h6P7/dkHi4Tc= +cloud.google.com/go/beyondcorp v1.0.7/go.mod h1:qiWZ0SIhhAB7wn5Vun0bNKdexl596QclVwWEUL+keK8= cloud.google.com/go/bigquery v1.59.1 h1:CpT+/njKuKT3CEmswm6IbhNu9u35zt5dO4yPDLW+nG4= cloud.google.com/go/bigquery v1.59.1/go.mod h1:VP1UJYgevyTwsV7desjzNzDND5p6hZB+Z8gZJN1GQUc= +cloud.google.com/go/bigquery v1.61.0 h1:w2Goy9n6gh91LVi6B2Sc+HpBl8WbWhIyzdvVvrAuEIw= +cloud.google.com/go/bigquery v1.61.0/go.mod h1:PjZUje0IocbuTOdq4DBOJLNYB0WF3pAKBHzAYyxCwFo= cloud.google.com/go/billing v1.18.2 h1:oWUEQvuC4JvtnqLZ35zgzdbuHt4Itbftvzbe6aEyFdE= cloud.google.com/go/billing v1.18.2/go.mod h1:PPIwVsOOQ7xzbADCwNe8nvK776QpfrOAUkvKjCUcpSE= +cloud.google.com/go/billing v1.18.6 h1:PDhxE/EhGGgM/HYKvjrGlxi9Sa0J57q3Qrp+C/JnxG0= +cloud.google.com/go/billing v1.18.6/go.mod h1:3aQtpAKmI0wPI4Dcele7cp87jg59EjOA37y7iGrRLIc= cloud.google.com/go/binaryauthorization v1.8.1 h1:1jcyh2uIUwSZkJ/JmL8kd5SUkL/Krbv8zmYLEbAz6kY= cloud.google.com/go/binaryauthorization v1.8.1/go.mod h1:1HVRyBerREA/nhI7yLang4Zn7vfNVA3okoAR9qYQJAQ= +cloud.google.com/go/binaryauthorization v1.8.4 h1:ZgCrxKEkyt4A0m4VjY3Jso9EBTzG2r2EihS/yI3XlnA= +cloud.google.com/go/binaryauthorization v1.8.4/go.mod h1:q0t7+U6A4mv7UAtps89kiJ8TlSAIACUJABZH7jE+7uk= cloud.google.com/go/certificatemanager v1.7.5 h1:UMBr/twXvH3jcT5J5/YjRxf2tvwTYIfrpemTebe0txc= cloud.google.com/go/certificatemanager v1.7.5/go.mod h1:uX+v7kWqy0Y3NG/ZhNvffh0kuqkKZIXdvlZRO7z0VtM= +cloud.google.com/go/certificatemanager v1.8.2 h1:NI7jAz5rIJxwKwcfowmqo9zCVY4mYaCcQo/fdpl2dK0= +cloud.google.com/go/certificatemanager v1.8.2/go.mod h1:x/OhbhxXrbAzPfLLN/tECrkgfnfg6qr6decH1V21/kQ= cloud.google.com/go/channel v1.17.5 h1:/omiBnyFjm4S1ETHoOmJbL7LH7Ljcei4rYG6Sj3hc80= cloud.google.com/go/channel v1.17.5/go.mod h1:FlpaOSINDAXgEext0KMaBq/vwpLMkkPAw9b2mApQeHc= +cloud.google.com/go/channel v1.17.8 h1:tSv4Wtk7moyJ5++exxRTefitVTxbOrqm2IcGQvMkGo0= +cloud.google.com/go/channel v1.17.8/go.mod h1:xWbsExBg6rzMyUtQa2oaX8n3sdROQuWXLNoZp8X7ssI= cloud.google.com/go/cloudbuild v1.15.1 h1:ZB6oOmJo+MTov9n629fiCrO9YZPOg25FZvQ7gIHu5ng= cloud.google.com/go/cloudbuild v1.15.1/go.mod h1:gIofXZSu+XD2Uy+qkOrGKEx45zd7s28u/k8f99qKals= +cloud.google.com/go/cloudbuild v1.16.2 h1:y24O8sDG1vxs3l0Zswjxow29csDnIPnorjRud6BGXmI= +cloud.google.com/go/cloudbuild v1.16.2/go.mod h1:CJuhrizzeQ79ryNUO0d227lHf5lqigvDngl4hvYwXiw= cloud.google.com/go/clouddms v1.7.4 h1:Sr0Zo5EAcPQiCBgHWICg3VGkcdS/LLP1d9SR7qQBM/s= cloud.google.com/go/clouddms v1.7.4/go.mod h1:RdrVqoFG9RWI5AvZ81SxJ/xvxPdtcRhFotwdE79DieY= +cloud.google.com/go/clouddms v1.7.7 h1:W+DQ0z9HCgdKvB2BacA5lb1qX/AO+LjIUBxXkM1iDvQ= +cloud.google.com/go/clouddms v1.7.7/go.mod h1:ikAo+Ekli1/xPaZvuP/9rmsgd34oEk6OndgNEdC2KRA= cloud.google.com/go/cloudtasks v1.12.6 h1:EUt1hIZ9bLv8Iz9yWaCrqgMnIU+Tdh0yXM1MMVGhjfE= cloud.google.com/go/cloudtasks v1.12.6/go.mod h1:b7c7fe4+TJsFZfDyzO51F7cjq7HLUlRi/KZQLQjDsaY= +cloud.google.com/go/cloudtasks v1.12.9 h1:gTNdEcNNIJV5LBilfHhgc2NOCrpRk04qvWwjbzW27oU= +cloud.google.com/go/cloudtasks v1.12.9/go.mod h1:ep1IV7Vud6LNy9JjJiYCcb/or8SO2h/He1gPQgF5Uqw= cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute v1.23.4/go.mod h1:/EJMj55asU6kAFnuZET8zqgwgJ9FvXWXOkkfQZa4ioI= cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= cloud.google.com/go/compute v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//uf3IB011ls= +cloud.google.com/go/compute v1.27.1 h1:0WbBLIPNANheCRZ4h8QhgzjN53KMutbiVBOLtPiVzBU= +cloud.google.com/go/compute v1.27.1/go.mod h1:UVWm+bWKEKoM+PW2sZycP1Jgk3NhKwR2Iy2Cnp/G40I= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/contactcenterinsights v1.13.0 h1:6Vs/YnDG5STGjlWMEjN/xtmft7MrOTOnOZYUZtGTx0w= cloud.google.com/go/contactcenterinsights v1.13.0/go.mod h1:ieq5d5EtHsu8vhe2y3amtZ+BE+AQwX5qAy7cpo0POsI= +cloud.google.com/go/contactcenterinsights v1.13.3 h1:Yd37VLbMokg7mlcf5azZ2cKdivibc51r1DSkIYcuwzE= +cloud.google.com/go/contactcenterinsights v1.13.3/go.mod h1:W7J0KTaHlvbL4l0ZkoTmgkKRPN3LxkdGSVQnv2CQ9js= cloud.google.com/go/container v1.31.0 h1:MAaNH7VRNPWEhvqOypq2j+7ONJKrKzon4v9nS3nLZe0= cloud.google.com/go/container v1.31.0/go.mod h1:7yABn5s3Iv3lmw7oMmyGbeV6tQj86njcTijkkGuvdZA= +cloud.google.com/go/container v1.37.1 h1:9g/2zHz4yHeNPNCRsghWBVoZKcGxVaIEb9T0DXAg5gc= +cloud.google.com/go/container v1.37.1/go.mod h1:8zwisvfdwqsXB/0TSxoUhTrfTrlfDV0pK9hcDtyFQ1c= cloud.google.com/go/containeranalysis v0.11.4 h1:doJ0M1ljS4hS0D2UbHywlHGwB7sQLNrt9vFk9Zyi7vY= cloud.google.com/go/containeranalysis v0.11.4/go.mod h1:cVZT7rXYBS9NG1rhQbWL9pWbXCKHWJPYraE8/FTSYPE= +cloud.google.com/go/containeranalysis v0.11.7 h1:X2qpMlj64GEmT7LX18qMjjTU/n5XOrZtYjUMZqKraes= +cloud.google.com/go/containeranalysis v0.11.7/go.mod h1:1xt9ZDhrB9py0gThDIg0Lq6AXVsFHKbXKYlqNAVhjcc= cloud.google.com/go/datacatalog v1.19.3 h1:A0vKYCQdxQuV4Pi0LL9p39Vwvg4jH5yYveMv50gU5Tw= cloud.google.com/go/datacatalog v1.19.3/go.mod h1:ra8V3UAsciBpJKQ+z9Whkxzxv7jmQg1hfODr3N3YPJ4= +cloud.google.com/go/datacatalog v1.20.2 h1:6LFlVev1D+Eoh8Ma6C3s3vgNqct97FdmW74Med4dfNs= +cloud.google.com/go/datacatalog v1.20.2/go.mod h1:OfoVR0QchMp2iwull28uaCkXsULClrVCe/Y5aBhwJpg= cloud.google.com/go/dataflow v0.9.5 h1:RYHtcPhmE664+F0Je46p+NvFbG8z//KCXp+uEqB4jZU= cloud.google.com/go/dataflow v0.9.5/go.mod h1:udl6oi8pfUHnL0z6UN9Lf9chGqzDMVqcYTcZ1aPnCZQ= +cloud.google.com/go/dataflow v0.9.8 h1:5ClJS5aKvoxzclKVhHtK6KBujXgIZM+oABAtP0+ECCQ= +cloud.google.com/go/dataflow v0.9.8/go.mod h1:0doO1EqzYcU/EAt/BsCZl+iOd9i/FwNGon6IgDBxAJU= cloud.google.com/go/dataform v0.9.2 h1:5e4eqGrd0iDTCg4Q+VlAao5j2naKAA7xRurNtwmUknU= cloud.google.com/go/dataform v0.9.2/go.mod h1:S8cQUwPNWXo7m/g3DhWHsLBoufRNn9EgFrMgne2j7cI= +cloud.google.com/go/dataform v0.9.5 h1:EhS2u65efQ2Wi3/RC+0rHxTno9IwL92ZqesBj7v+WRA= +cloud.google.com/go/dataform v0.9.5/go.mod h1:5FCHfsQNNmVvQJeI5XP7ftiOPlgHmYz4NUUhmCPrHag= cloud.google.com/go/datafusion v1.7.5 h1:HQ/BUOP8OIGJxuztpYvNvlb+/U+/Bfs9SO8tQbh61fk= cloud.google.com/go/datafusion v1.7.5/go.mod h1:bYH53Oa5UiqahfbNK9YuYKteeD4RbQSNMx7JF7peGHc= +cloud.google.com/go/datafusion v1.7.8 h1:RKm+n4ri+Y5XhP065FVX2Wv/G90couln8If+fCSS6j8= +cloud.google.com/go/datafusion v1.7.8/go.mod h1:VVkTWac1XVCVdf2nzlU68OvoDO7uc0E58pR1Q5zq8JQ= cloud.google.com/go/datalabeling v0.8.5 h1:GpIFRdm0qIZNsxqURFJwHt0ZBJZ0nF/mUVEigR7PH/8= cloud.google.com/go/datalabeling v0.8.5/go.mod h1:IABB2lxQnkdUbMnQaOl2prCOfms20mcPxDBm36lps+s= +cloud.google.com/go/datalabeling v0.8.8 h1:yZ4ki5DtBD9aO8HluxmF9kl+v5Ir6yzfQNhh3J4vHiU= +cloud.google.com/go/datalabeling v0.8.8/go.mod h1:68L3luQpu2/KIQxK+B8ChR7c8id8wT7/txJNddsHpq0= cloud.google.com/go/dataplex v1.14.2 h1:fxIfdU8fxzR3clhOoNI7XFppvAmndxDu1AMH+qX9WKQ= cloud.google.com/go/dataplex v1.14.2/go.mod h1:0oGOSFlEKef1cQeAHXy4GZPB/Ife0fz/PxBf+ZymA2U= +cloud.google.com/go/dataplex v1.17.0 h1:TpRuoH+tLKQOvUWHgxwnvSPgKkZYcWUmcJtcanQH7CI= +cloud.google.com/go/dataplex v1.17.0/go.mod h1:pSJPr0n+iu2/YKre2cRDwvdLrVg8EwGg483LB0AxA/g= +cloud.google.com/go/dataproc v1.12.0 h1:W47qHL3W4BPkAIbk4SWmIERwsWBaNnWm0P2sdx3YgGU= +cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= cloud.google.com/go/dataproc/v2 v2.4.0 h1:/u81Fd+BvCLp+xjctI1DiWVJn6cn9/s3Akc8xPH02yk= cloud.google.com/go/dataproc/v2 v2.4.0/go.mod h1:3B1Ht2aRB8VZIteGxQS/iNSJGzt9+CA0WGnDVMEm7Z4= +cloud.google.com/go/dataproc/v2 v2.5.0 h1:9+aIbMiJxrDZvGUYz6moDn8AmUV/zUZyp/B3xJlH0ms= +cloud.google.com/go/dataproc/v2 v2.5.0/go.mod h1:VV8BisKb9NpQsd/8XOriS5K0wpIlecTBrBm0ntvQ/g0= cloud.google.com/go/dataqna v0.8.5 h1:9ybXs3nr9BzxSGC04SsvtuXaHY0qmJSLIpIAbZo9GqQ= cloud.google.com/go/dataqna v0.8.5/go.mod h1:vgihg1mz6n7pb5q2YJF7KlXve6tCglInd6XO0JGOlWM= +cloud.google.com/go/dataqna v0.8.8 h1:r1dGgl8RJQA8rGz91lkktAvuy6YzvPXsj77WqIHoUuU= +cloud.google.com/go/dataqna v0.8.8/go.mod h1:DXb55JvGZN6EH3gvwu0JEbJvadxXOGL6grkhqP9y3QA= cloud.google.com/go/datastore v1.15.0 h1:0P9WcsQeTWjuD1H14JIY7XQscIPQ4Laje8ti96IC5vg= cloud.google.com/go/datastore v1.15.0/go.mod h1:GAeStMBIt9bPS7jMJA85kgkpsMkvseWWXiaHya9Jes8= +cloud.google.com/go/datastore v1.17.1 h1:6Me8ugrAOAxssGhSo8im0YSuy4YvYk4mbGvCadAH5aE= +cloud.google.com/go/datastore v1.17.1/go.mod h1:mtzZ2HcVtz90OVrEXXGDc2pO4NM1kiBQy8YV4qGe0ZM= cloud.google.com/go/datastream v1.10.4 h1:o1QDKMo/hk0FN7vhoUQURREuA0rgKmnYapB+1M+7Qz4= cloud.google.com/go/datastream v1.10.4/go.mod h1:7kRxPdxZxhPg3MFeCSulmAJnil8NJGGvSNdn4p1sRZo= +cloud.google.com/go/datastream v1.10.7 h1:IgjUEkJVecIPALsbJM/nGd1yuHhOfuME42vMkHGPbKI= +cloud.google.com/go/datastream v1.10.7/go.mod h1:wNlOxMpOCP/uaV+0O0PC5wlCmpHGDUhyRGQ5RBZAvSw= cloud.google.com/go/deploy v1.17.1 h1:m27Ojwj03gvpJqCbodLYiVmE9x4/LrHGGMjzc0LBfM4= cloud.google.com/go/deploy v1.17.1/go.mod h1:SXQyfsXrk0fBmgBHRzBjQbZhMfKZ3hMQBw5ym7MN/50= +cloud.google.com/go/deploy v1.19.1 h1:UHNCNceW1SN4nnQTautp2yJxYA65jQ5aTG3kAPE4xAk= +cloud.google.com/go/deploy v1.19.1/go.mod h1:y2DyvlK02aUlUFjDwTbEfOMTH29IGAjSniSGw+MceVM= cloud.google.com/go/dialogflow v1.49.0 h1:KqG0oxGE71qo0lRVyAoeBozefCvsMfcDzDjoLYSY0F4= cloud.google.com/go/dialogflow v1.49.0/go.mod h1:dhVrXKETtdPlpPhE7+2/k4Z8FRNUp6kMV3EW3oz/fe0= +cloud.google.com/go/dialogflow v1.54.1 h1:tPHEEtGY3U5w2XzwHJm0M4WsoQpfH9UTnC+R+5W0FFY= +cloud.google.com/go/dialogflow v1.54.1/go.mod h1:SDAvjPxEwb+DTRlxkCu0B5qilt0HtaV2GeoUBysvgCQ= cloud.google.com/go/dlp v1.11.2 h1:lTipOuJaSjlYnnotPMbEhKURLC6GzCMDDzVbJAEbmYM= cloud.google.com/go/dlp v1.11.2/go.mod h1:9Czi+8Y/FegpWzgSfkRlyz+jwW6Te9Rv26P3UfU/h/w= +cloud.google.com/go/dlp v1.14.1 h1:FofFc2f9EvWgwKNwAagq81cyM16BtxBxBpkVvnC5b4c= +cloud.google.com/go/dlp v1.14.1/go.mod h1:nY5sIxqHm2APxYUpAoq8xOMtHLjFyBYUNbYjjnBptqY= cloud.google.com/go/documentai v1.25.0 h1:lI62GMEEPO6vXJI9hj+G9WjOvnR0hEjvjokrnex4cxA= cloud.google.com/go/documentai v1.25.0/go.mod h1:ftLnzw5VcXkLItp6pw1mFic91tMRyfv6hHEY5br4KzY= +cloud.google.com/go/documentai v1.30.2 h1:dhg3vefzZtoZgwH8j+FpEPCSH8DzNW/wXi2SL6wpX4w= +cloud.google.com/go/documentai v1.30.2/go.mod h1:nMh79XZZ6dkXWZlh60vmyFPf9AySGM0QCYFJA39I2IU= cloud.google.com/go/domains v0.9.5 h1:Mml/R6s3vQQvFPpi/9oX3O5dRirgjyJ8cksK8N19Y7g= cloud.google.com/go/domains v0.9.5/go.mod h1:dBzlxgepazdFhvG7u23XMhmMKBjrkoUNaw0A8AQB55Y= +cloud.google.com/go/domains v0.9.8 h1:p/4SYTrOunrptanJqwKFff81pubajoy6mPan2zKyT+k= +cloud.google.com/go/domains v0.9.8/go.mod h1:CJzupa3+HxdkCSn6hXu0tcdcsbZS2ZNK1zfSA+FqfPM= cloud.google.com/go/edgecontainer v1.1.5 h1:tBY32km78ScpK2aOP84JoW/+wtpx5WluyPUSEE3270U= cloud.google.com/go/edgecontainer v1.1.5/go.mod h1:rgcjrba3DEDEQAidT4yuzaKWTbkTI5zAMu3yy6ZWS0M= +cloud.google.com/go/edgecontainer v1.2.2 h1:WT9LZrHsNNbVplz2P+a+RkOgbVGOFcPS4q85rXfkV4M= +cloud.google.com/go/edgecontainer v1.2.2/go.mod h1:PwFM/JBBTJ1pXSNNHD+NCMEhZylPOy1FCXuYCbl7ACk= cloud.google.com/go/errorreporting v0.3.0 h1:kj1XEWMu8P0qlLhm3FwcaFsUvXChV/OraZwA70trRR0= cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= cloud.google.com/go/essentialcontacts v1.6.6 h1:13eHn5qBnsawxI7mIrv4jRIEmQ1xg0Ztqw5ZGqtUNfA= cloud.google.com/go/essentialcontacts v1.6.6/go.mod h1:XbqHJGaiH0v2UvtuucfOzFXN+rpL/aU5BCZLn4DYl1Q= +cloud.google.com/go/essentialcontacts v1.6.9 h1:wY9FAjLpJZ15u1/ABHFQqN4pSlCBZIzFS8ap9UjQ9ww= +cloud.google.com/go/essentialcontacts v1.6.9/go.mod h1:wS/7YcnVzn82DqBv9lOQoHZpWOdgwGbWk02QH1460dU= cloud.google.com/go/eventarc v1.13.4 h1:ORkd6/UV5FIdA8KZQDLNZYKS7BBOrj0p01DXPmT4tE4= cloud.google.com/go/eventarc v1.13.4/go.mod h1:zV5sFVoAa9orc/52Q+OuYUG9xL2IIZTbbuTHC6JSY8s= +cloud.google.com/go/eventarc v1.13.7 h1:fl6Us+6WkBDIpBTTyQLSfCDYl4GNPmsVJdxsxK+SNQ4= +cloud.google.com/go/eventarc v1.13.7/go.mod h1:yslFvubtw7PovgFr/Gg8GrqcOfJBAU4D5Qveds4vOzA= cloud.google.com/go/filestore v1.8.1 h1:X5G4y/vrUo1B8Nsz93qSWTMAcM8LXbGUldq33OdcdCw= cloud.google.com/go/filestore v1.8.1/go.mod h1:MbN9KcaM47DRTIuLfQhJEsjaocVebNtNQhSLhKCF5GM= +cloud.google.com/go/filestore v1.8.4 h1:cvwDVEraGSmlWuJfhJAx3uvWxKyD30x8QwyONlZ8voY= +cloud.google.com/go/filestore v1.8.4/go.mod h1:GnZEiebr0Eru+BALoYDsuOyqSzM4EV7n5HpCaXT0RT8= cloud.google.com/go/firestore v1.14.0 h1:8aLcKnMPoldYU3YHgu4t2exrKhLQkqaXAGqT0ljrFVw= cloud.google.com/go/firestore v1.14.0/go.mod h1:96MVaHLsEhbvkBEdZgfN+AS/GIkco1LRpH9Xp9YZfzQ= +cloud.google.com/go/firestore v1.15.0 h1:/k8ppuWOtNuDHt2tsRV42yI21uaGnKDEQnRFeBpbFF8= +cloud.google.com/go/firestore v1.15.0/go.mod h1:GWOxFXcv8GZUtYpWHw/w6IuYNux/BtmeVTMmjrm4yhk= cloud.google.com/go/functions v1.16.0 h1:IWVylmK5F6hJ3R5zaRW7jI5PrWhCvtBVU4axQLmXSo4= cloud.google.com/go/functions v1.16.0/go.mod h1:nbNpfAG7SG7Duw/o1iZ6ohvL7mc6MapWQVpqtM29n8k= +cloud.google.com/go/functions v1.16.3 h1:YMVEpuYdW5pc4yVZO7fevlDridaWVXdFEeoUVJ3omY8= +cloud.google.com/go/functions v1.16.3/go.mod h1:Uk3Bu1mv6+f27PHh+yOjMAMB0u4LRkn7dxsdHBZmPKM= cloud.google.com/go/gaming v1.6.0 h1:PKggmegChZulPW8yvtziF8P9UOuVFwbvylbEucTNups= +cloud.google.com/go/gaming v1.9.0 h1:7vEhFnZmd931Mo7sZ6pJy7uQPDxF7m7v8xtBheG08tc= +cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= cloud.google.com/go/gkebackup v1.3.5 h1:iuE8KNtTsPOc79qeWoNS8zOWoXPD9SAdOmwgxtlCmh8= cloud.google.com/go/gkebackup v1.3.5/go.mod h1:KJ77KkNN7Wm1LdMopOelV6OodM01pMuK2/5Zt1t4Tvc= +cloud.google.com/go/gkebackup v1.5.1 h1:o6VzDCSiSF2E2PEWbxl9mMnZibs1hPCc0UkLRD1N0Do= +cloud.google.com/go/gkebackup v1.5.1/go.mod h1:FCz8M70up0yEwLXBmVJRckYoOh9x/eTo8aymJcdrMu4= cloud.google.com/go/gkeconnect v0.8.5 h1:17d+ZSSXKqG/RwZCq3oFMIWLPI8Zw3b8+a9/BEVlwH0= cloud.google.com/go/gkeconnect v0.8.5/go.mod h1:LC/rS7+CuJ5fgIbXv8tCD/mdfnlAadTaUufgOkmijuk= +cloud.google.com/go/gkeconnect v0.8.8 h1:sekj1nCVRFM9lRizo/ev+aCscpLQYds3tqzwvWuTix8= +cloud.google.com/go/gkeconnect v0.8.8/go.mod h1:S3UvXOu5vxZmeBU8YkpHMbcjsi9d0HDuJ+fB6ofHwKs= cloud.google.com/go/gkehub v0.14.5 h1:RboLNFzf9wEMSo7DrKVBlf+YhK/A/jrLN454L5Tz99Q= cloud.google.com/go/gkehub v0.14.5/go.mod h1:6bzqxM+a+vEH/h8W8ec4OJl4r36laxTs3A/fMNHJ0wA= +cloud.google.com/go/gkehub v0.14.8 h1:GFvRImZSpLg+2K08RD0bkQ/DnXNdy4BMnaUj3ZcpGEg= +cloud.google.com/go/gkehub v0.14.8/go.mod h1:Tdd33Wg3Jeehu4mIt9Fkm/ryy5wtJ8a3bjnzEnuY8UU= cloud.google.com/go/gkemulticloud v1.1.1 h1:rsSZAGLhyjyE/bE2ToT5fqo1qSW7S+Ubsc9jFOcbhSI= cloud.google.com/go/gkemulticloud v1.1.1/go.mod h1:C+a4vcHlWeEIf45IB5FFR5XGjTeYhF83+AYIpTy4i2Q= +cloud.google.com/go/gkemulticloud v1.2.1 h1:NKiXbkT+B3ZTDIOtUlsLrt3uT5RSEPfCyZ+N0qDGN1w= +cloud.google.com/go/gkemulticloud v1.2.1/go.mod h1:9VT+++rL2+x7o9+hc0R4CO4ywFzqlvISPZxPM93p+pw= cloud.google.com/go/grafeas v0.2.0 h1:CYjC+xzdPvbV65gi6Dr4YowKcmLo045pm18L0DhdELM= +cloud.google.com/go/grafeas v0.3.4 h1:D4x32R/cHX3MTofKwirz015uEdVk4uAxvZkZCZkOrF4= +cloud.google.com/go/grafeas v0.3.4/go.mod h1:A5m316hcG+AulafjAbPKXBO/+I5itU4LOdKO2R/uDIc= +cloud.google.com/go/grafeas v0.3.6 h1:7bcA10EBgTsxeAVypJhz2Dv3fhrdlO7Ml8l7ZZA2IkE= +cloud.google.com/go/grafeas v0.3.6/go.mod h1:to6ECAPgRO2xeqD8ISXHc70nObJuaKZThreQOjeOH3o= cloud.google.com/go/gsuiteaddons v1.6.5 h1:CZEbaBwmbYdhFw21Fwbo+C35HMe36fTE0FBSR4KSfWg= cloud.google.com/go/gsuiteaddons v1.6.5/go.mod h1:Lo4P2IvO8uZ9W+RaC6s1JVxo42vgy+TX5a6hfBZ0ubs= +cloud.google.com/go/gsuiteaddons v1.6.8 h1:p+ws9HophY4UwWSAbJ6azmLlXYRv+NchybeiA6vly+E= +cloud.google.com/go/gsuiteaddons v1.6.8/go.mod h1:hxW23+rb48hDo82PVJJzWCHyOy7AyqgnZ8SnEUovIAE= cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= +cloud.google.com/go/iam v1.1.8/go.mod h1:GvE6lyMmfxXauzNq8NbgJbeVQNspG+tcdL/W8QO1+zE= cloud.google.com/go/iap v1.9.4 h1:94zirc2r4t6KzhAMW0R6Dme005eTP6yf7g6vN4IhRrA= cloud.google.com/go/iap v1.9.4/go.mod h1:vO4mSq0xNf/Pu6E5paORLASBwEmphXEjgCFg7aeNu1w= +cloud.google.com/go/iap v1.9.7 h1:7b0Q+gbwrSliZ7p5NLT8ngI+bg/p4vxEcYbvm64X9yA= +cloud.google.com/go/iap v1.9.7/go.mod h1:H/hF8BM9BMHRoHek60UMnJcNZpnMLdQYwc1L4OvFomk= cloud.google.com/go/ids v1.4.5 h1:xd4U7pgl3GHV+MABnv1BF4/Vy/zBF7CYC8XngkOLzag= cloud.google.com/go/ids v1.4.5/go.mod h1:p0ZnyzjMWxww6d2DvMGnFwCsSxDJM666Iir1bK1UuBo= +cloud.google.com/go/ids v1.4.8 h1:LkWTd5XeJba2CFOBfHHabLT15JlPM81cmBtnas593u4= +cloud.google.com/go/ids v1.4.8/go.mod h1:uW399c5bbwB5/YykcO2uQNwl3l+r6oMPEN2p9BmxCTY= cloud.google.com/go/iot v1.7.5 h1:munTeBlbqI33iuTYgXy7S8lW2TCgi5l1hA4roSIY+EE= cloud.google.com/go/iot v1.7.5/go.mod h1:nq3/sqTz3HGaWJi1xNiX7F41ThOzpud67vwk0YsSsqs= +cloud.google.com/go/iot v1.7.8 h1:XSC4GBFRr8H/DoJ6pav+Lap4zowdsQs/79+r+kONG50= +cloud.google.com/go/iot v1.7.8/go.mod h1:WKcw6vyfKlHKWdT3Sht8IhcK2iMydEK0Qv4Mwy3p1ms= cloud.google.com/go/kms v1.15.7 h1:7caV9K3yIxvlQPAcaFffhlT7d1qpxjB1wHBtjWa13SM= cloud.google.com/go/kms v1.15.7/go.mod h1:ub54lbsa6tDkUwnu4W7Yt1aAIFLnspgh0kPGToDukeI= +cloud.google.com/go/kms v1.18.1 h1:tz1oSpKokgn1+FF7mEMMmsu0FVHQebZjtKetX3fbYdo= +cloud.google.com/go/kms v1.18.1/go.mod h1:fOsmW0fzDVYXM0AOJWmpB0gFVOVgC33giwYi0kcTdBA= cloud.google.com/go/language v1.12.3 h1:iaJZg6K4j/2PvZZVcjeO/btcWWIllVRBhuTFjGO4LXs= cloud.google.com/go/language v1.12.3/go.mod h1:evFX9wECX6mksEva8RbRnr/4wi/vKGYnAJrTRXU8+f8= +cloud.google.com/go/language v1.12.6 h1:XL1lpjv/fnJAYkd0OjA24pz38sgdxx6Tb8y/YmN/6wA= +cloud.google.com/go/language v1.12.6/go.mod h1:zbac+SstgMxDAOY5iCMeq5mKNkEYjposny9ZpdVUhMU= cloud.google.com/go/lifesciences v0.9.5 h1:gXvN70m2p+4zgJFzaz6gMKaxTuF9WJ0USYoMLWAOm8g= cloud.google.com/go/lifesciences v0.9.5/go.mod h1:OdBm0n7C0Osh5yZB7j9BXyrMnTRGBJIZonUMxo5CzPw= +cloud.google.com/go/lifesciences v0.9.8 h1:doOIvlAyiwcPcJoNlpFpRLUCljl0tayLvnllF3qs3wA= +cloud.google.com/go/lifesciences v0.9.8/go.mod h1:3wKB6HF0My17uQ+bnReWumKiDksYnV3ItF4+bAA6IbQ= cloud.google.com/go/logging v1.9.0 h1:iEIOXFO9EmSiTjDmfpbRjOxECO7R8C7b8IXUGOj7xZw= cloud.google.com/go/logging v1.9.0/go.mod h1:1Io0vnZv4onoUnsVUQY3HZ3Igb1nBchky0A0y7BBBhE= +cloud.google.com/go/logging v1.10.0 h1:f+ZXMqyrSJ5vZ5pE/zr0xC8y/M9BLNzQeLBwfeZ+wY4= +cloud.google.com/go/logging v1.10.0/go.mod h1:EHOwcxlltJrYGqMGfghSet736KR3hX1MAj614mrMk9I= cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI= cloud.google.com/go/longrunning v0.5.5 h1:GOE6pZFdSrTb4KAiKnXsJBtlE6mEyaW44oKyMILWnOg= cloud.google.com/go/longrunning v0.5.5/go.mod h1:WV2LAxD8/rg5Z1cNW6FJ/ZpX4E4VnDnoTk0yawPBB7s= +cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng= +cloud.google.com/go/longrunning v0.5.8 h1:QThI5BFSlYlS7K0wnABCdmKsXbG/htLc3nTPzrfOgeU= +cloud.google.com/go/longrunning v0.5.8/go.mod h1:oJDErR/mm5h44gzsfjQlxd6jyjFvuBPOxR1TLy2+cQk= cloud.google.com/go/managedidentities v1.6.5 h1:+bpih1piZVLxla/XBqeSUzJBp8gv9plGHIMAI7DLpDM= cloud.google.com/go/managedidentities v1.6.5/go.mod h1:fkFI2PwwyRQbjLxlm5bQ8SjtObFMW3ChBGNqaMcgZjI= +cloud.google.com/go/managedidentities v1.6.8 h1:WV00WrfhqGWKv5U4zo/Zjmni3tIqGAduK9z7rxJh5tU= +cloud.google.com/go/managedidentities v1.6.8/go.mod h1:Gl4bBPT4LV1vwWMHp+RNBWJA7P8e5bArg0YDbdERB3o= cloud.google.com/go/maps v1.6.4 h1:EVCZAiDvog9So46460BGbCasPhi613exoaQbpilMVlk= cloud.google.com/go/maps v1.6.4/go.mod h1:rhjqRy8NWmDJ53saCfsXQ0LKwBHfi6OSh5wkq6BaMhI= +cloud.google.com/go/maps v1.11.2 h1:wq9pTwTU5Cq7cPRV+kIRfZEj0GyteqzBRryXJK9yq/M= +cloud.google.com/go/maps v1.11.2/go.mod h1:YzCIVDLDAAZQt+sTl+hZxanOmKc4v8aFSWZfxMdKAqw= cloud.google.com/go/mediatranslation v0.8.5 h1:c76KdIXljQHSCb/Cy47S8H4s05A4zbK3pAFGzwcczZo= cloud.google.com/go/mediatranslation v0.8.5/go.mod h1:y7kTHYIPCIfgyLbKncgqouXJtLsU+26hZhHEEy80fSs= +cloud.google.com/go/mediatranslation v0.8.8 h1:N4ERIBaMGe7Xu+zpf26tYpY34qSN3Z2vlSNh+iZJ0H0= +cloud.google.com/go/mediatranslation v0.8.8/go.mod h1:/2BevZygMTb57aSW5xxDnFkl/ohrs8T8O2+f5qGhMsE= cloud.google.com/go/memcache v1.10.5 h1:yeDv5qxRedFosvpMSEswrqUsJM5OdWvssPHFliNFTc4= cloud.google.com/go/memcache v1.10.5/go.mod h1:/FcblbNd0FdMsx4natdj+2GWzTq+cjZvMa1I+9QsuMA= +cloud.google.com/go/memcache v1.10.8 h1:mGzMT2yLHc8C/kL1K/8FfuEH09Llh62iKh6R3KImADY= +cloud.google.com/go/memcache v1.10.8/go.mod h1:ryDp9chCUWXkTYYNiTEE0o/RBjGrcThZ/EOb+iW/TMo= cloud.google.com/go/metastore v1.13.4 h1:dR7vqWXlK6IYR8Wbu9mdFfwlVjodIBhd1JRrpZftTEg= cloud.google.com/go/metastore v1.13.4/go.mod h1:FMv9bvPInEfX9Ac1cVcRXp8EBBQnBcqH6gz3KvJ9BAE= +cloud.google.com/go/metastore v1.13.7 h1:tFs5L0Z+pT9GU08Iy2CuR0bExtg0o/ur+PbFgCRgEzw= +cloud.google.com/go/metastore v1.13.7/go.mod h1:eQA2VqSDe1ooVQs8hteKUCBYf3wRlMAJiXZ+ru3QpnU= cloud.google.com/go/monitoring v1.18.0 h1:NfkDLQDG2UR3WYZVQE8kwSbUIEyIqJUPl+aOQdFH1T4= cloud.google.com/go/monitoring v1.18.0/go.mod h1:c92vVBCeq/OB4Ioyo+NbN2U7tlg5ZH41PZcdvfc+Lcg= +cloud.google.com/go/monitoring v1.20.0 h1:GsIGYe6Q42EHONJtrUenZFpPIF60qLpeMhxVHIBcaPA= +cloud.google.com/go/monitoring v1.20.0/go.mod h1:5oUy5KllE4yxpztDJuzq/VVck0Q0cn/ykC98C9MXux0= cloud.google.com/go/networkconnectivity v1.14.4 h1:GBfXFhLyPspnaBE3nI/BRjdhW8vcbpT9QjE/4kDCDdc= cloud.google.com/go/networkconnectivity v1.14.4/go.mod h1:PU12q++/IMnDJAB+3r+tJtuCXCfwfN+C6Niyj6ji1Po= +cloud.google.com/go/networkconnectivity v1.14.7 h1:pZNeZUpQlIzKXZViX3kTthVMKYOBbTQ3qOMzs0Yob2Q= +cloud.google.com/go/networkconnectivity v1.14.7/go.mod h1:hdX86Gs4t3ZDv91Q7XFOxtWd9hcpkmZgVFoRoLDNsrU= cloud.google.com/go/networkmanagement v1.9.4 h1:aLV5GcosBNmd6M8+a0ekB0XlLRexv4fvnJJrYnqeBcg= cloud.google.com/go/networkmanagement v1.9.4/go.mod h1:daWJAl0KTFytFL7ar33I6R/oNBH8eEOX/rBNHrC/8TA= +cloud.google.com/go/networkmanagement v1.13.3 h1:VbQE6bU3P1892HAo9g/eNBARqHH64Omfx3+m29nDkmA= +cloud.google.com/go/networkmanagement v1.13.3/go.mod h1:UVyvulpb1cOu2DfAHkxOGJTBVOC7nxjhaCKi3HMm70I= cloud.google.com/go/networksecurity v0.9.5 h1:+caSxBTj0E8OYVh/5wElFdjEMO1S/rZtE1152Cepchc= cloud.google.com/go/networksecurity v0.9.5/go.mod h1:KNkjH/RsylSGyyZ8wXpue8xpCEK+bTtvof8SBfIhMG8= +cloud.google.com/go/networksecurity v0.9.8 h1:jtXSJUx3tCHZB5sV0QtTlFWWWGfFxGwRAZAOGBZARJ0= +cloud.google.com/go/networksecurity v0.9.8/go.mod h1:8wCm5we0Aqf9ORfCUunupx5ipdfGFTL+PTTkYoBIFjE= cloud.google.com/go/notebooks v1.11.3 h1:FH48boYmrWVQ6k0Mx/WrnNafXncT5iSYxA8CNyWTgy0= cloud.google.com/go/notebooks v1.11.3/go.mod h1:0wQyI2dQC3AZyQqWnRsp+yA+kY4gC7ZIVP4Qg3AQcgo= +cloud.google.com/go/notebooks v1.11.6 h1:7K240HF+9RDYV44DsxjmccpFZ7olN5VjSRrqunTC89c= +cloud.google.com/go/notebooks v1.11.6/go.mod h1:JoKKqNBlcs2f2K4L/Ao6FAUZI0Yw0j2cZOSRQFcHk8Q= cloud.google.com/go/optimization v1.6.3 h1:63NZaWyN+5rZEKHPX4ACpw3BjgyeuY8+rCehiCMaGPY= cloud.google.com/go/optimization v1.6.3/go.mod h1:8ve3svp3W6NFcAEFr4SfJxrldzhUl4VMUJmhrqVKtYA= +cloud.google.com/go/optimization v1.6.6 h1:45n/Qw2Mt1urpOA1fvUBjik5LzCyOl4gSQtFI9DFwcg= +cloud.google.com/go/optimization v1.6.6/go.mod h1:qFLRJ5h7HD9YydjM8F+uKkU++MHCvrGyakgiHSkL1KE= cloud.google.com/go/orchestration v1.8.5 h1:YHgWMlrPttIVGItgGfuvO2KM7x+y9ivN/Yk92pMm1a4= cloud.google.com/go/orchestration v1.8.5/go.mod h1:C1J7HesE96Ba8/hZ71ISTV2UAat0bwN+pi85ky38Yq8= +cloud.google.com/go/orchestration v1.9.3 h1:tYrt0nb6s7SuoRnZ5ej3sdn/eH5AjpVaAYRCjm7fYHk= +cloud.google.com/go/orchestration v1.9.3/go.mod h1:6cOnot26ereouYWqhm5k8fX1dysq+e71bEjYro+8RYA= cloud.google.com/go/orgpolicy v1.12.1 h1:2JbXigqBJVp8Dx5dONUttFqewu4fP0p3pgOdIZAhpYU= cloud.google.com/go/orgpolicy v1.12.1/go.mod h1:aibX78RDl5pcK3jA8ysDQCFkVxLj3aOQqrbBaUL2V5I= +cloud.google.com/go/orgpolicy v1.12.4 h1:Fg3GOwl6ANDmZMG4tkIvj2DUFzdTkgUwtKGwvJT3xvI= +cloud.google.com/go/orgpolicy v1.12.4/go.mod h1:lHr1a8OmY3aA+WMvNyX+ckZ47r5vp+NI1eeC0zKTQCs= cloud.google.com/go/osconfig v1.12.5 h1:Mo5jGAxOMKH/PmDY7fgY19yFcVbvwREb5D5zMPQjFfo= cloud.google.com/go/osconfig v1.12.5/go.mod h1:D9QFdxzfjgw3h/+ZaAb5NypM8bhOMqBzgmbhzWViiW8= +cloud.google.com/go/osconfig v1.12.8 h1:4nYxEmrxDHiORT3+YS10I0WAaI6cFshy2RE7KCpGQDY= +cloud.google.com/go/osconfig v1.12.8/go.mod h1:GF1mHXXkpBlMhuHkZo58PPtbMEVapeNvT/wLYwjR+5g= cloud.google.com/go/oslogin v1.13.1 h1:1K4nOT5VEZNt7XkhaTXupBYos5HjzvJMfhvyD2wWdFs= cloud.google.com/go/oslogin v1.13.1/go.mod h1:vS8Sr/jR7QvPWpCjNqy6LYZr5Zs1e8ZGW/KPn9gmhws= +cloud.google.com/go/oslogin v1.13.4 h1:w3ILkrWvJzvBZOMPdL+psn0RQfB1eAWjckJTqe7/ANo= +cloud.google.com/go/oslogin v1.13.4/go.mod h1:ae2K89lAr0zkWP7CCqdGiCBZTis1ymCM0xhmpUfaQYY= cloud.google.com/go/phishingprotection v0.8.5 h1:DH3WFLzEoJdW/6xgsmoDqOwT1xddFi7gKu0QGZQhpGU= cloud.google.com/go/phishingprotection v0.8.5/go.mod h1:g1smd68F7mF1hgQPuYn3z8HDbNre8L6Z0b7XMYFmX7I= +cloud.google.com/go/phishingprotection v0.8.8 h1:tT5qmQxpdQxvsglgbL+WI/XFehcj1M9X4gpqU2Bm0NU= +cloud.google.com/go/phishingprotection v0.8.8/go.mod h1:TjMWRJeTs/3TAVCuzhp6oQ+ng8FWz7PKmgJ8b2+eXkM= cloud.google.com/go/policytroubleshooter v1.10.3 h1:c0WOzC6hz964QWNBkyKfna8A2jOIx1zzZa43Gx/P09o= cloud.google.com/go/policytroubleshooter v1.10.3/go.mod h1:+ZqG3agHT7WPb4EBIRqUv4OyIwRTZvsVDHZ8GlZaoxk= +cloud.google.com/go/policytroubleshooter v1.10.6 h1:ahSVHd6IJ70WdLfsxIZ0tyDmM5Qtol0tlyNEfbB5lEI= +cloud.google.com/go/policytroubleshooter v1.10.6/go.mod h1:mEYX75+EvMAoJVNqpJ88hcZjPiUTmOsjlaGpDu/ZrD0= cloud.google.com/go/privatecatalog v0.9.5 h1:UZ0assTnATXSggoxUIh61RjTQ4P9zCMk/kEMbn0nMYA= cloud.google.com/go/privatecatalog v0.9.5/go.mod h1:fVWeBOVe7uj2n3kWRGlUQqR/pOd450J9yZoOECcQqJk= +cloud.google.com/go/privatecatalog v0.9.8 h1:5pUH09v1S1eT3Y+TviSfpLxLb1HY8JIR+I3Yjq1f20Q= +cloud.google.com/go/privatecatalog v0.9.8/go.mod h1:ki1VWJTD/fSDJibXDmrm9Mn+Tzrl3sQZq4pZh3VBU+c= cloud.google.com/go/pubsub v1.36.1 h1:dfEPuGCHGbWUhaMCTHUFjfroILEkx55iUmKBZTP5f+Y= cloud.google.com/go/pubsub v1.36.1/go.mod h1:iYjCa9EzWOoBiTdd4ps7QoMtMln5NwaZQpK1hbRfBDE= +cloud.google.com/go/pubsub v1.40.0 h1:0LdP+zj5XaPAGtWr2V6r88VXJlmtaB/+fde1q3TU8M0= +cloud.google.com/go/pubsub v1.40.0/go.mod h1:BVJI4sI2FyXp36KFKvFwcfDRDfR8MiLT8mMhmIhdAeA= cloud.google.com/go/pubsublite v1.8.1 h1:pX+idpWMIH30/K7c0epN6V703xpIcMXWRjKJsz0tYGY= cloud.google.com/go/pubsublite v1.8.1/go.mod h1:fOLdU4f5xldK4RGJrBMm+J7zMWNj/k4PxwEZXy39QS0= +cloud.google.com/go/pubsublite v1.8.2 h1:jLQozsEVr+c6tOU13vDugtnaBSUy/PD5zK6mhm+uF1Y= +cloud.google.com/go/pubsublite v1.8.2/go.mod h1:4r8GSa9NznExjuLPEJlF1VjOPOpgf3IT6k8x/YgaOPI= cloud.google.com/go/recaptchaenterprise v1.3.1 h1:u6EznTGzIdsyOsvm+Xkw0aSuKFXQlyjGE9a4exk6iNQ= cloud.google.com/go/recaptchaenterprise/v2 v2.9.2 h1:U3Wfq12X9cVMuTpsWDSURnXF0Z9hSPTHj+xsnXDRLsw= cloud.google.com/go/recaptchaenterprise/v2 v2.9.2/go.mod h1:trwwGkfhCmp05Ll5MSJPXY7yvnO0p4v3orGANAFHAuU= +cloud.google.com/go/recaptchaenterprise/v2 v2.13.1 h1:SkC5VgprI3SC2al+5hQn5VYfzZ3Tq9AfKv6Nst14Gcg= +cloud.google.com/go/recaptchaenterprise/v2 v2.13.1/go.mod h1:z7FFKUnrk8oKc5WwLnuj6ae3uOjZGYY7tf4FIRjQD3Y= cloud.google.com/go/recommendationengine v0.8.5 h1:ineqLswaCSBY0csYv5/wuXJMBlxATK6Xc5jJkpiTEdM= cloud.google.com/go/recommendationengine v0.8.5/go.mod h1:A38rIXHGFvoPvmy6pZLozr0g59NRNREz4cx7F58HAsQ= +cloud.google.com/go/recommendationengine v0.8.8 h1:B8olyGeU4NfbATF2tL0n8RXSxO3GjiMmyywUtFZIe2M= +cloud.google.com/go/recommendationengine v0.8.8/go.mod h1:XHm+7adVfxfllhSTUbKyhdqzFyk15lbeCqaULzpT5LM= cloud.google.com/go/recommender v1.12.1 h1:LVLYS3r3u0MSCxQSDUtLSkporEGi9OAE6hGvayrZNPs= cloud.google.com/go/recommender v1.12.1/go.mod h1:gf95SInWNND5aPas3yjwl0I572dtudMhMIG4ni8nr+0= +cloud.google.com/go/recommender v1.12.4 h1:X6BOnfvQufYDo5YNlzmYv+hpk0HyDAdjw+u/qczeNkE= +cloud.google.com/go/recommender v1.12.4/go.mod h1:ZA02CeWOdH3Pw377pofqtdrIkN+Wh4vnZdDHl08KR/c= cloud.google.com/go/redis v1.14.2 h1:QF0maEdVv0Fj/2roU8sX3NpiDBzP9ICYTO+5F32gQNo= cloud.google.com/go/redis v1.14.2/go.mod h1:g0Lu7RRRz46ENdFKQ2EcQZBAJ2PtJHJLuiiRuEXwyQw= +cloud.google.com/go/redis v1.16.1 h1:ROAo4UKsHVrZbofV6q3Z3DUr26otC7Y4wxspMixfmC8= +cloud.google.com/go/redis v1.16.1/go.mod h1:KI+VIUVSXZUmbCkhCbbGitRqZGLmlz9BAhAyHgBTRE4= cloud.google.com/go/resourcemanager v1.9.5 h1:AZWr1vWVDKGwfLsVhcN+vcwOz3xqqYxtmMa0aABCMms= cloud.google.com/go/resourcemanager v1.9.5/go.mod h1:hep6KjelHA+ToEjOfO3garMKi/CLYwTqeAw7YiEI9x8= +cloud.google.com/go/resourcemanager v1.9.8 h1:LMFZspU5krxBIz3pXk0QTFnmdAwKN8hnq71vmHPVNKs= +cloud.google.com/go/resourcemanager v1.9.8/go.mod h1:L3cVnfsZ1Wsw4f9hBNmZ7O1/ahJRPn8Ltg03ifaqsIw= cloud.google.com/go/resourcesettings v1.6.5 h1:BTr5MVykJwClASci/7Og4Qfx70aQ4n3epsNLj94ZYgw= cloud.google.com/go/resourcesettings v1.6.5/go.mod h1:WBOIWZraXZOGAgoR4ukNj0o0HiSMO62H9RpFi9WjP9I= +cloud.google.com/go/resourcesettings v1.7.1 h1:wj0j3d2nWa31FQl8PbvCfVERqAzmrAnejSqH+j6Mr2s= +cloud.google.com/go/resourcesettings v1.7.1/go.mod h1:f2WI2DpFghwCHYfyht0vMX2UKqJ9FRbXixXHBT3BmFQ= cloud.google.com/go/retail v1.16.0 h1:Fn1GuAua1c6crCGqfJ1qMxG1Xh10Tg/x5EUODEHMqkw= cloud.google.com/go/retail v1.16.0/go.mod h1:LW7tllVveZo4ReWt68VnldZFWJRzsh9np+01J9dYWzE= +cloud.google.com/go/retail v1.17.1 h1:npaL3nMGVZr9vzIllmYVt9UQ63Tlfz/bIqme3O6dthE= +cloud.google.com/go/retail v1.17.1/go.mod h1:UXtxpeokEUhbMRgq2dJH08Z5QTZgRzYR6sGES87xDkA= cloud.google.com/go/run v1.3.4 h1:m9WDA7DzTpczhZggwYlZcBWgCRb+kgSIisWn1sbw2rQ= cloud.google.com/go/run v1.3.4/go.mod h1:FGieuZvQ3tj1e9GnzXqrMABSuir38AJg5xhiYq+SF3o= +cloud.google.com/go/run v1.3.8 h1:n3eQ9GeHUn9lKwY7yCNUHqVCshUj9lTv+oaBGxqGlNU= +cloud.google.com/go/run v1.3.8/go.mod h1:dFsJfGTEVGW37sCqzJ/kLMmRS2/wfwGsUMOEuv0ryL0= cloud.google.com/go/scheduler v1.10.6 h1:5U8iXLoQ03qOB+ZXlAecU7fiE33+u3QiM9nh4cd0eTE= cloud.google.com/go/scheduler v1.10.6/go.mod h1:pe2pNCtJ+R01E06XCDOJs1XvAMbv28ZsQEbqknxGOuE= +cloud.google.com/go/scheduler v1.10.9 h1:X8/aahnwiyTNmYWc9Dda4iEtVMbBc68X1g6wULi5FJU= +cloud.google.com/go/scheduler v1.10.9/go.mod h1:nhiBshhr2jJggklptGgj33DF+aQ3/4CWaTeazS/8Qm0= cloud.google.com/go/secretmanager v1.11.5 h1:82fpF5vBBvu9XW4qj0FU2C6qVMtj1RM/XHwKXUEAfYY= cloud.google.com/go/secretmanager v1.11.5/go.mod h1:eAGv+DaCHkeVyQi0BeXgAHOU0RdrMeZIASKc+S7VqH4= +cloud.google.com/go/secretmanager v1.13.2 h1:WnyajcyWf5MLq9lPyVxEyOBAhQdPcpckG3lMw8LqAHw= +cloud.google.com/go/secretmanager v1.13.2/go.mod h1:rB3lORY7QZrjACov35PX0KXMM0bKlbkL0/eFlS312wk= cloud.google.com/go/security v1.15.5 h1:wTKJQ10j8EYgvE8Y+KhovxDRVDk2iv/OsxZ6GrLP3kE= cloud.google.com/go/security v1.15.5/go.mod h1:KS6X2eG3ynWjqcIX976fuToN5juVkF6Ra6c7MPnldtc= +cloud.google.com/go/security v1.17.1 h1:JjKlR4fUJNyq/+lPDi2PhC4G5G3+tda8gboLdona66Y= +cloud.google.com/go/security v1.17.1/go.mod h1:i/v+U4Jxs8mTFXmB/eYIYBdRl7mFmeo3VrcFw+r6e9o= cloud.google.com/go/securitycenter v1.24.4 h1:/5jjkZ+uGe8hZ7pvd7pO30VW/a+pT2MrrdgOqjyucKQ= cloud.google.com/go/securitycenter v1.24.4/go.mod h1:PSccin+o1EMYKcFQzz9HMMnZ2r9+7jbc+LvPjXhpwcU= +cloud.google.com/go/securitycenter v1.31.0 h1:gjXbwJDFA4amC9bp6MR20oBkaAXNethP/Di3cON7Ad4= +cloud.google.com/go/securitycenter v1.31.0/go.mod h1:6nVpMYo9Q02wR7ql1L17R1vE2KNvcooSkyKoJWB4Ox4= +cloud.google.com/go/servicecontrol v1.10.0 h1:P1OiVugNQtWVM3hVJSzaAmye48pExx1VPX2SKT8Z4Yg= +cloud.google.com/go/servicecontrol v1.10.0/go.mod h1:pQvyvSRh7YzUF2efw7H87V92mxU8FnFDawMClGCNuAA= cloud.google.com/go/servicedirectory v1.11.4 h1:da7HFI1229kyzIyuVEzHXip0cw0d+E0s8mjQby0WN+k= cloud.google.com/go/servicedirectory v1.11.4/go.mod h1:Bz2T9t+/Ehg6x+Y7Ycq5xiShYLD96NfEsWNHyitj1qM= +cloud.google.com/go/servicedirectory v1.11.8 h1:AfGFD8GiLoHrPC22lThekCvn4NgB3fIuhctNoGViZlk= +cloud.google.com/go/servicedirectory v1.11.8/go.mod h1:BCapDXmWzKx42Ffd/j8q7m5GNIH0JkolKhwK2quAm94= +cloud.google.com/go/servicemanagement v1.6.0 h1:flWoX0eJy21+34I/7HPUbpr6xTHPVzws1xnecLFlUm0= +cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= +cloud.google.com/go/serviceusage v1.5.0 h1:fl1AGgOx7E2eyBmH5ofDXT9w8xGvEaEnHYyNYGkxaqg= +cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= cloud.google.com/go/shell v1.7.5 h1:3Fq2hzO0ZSyaqBboJrFkwwf/qMufDtqwwA6ep8EZxEI= cloud.google.com/go/shell v1.7.5/go.mod h1:hL2++7F47/IfpfTO53KYf1EC+F56k3ThfNEXd4zcuiE= +cloud.google.com/go/shell v1.7.8 h1:kHlY2KR+4uyPK4a96nXCXXRjqwFHxOUAmEfrAF+Gc7o= +cloud.google.com/go/shell v1.7.8/go.mod h1:07qTjW9lCuFbkb2G0hzqvNELK5nwT5aSsn6Own/a5bE= cloud.google.com/go/spanner v1.57.0 h1:fJq+ZfQUDHE+cy1li0bJA8+sy2oiSGhuGqN5nqVaZdU= cloud.google.com/go/spanner v1.57.0/go.mod h1:aXQ5QDdhPRIqVhYmnkAdwPYvj/DRN0FguclhEWw+jOo= +cloud.google.com/go/spanner v1.64.0 h1:ltyPbHA/nRAtAhU/o742dXBCI1eNHPeaRY09Ja8B+hM= +cloud.google.com/go/spanner v1.64.0/go.mod h1:TOFx3pb2UwPsDGlE1gTehW+y6YlU4IFk+VdDHSGQS/M= cloud.google.com/go/speech v1.21.1 h1:nuFc+Kj5B8de75nN4FdPyUbI2SiBoHZG6BLurXL56Q0= cloud.google.com/go/speech v1.21.1/go.mod h1:E5GHZXYQlkqWQwY5xRSLHw2ci5NMQNG52FfMU1aZrIA= +cloud.google.com/go/speech v1.23.2 h1:s26zNLdGYeeNDftncc72CpxNAjRsSQa+Dmi6msioUmI= +cloud.google.com/go/speech v1.23.2/go.mod h1:U3p1TXiaFNMw/bs593/9cx6zehLkhcxx1aTMMnMgefM= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.35.1/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= cloud.google.com/go/storagetransfer v1.10.4 h1:dy4fL3wO0VABvzM05ycMUPFHxTPbJz9Em8ikAJVqSbI= cloud.google.com/go/storagetransfer v1.10.4/go.mod h1:vef30rZKu5HSEf/x1tK3WfWrL0XVoUQN/EPDRGPzjZs= +cloud.google.com/go/storagetransfer v1.10.7 h1:UFHrgNnef8OwipBt/eroKytztOTFIqYKMSDU+JO8lQk= +cloud.google.com/go/storagetransfer v1.10.7/go.mod h1:vc58NUgvigCZtNvmnMPir9QSsOri8yfOIpL4KvNsnnw= cloud.google.com/go/talent v1.6.6 h1:JssV0CE3FNujuSWn7SkosOzg7qrMxVnt6txOfGcMSa4= cloud.google.com/go/talent v1.6.6/go.mod h1:y/WQDKrhVz12WagoarpAIyKKMeKGKHWPoReZ0g8tseQ= +cloud.google.com/go/talent v1.6.9 h1:nJ2mB7GPrWjptlynT+vywqXv/XEQIgDdEw/5w3bTG5I= +cloud.google.com/go/talent v1.6.9/go.mod h1:wvqO09RhWW8EfZBPcG/2FRT9SDbi2vsVXfV+jMzJD/w= cloud.google.com/go/texttospeech v1.7.5 h1:dxY2Q5mHCbrGa3oPR2O3PCicdnvKa1JmwGQK36EFLOw= cloud.google.com/go/texttospeech v1.7.5/go.mod h1:tzpCuNWPwrNJnEa4Pu5taALuZL4QRRLcb+K9pbhXT6M= +cloud.google.com/go/texttospeech v1.7.8 h1:CBJ83C1GbeJNLFdp27lfO8CcO8meHKJ27wl4vDqTVd8= +cloud.google.com/go/texttospeech v1.7.8/go.mod h1:ynSE4aBS/J/hwi8U8Aa+gwtOlwwCeymOniUSrx4eYyg= cloud.google.com/go/tpu v1.6.5 h1:C8YyYda8WtNdBoCgFwwBzZd+S6+EScHOxM/z1h0NNp8= cloud.google.com/go/tpu v1.6.5/go.mod h1:P9DFOEBIBhuEcZhXi+wPoVy/cji+0ICFi4TtTkMHSSs= +cloud.google.com/go/tpu v1.6.8 h1:sXK26IAV5uYqjacvlZlIa1Z2O0fNnCk2nUm3xjqKIsM= +cloud.google.com/go/tpu v1.6.8/go.mod h1:+u/GrLBfe2MAf33D9cyU36dOy7XKtfar4IRrO2k5rCI= cloud.google.com/go/trace v1.10.5 h1:0pr4lIKJ5XZFYD9GtxXEWr0KkVeigc3wlGpZco0X1oA= cloud.google.com/go/trace v1.10.5/go.mod h1:9hjCV1nGBCtXbAE4YK7OqJ8pmPYSxPA0I67JwRd5s3M= +cloud.google.com/go/trace v1.10.8 h1:PffY+74UyMjCeKQGp0qW7kGRPsmDtx8BX4Py/2IhZjA= +cloud.google.com/go/trace v1.10.8/go.mod h1:zu8PHOoxf4f4qUl81OFdVn02fmje7v79wo57Fz7oIPo= cloud.google.com/go/translate v1.10.1 h1:upovZ0wRMdzZvXnu+RPam41B0mRJ+coRXFP2cYFJ7ew= cloud.google.com/go/translate v1.10.1/go.mod h1:adGZcQNom/3ogU65N9UXHOnnSvjPwA/jKQUMnsYXOyk= +cloud.google.com/go/translate v1.10.4 h1:fac6q6uquqLev8aV0X5cT9oPVUvfCwPtxkQVBayOR6E= +cloud.google.com/go/translate v1.10.4/go.mod h1:8zF+IIQKPtqi2ebyISjgZDwj095cceaj0dDX2mI9WiU= cloud.google.com/go/video v1.20.4 h1:TXwotxkShP1OqgKsbd+b8N5hrIHavSyLGvYnLGCZ7xc= cloud.google.com/go/video v1.20.4/go.mod h1:LyUVjyW+Bwj7dh3UJnUGZfyqjEto9DnrvTe1f/+QrW0= +cloud.google.com/go/video v1.21.1 h1:VGUgIdrwKj7IDR10bApRB8AID8LEJnNpplocDfFGGho= +cloud.google.com/go/video v1.21.1/go.mod h1:m5bJKcdJ9sKTMJO6EWmtLXhmvEWbrDSSmzpo2sxTP9c= cloud.google.com/go/videointelligence v1.11.5 h1:mYaWH8uhUCXLJCN3gdXswKzRa2+lK0zN6/KsIubm6pE= cloud.google.com/go/videointelligence v1.11.5/go.mod h1:/PkeQjpRponmOerPeJxNPuxvi12HlW7Em0lJO14FC3I= +cloud.google.com/go/videointelligence v1.11.8 h1:B3zIDWYh+b+O5PuQUef7fAmBEaCfISOg3UdOjIrugNo= +cloud.google.com/go/videointelligence v1.11.8/go.mod h1:pwQD5fVcMPPAcovgt+ywF1OaLD+V1EDxG7RX4Q+1r4k= cloud.google.com/go/vision v1.2.0 h1:/CsSTkbmO9HC8iQpxbK8ATms3OQaX3YQUeTMGCxlaK4= cloud.google.com/go/vision/v2 v2.8.0 h1:W52z1b6LdGI66MVhE70g/NFty9zCYYcjdKuycqmlhtg= cloud.google.com/go/vision/v2 v2.8.0/go.mod h1:ocqDiA2j97pvgogdyhoxiQp2ZkDCyr0HWpicywGGRhU= +cloud.google.com/go/vision/v2 v2.8.3 h1:cL2ndZQzfffr1xw8SeHlTX3Bsp31vYyES+sLdT1bJNI= +cloud.google.com/go/vision/v2 v2.8.3/go.mod h1:MeN2uM4T5MSOULtIIJEW/Ymr6It6eSP0ZdqCGuGKFXw= cloud.google.com/go/vmmigration v1.7.5 h1:5v9RT2vWyuw3pK2ox0HQpkoftO7Q7/8591dTxxQc79g= cloud.google.com/go/vmmigration v1.7.5/go.mod h1:pkvO6huVnVWzkFioxSghZxIGcsstDvYiVCxQ9ZH3eYI= +cloud.google.com/go/vmmigration v1.7.8 h1:3JKqN0BxgWOLJTRsIg1gp+kZdFxiwg3FI81RwRMs6UQ= +cloud.google.com/go/vmmigration v1.7.8/go.mod h1:ARowCnYGN1+cFTdMR6FMsUSHuC2v1PmLRM35JfanA8c= cloud.google.com/go/vmwareengine v1.1.1 h1:EGdDi9QbqThfZq3ILcDK5g+m9jTevc34AY5tACx5v7k= cloud.google.com/go/vmwareengine v1.1.1/go.mod h1:nMpdsIVkUrSaX8UvmnBhzVzG7PPvNYc5BszcvIVudYs= +cloud.google.com/go/vmwareengine v1.1.4 h1:euh/uASKEi6kVOGU3KWq6enpJZ4v/iGLApxcV8+KxzA= +cloud.google.com/go/vmwareengine v1.1.4/go.mod h1:v+UndgfEEMePkZ8eXqzzFODipi/ls657S3MoSLI9JZ4= cloud.google.com/go/vpcaccess v1.7.5 h1:XyL6hTLtEM/eE4F1GEge8xUN9ZCkiVWn44K/YA7z1rQ= cloud.google.com/go/vpcaccess v1.7.5/go.mod h1:slc5ZRvvjP78c2dnL7m4l4R9GwL3wDLcpIWz6P/ziig= +cloud.google.com/go/vpcaccess v1.7.8 h1:TH/aIfHStC6OWwvnZ27Olt7PFNF7OLgaAiIq8Jzc9pM= +cloud.google.com/go/vpcaccess v1.7.8/go.mod h1:fOd55qBAQiAFPA/hYwnOWgYNjcbvRMxd0rLvvojH/nU= cloud.google.com/go/webrisk v1.9.5 h1:251MvGuC8wisNN7+jqu9DDDZAi38KiMXxOpA/EWy4dE= cloud.google.com/go/webrisk v1.9.5/go.mod h1:aako0Fzep1Q714cPEM5E+mtYX8/jsfegAuS8aivxy3U= +cloud.google.com/go/webrisk v1.9.8 h1:Q43FyTPv300dAYio0OlLbj164xQdvNLPPTSRuT/CGvY= +cloud.google.com/go/webrisk v1.9.8/go.mod h1:ywUL9x0E81fft6TYggLWc+HUaCkuhMBl/RHnG8q5d5M= cloud.google.com/go/websecurityscanner v1.6.5 h1:YqWZrZYabG88TZt7364XWRJGhxmxhony2ZUyZEYMF2k= cloud.google.com/go/websecurityscanner v1.6.5/go.mod h1:QR+DWaxAz2pWooylsBF854/Ijvuoa3FCyS1zBa1rAVQ= +cloud.google.com/go/websecurityscanner v1.6.8 h1:kWWuc1gxoziEQ66YpRD88rUsUONOEFYU4WJa4YU3P8k= +cloud.google.com/go/websecurityscanner v1.6.8/go.mod h1:VyEfLCEjX9PN6mhOzuuuIVKHQ9FLHPKsbSg+KxzTW8k= cloud.google.com/go/workflows v1.12.4 h1:uHNmUiatTbPQ4H1pabwfzpfEYD4BBnqDHqMm2IesOh4= cloud.google.com/go/workflows v1.12.4/go.mod h1:yQ7HUqOkdJK4duVtMeBCAOPiN1ZF1E9pAMX51vpwB/w= +cloud.google.com/go/workflows v1.12.7 h1:Izlx3tQ0R2DV67/cpOlXsJO7vBNeiq81j0z2yDO7s9s= +cloud.google.com/go/workflows v1.12.7/go.mod h1:W33pjrwjgNIDBYY5xdQfHeUxE3icFjO5x7Fh9kA4P2M= +cosmossdk.io/api v0.7.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= +cosmossdk.io/log v1.2.0/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= +cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= crawshaw.io/sqlite v0.3.3-0.20220618202545-d1964889ea3c h1:wvzox0eLO6CKQAMcOqz7oH3UFqMpMmK7kwmwV+22HIs= crawshaw.io/sqlite v0.3.3-0.20220618202545-d1964889ea3c/go.mod h1:igAO5JulrQ1DbdZdtVq48mnZUBAPOeFzer7VhDWNtW4= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= +gioui.org v0.0.0-20210308172011-57750fc8a0a6 h1:K72hopUosKG3ntOPNG4OzzbuhxGuVf06fa2la1/H/Ho= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= +git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik= +git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= github.com/Abirdcfly/dupword v0.0.7 h1:z14n0yytA3wNO2gpCD/jVtp/acEXPGmYu0esewpBt6Q= github.com/Abirdcfly/dupword v0.0.7/go.mod h1:K/4M1kj+Zh39d2aotRwypvasonOyAMH1c/IZJzE0dmk= +github.com/Abirdcfly/dupword v0.0.11 h1:z6v8rMETchZXUIuHxYNmlUAuKuB21PeaSymTed16wgU= +github.com/Abirdcfly/dupword v0.0.11/go.mod h1:wH8mVGuf3CP5fsBTkfWwwwKTjDnVVCxtU8d8rgeVYXA= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8 h1:V8krnnfGj4pV65YLUm3C0/8bl7V5Nry2Pwvy3ru/wLc= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= +github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9 h1:HD8gA2tkByhMAwYaFAX9w2l7vxvBQ5NMoxDrkhqhtn4= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Antonboom/errname v0.1.7 h1:mBBDKvEYwPl4WFFNwec1CZO096G6vzK9vvDQzAwkako= github.com/Antonboom/errname v0.1.7/go.mod h1:g0ONh16msHIPgJSGsecu1G/dcF2hlYR/0SddnIAGavU= +github.com/Antonboom/errname v0.1.9 h1:BZDX4r3l4TBZxZ2o2LNrlGxSHran4d1u4veZdoORTT4= +github.com/Antonboom/errname v0.1.9/go.mod h1:nLTcJzevREuAsgTbG85UsuiWpMpAqbKD1HNZ29OzE58= github.com/Antonboom/nilnil v0.1.1 h1:PHhrh5ANKFWRBh7TdYmyyq2gyT2lotnvFvvFbylF81Q= github.com/Antonboom/nilnil v0.1.1/go.mod h1:L1jBqoWM7AOeTD+tSquifKSesRHs4ZdaxvZR+xdJEaI= +github.com/Antonboom/nilnil v0.1.3 h1:6RTbx3d2mcEu3Zwq9TowQpQMVpP75zugwOtqY1RTtcE= +github.com/Antonboom/nilnil v0.1.3/go.mod h1:iOov/7gRcXkeEU+EMGpBu2ORih3iyVEiWjeste1SJm8= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 h1:qoVeMsc9/fh/yhxVaA0obYjVH/oI/ihrOoMwsLS9KSA= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= @@ -273,21 +540,36 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= +github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= +github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw= github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c= github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= +github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible h1:rZgFj+Gtf3NMi/U5FvCvhzaxzW/TaPYgUYx3bAPz9DE= +github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible/go.mod h1:HPYO+50pSWkPoj9Q/eq0aRGByCL6ScRlUmiEX5Zgm+w= +github.com/CloudyKit/jet/v3 v3.0.0 h1:1PwO5w5VCtlUUl+KTOBsTGZlhjWkcybsGaAau52tOy8= github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= github.com/CloudyKit/jet/v6 v6.2.0 h1:EpcZ6SR9n28BUGtNJSvlBqf90IpjeFr36Tizxhn/oME= github.com/CloudyKit/jet/v6 v6.2.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4= -github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= +github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= +github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 h1:+r1rSv4gvYn0wmRjC8X7IAzX8QezqtFV9m0MUHFJgts= github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0/go.mod h1:b3g59n2Y+T5xmcxJL+UEG2f8cQploZm1mR/v6BW0mU0= +github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20190129172621-c8b1d7a94ddf h1:8F6fjL5iQP6sArGtPuXh0l6hggdcIpAm4ChjVJE4oTs= github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20190129172621-c8b1d7a94ddf/go.mod h1:aJ4qN3TfrelA6NZ6AXsXRfmEVaYin3EDbSPJrKS8OXo= +github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.0 h1:oVLqHXhnYtUwM89y9T1fXGaK9wTkXHgNp8/ZNMQzUxE= +github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.0/go.mod h1:dppbR7CwXD4pgtV9t3wD1812RaLDcBjtblcDF5f1vI0= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/Joker/hpp v1.0.0 h1:65+iuJYdRXv/XyN62C1uEmmOx3432rNG/rKlX6V7Kkc= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= github.com/Joker/jade v1.1.3 h1:Qbeh12Vq6BxURXT1qZBRHsDxeURB8ztcL6f3EXSGeHk= github.com/Joker/jade v1.1.3/go.mod h1:T+2WLyt7VH6Lp0TRxQrUYEs64nRc83wkMQrfeIQKduM= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw= @@ -296,6 +578,8 @@ github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF0 github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= +github.com/Microsoft/hcsshim v0.9.4 h1:mnUj0ivWy6UzbB1uLFqKR6F+ZyiDc7j4iGgHTpO+5+I= +github.com/Microsoft/hcsshim v0.9.4/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OpenPeeDeeP/depguard v1.1.1 h1:TSUznLjvp/4IUP+OQ0t/4jF4QUyxIcVX8YnghZdunyA= github.com/OpenPeeDeeP/depguard v1.1.1/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= @@ -310,20 +594,35 @@ github.com/Shopify/sarama v1.19.0 h1:9oksLxC6uxVPHPVYUmq6xhr1BOF/hHobWH2UzO67z1s github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/VictoriaMetrics/metrics v1.23.1 h1:/j8DzeJBxSpL2qSIdqnRFLvQQhbJyJbbEi22yMm7oL0= github.com/VictoriaMetrics/metrics v1.23.1/go.mod h1:rAr/llLpEnAdTehiNlUxKgnjcOuROSzpw0GvjpEbvFc= +github.com/aclements/go-gg v0.0.0-20170118225347-6dbb4e4fefb0 h1:E5Dzlk3akC+T2Zj1LBHgfPK1y8YWgLDnNDRmG+tpSKw= github.com/aclements/go-gg v0.0.0-20170118225347-6dbb4e4fefb0/go.mod h1:55qNq4vcpkIuHowELi5C8e+1yUHtoLoOUR9QU5j7Tes= github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794 h1:xlwdaKcTNVW4PtpQb8aKA4Pjy0CdJHEqvFbAnvR5m2g= github.com/aclements/go-moremath v0.0.0-20210112150236-f10218a38794/go.mod h1:7e+I0LQFUI9AXWxOfsQROs9xPhoJtbsyWcjJqDd4KPY= github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw= +github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= +github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9 h1:7kQgkwGRoLzC9K0oyXdJo7nve/bynv/KwUsxbiTlzAM= +github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= +github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19 h1:iXUgAaqDcIUGbRoy2TdeofRG/j1zpGRSEmNK05T+bi8= +github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527 h1:NImof/JkF93OVWZY+PINgl6fPtQyF6f+hNUtZ0QZA1c= github.com/ajstarks/svgo v0.0.0-20210923152817-c3b6e2f0c527/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 h1:byYvvbfSo3+9efR4IeReh77gVs4PnNDR3AMOE9NJ7a0= github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0/go.mod h1:q37NoqncT41qKc048STsifIt69LfUJ8SrWWcz/yam5k= github.com/alecthomas/atomic v0.1.0-alpha2 h1:dqwXmax66gXvHhsOS4pGPZKqYOlTkapELkLb3MNdlH8= github.com/alecthomas/atomic v0.1.0-alpha2/go.mod h1:zD6QGEyw49HIq19caJDc2NMXAy8rNi9ROrxtMXATfyI= github.com/alecthomas/kingpin/v2 v2.3.2 h1:H0aULhgmSzN8xQ3nX1uxtdlTHYoPLu5AhHxWrKI6ocU= github.com/alecthomas/kingpin/v2 v2.3.2/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= +github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY= +github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= +github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= +github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= @@ -366,15 +665,31 @@ github.com/anacrolix/utp v0.1.0/go.mod h1:MDwc+vsGEq7RMw6lr2GKOEqjWny5hO5OZXRVNa github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= +github.com/apache/arrow/go/v14 v14.0.2 h1:N8OkaJEOfI3mEZt07BIkvo4sC6XDbL+48MBPWO5IONw= +github.com/apache/arrow/go/v14 v14.0.2/go.mod h1:u3fgh3EdgN/YQ8cVQRguVW3R+seMybFg8QBQ5LU+eBY= +github.com/apache/arrow/go/v15 v15.0.2 h1:60IliRbiyTWCWjERBCkO1W4Qun9svcYoZrSLcyOsMLE= +github.com/apache/arrow/go/v15 v15.0.2/go.mod h1:DGXsR3ajT524njufqf95822i+KTh+yea1jass9YXgjA= github.com/apache/thrift v0.13.0 h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= +github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs= +github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= +github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a h1:pv34s756C4pEXnjgPfGYgdhg/ZdajGhyOvzx8k+23nw= github.com/ashanbrown/forbidigo v1.3.0 h1:VkYIwb/xxdireGAdJNZoo24O4lmnEWkactplBlWTShc= github.com/ashanbrown/forbidigo v1.3.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= +github.com/ashanbrown/forbidigo v1.5.1 h1:WXhzLjOlnuDYPYQo/eFlcFMi8X/kLfvWLYu6CSoebis= +github.com/ashanbrown/forbidigo v1.5.1/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= github.com/aws/aws-lambda-go v1.13.3 h1:SuCy7H3NLyp+1Mrfp+m80jcbi9KYWAs9/BXwppwRDzY= @@ -401,10 +716,12 @@ github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= +github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible h1:Ppm0npCCsmuR9oQaBtRuZcmILVE74aXE+AmrJj8L2ns= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/immutable v0.3.0 h1:TVRhuZx2wG9SZ0LRdqlbs9S5BZ6Y24hJEHTCgWHZEIw= github.com/benbjohnson/immutable v0.3.0/go.mod h1:uc6OHo6PN2++n98KHLxW8ef4W42ylHiQSENghE1ezxI= @@ -412,21 +729,33 @@ github.com/bits-and-blooms/bitset v1.2.2 h1:J5gbX05GpMdBjCvQ9MteIg2KKDExr7DrgK+Y github.com/bits-and-blooms/bitset v1.2.2/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bkielbasa/cyclop v1.2.0 h1:7Jmnh0yL2DjKfw28p86YTd/B4lRGcNuu12sKE35sM7A= github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bombsimon/wsl/v3 v3.3.0 h1:Mka/+kRLoQJq7g2rggtgQsjuI/K5Efd87WX96EWFxjM= github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= +github.com/bombsimon/wsl/v3 v3.4.0 h1:RkSxjT3tmlptwfgEgTgU+KYKLI35p/tviNXNXiL2aNU= +github.com/bombsimon/wsl/v3 v3.4.0/go.mod h1:KkIB+TXkqy6MvK9BDZVbZxKNYsE1/oLRJbIFtf14qqo= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/boombuler/barcode v1.0.1 h1:NDBbPmhS+EqABEs5Kg3n/5ZNjy73Pz7SIV+KCeqyXcs= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 h1:GKTyiRCL6zVf5wWaqKnf+7Qs6GbEPfd4iMOitWzXJx8= github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8/go.mod h1:spo1JLcs67NmW1aVLEgtA8Yy1elc+X8y5SRW1sFW4Og= github.com/breml/bidichk v0.2.3 h1:qe6ggxpTfA8E75hdjWPZ581sY3a2lnl0IRxLQFelECI= github.com/breml/bidichk v0.2.3/go.mod h1:8u2C6DnAy0g2cEq+k/A2+tr9O1s+vHGxWn0LTc70T2A= +github.com/breml/bidichk v0.2.4 h1:i3yedFWWQ7YzjdZJHnPo9d/xURinSq3OM+gyM43K4/8= +github.com/breml/bidichk v0.2.4/go.mod h1:7Zk0kRFt1LIZxtQdl9W9JwGAcLTTkOs+tN7wuEYGJ3s= github.com/breml/errchkjson v0.3.0 h1:YdDqhfqMT+I1vIxPSas44P+9Z9HzJwCeAzjB8PxP1xw= github.com/breml/errchkjson v0.3.0/go.mod h1:9Cogkyv9gcT8HREpzi3TiqBxCqDzo8awa92zSDFcofU= +github.com/breml/errchkjson v0.3.1 h1:hlIeXuspTyt8Y/UmP5qy1JocGNR00KQHgfaNtRAjoxQ= +github.com/breml/errchkjson v0.3.1/go.mod h1:XroxrzKjdiutFyW3nWhw34VGg7kiMsDQox73yWCGI2U= github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= github.com/btcsuite/btcd/btcec/v2 v2.2.1/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd11lSPuIupwTkI8= github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= +github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= @@ -436,10 +765,16 @@ github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3 github.com/btcsuite/winsvc v1.0.0 h1:J9B4L7e3oqhXOcm+2IuNApwzQec85lE+QaikUcCs+dk= github.com/bufbuild/buf v1.7.0 h1:uWRjhIXcrWkzIkA5TqXGyJbF51VW54QJsQZ3nwaes5Q= github.com/bufbuild/buf v1.7.0/go.mod h1:Go40fMAF46PnPLC7jJgTQhAI95pmC0+VtxFKVC0qLq0= +github.com/bufbuild/buf v1.15.1 h1:v7sK2uMEsGX4Z2hvu+xiMheH3C3AKBGfxPBgdUZYDQ8= +github.com/bufbuild/buf v1.15.1/go.mod h1:TQeGKam1QMfHy/xsSnnMpxN3JK5HBb6aNvZj4m52gkE= github.com/bufbuild/connect-go v1.0.0 h1:htSflKUT8y1jxhoPhPYTZMrsY3ipUXjjrbcZR5O2cVo= github.com/bufbuild/connect-go v1.0.0/go.mod h1:9iNvh/NOsfhNBUH5CtvXeVUskQO1xsrEviH7ZArwZ3I= +github.com/bufbuild/connect-go v1.5.2 h1:G4EZd5gF1U1ZhhbVJXplbuUnfKpBZ5j5izqIwu2g2W8= +github.com/bufbuild/connect-go v1.5.2/go.mod h1:GmMJYR6orFqD0Y6ZgX8pwQ8j9baizDrIQMm1/a6LnHk= +github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40= github.com/butuzov/ireturn v0.1.1 h1:QvrO2QF2+/Cx1WA/vETCIYBKtRjc30vesdoPUNo1EbY= github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= +github.com/bwesterb/go-ristretto v1.2.3 h1:1w53tCkGhCQ5djbat3+MH0BAQ5Kfgbt56UZQ/JMzngw= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b h1:6+ZFm0flnudZzdSE0JxlhR2hKnGPcNB35BjQf4RYQDY= github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= @@ -452,12 +787,19 @@ github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charithe/durationcheck v0.0.9 h1:mPP4ucLrf/rKZiIG/a9IPXHGlh8p4CzgpyTy6EEutYk= github.com/charithe/durationcheck v0.0.9/go.mod h1:SSbRIBVfMjCi/kEB6K65XEA83D6prSM8ap1UCpNKtgg= +github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= +github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= github.com/chavacava/garif v0.0.0-20220630083739-93517212f375 h1:E7LT642ysztPWE0dfz43cWOvMiF42DyTRC+eZIaO4yI= github.com/chavacava/garif v0.0.0-20220630083739-93517212f375/go.mod h1:4m1Rv7xfuwWPNKXlThldNuJvutYM6J95wNuuVmn55To= +github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 h1:W9o46d2kbNL06lq7UNDPV0zYLzkrde/bjIqO02eoll0= +github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8/go.mod h1:gakxgyXaaPkxvLw1XQxNGK4I37ys9iBRzNUx/B7pUCo= github.com/checkpoint-restore/go-criu/v5 v5.3.0 h1:wpFFOoomK3389ue2lAb0Boag6XPht5QYpipxmSNL4d8= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= +github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 h1:SKI1/fuSdodxmNNyVBR8d7X/HuLnRpvvFO0AgyQk764= github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U= github.com/cheggaaa/pb v1.0.27 h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc= +github.com/chigopher/pathlib v0.12.0 h1:1GM7fN/IwXXmOHbd1jkMqHD2wUhYqUvafgxTwmLT/q8= +github.com/chigopher/pathlib v0.12.0/go.mod h1:EJ5UtJ/sK8Nt6q3VWN+EwZLZ3g0afJiG8NegYiQQ/gQ= github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89 h1:aPflPkRFkVwbW6dmcVqfgwp1i+UWGFH6VgR1Jim5Ygc= github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= github.com/chromedp/chromedp v0.9.2 h1:dKtNz4kApb06KuSXoTQIyUC2TrA0fhGDwNZf3bcgfKw= @@ -478,56 +820,135 @@ github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBS github.com/cloudflare/cloudflare-go v0.14.0 h1:gFqGlGl/5f9UGXAaKapCGUfaTCgRKKnzu2VvzMZlOFA= github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 h1:hzAQntlaYRkVSFEfj9OTWlVV1H155FMD8BTKktLv0QI= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe h1:QQ3GSy+MqSHxm/d8nCtnAiZdYFd45cYZPs8vOOIYKfk= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw= github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= +github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= +github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM= +github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= +github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677/go.mod h1:890yq1fUb9b6dGNwssgeUO5vQV9qfXnCPxAJhBQfXw0= github.com/cockroachdb/pebble v0.0.0-20230226194802-02d779ffbc46/go.mod h1:9lRMC4XN3/BLPtIp6kAKwIaHu369NOf2rMucPzipz50= +github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= +github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 h1:IKgmqgMQlVJIZj19CdocBeSfSaiCbEBZGKODaixqtHM= +github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/cometbft/cometbft v0.37.5/go.mod h1:QC+mU0lBhKn8r9qvmnq53Dmf3DWBt4VtkcKw2C81wxY= +github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= +github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= +github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f h1:C43yEtQ6NIf4ftFXD/V55gnGFgPbMQobd//YlnLjUJ8= github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= +github.com/containerd/aufs v1.0.0 h1:2oeJiwX5HstO7shSrPZjrohJZLzK36wvpdmzDRkL/LY= +github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= +github.com/containerd/btrfs v1.0.0 h1:osn1exbzdub9L5SouXO5swW4ea/xVdJZ3wokxN5GrnA= +github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= +github.com/containerd/cgroups v1.0.3 h1:ADZftAkglvCiD44c77s5YmMqaP2pzVCFZvBmAlBdAP4= +github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/containerd v1.6.8 h1:h4dOFDwzHmqFEP754PgfgTeVXFnLiRc6kiqC7tplDJs= github.com/containerd/containerd v1.6.8/go.mod h1:By6p5KqPK0/7/CgO/A6t/Gz+CUYUu2zf1hUaaymVXB0= +github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU= +github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= +github.com/containerd/fuse-overlayfs-snapshotter v1.0.2 h1:Xy9Tkx0tk/SsMfLDFc69wzqSrxQHYEFELHBO/Z8XO3M= +github.com/containerd/fuse-overlayfs-snapshotter v1.0.2/go.mod h1:nRZceC8a7dRm3Ao6cJAwuJWPFiBPaibHiFntRUnzhwU= +github.com/containerd/go-cni v1.1.6 h1:el5WPymG5nRRLQF1EfB97FWob4Tdc8INg8RZMaXWZlo= +github.com/containerd/go-cni v1.1.6/go.mod h1:BWtoWl5ghVymxu6MBjg79W9NZrCRyHIdUtk4cauMe34= +github.com/containerd/go-runc v1.0.0 h1:oU+lLv1ULm5taqgV/CJivypVODI4SUz1znWjv3nNYS0= +github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= +github.com/containerd/imgcrypt v1.1.4 h1:iKTstFebwy3Ak5UF0RHSeuCTahC5OIrPJa6vjMAM81s= +github.com/containerd/imgcrypt v1.1.4/go.mod h1:LorQnPtzL/T0IyCeftcsMEO7AqxUDbdO8j/tSUpgxvo= +github.com/containerd/nri v0.1.0 h1:6QioHRlThlKh2RkRTR4kIT3PKAcrLo3gIWnjkM4dQmQ= +github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= +github.com/containerd/stargz-snapshotter v0.11.3 h1:D3PoF563XmOBdtfx2G6AkhbHueqwIVPBFn2mrsWLa3w= +github.com/containerd/stargz-snapshotter v0.11.3/go.mod h1:2j2EAUyvrLU4D9unYlTIwGhDKQIk74KJ9E71lJsQCVM= +github.com/containerd/stargz-snapshotter/estargz v0.11.3 h1:k2kN16Px6LYuv++qFqK+JTcYqc8bEVxzGpf8/gFBL5M= +github.com/containerd/stargz-snapshotter/estargz v0.11.3/go.mod h1:7vRJIcImfY8bpifnMjt+HTJoQxASq7T28MYbP15/Nf0= +github.com/containerd/stargz-snapshotter/estargz v0.12.1 h1:+7nYmHJb0tEkcRaAW+MHqoKaJYZmkikupxCqVtmPuY0= +github.com/containerd/stargz-snapshotter/estargz v0.12.1/go.mod h1:12VUuCq3qPq4y8yUW+l5w3+oXV3cx2Po3KSe/SmPGqw= +github.com/containerd/ttrpc v1.1.0 h1:GbtyLRxb0gOLR0TYQWt3O6B0NvT8tMdorEHqIQo/lWI= +github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= github.com/containerd/typeurl v1.0.2 h1:Chlt8zIieDbzQFzXzAeBEF92KhExuE4p9p92/QmY7aY= github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= +github.com/containerd/zfs v1.0.0 h1:cXLJbx+4Jj7rNsTiqVfm6i+RNLx6FFA2fMmDlEf+Wm8= +github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= +github.com/containernetworking/cni v1.1.1 h1:ky20T7c0MvKvbMOwS/FrlbNwjEoqJEUUYfsL4b0mc4k= +github.com/containernetworking/cni v1.1.1/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= +github.com/containernetworking/plugins v1.1.1 h1:+AGfFigZ5TiQH00vhR8qPeSatj53eNGz0C1d3wVYlHE= +github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8= +github.com/containers/ocicrypt v1.1.3 h1:uMxn2wTb4nDR7GqG3rnZSfpJXqWURfzZ7nKydzIeKpA= +github.com/containers/ocicrypt v1.1.3/go.mod h1:xpdkbVAuaH3WzbEabUd5yDsl9SwJA5pABH85425Es2g= +github.com/coreos/bbolt v1.3.2 h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible h1:bXhRBIXoTm9BYHS3gE0TtQuyNZyeEMux2sDi4oo5YOo= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7 h1:u9SHYsPQNyt5tgDm3YN7+9dYrpK96E5wFilTFWIDZOM= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf h1:CAKfRE2YtTUIjjh1bkBtyYFaUT/WmOqsJjgtihT0vMI= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9HD3nmY= github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= +github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1.0.20220726092710-f848e4300a8a h1:2humuGPw3O5riJVFq/E2FRjF57UrO97W1qJcGVmK+6k= github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1.0.20220726092710-f848e4300a8a/go.mod h1:c8IO23vgNxueCCJlSI9awQtcxsvc+buzaeThB85qfBU= github.com/cosmos/gogoproto v1.4.1/go.mod h1:Ac9lzL4vFpBMcptJROQ6dQ4M3pOEK5Z/l0Q9p+LoCr4= +github.com/cosmos/gogoproto v1.4.3/go.mod h1:0hLIG5TR7IvV1fme1HCFKjfzW9X2x0Mo+RooWXCnOWU= github.com/cosmos/gogoproto v1.4.6/go.mod h1:VS/ASYmPgv6zkPKLjR9EB91lwbLHOzaGCirmKKhncfI= +github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= +github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= +github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-go/v7 v7.7.0/go.mod h1:zzFhtp9g9RrN/UxXWrdUu5VyonBALCAHujXQCzrZSu8= +github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creachadair/command v0.0.0-20220916173946-56a74cdd66b6 h1:uKuolOJonQOb/2+z/wFSJeVREP6fSoigr/X4Wlfhwwg= +github.com/creachadair/command v0.0.0-20220916173946-56a74cdd66b6/go.mod h1:jN7ZJM5YSVtD3SHmkAdN/cOC1dXiqg2Y9K5Sr5a8Nxw= +github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= +github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= +github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= +github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/cristalhq/acmd v0.8.1 h1:mtFp/cbeJNY5jokF9zPz5mRllGHropRrOkOVxeGS6FI= github.com/cristalhq/acmd v0.8.1/go.mod h1:LG5oa43pE/BbxtfMoImHCQN++0Su7dzipdgBjMCBVDQ= +github.com/cristalhq/acmd v0.11.1 h1:DJ4fh2Pv0nPKmqT646IU/0Vh5FNdGblxvF+3/W3NAUI= +github.com/cristalhq/acmd v0.11.1/go.mod h1:LG5oa43pE/BbxtfMoImHCQN++0Su7dzipdgBjMCBVDQ= +github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= +github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= +github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= +github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI= github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= @@ -535,6 +956,8 @@ github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53E github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/daixiang0/gci v0.8.1 h1:T4xpSC+hmsi4CSyuYfIJdMZAr9o7xZmHpQVygMghGZ4= github.com/daixiang0/gci v0.8.1/go.mod h1:EpVfrztufwVgQRXjnX4zuNinEpLj5OmMjtu/+MB0V0c= +github.com/daixiang0/gci v0.10.1 h1:eheNA3ljF6SxnPD/vE4lCBusVHmV3Rs3dkKvFrJ7MR0= +github.com/daixiang0/gci v0.10.1/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= @@ -543,21 +966,43 @@ github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbz github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= +github.com/denisenkom/go-mssqldb v0.12.0 h1:VtrkII767ttSPNRfFekePK3sctr+joXgO58stqQbtUA= +github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= +github.com/dgraph-io/badger v1.6.0 h1:DshxFxZWXUcO0xX476VJC07Xsr6ZCBVRHKZ93Oh7Evo= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= +github.com/dgraph-io/badger/v3 v3.2103.2 h1:dpyM5eCJAtQCBcMCZcT4UBZchuTJgCywerHHgmxfxM8= +github.com/dgraph-io/badger/v3 v3.2103.2/go.mod h1:RHo4/GmYcKKh5Lxu63wLEMHJ70Pac2JqZRYGhlyAo2M= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4= +github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= +github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= +github.com/djherbis/atime v1.1.0 h1:rgwVbP/5by8BvvjBNrbh64Qz33idKT3pSnMSJsxhi0g= github.com/djherbis/atime v1.1.0/go.mod h1:28OF6Y8s3NQWwacXc5eZTsEsiMzp7LF8MbXE+XJPdBE= +github.com/docker/cli v20.10.17+incompatible h1:eO2KS7ZFeov5UJeaDmIs1NFEDRf32PaqRpvoEkKBy5M= +github.com/docker/cli v20.10.17+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v23.0.1+incompatible h1:LRyWITpGzl2C9e9uGxzisptnxAn1zfZKXy13Ul2Q5oM= github.com/docker/cli v23.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v20.10.19+incompatible h1:lzEmjivyNHFHMNAFLXORMBXyGIhw/UP4DvJwvyKYq64= github.com/docker/docker v20.10.19+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v23.0.1+incompatible h1:vjgvJZxprTTE1A37nm+CLNAdwu6xZekyoiVlUZEINcY= +github.com/docker/docker v23.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v24.0.9+incompatible h1:HPGzNmwfLZWdxHqK9/II92pyi1EpYKsAqcl4G0Of9v0= github.com/docker/docker v24.0.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.6.4 h1:axCks+yV+2MR3/kZhAmy07yC56WZ2Pwu/fKWtKuZB0o= +github.com/docker/docker-credential-helpers v0.6.4/go.mod h1:ofX3UI0Gz1TteYBjtgs07O36Pyasyp66D2uKT7H8W1c= +github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= +github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= +github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7 h1:tYwu/z8Y0NkkzGEh3z21mSWggMg4LwLRFucLS7TjARg= github.com/eapache/go-resiliency v1.1.0 h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU= @@ -565,40 +1010,55 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8 github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= +github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= +github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.12.0 h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjletLK6K0rbxyZI= github.com/envoyproxy/go-control-plane v0.12.0/go.mod h1:ZBTaoJ23lqITozF0M6G4/IragXCQKCnYbmlmtHvwRG0= +github.com/envoyproxy/go-control-plane v0.12.1-0.20240621013728-1eb8caab5155 h1:IgJPqnrlY2Mr4pYB6oaMKvFvwJ9H+X6CCY5x1vCTcpc= github.com/envoyproxy/go-control-plane v0.12.1-0.20240621013728-1eb8caab5155/go.mod h1:5Wkq+JduFtdAXihLmeTJf+tRYIT4KBc2vPXDhwVo1pA= github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= +github.com/etcd-io/bbolt v1.3.3 h1:gSJmxrs37LgTqR/oyJBWok6k6SvXEUerFTbltIhXkBM= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= +github.com/evmos/os/example_chain v0.0.0-20240924163020-b2a4187dad50/go.mod h1:+SPMqw9wtbWO3jG02uLbLtVVjMHBldmXTN51kxbWqJ8= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= +github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g= +github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw= +github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c h1:CndMRAH4JIwxbW8KYq6Q+cGWcGHz0FjGR3QqcInWcW0= github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= +github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4 h1:GY1+t5Dr9OKADM64SYnQjw/w99HMYvQ0A8/JoUkxVmc= +github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw= github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db h1:gb2Z18BhTPJPpLQWj4T+rfKHYCHxRHCtRxhKKjRidVw= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8 h1:a9ENSRDFBUPkJ5lCgVZh26+ZbGyoVJG7yb5SSzF5H54= @@ -608,6 +1068,7 @@ github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 h1:IZqZOB2fydHte3kUgxrzK5E1fW7RQGeDwE8F/ZZnUYc= github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= +github.com/gavv/httpexpect v2.0.0+incompatible h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= @@ -615,25 +1076,41 @@ github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9 h1:r5GgOLGbza2wVHRzK7aAj6lWZjfbAwiu/RDCVOKjRyM= github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= +github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= +github.com/go-check/check v0.0.0-20180628173108-788fd7840127 h1:0gkP6mzaMqkmpcJYCFOLkIBwI7xFExG03bbkOkCvUPI= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-chi/chi/v5 v5.0.7 h1:rDTPXLDHGATaeHvVlLcR4Qe0zftYethFucbjVQ1PxU8= github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= +github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-critic/go-critic v0.6.5 h1:fDaR/5GWURljXwF8Eh31T2GZNz9X4jeboS912mWF8Uo= github.com/go-critic/go-critic v0.6.5/go.mod h1:ezfP/Lh7MA6dBNn4c6ab5ALv3sKnZVLx37tr00uuaOY= +github.com/go-critic/go-critic v0.7.0 h1:tqbKzB8pqi0NsRZ+1pyU4aweAF7A7QN0Pi4Q02+rYnQ= +github.com/go-critic/go-critic v0.7.0/go.mod h1:moYzd7GdVXE2C2hYTwd7h0CPcqlUeclsyBRwMa38v64= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ= github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= +github.com/go-fonts/latin-modern v0.2.0 h1:5/Tv1Ek/QCr20C6ZOz15vw3g7GELYL98KWr8Hgo+3vk= github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/liberation v0.2.0 h1:jAkAWJP4S+OsrPLZM4/eC9iW7CtHy+HBXrEwZXWo5VM= github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/stix v0.1.0 h1:UlZlgrvvmT/58o573ot7NFw0vZasZ5I6bcIft/oMdgg= github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= +github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I= github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= +github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81 h1:6zl3BbBhdnMkpSj2YY30qV3gDcVBGtFgVsV3+/i+mKQ= github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -641,34 +1118,63 @@ github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ4 github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab h1:xveKWz2iaueeTaUgdetzel+U7exyigDYBryyVfV/rZk= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +github.com/go-pdf/fpdf v0.5.0 h1:GHpcYsiDV2hdo77VTOuTF9k1sN8F8IY7NjnCo9x+NPY= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= +github.com/go-pdf/fpdf v0.6.0 h1:MlgtGIfsdMEEQJr2le6b/HNr1ZlQwxyWr77r2aj2U/8= +github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= +github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.4.0 h1:7LxgVwFb2hIQtMm87NdgAVfXjnt4OePseqT1tKx+opk= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= +github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR6jE7g= github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= +github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= +github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= github.com/go-toolsmith/astcopy v1.0.2 h1:YnWf5Rnh1hUudj11kei53kI57quN/VH6Hp1n+erozn0= github.com/go-toolsmith/astcopy v1.0.2/go.mod h1:4TcEdbElGc9twQEYpVo/aieIXfHhiuLh4aLAck6dO7Y= +github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= +github.com/go-toolsmith/astcopy v1.1.0/go.mod h1:hXM6gan18VA1T/daUEHCFcYiW8Ai1tIwIzHY6srfEAw= github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= github.com/go-toolsmith/astequal v1.0.2/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= github.com/go-toolsmith/astequal v1.0.3 h1:+LVdyRatFS+XO78SGV4I3TCEA0AC7fKEGma+fH+674o= github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= +github.com/go-toolsmith/astequal v1.1.0 h1:kHKm1AWqClYn15R0K1KKE4RG614D46n+nqUQ06E1dTw= +github.com/go-toolsmith/astequal v1.1.0/go.mod h1:sedf7VIdCL22LD8qIvv7Nn9MuWJruQA/ysswh64lffQ= github.com/go-toolsmith/astfmt v1.0.0 h1:A0vDDXt+vsvLEdbMFJAUBI/uTbRw1ffOPnxsILnFL6k= github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= +github.com/go-toolsmith/astfmt v1.1.0 h1:iJVPDPp6/7AaeLJEruMsBUlOYCmvg0MoCfJprsOmcco= +github.com/go-toolsmith/astfmt v1.1.0/go.mod h1:OrcLlRwu0CuiIBp/8b5PYF9ktGVZUjlNMV634mhwuQ4= github.com/go-toolsmith/astp v1.0.0 h1:alXE75TXgcmupDsMK1fRAy0YUzLzqPVvBKoyWV+KPXg= github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= +github.com/go-toolsmith/astp v1.1.0 h1:dXPuCl6u2llURjdPLLDxJeZInAeZ0/eZwFJmqZMnpQA= +github.com/go-toolsmith/astp v1.1.0/go.mod h1:0T1xFGz9hicKs8Z5MfAqSUitoUYS30pDMsRVIDHs8CA= +github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5 h1:eD9POs68PHkwrx7hAB78z1cb6PfGq/jyWn3wJywsH1o= github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5/go.mod h1:3NAwwmD4uY/yggRxoEjk/S00MIV3A+H7rrE3i87eYxM= +github.com/go-toolsmith/pkgload v1.2.2 h1:0CtmHq/02QhxcF7E9N5LIFcYFsMR5rdovfqTtRKkgIk= +github.com/go-toolsmith/pkgload v1.2.2/go.mod h1:R2hxLNRKuAsiXCo2i5J6ZQPhnPMOVtU+f0arbFPWCus= github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4= github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= +github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQiyP2Bvw= +github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= github.com/go-toolsmith/typep v1.0.2 h1:8xdsa1+FSIH/RhEkgnD1j2CJOy5mNllW1Q9tRiYwvlk= github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= +github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= +github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b h1:khEcpUM4yFcxg4/FHQWkvVRmgijNXRfzkIDHh23ggEo= github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= +github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U= +github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/go-zookeeper/zk v1.0.2 h1:4mx0EYENAdX/B/rbunjlt5+4RTA/a9SMHBRuSKdGxPM= github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= @@ -681,12 +1187,23 @@ github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= github.com/gofrs/uuid v4.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= +github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M= +github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= +github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 h1:+eHOFJl1BaXrQxKX+T06f78590z4qA2ZzBTqahsKSE4= +github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -700,30 +1217,47 @@ github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 h1:amWTbTGqOZ71ruzr github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2/go.mod h1:9wOXstvyDRshQ9LggQuzBCGysxs3b6Uo/1MvYCR2NMs= github.com/golangci/golangci-lint v1.50.1 h1:C829clMcZXEORakZlwpk7M4iDw2XiwxxKaG504SZ9zY= github.com/golangci/golangci-lint v1.50.1/go.mod h1:AQjHBopYS//oB8xs0y0M/dtxdKHkdhl0RvmjUct0/4w= +github.com/golangci/golangci-lint v1.52.0 h1:T7w3tuF1goz64qGV+ML4MgysSl/yUfA3UZJK92oE48A= +github.com/golangci/golangci-lint v1.52.0/go.mod h1:wlTh+d/oVlgZC2yCe6nlxrxNAnuhEQC0Zdygoh72Uak= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= github.com/golangci/misspell v0.3.5 h1:pLzmVdl3VxTOncgzHcvLOKirdvcx/TydsClUQXTehjo= github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= +github.com/golangci/misspell v0.4.0 h1:KtVB/hTK4bbL/S6bs64rYyk8adjmh1BygbBiaAiX+a0= +github.com/golangci/misspell v0.4.0/go.mod h1:W6O/bwV6lGDxUCChm2ykw9NQdd5bYd1Xkjo88UcWyJc= github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 h1:DIPQnGy2Gv2FSA4B/hh8Q7xx3B7AIDk3DAMeHclH1vQ= github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6/go.mod h1:0AKcRCkMoKvUvlf89F6O7H2LYdhr1zBh736mBItOdRs= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= +github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38 h1:y0Wmhvml7cGnzPa9nocn/fMraMH/lMDdeG+rkx4VgYY= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= +github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac h1:Q0Jsdxl5jbxouNs1TQYt0gxesYMU4VXRbsTlgDloZ50= github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac/go.mod h1:P32wAyui1PQ58Oce/KYkOqQv8cVw1zAapXOl+dRFGbc= +github.com/gonum/floats v0.0.0-20181209220543-c233463c7e82 h1:EvokxLQsaaQjcWVWSV38221VAK7qc2zhaO17bKys/18= github.com/gonum/floats v0.0.0-20181209220543-c233463c7e82/go.mod h1:PxC8OnwL11+aosOB5+iEPoV3picfs8tUpkVd0pDo+Kg= +github.com/gonum/internal v0.0.0-20181124074243-f884aa714029 h1:8jtTdc+Nfj9AR+0soOeia9UZSvYBvETVHZrugUowJ7M= github.com/gonum/internal v0.0.0-20181124074243-f884aa714029/go.mod h1:Pu4dmpkhSyOzRwuXkOgAvijx4o+4YMUJJo9OvPYMkks= +github.com/gonum/lapack v0.0.0-20181123203213-e4cdc5a0bff9 h1:7qnwS9+oeSiOIsiUMajT+0R7HR6hw5NegnKPmn/94oI= github.com/gonum/lapack v0.0.0-20181123203213-e4cdc5a0bff9/go.mod h1:XA3DeT6rxh2EAE789SSiSJNqxPaC0aE9J8NTOI0Jo/A= +github.com/gonum/matrix v0.0.0-20181209220409-c518dec07be9 h1:V2IgdyerlBa/MxaEFRbV5juy/C3MGdj4ePi+g6ePIp4= github.com/gonum/matrix v0.0.0-20181209220409-c518dec07be9/go.mod h1:0EXg4mc1CNP0HCqCz+K4ts155PXIlUywf0wqN+GfPZw= github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-containerregistry v0.13.0 h1:y1C7Z3e149OJbOPDBxLYR8ITPz8dTKqQwjErKVHJC8k= +github.com/google/go-containerregistry v0.13.0/go.mod h1:J9FQ+eSS4a1aC2GNZxvNpbWhgp0487v+cgiilB4FqDo= github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9 h1:OF1IPgv+F4NmqmJ98KTjdN97Vs1JxDPB3vbmYzV2dpk= github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= +github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= +github.com/google/safehtml v0.0.2 h1:ZOt2VXg4x24bW0m2jtzAOkhoXV0iM8vNKc0paByCZqM= github.com/google/safehtml v0.0.2/go.mod h1:L4KWwDsUJdECRAEpZoBn3O64bQaywRscowZjJAzjHnU= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= @@ -732,17 +1266,27 @@ github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e h1:CYRpN206UTHUi github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/googleapis/gax-go/v2 v2.12.1/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= +github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= +github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI= github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/googleapis/google-cloud-go-testing v0.0.0-20210719221736-1c9a4c676720 h1:zC34cGQu69FG7qzJ3WiKW244WfhDC3xxYMeNOX2gtUQ= github.com/googleapis/google-cloud-go-testing v0.0.0-20210719221736-1c9a4c676720/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gookit/color v1.5.1 h1:Vjg2VEcdHpwq+oY63s/ksHrgJYCTo0bwWvmmYWdE9fQ= +github.com/gookit/color v1.5.1/go.mod h1:wZFzea4X8qN6vHOSP2apMb4/+w/orMznEzYsIHPaqKM= +github.com/gookit/color v1.5.2 h1:uLnfXcaFjlrDnQDT+NCBcfhrXqYTx/rcCa6xn01Y8yI= +github.com/gookit/color v1.5.2/go.mod h1:w8h4bGiHeeBpvQVePTutdbERIUf3oJE5lZ8HM0UgXyg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 h1:PVRE9d4AQKmbelZ7emNig1+NT27DUmKZn5qXxfio54U= github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= +github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28 h1:9alfqbrhuD+9fLZ4iaAVwhlp5PEhmnBt7yvK2Oy5C1U= +github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= @@ -758,6 +1302,8 @@ github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3 github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= +github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= +github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/gotestyourself/gotestyourself v2.2.0+incompatible h1:AQwinXlbQR2HvPjQZOmDhRqsv5mZf+Jb1RnSLxcqZcI= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= @@ -766,32 +1312,52 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmg github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= +github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= +github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= +github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= +github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/guptarohit/asciigraph v0.5.5 h1:ccFnUF8xYIOUPPY3tmdvRyHqmn1MYI9iv1pLKX+/ZkQ= github.com/guptarohit/asciigraph v0.5.5/go.mod h1:dYl5wwK4gNsnFf9Zp+l06rFiDZ5YtXM6x7SRWZ3KGag= +github.com/hanwen/go-fuse/v2 v2.1.1-0.20220112183258-f57e95bda82d h1:ibbzF2InxMOS+lLCphY9PHNKPURDUBNKaG6ErSq8gJQ= +github.com/hanwen/go-fuse/v2 v2.1.1-0.20220112183258-f57e95bda82d/go.mod h1:B1nGE/6RBFyBRC1RRnf23UpwCdyJ31eukw34oAKukAc= github.com/hashicorp/consul/api v1.25.1 h1:CqrdhYzc8XZuPnhIYZWH45toM0LB9ZeYr/gvpLVI3PE= github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= +github.com/hashicorp/consul/api v1.28.2 h1:mXfkRHrpHN4YY3RqL09nXU1eHKLNiuAN4kHvDQ16k/8= +github.com/hashicorp/consul/api v1.28.2/go.mod h1:KyzqzgMEya+IZPcD65YFoOVAgPpbfERu4I/tzG6/ueE= github.com/hashicorp/consul/sdk v0.3.0 h1:UOxjlb4xVNF93jak1mzzoBatyFju9nrkxpVwIp/QqxQ= +github.com/hashicorp/consul/sdk v0.14.1 h1:ZiwE2bKb+zro68sWzZ1SgHF3kRMBZ94TwOCFRF4ylPs= +github.com/hashicorp/consul/sdk v0.14.1/go.mod h1:vFt03juSzocLRFo59NkeQHHmQa6+g7oU0pfzdI1mUhg= +github.com/hashicorp/consul/sdk v0.16.0 h1:SE9m0W6DEfgIVCJX7xU+iv/hUl4m/nxqMTnCdMxDpJ8= +github.com/hashicorp/consul/sdk v0.16.0/go.mod h1:7pxqqhqoaPqnBnzXD1StKed62LqJeClzVsUEy85Zr0A= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= +github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= +github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3 h1:QlWt0KvWT0lq8MFppF9tsJGF+ynG7ztc2KIPhzRGk7s= +github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= +github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= +github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/mdns v1.0.0 h1:WhIgCr5a7AaVH6jPUwjtRuuE7/RDufnUvzIr48smyxs= +github.com/hashicorp/mdns v1.0.4 h1:sY0CMhFmjIPDMlTB+HfymFHCaYLhgifZ0QhjaYKD/UQ= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3 h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M= +github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= @@ -802,14 +1368,18 @@ github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.4.0 h1:ZDDILMbB37UlAVLlWcJ2Iz1XuahZZTDZfdCKeclfq2s= github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= +github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/hydrogen18/memlistener v1.0.0 h1:JR7eDj8HD6eXrc5fWLbSUnfcQFL06PYvCc0DKQnWfaU= github.com/hydrogen18/memlistener v1.0.0/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI= +github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465 h1:KwWnWVWCNtNq/ewIX7HIKnELmEx2nDP42yskD/pi7QE= github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imkira/go-interpol v1.1.0 h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb v1.8.3 h1:WEypI1BQFTT4teLM+1qkEcvUi0dAvopAI/ir0vAiBg8= @@ -822,9 +1392,20 @@ github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 h1:vilfsD github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/informalsystems/tm-load-test v1.3.0 h1:FGjKy7vBw6mXNakt+wmNWKggQZRsKkEYpaFk/zR64VA= github.com/informalsystems/tm-load-test v1.3.0/go.mod h1:OQ5AQ9TbT5hKWBNIwsMjn6Bf4O0U4b1kRc+0qZlQJKw= +github.com/intel/goresctrl v0.2.0 h1:JyZjdMQu9Kl/wLXe9xA6s1X+tF6BWsQPFGJMEeCfWzE= +github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= +github.com/iris-contrib/blackfriday v2.0.0+incompatible h1:o5sHQHHm0ToHUlAJSTjW9UWicjJSDDauOOQ2AHuIVp4= github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= +github.com/iris-contrib/go.uuid v2.0.0+incompatible h1:XZubAYg61/JwnJNbZilGjf3b3pB80+OQg2qf6c8BfWE= github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= +github.com/iris-contrib/httpexpect/v2 v2.12.1 h1:3cTZSyBBen/kfjCtgNFoUKi1u0FVXNaAjyRJOo6AVS4= +github.com/iris-contrib/httpexpect/v2 v2.12.1/go.mod h1:7+RB6W5oNClX7PTwJgJnsQP3ZuUUYB3u61KCqeSgZ88= +github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0 h1:Kyp9KiXwsyZRTeoNjgVCrWks7D8ht9+kg6yCjh8K97o= +github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI= github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= +github.com/iris-contrib/jade v1.1.4 h1:WoYdfyJFfZIUgqNAeOyRfTNQZOksSlZ6+FnXR3AEpX0= +github.com/iris-contrib/jade v1.1.4/go.mod h1:EDqR+ur9piDl6DUgs6qRrlfzmlx/D5UybogqrXvJTBE= +github.com/iris-contrib/pongo2 v0.0.1 h1:zGP7pW51oi5eQZMIlGA3I+FHY9/HOQWDB+572yin0to= github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/iris-contrib/schema v0.0.6 h1:CPSBLyx2e91H2yJzPuhGuifVRnZBBJ3pCOMbOvPZaTw= @@ -833,13 +1414,17 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a h1:d4+I1YEKVmWZrgkt6jpXBnLgV2ZjO0YxEtLDdfIZfH4= github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= +github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 h1:2uT3aivO7NVpUPGcQX7RbHijHMyWix/yCnIrCWc+5co= +github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e h1:UvSe12bq+Uj2hWd8aOlwPmoZ+CITRFrdit+sDGfAg8U= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jgautheron/goconst v1.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM= github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jhump/gopoet v0.0.0-20190322174617-17282ff210b3/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= +github.com/jhump/gopoet v0.1.0 h1:gYjOPnzHd2nzB37xYQZxj4EIQNpBrBskRqQQ3q4ZgSg= github.com/jhump/gopoet v0.1.0/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= +github.com/jhump/goprotoc v0.5.0 h1:Y1UgUX+txUznfqcGdDef8ZOVlyQvnV0pKWZH08RmZuo= github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7UvLHRQ= github.com/jhump/protocompile v0.0.0-20220216033700-d705409f108f h1:BNuUg9k2EiJmlMwjoef3e8vZLHplbVw6DrjGFjLL+Yo= github.com/jhump/protocompile v0.0.0-20220216033700-d705409f108f/go.mod h1:qr2b5kx4HbFS7/g4uYO5qv9ei8303JMsC7ESbYiqr2Q= @@ -847,9 +1432,14 @@ github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuT github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= +github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= +github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= +github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= +github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= @@ -858,23 +1448,41 @@ github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5 h1:rhqTjzJlm7EbkELJDKMTU7udov+Se0xZkWmugr6zGok= +github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/loggo v0.0.0-20180524022052-584905176618 h1:MK144iBQF9hTSwBW/9eJm034bVoG30IshVm688T2hi8= +github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= +github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073 h1:WQM1NildKThwdP7qWrNAFGzp4ijNLw8RlgENkaI4MJs= +github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5 h1:PJr+ZMXIecYc1Ey2zucXdR73SMBtgjPgwa31099IMv0= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/junk1tm/musttag v0.5.0 h1:bV1DTdi38Hi4pG4OVWa7Kap0hi0o7EczuK6wQt9zPOM= +github.com/junk1tm/musttag v0.5.0/go.mod h1:PcR7BA+oREQYvHwgjIDmw3exJeds5JzRcvEJTfjrA0M= +github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karalabe/usb v0.0.2 h1:M6QQBNxF+CQ8OFvxrT90BA0qBOXymndZnk5q235mFc4= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kataras/blocks v0.0.7 h1:cF3RDY/vxnSRezc7vLFlQFTYXG/yAr1o7WImJuZbzC4= github.com/kataras/blocks v0.0.7/go.mod h1:UJIU97CluDo0f+zEjbnbkeMRlvYORtmc1304EeyXf4I= +github.com/kataras/golog v0.0.9/go.mod h1:12HJgwBIZFNGL0EJnMRhmvGA0PQGx8VFwrZtM4CqbAk= github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= github.com/kataras/golog v0.1.8 h1:isP8th4PJH2SrbkciKnylaND9xoTtfxv++NB+DF0l9g= github.com/kataras/golog v0.1.8/go.mod h1:rGPAin4hYROfk1qT9wZP6VY2rsb4zzc37QpdPjdkqVw= +github.com/kataras/iris/v12 v12.0.1/go.mod h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U= github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= github.com/kataras/iris/v12 v12.2.0 h1:WzDY5nGuW/LgVaFS5BtTkW3crdSKJ/FEgWnxPnIVVLI= github.com/kataras/iris/v12 v12.2.0/go.mod h1:BLzBpEunc41GbE68OUaQlqX4jzi791mx5HU04uPb90Y= +github.com/kataras/jwt v0.1.8 h1:u71baOsYD22HWeSOg32tCHbczPjdCk7V4MMeJqTtmGk= +github.com/kataras/jwt v0.1.8/go.mod h1:Q5j2IkcIHnfwy+oNY3TVWuEBJNw0ADgCcXK9CaZwV4o= +github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6im82hfqw= github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= +github.com/kataras/neffos v0.0.21 h1:UwN/F44jlqdtgFI29y3VhA7IlJ4JbK3UjCbTDg1pYoo= +github.com/kataras/neffos v0.0.21/go.mod h1:FeGka8lu8cjD2H+0OpBvW8c6xXawy3fj5VX6xcIJ1Fg= +github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0= github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= github.com/kataras/pio v0.0.11 h1:kqreJ5KOEXGMwHAWHDwIl+mjfNCPhAwZPa8gK7MKlyw= github.com/kataras/pio v0.0.11/go.mod h1:38hH6SWH6m4DKSYmRhlrCJ5WItwWgCVrTNU62XZyUvI= @@ -887,17 +1495,25 @@ github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4 github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.6.2 h1:uGQ9xI8/pgc9iOoCe7kWQgRE6SBTrCGmTSf0LrEtY7c= github.com/kisielk/errcheck v1.6.2/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= +github.com/kisielk/errcheck v1.6.3 h1:dEKh+GLHcWm2oN34nMvDzn1sqI0i0WxPvrgiJA5JuM8= +github.com/kisielk/errcheck v1.6.3/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kkHAIKE/contextcheck v1.1.3 h1:l4pNvrb8JSwRd51ojtcOxOeHJzHek+MtOyXbaR0uvmw= github.com/kkHAIKE/contextcheck v1.1.3/go.mod h1:PG/cwd6c0705/LM0KTr1acO2gORUxkSVWyLJOFW5qoo= +github.com/kkHAIKE/contextcheck v1.1.4 h1:B6zAaLhOEEcjvUgIYEqystmnFk1Oemn8bvJhbt0GMb8= +github.com/kkHAIKE/contextcheck v1.1.4/go.mod h1:1+i/gWqokIa+dm31mqGLZhZJ7Uh44DJGZVmr6QRBNJg= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE= github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= @@ -915,6 +1531,9 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/kyoh86/exportloopref v0.1.8 h1:5Ry/at+eFdkX9Vsdw3qU4YkvGtzuVfzT4X7S77LoN/M= github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= +github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= +github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= +github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= github.com/labstack/echo/v4 v4.10.0 h1:5CiyngihEO4HXsz3vVsJn7f8xAlWwRr3aY6Ih280ZKA= github.com/labstack/echo/v4 v4.10.0/go.mod h1:S/T/5fy/GigaXnHTkh0ZGe4LpkkQysvRjFMSUTkDRNQ= @@ -925,6 +1544,8 @@ github.com/ldez/gomoddirectives v0.2.3 h1:y7MBaisZVDYmKvt9/l1mjNCiSA1BVn34U0ObUc github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= github.com/ldez/tagliatelle v0.3.1 h1:3BqVVlReVUZwafJUwQ+oxbx2BEX2vUG4Yu/NOfMiKiM= github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= +github.com/ldez/tagliatelle v0.4.0 h1:sylp7d9kh6AdXN2DpVGHBRb5guTVAgOxqNGhbqc4b1c= +github.com/ldez/tagliatelle v0.4.0/go.mod h1:mNtTfrHy2haaBAw+VT7IBV6VXBThS7TCreYWbBcJ87I= github.com/ledgerwatch/interfaces v0.0.0-20230210062155-539b8171d9f0 h1:AbXB1b7L84dXxc0em6As+KkjbjEdIebsF07WVLemEXI= github.com/ledgerwatch/interfaces v0.0.0-20230210062155-539b8171d9f0/go.mod h1:ugQv1QllJzBny3cKZKxUrSnykkjkBgm27eQM6dnGAcc= github.com/ledgerwatch/log/v3 v3.7.0 h1:aFPEZdwZx4jzA3+/Pf8wNDN5tCI0cIolq/kfvgcM+og= @@ -933,9 +1554,13 @@ github.com/ledgerwatch/secp256k1 v1.0.0 h1:Usvz87YoTG0uePIV8woOof5cQnLXGYa162rFf github.com/ledgerwatch/secp256k1 v1.0.0/go.mod h1:SPmqJFciiF/Q0mPt2jVs2dTr/1TZBTIA+kPMmKgBAak= github.com/ledgerwatch/trackerslist v1.0.0 h1:6gnQu93WCTL4jPcdmc8UEmw56Cb8IFQHLGnevfIeLwo= github.com/ledgerwatch/trackerslist v1.0.0/go.mod h1:pCC+eEw8izNcnBBiSwvIq8kKsxDLInAafSW275jqFrg= +github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80 h1:6Yzfa6GP0rIo/kULo2bwGEkFvCePZ3qHDDTC3/J9Swo= +github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/leonklingele/grouper v1.1.0 h1:tC2y/ygPbMFSBOs3DcyaEMKnnwH7eYKzohOtRrf0SAg= github.com/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= +github.com/leonklingele/grouper v1.1.1 h1:suWXRU57D4/Enn6pXR0QVqqWWrnJ9Osrz+5rjt8ivzU= +github.com/leonklingele/grouper v1.1.1/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= @@ -943,12 +1568,19 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1 h1:vi1F1IQ8N7hNWytK9DpJsUfQhGuNSc19z330K6vl4zk= github.com/linxGnu/grocksdb v1.7.15/go.mod h1:pY55D0o+r8yUYLq70QmhdudxYvoDb9F+9puf4m3/W+U= github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= +github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lispad/go-generics-tools v1.1.0 h1:mbSgcxdFVmpoyso1X/MJHXbSbSL3dD+qhRryyxk+/XY= github.com/lispad/go-generics-tools v1.1.0/go.mod h1:2csd1EJljo/gy5qG4khXol7ivCPptNjG5Uv2X8MgK84= github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/lyft/protoc-gen-star/v2 v2.0.3 h1:/3+/2sWyXeMLzKd1bX+ixWKgEMsULrIivpDsuaF441o= +github.com/lyft/protoc-gen-star/v2 v2.0.3/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk= github.com/lyft/protoc-gen-validate v0.0.13 h1:KNt/RhmQTOLr7Aj8PsJ7mTronaFyx80mRTT9qF261dA= +github.com/magefile/mage v1.14.0 h1:6QDX3g6z1YvJ4olPhT1wksUcSa/V0a1B+pJb73fBjyo= +github.com/magefile/mage v1.14.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailgun/raymond/v2 v2.0.48 h1:5dmlB680ZkFG2RN/0lvTAghrSxIESeu9/2aeDqACtjw= @@ -959,34 +1591,50 @@ github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= github.com/maratori/testpackage v1.1.0 h1:GJY4wlzQhuBusMF1oahQCBtUV/AQ/k69IZ68vxaac2Q= github.com/maratori/testpackage v1.1.0/go.mod h1:PeAhzU8qkCwdGEMTEupsHJNlQu2gZopMC6RjbhmHeDc= +github.com/maratori/testpackage v1.1.1 h1:S58XVV5AD7HADMmD0fNnziNHqKvSdDuEKdPD1rNTU04= +github.com/maratori/testpackage v1.1.1/go.mod h1:s4gRK/ym6AMrqpOa/kEbQTV4Q4jb7WeLZzVhVVVOQMc= github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 h1:pWxk9e//NbPwfxat7RXkts09K+dEBJWakUWwICVqYbA= github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= +github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 h1:gWg6ZQ4JhDfJPqlo2srm/LN17lpybq15AryXIRcWYLE= +github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= +github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/matryer/moq v0.3.0 h1:4j0goF/XK3pMTc7fJB3fveuTJoQNdavRX/78vlK3Xb4= github.com/matryer/moq v0.3.0/go.mod h1:RJ75ZZZD71hejp39j4crZLsEDszGk6iH4v4YsWFKH4s= +github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2 h1:JAEbJn3j/FrhdWA9jW8B5ajsLIjeuEHLi8xE4fk997o= github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2/go.mod h1:0KeJpeMD6o+O4hW7qJOT7vyQPKrWmj26uf5wMc/IiIs= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.5/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= +github.com/mattn/go-sqlite3 v1.14.9 h1:10HX2Td0ocZpYEjhilsuo6WWtUqttj2Kb0KtD86/KYA= +github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/goveralls v0.0.2 h1:7eJB6EqsPhRVxvwEXGnqdO2sJI0PTsrWoTMXEk9/OQc= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= +github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed h1:3dQJqqDouawQgl3gBE1PNHKFkJYGEuFb1DbSlaxdosE= +github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg= +github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= +github.com/mediocregopher/radix/v3 v3.8.1 h1:rOkHflVuulFKlwsLY01/M2cM2tWCjDoETcMqKbAWu1M= +github.com/mediocregopher/radix/v3 v3.8.1/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= +github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 h1:zpIH83+oKzcpryru8ceC6BxnoG8TBrhgAvRg8obzup0= +github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= github.com/mgechev/revive v1.2.4 h1:+2Hd/S8oO2H0Ikq2+egtNwQsVhAeELHjxjIUFX5ajLI= github.com/mgechev/revive v1.2.4/go.mod h1:iAWlQishqCuj4yhV24FTnKSXGpbAA+0SckXB8GQMX/Q= +github.com/mgechev/revive v1.3.1 h1:OlQkcH40IB2cGuprTPcjB0iIUddgVZgGmDX3IAMR8D4= +github.com/mgechev/revive v1.3.1/go.mod h1:YlD6TTWl2B8A103R9KWJSPVI9DrEf+oqr15q21Ld+5I= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/microcosm-cc/bluemonday v1.0.23 h1:SMZe2IGa0NuHvnVNAZ+6B38gsTbi5e4sViiWJyDDqFY= github.com/microcosm-cc/bluemonday v1.0.23/go.mod h1:mN70sk7UkkF8TUr2IGBpNN0jAgStuPzlK76QuruE/z4= @@ -994,24 +1642,55 @@ github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKju github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= +github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU= +github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= +github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible h1:aKW/4cBs+yK6gpqU3K/oIwk9Q/XICqd3zOX/UFuvqmk= +github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= +github.com/mitchellh/cli v1.1.0 h1:tEElEatulEHDeedTxwckzyYMA5c86fbmNIUL1hBIiTg= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= +github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/gox v0.4.0 h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc= +github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= +github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= +github.com/mmcloughlin/avo v0.5.0 h1:nAco9/aI9Lg2kiuROBY6BhCI/z0t5jEvJfjWbL8qXLU= +github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= github.com/moby/buildkit v0.10.4 h1:FvC+buO8isGpUFZ1abdSLdGHZVqg9sqI4BbFL8tlzP4= github.com/moby/buildkit v0.10.4/go.mod h1:Yajz9vt1Zw5q9Pp4pdb3TCSUXJBIroIQGQ3TTs/sLug= +github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= +github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= +github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/sys/mount v0.3.0 h1:bXZYMmq7DBQPwHRxH/MG+u9+XF90ZOwoXpHTOznMGp0= +github.com/moby/sys/mount v0.3.0/go.mod h1:U2Z3ur2rXPFrFmy4q6WMwWrBOAQGYtYTRVM8BIvzbwk= github.com/moby/sys/mountinfo v0.5.0 h1:2Ks8/r6lopsxWi9m58nlwjaeSzUX9iiL1vj5qB/9ObI= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= +github.com/moby/sys/mountinfo v0.6.0 h1:gUDhXQx58YNrpHlK4nSL+7y2pxFZkUcXqzFDKWdC0Oo= github.com/moby/sys/mountinfo v0.6.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= +github.com/moby/sys/signal v0.6.0 h1:aDpY94H8VlhTGa9sNYUFCFsMZIUh5wm0B6XkIoJj/iY= +github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= +github.com/moby/sys/symlink v0.2.0 h1:tk1rOM+Ljp0nFmfOIBtlV3rTDlWOwFRhjEeAhZB0nZc= +github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae h1:O4SWKdcHVCvYqyDV+9CJA1fcDN2L11Bule0iFy3YlAI= github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA= github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/moricho/tparallel v0.2.1 h1:95FytivzT6rYzdJLdtfn6m1bfFJylOJK41+lgv/EHf4= github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= +github.com/moricho/tparallel v0.3.0 h1:8dDx3S3e+jA+xiQXC7O3dvfRTe/J+FYlTDDW01Y7z/Q= +github.com/moricho/tparallel v0.3.0/go.mod h1:leENX2cUv7Sv2qDgdi0D0fCftN8fRC67Bcn8pqzeYNI= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= +github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5 h1:0KqC6/sLy7fDpBdybhVkkv4Yz+PmB7c9Dz9z3dLW804= +github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5/go.mod h1:FUqVoUPHSEdDR0MnFM3Dh8AU0pZHLXUD127SAJGER/s= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mrunalp/fileutils v0.5.1 h1:F+S7ZlNKnrwHfSwdlgNSkKo67ReVf8o9fel6C3dkm/Q= github.com/mrunalp/fileutils v0.5.1/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= @@ -1027,28 +1706,45 @@ github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo github.com/nats-io/jwt v0.3.2 h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI= github.com/nats-io/jwt/v2 v2.0.3 h1:i/O6cmIsjpcQyWDYNcq2JyZ3/VTF8SJ4JWluI5OhpvI= github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= +github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= +github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.5.0 h1:wsnVaaXH9VRSg+A2MVg5Q727/CqxnmPLGFQ3YZYKTQg= github.com/nats-io/nats-server/v2 v2.5.0/go.mod h1:Kj86UtrXAL6LwYRA6H4RqzkHhK0Vcv2ZnKD5WbQ1t3g= +github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= github.com/nats-io/nats.go v1.31.0 h1:/WFBHEc/dOKBF6qf1TZhrdEfTmOZ5JzdJ+Y3m6Y/p7E= github.com/nats-io/nats.go v1.31.0/go.mod h1:di3Bm5MLsoB4Bx61CBTsxuarI36WbhAwOm8QrW39+i8= +github.com/nats-io/nats.go v1.34.0 h1:fnxnPCNiwIG5w08rlMcEKTUw4AV/nKyGCOJE8TdhSPk= +github.com/nats-io/nats.go v1.34.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8= +github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= github.com/nats-io/nkeys v0.4.6 h1:IzVe95ru2CT6ta874rt9saQRkWfe2nFj1NtvYSLqMzY= github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADymtkpts= +github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI= +github.com/nats-io/nkeys v0.4.7/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6FxaNu/BnU2OAaLF86eTVhP2hjTB6iMvItA= github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/nishanths/exhaustive v0.8.3 h1:pw5O09vwg8ZaditDp/nQRqVnrMczSJDxRDJMowvhsrM= github.com/nishanths/exhaustive v0.8.3/go.mod h1:qj+zJJUgJ76tR92+25+03oYUhzF4R7/2Wk7fGTfCHmg= +github.com/nishanths/exhaustive v0.9.5 h1:TzssWan6orBiLYVqewCG8faud9qlFntJE30ACpzmGME= +github.com/nishanths/exhaustive v0.9.5/go.mod h1:IbwrGdVMizvDcIxPYGVdQn5BqWJaOwpCvg4RGb8r/TA= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= +github.com/nunnatsa/ginkgolinter v0.9.0 h1:Sm0zX5QfjJzkeCjEp+t6d3Ha0jwvoDjleP9XCsrEzOA= +github.com/nunnatsa/ginkgolinter v0.9.0/go.mod h1:FHaMLURXP7qImeH6bvxWJUpyH+2tuqe5j4rW1gxJRmI= +github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2 h1:wVfs8F+in6nTBMkA7CbRw+zZMIB7nNM825cM1wuzoTk= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= +github.com/oklog/ulid/v2 v2.1.0 h1:+9lhoxAP56we25tyYETBBY1YLA2SaoLvUFgrP2miPJU= +github.com/oklog/ulid/v2 v2.1.0/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= @@ -1057,6 +1753,7 @@ github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 h1:3 github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.10.0 h1:rAiKF8hTcgLI3w0DHm6i0ylVVcOrlgR1kK99DRLDhyU= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= +github.com/opencontainers/selinux v1.10.1 h1:09LIPVRP3uuZGQvgR+SgMSNBd1Eb3vlRbGqQpoHsF8w= github.com/opencontainers/selinux v1.10.1/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 h1:lM6RxxfUMrYL/f8bWEUqdXrANWtrL7Nndbm9iFN0DlU= github.com/opentracing/basictracer-go v1.0.0 h1:YyUAhaEfjoWXclZVJ9sGoNct7j4TVk7lZWlQw5UXuoo= @@ -1065,12 +1762,19 @@ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYr github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5 h1:ZCnq+JUrvXcDVhX/xRolRBZifmabN1HcS1wrPSvxhrU= github.com/openzipkin/zipkin-go v0.2.5 h1:UwtQQx2pyPIgWYHRg+epgdx1/HnBQTgN3/oIYEJTQzU= github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= +github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde h1:x0TT0RDC7UhAVbbWWBzr41ElhJx5tXPWkIHA2HWPRuw= +github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= +github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1kY= +github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM= github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= +github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0 h1:TJIWdbX0B+kpNagQrjgq8bCMrbhiuX73M2XwgtDMoOI= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.1 h1:BCmzIS3n71sGfHB5NMNDB3lHYPz8fWSkCAErHed//qc= github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pact-foundation/pact-go v1.0.4 h1:OYkFijGHoZAYbOIb1LWXrwKQbMMRUv1oQ89blD2Mh2Q= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= @@ -1088,10 +1792,14 @@ github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssy github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d h1:CdDQnGF8Nq9ocOS/xlSptM1N3BbrA6/kmaep5ggwaIA= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= +github.com/phpdave11/gofpdf v1.4.2 h1:KPKiIbfwbvC/wOncwhrpRdXVj2CZTCFlw4wnoyjtHfQ= github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/phpdave11/gofpdi v1.0.13 h1:o61duiW8M9sMlkVXWlvP92sZJtGKENvW3VExs6dZukQ= github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= +github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= +github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pion/datachannel v1.5.2 h1:piB93s8LGmbECrpO84DnkIVWasRMk3IimbcXkTQLE6E= github.com/pion/datachannel v1.5.2/go.mod h1:FTGQWaHrdCwIJ1rw6xBIfZVkslikjShim5yr05XFuCQ= github.com/pion/dtls/v2 v2.1.5 h1:jlh2vtIyUBShchoTDqpCCqiYCyRFJ/lvf/gQ8TALs+c= @@ -1133,9 +1841,13 @@ github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzL github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= +github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA= +github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo= github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pointlander/compress v1.1.1-0.20190518213731-ff44bd196cc3 h1:hUmXhbljNFtrH5hzV9kiRoddZ5nfPTq3K0Sb2hYYiqE= github.com/pointlander/compress v1.1.1-0.20190518213731-ff44bd196cc3/go.mod h1:q5NXNGzqj5uPnVuhGkZfmgHqNUhf15VLi6L9kW0VEc0= @@ -1145,8 +1857,13 @@ github.com/pointlander/peg v1.0.1 h1:mgA/GQE8TeS9MdkU6Xn6iEzBmQUQCNuWD7rHCK6Mjs0 github.com/pointlander/peg v1.0.1/go.mod h1:5hsGDQR2oZI4QoWz0/Kdg3VSVEC31iJw/b7WjqCBGRI= github.com/polyfloyd/go-errorlint v1.0.5 h1:AHB5JRCjlmelh9RrLxT9sgzpalIwwq4hqE8EkwIwKdY= github.com/polyfloyd/go-errorlint v1.0.5/go.mod h1:APVvOesVSAnne5SClsPxPdfvZTVDojXh1/G3qb5wjGI= +github.com/polyfloyd/go-errorlint v1.4.5 h1:70YWmMy4FgRHehGNOUask3HtSFSOLKgmDn7ryNe7LqI= +github.com/polyfloyd/go-errorlint v1.4.5/go.mod h1:sIZEbFoDOCnTYYZoVkjc4hTnM459tuWA9H/EkdXwsKk= github.com/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= +github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.0/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= @@ -1157,8 +1874,7 @@ github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= @@ -1166,6 +1882,7 @@ github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+ github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= @@ -1176,18 +1893,34 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/quasilyte/go-ruleguard v0.3.1-0.20210203134552-1b5a410e1cc8/go.mod h1:KsAh3x0e7Fkpgs+Q9pNLS5XpFSvYCEVl5gP9Pp1xp30= github.com/quasilyte/go-ruleguard v0.3.18 h1:sd+abO1PEI9fkYennwzHn9kl3nqP6M5vE7FiOzZ+5CE= github.com/quasilyte/go-ruleguard v0.3.18/go.mod h1:lOIzcYlgxrQ2sGJ735EHXmf/e9MJ516j16K/Ifcttvs= +github.com/quasilyte/go-ruleguard v0.4.0 h1:DyM6r+TKL+xbKB4Nm7Afd1IQh9kEUKQs2pboWGKtvQo= +github.com/quasilyte/go-ruleguard v0.4.0/go.mod h1:Eu76Z/R8IXtViWUIHkE3p8gdH3/PKk1eh3YGfaEof10= github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/go-ruleguard/dsl v0.3.21 h1:vNkC6fC6qMLzCOGbnIHOd5ixUGgTbp3Z4fGnUgULlDA= github.com/quasilyte/go-ruleguard/dsl v0.3.21/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= +github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71 h1:CNooiryw5aisadVfzneSZPswRWvnVW8hF1bS/vo8ReI= github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= github.com/quasilyte/gogrep v0.0.0-20220828223005-86e4605de09f h1:6Gtn2i04RD0gVyYf2/IUMTIs+qYleBt4zxDqkLTcu4U= github.com/quasilyte/gogrep v0.0.0-20220828223005-86e4605de09f/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= +github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= +github.com/quasilyte/gogrep v0.5.0/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 h1:L8QM9bvf68pVdQ3bCFZMDmnt9yqcMBro1pC7F+IPYMY= github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= +github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl980XxGFEZSS6KlBGIV0diGdySzxATTWoqaU= +github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= +github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= +github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= +github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5 h1:CvqZS4QYHBRvx7AeFdimd16HCbLlYsvQMcKDACpJW/c= +github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls= +github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96 h1:J8J/cgLDRuqXJnwIrRDBvtl+LLsdg7De74znW/BRRq4= +github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls= +github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e h1:eTWZyPUnHcuGRDiryS/l2I7FfKjbU3IBx3IjqHPxuKU= +github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI= github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= @@ -1198,41 +1931,72 @@ github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 h1:Lt9DzQALzHoDwMBGJ6v8ObDPR0dzr2a6sXTB1Fq7IHs= github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417/go.mod h1:qe5TWALJ8/a1Lqznoc5BDHpYX/8HU60Hm2AwRmqzxqA= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= +github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= +github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= +github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= +github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245 h1:K1Xf3bKttbF+koVGaX5xngRIZ5bVjbmPnaxE/dR08uY= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/ryancurrah/gomodguard v1.2.4 h1:CpMSDKan0LtNGGhPrvupAoLeObRFjND8/tU1rEOtBp4= github.com/ryancurrah/gomodguard v1.2.4/go.mod h1:+Kem4VjWwvFpUJRJSwa16s1tBJe+vbv02+naTow2f6M= +github.com/ryancurrah/gomodguard v1.3.0 h1:q15RT/pd6UggBXVBuLps8BXRvl5GPBcwVA7BJHMLuTw= +github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= github.com/ryanrolds/sqlclosecheck v0.3.0 h1:AZx+Bixh8zdUBxUA1NxbxVAS78vTPq4rCb8OUZI9xFw= github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= +github.com/ryanrolds/sqlclosecheck v0.4.0 h1:i8SX60Rppc1wRuyQjMciLqIzV3xnoHB7/tXbr6RGYNI= +github.com/ryanrolds/sqlclosecheck v0.4.0/go.mod h1:TBRRjzL31JONc9i4XMinicuo+s+E8yKZ5FN8X3G6CKQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= +github.com/ryanuber/columnize v2.1.0+incompatible h1:j1Wcmh8OrK4Q7GXY+V7SVSY8nUWQxHW5TkBe7YUl+2s= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/crypt v0.17.0 h1:ZA/7pXyjkHoK4bW4mIdnCLvL8hd+Nrbiw7Dqk7D4qUk= github.com/sagikazarmark/crypt v0.17.0/go.mod h1:SMtHTvdmsZMuY/bpZoqokSoChIrcJ/epOxZN58PbZDg= +github.com/sagikazarmark/crypt v0.19.0 h1:WMyLTjHBo64UvNcWqpzY3pbZTYgnemZU8FBZigKc42E= +github.com/sagikazarmark/crypt v0.19.0/go.mod h1:c6vimRziqqERhtSe0MhIvzE1w54FrCHtrXb5NH/ja78= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da h1:p3Vo3i64TCLY7gIfzeQaUJ+kppEO5WQG3cL8iE8tGHU= +github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQo= +github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= github.com/sanposhiho/wastedassign/v2 v2.0.6 h1:+6/hQIHKNJAUixEj6EmOngGIisyeI+T3335lYTyxRoA= github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= +github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= +github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= github.com/sashamelentyev/usestdlibvars v1.20.0 h1:K6CXjqqtSYSsuyRDDC7Sjn6vTMLiSJa4ZmDkiokoqtw= github.com/sashamelentyev/usestdlibvars v1.20.0/go.mod h1:0GaP+ecfZMXShS0A94CJn6aEuPRILv8h/VuWI9n1ygg= +github.com/sashamelentyev/usestdlibvars v1.23.0 h1:01h+/2Kd+NblNItNeux0veSL5cBF1jbEOPrEhDzGYq0= +github.com/sashamelentyev/usestdlibvars v1.23.0/go.mod h1:YPwr/Y1LATzHI93CqoPUN/2BzGQ/6N/cl/KwgR0B/aU= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/schollz/closestmatch v2.1.0+incompatible h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sclevine/agouti v3.0.0+incompatible h1:8IBJS6PWz3uTlMP3YBIR5f+KAldcGuOeFkFbUWfBgK4= +github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646 h1:RpforrEYXWkmGwJHIGnLZ3tTWStkjVVstwzNGqxX2Ds= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/securego/gosec/v2 v2.13.1 h1:7mU32qn2dyC81MH9L2kefnQyRMUarfDER3iQyMHcjYM= github.com/securego/gosec/v2 v2.13.1/go.mod h1:EO1sImBMBWFjOTFzMWfTRrZW6M15gm60ljzrmy/wtHo= +github.com/securego/gosec/v2 v2.15.0 h1:v4Ym7FF58/jlykYmmhZ7mTm7FQvN/setNm++0fgIAtw= +github.com/securego/gosec/v2 v2.15.0/go.mod h1:VOjTrZOkUtSDt2QLSJmQBMWnvwiQPEjg0l+5juIqGk8= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002 h1:ka9QPuQg2u4LGipiZGsgkg3rJCo4iIUCy75FddM0GRQ= +github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= +github.com/shirou/gopsutil/v3 v3.23.2 h1:PAWSuiAszn7IhPMBtXsbSCafej7PqUOvY6YywlQUExU= +github.com/shirou/gopsutil/v3 v3.23.2/go.mod h1:gv0aQw33GLo3pG8SiWKiQrbDzbRY1K80RyZJ7V4Th1M= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041 h1:llrF3Fs4018ePo4+G/HV/uQUqEI1HMDjCeOf2V6puPc= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= @@ -1242,6 +2006,8 @@ github.com/sivchari/nosnakecase v1.7.0 h1:7QkpWIRMe8x25gckkFd2A5Pi6Ymo0qgr4JrhGt github.com/sivchari/nosnakecase v1.7.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= github.com/sivchari/tenv v1.7.0 h1:d4laZMBK6jpe5PWepxlV9S+LC0yXqvYHiq8E6ceoVVE= github.com/sivchari/tenv v1.7.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= +github.com/sivchari/tenv v1.7.1 h1:PSpuD4bu6fSmtWMxSGWcvqUUgIn7k3yOJhOIzVWn8Ak= +github.com/sivchari/tenv v1.7.1/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= @@ -1251,16 +2017,22 @@ github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPH github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/sonatard/noctx v0.0.1 h1:VC1Qhl6Oxx9vvWo3UDgrGXYCeKCe3Wbw7qAWL6FrmTY= github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= +github.com/sonatard/noctx v0.0.2 h1:L7Dz4De2zDQhW8S0t+KUjY0MAQJd6SgVwhzNIc4ok00= +github.com/sonatard/noctx v0.0.2/go.mod h1:kzFz+CzWSjQ2OzIm46uJZoXuBpa2+0y3T36U18dWqIo= github.com/sony/gobreaker v0.4.1 h1:oMnRNZXX5j85zso6xCPRNPtmAycat+WcoKbklScLDgQ= github.com/sourcegraph/go-diff v0.6.1 h1:hmA1LzxW0n1c3Q4YbrFgg4P99GSnebYa3x8gr0HZqLQ= github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= +github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= +github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.4.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= @@ -1278,46 +2050,74 @@ github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YE github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= +github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980 h1:lIOOHPEbXzO3vnmx2gok1Tfs31Q8GQqKLc8vVqyQq/I= +github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e h1:mOtuXaRAbVZsxAHVdPR3IjfmN8T1h2iczJLynhLybf8= github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344 h1:m+8fKfQwCAy1QjzINvKe/pYtLjo2dl59x2w9YSEJxuY= github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c h1:+aPplBwWcHBo6q9xrfWdMrT9o4kltkmmvpemgIjep/8= +github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c/go.mod h1:SbErYREK7xXdsRiigaQiQkI9McGRzYMvlKYaP3Nimdk= +github.com/tchap/go-patricia v2.2.6+incompatible h1:JvoDL7JSoIP2HDE8AbDH3zC8QBPxmzYe32HHy5yQ+Ck= +github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tdakkota/asciicheck v0.1.1 h1:PKzG7JUTUmVspQTDqtkX9eSiLGossXTybutHwTXuO0A= github.com/tdakkota/asciicheck v0.1.1/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= +github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= +github.com/tdakkota/asciicheck v0.2.0/go.mod h1:Qb7Y9EgjCLJGup51gDHFzbI08/gbGhL/UVhYIPWG2rg= github.com/tdewolff/minify/v2 v2.12.4 h1:kejsHQMM17n6/gwdw53qsi6lg0TGddZADVyQOz1KMdE= github.com/tdewolff/minify/v2 v2.12.4/go.mod h1:h+SRvSIX3kwgwTFOpSckvSxgax3uy8kZTSF1Ojrr3bk= github.com/tdewolff/parse/v2 v2.6.4 h1:KCkDvNUMof10e3QExio9OPZJT8SbdKojLBumw8YZycQ= github.com/tdewolff/parse/v2 v2.6.4/go.mod h1:woz0cgbLwFdtbjJu8PIKxhW05KplTFQkOdX78o+Jgrs= +github.com/tdewolff/test v1.0.7 h1:8Vs0142DmPFW/bQeHRP3MV19m1gvndjUb1sn8yy74LM= github.com/tdewolff/test v1.0.7/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= +github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= +github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= github.com/tetafro/godot v1.4.11 h1:BVoBIqAf/2QdbFmSwAWnaIqDivZdOV0ZRwEm6jivLKw= github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 h1:kl4KhGNsJIbDHS9/4U9yQo1UcPQM0kOMJHn29EoH/Ro= github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= +github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e h1:MV6KaVu/hzByHP0UvJ4HcMGE/8a6A4Rggc/0wx2AvJo= +github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= github.com/timonwong/loggercheck v0.9.3 h1:ecACo9fNiHxX4/Bc02rW2+kaJIAMAes7qJ7JKxt0EZI= github.com/timonwong/loggercheck v0.9.3/go.mod h1:wUqnk9yAOIKtGA39l1KLE9Iz0QiTocu/YZoOf+OzFdw= +github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= +github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8 h1:ndzgwNDnKIqyCvHTXaCqh9KlOWKvBry6nuXMJmonVsE= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tomarrell/wrapcheck/v2 v2.7.0 h1:J/F8DbSKJC83bAvC6FoZaRjZiZ/iKoueSdrEkmGeacA= github.com/tomarrell/wrapcheck/v2 v2.7.0/go.mod h1:ao7l5p0aOlUNJKI0qVwB4Yjlqutd0IvAB9Rdwyilxvg= +github.com/tomarrell/wrapcheck/v2 v2.8.1 h1:HxSqDSN0sAt0yJYsrcYVoEeyM4aI9yAm3KQpIXDJRhQ= +github.com/tomarrell/wrapcheck/v2 v2.8.1/go.mod h1:/n2Q3NZ4XFT50ho6Hbxg+RV1uyo2Uow/Vdm9NQcl5SE= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= +github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274 h1:wbyZxD6IPFp0sl5uscMOJRsz5UKGFiNiD16e+MVfKZY= +github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274/go.mod h1:oPAfvw32vlUJSjyDcQ3Bu0nb2ON2B+G0dtVN/SZNJiA= +github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 h1:8eY6m1mjgyB8XySUR7WvebTM8D/Vs86jLJzD/Tw7zkc= +github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg= +github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0= +github.com/tonistiigi/go-archvariant v1.0.0/go.mod h1:TxFmO5VS6vMq2kvs3ht04iPXtu2rUT/erOnGFYfk5Ho= +github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0= +github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk= +github.com/tonistiigi/vt100 v0.0.0-20210615222946-8066bb97264f h1:DLpt6B5oaaS8jyXHa9VA4rrZloBVPVXeCtrOsrFauxc= +github.com/tonistiigi/vt100 v0.0.0-20210615222946-8066bb97264f/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc= github.com/torquem-ch/mdbx-go v0.27.5 h1:bbhXQGFCmoxbRDXKYEJwxSOOTeBKwoD4pFBUpK9+V1g= github.com/torquem-ch/mdbx-go v0.27.5/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= @@ -1326,6 +2126,7 @@ github.com/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iL github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI= github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= +github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA= github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= @@ -1344,16 +2145,25 @@ github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQ github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ= github.com/valyala/histogram v1.2.0/go.mod h1:Hb4kBwb4UxsaNbbbh+RRz8ZR6pdodR57tzWUS3BUzXY= +github.com/valyala/quicktemplate v1.7.0 h1:LUPTJmlVcb46OOUY3IeD9DojFpAVbsG+5WFTcjMJzCM= +github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= +github.com/vbatts/tar-split v0.11.2 h1:Via6XqJr0hceW4wff3QRzD5gAk/tatMw/4ZA7cTlIME= +github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI= github.com/vektra/mockery/v2 v2.14.0 h1:KZ1p5Hrn8tiY+LErRMr14HHle6khxo+JKOXLBW/yfqs= github.com/vektra/mockery/v2 v2.14.0/go.mod h1:bnD1T8tExSgPD1ripLkDbr60JA9VtQeu12P3wgLZd7M= +github.com/vektra/mockery/v2 v2.23.1 h1:N59FENM2d/gWE6Ns5JPuf9a7jqQWeheGefZqvuvb1dM= +github.com/vektra/mockery/v2 v2.23.1/go.mod h1:Zh3Kv1ckKs6FokhlVLcCu6UTyzfS3M8mpROz1lBNp+w= github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= +github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5 h1:+UB2BJA852UkGH42H+Oee69djmxS3ANzl2b/JtT1YiA= github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df h1:OviZH7qLw/7ZovXvuNyL3XQl8UFofeikI1NW1Gypu7k= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= +github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f h1:p4VB7kIXpOQvVn1ZaTIVp+3vuYAXFe3OJEvjbUYJLaA= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= @@ -1368,63 +2178,112 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xhit/go-str2duration v1.2.0 h1:BcV5u025cITWxEQKGWr1URRzrcXtu7uk8+luz3Yuhwc= +github.com/xhit/go-str2duration v1.2.0/go.mod h1:3cPSlfZlUHVlneIVfePFWcJZsuwf+P1v2SRTV4cUmp4= github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= +github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= +github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= +github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/yeya24/promlinter v0.2.0 h1:xFKDQ82orCU5jQujdaD8stOHiv8UN68BSdn2a8u8Y3o= github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= github.com/yosssi/ace v0.0.5 h1:tUkIP/BLdKqrlrPwcmH0shwEEhTRHoGnc1wFIWmaBUA= github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0= +github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= +github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= +github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= +github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= gitlab.com/bosi/decorder v0.2.3 h1:gX4/RgK16ijY8V+BRQHAySfQAb354T7/xQpDB2n10P0= gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= +go.einride.tech/aip v0.66.0 h1:XfV+NQX6L7EOYK11yoHHFtndeaWh3KbD9/cN/6iWEt8= +go.einride.tech/aip v0.66.0/go.mod h1:qAhMsfT7plxBX+Oy7Huol6YUvZ0ZzdUz26yZsQwfl1M= +go.einride.tech/aip v0.67.1 h1:d/4TW92OxXBngkSOwWS2CH5rez869KpKMaN44mdxkFI= +go.einride.tech/aip v0.67.1/go.mod h1:ZGX4/zKw8dcgzdLsrvpOOGxfxI2QSk12SlP7d6c0/XI= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0= go.etcd.io/etcd/api/v3 v3.5.10 h1:szRajuUUbLyppkhs9K6BRtjY37l66XQQmw7oZRANE4k= go.etcd.io/etcd/api/v3 v3.5.10/go.mod h1:TidfmT4Uycad3NM/o25fG3J07odo4GBB9hoxaodFCtI= +go.etcd.io/etcd/api/v3 v3.5.12 h1:W4sw5ZoU2Juc9gBWuLk5U6fHfNVyY1WC5g9uiXZio/c= +go.etcd.io/etcd/api/v3 v3.5.12/go.mod h1:Ot+o0SWSyT6uHhA56al1oCED0JImsRiU9Dc26+C2a+4= go.etcd.io/etcd/client/pkg/v3 v3.5.10 h1:kfYIdQftBnbAq8pUWFXfpuuxFSKzlmM5cSn76JByiT0= go.etcd.io/etcd/client/pkg/v3 v3.5.10/go.mod h1:DYivfIviIuQ8+/lCq4vcxuseg2P2XbHygkKwFo9fc8U= +go.etcd.io/etcd/client/pkg/v3 v3.5.12 h1:EYDL6pWwyOsylrQyLp2w+HkQ46ATiOvoEdMarindU2A= +go.etcd.io/etcd/client/pkg/v3 v3.5.12/go.mod h1:seTzl2d9APP8R5Y2hFL3NVlD6qC/dOT+3kvrqPyTas4= go.etcd.io/etcd/client/v2 v2.305.10 h1:MrmRktzv/XF8CvtQt+P6wLUlURaNpSDJHFZhe//2QE4= go.etcd.io/etcd/client/v2 v2.305.10/go.mod h1:m3CKZi69HzilhVqtPDcjhSGp+kA1OmbNn0qamH80xjA= +go.etcd.io/etcd/client/v2 v2.305.12 h1:0m4ovXYo1CHaA/Mp3X/Fak5sRNIWf01wk/X1/G3sGKI= +go.etcd.io/etcd/client/v2 v2.305.12/go.mod h1:aQ/yhsxMu+Oht1FOupSr60oBvcS9cKXHrzBpDsPTf9E= go.etcd.io/etcd/client/v3 v3.5.10 h1:W9TXNZ+oB3MCd/8UjxHTWK5J9Nquw9fQBLJd5ne5/Ao= go.etcd.io/etcd/client/v3 v3.5.10/go.mod h1:RVeBnDz2PUEZqTpgqwAtUd8nAPf5kjyFyND7P1VkOKc= +go.etcd.io/etcd/client/v3 v3.5.12 h1:v5lCPXn1pf1Uu3M4laUE2hp/geOTc5uPcYYsNe1lDxg= +go.etcd.io/etcd/client/v3 v3.5.12/go.mod h1:tSbBCakoWmmddL+BKVAJHa9km+O/E+bumDe9mSbPiqw= go.etcd.io/gofail v0.1.0 h1:XItAMIhOojXFQMgrxjnd2EIIHun/d5qL0Pf7FzVTkFg= go.etcd.io/gofail v0.1.0/go.mod h1:VZBCXYGZhHAinaBiiqYvuDynvahNsAyLFwB3kEHKz1M= +go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1 h1:A/5uWzF44DlIgdm/PQFwfMkW0JX+cIcQi/SwLAmZP5M= +go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.3/go.mod h1:Dts42MGkzZne2yCru741+bFiTMWkIj/LLRizad7b9tw= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0/go.mod h1:tIKj3DbO8N9Y2xo52og3irLsPI4GW02DSMtrVgNMgxg= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.29.0 h1:Wjp9vsVSIEyvdiaECfqxY9xBqQ7JaSCGtvHgR4doXZk= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.29.0/go.mod h1:vHItvsnJtp7ES++nFLLFBzUWny7fJQSvTlxFcqQGUr4= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0/go.mod h1:rdENBZMT2OE6Ne/KLwpiXudnAsbdrdBaqBvTN8M8BgA= go.opentelemetry.io/otel v1.11.0/go.mod h1:H2KtuEphyMvlhZ+F7tg9GRhAOe60moNx61Ex+WmiKkk= +go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= go.opentelemetry.io/otel v1.23.0/go.mod h1:YCycw9ZeKhcJFrb34iVSkyT0iczq/zYDtZYFufObyB0= +go.opentelemetry.io/otel/exporters/jaeger v1.4.1 h1:VHCK+2yTZDqDaVXj7JH2Z/khptuydo6C0ttBh2bxAbc= +go.opentelemetry.io/otel/exporters/jaeger v1.4.1/go.mod h1:ZW7vkOu9nC1CxsD8bHNHCia5JUbwP39vxgd1q4Z5rCI= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.1 h1:imIM3vRDMyZK1ypQlQlO+brE22I9lRhJsBDXpDWjlz8= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.1/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1 h1:WPpPsAAs8I2rA47v5u0558meKmmwm1Dj99ZbqCV8sZ8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1/go.mod h1:o5RW5o2pKpJLD5dNTCmjF1DorYwMeFJmb/rKr5sLaa8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.1 h1:AxqDiGk8CorEXStMDZF5Hz9vo9Z7ZZ+I5m8JRl/ko40= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.1/go.mod h1:c6E4V3/U+miqjs/8l950wggHGL1qzlp0Ypj9xoGrPqo= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.4.1 h1:8qOago/OqoFclMUUj/184tZyRdDZFpcejSjbk5Jrl6Y= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.4.1/go.mod h1:VwYo0Hak6Efuy0TXsZs8o1hnV3dHDPNtDbycG0hI8+M= +go.opentelemetry.io/otel/internal/metric v0.27.0 h1:9dAVGAfFiiEq5NVB9FUJ5et+btbDQAUIJehJ+ikyryk= +go.opentelemetry.io/otel/internal/metric v0.27.0/go.mod h1:n1CVxRqKqYZtqyTh9U/onvKapPGv7y/rpyOTI+LFNzw= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= go.opentelemetry.io/otel/metric v1.23.0/go.mod h1:MqUW2X2a6Q8RN96E2/nqNoT+z9BSms20Jb7Bbp+HiTo= +go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= go.opentelemetry.io/otel/trace v1.11.0/go.mod h1:nyYjis9jy0gytE9LXGU+/m1sHTKbRY0fX0hulNNDP1U= +go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= go.opentelemetry.io/otel/trace v1.23.0/go.mod h1:GSGTbIClEsuZrGIzoEHqsVfxgn5UkggkflQwDScNUsk= go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8= +go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= @@ -1432,7 +2291,10 @@ go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.22.0/go.mod h1:H4siCOZOrAolnUPJEkfaSjDqyP+BDS0DdDWzwcgt3+U= go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= @@ -1440,18 +2302,28 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91 h1:Ic/qN6TEifvObMGQy72k0n1LlJr7DjWWEi+MOsDOiSk= golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 h1:jWGQJV4niP+CCmFW9ekjA9Zx8vYORzOUH2/Nl5WPuLQ= +golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1459,12 +2331,16 @@ golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+o golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs= golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20220302094943-723b81ca9867 h1:TcHcE0vrmgzNH1v3ppjcMGbhG5+9fMuvOmUYwNEF4q4= +golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= @@ -1479,15 +2355,19 @@ golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= @@ -1497,7 +2377,9 @@ golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= -golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= +golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/perf v0.0.0-20230113213139-801c7ef9e5c5 h1:ObuXPmIgI4ZMyQLIz48cJYgSyWdjUXc2SZAdyJMwEAU= golang.org/x/perf v0.0.0-20230113213139-801c7ef9e5c5/go.mod h1:UBKtEnL8aqnd+0JHqZ+2qoMDwtuy6cYhhKNoHLBiTQc= golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1513,7 +2395,6 @@ golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1527,13 +2408,14 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220325203850-36772127a21f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1541,27 +2423,37 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2 h1:IRJeR9r1pYWsHKTRe/IInb7lYvbBVIqOgsX/u0mbOWY= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= +golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1600,17 +2492,28 @@ golang.org/x/tools v0.1.9-0.20211228192929-ee1ca4ffc4da/go.mod h1:nABZi5QlRsZVlz golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= +golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= +golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/gonum v0.9.3 h1:DnoIG+QAMaF5NvxnGe/oKsgKcAc6PcUyl8q0VetfQ8s= gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= +gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= +gonum.org/v1/gonum v0.12.0 h1:xKuo6hzt+gMav00meVPUlXwSdoEJP46BR+wdxQEFK2o= +gonum.org/v1/gonum v0.12.0/go.mod h1:73TDxJfAAHeA8Mk9mf8NlIppyhQNo5GLTcYeqgo2lvY= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= +gonum.org/v1/plot v0.10.0 h1:ymLukg4XJlQnYUJCp+coQq5M7BsUJFk6XQE4HPflwdw= gonum.org/v1/plot v0.10.0/go.mod h1:JWIHJ7U20drSQb/aDpTetJzfC1KlAPldJLpkSy88dvQ= +gonum.org/v1/plot v0.10.1 h1:dnifSs43YJuNMDzB7v8wV64O4ABBHReuAVAoBxqBqS4= +gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= google.golang.org/api v0.0.0-20170206182103-3d017632ea10/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.152.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= google.golang.org/api v0.153.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= @@ -1619,6 +2522,10 @@ google.golang.org/api v0.160.0/go.mod h1:0mu0TpK33qnydLvWqbImq2b1eQ5FHRSDCBzAxX9 google.golang.org/api v0.162.0/go.mod h1:6SulDkfoBIg4NFmCuZ39XeeAgSHCPecfSUuDyYlAHs0= google.golang.org/api v0.164.0/go.mod h1:2OatzO7ZDQsoS7IFf3rvsE17/TldiU3F/zxFHeqUB5o= google.golang.org/api v0.166.0/go.mod h1:4FcBc686KFi7QI/U51/2GKKevfZMpM17sCdibqe/bSA= +google.golang.org/api v0.171.0/go.mod h1:Hnq5AHm4OTMt2BUVjael2CWZFD6vksJdWCWiUAmjC9o= +google.golang.org/api v0.178.0/go.mod h1:84/k2v8DFpDRebpGcooklv/lais3MEfqpaBLA12gl2U= +google.golang.org/api v0.183.0/go.mod h1:q43adC5/pHoSZTx5h2mSmdF7NcyfW9JuDyIOJAgS9ZQ= +google.golang.org/api v0.184.0/go.mod h1:CeDTtUEiYENAf8PPG5VZW2yNp2VM3VWbCeTioAZBTBA= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1627,12 +2534,17 @@ google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20230202175211-008b39050e57/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/genproto v0.0.0-20230227214838-9b19f0bdc514/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= google.golang.org/genproto v0.0.0-20240205150955-31a09d347014/go.mod h1:xEgQu1e4stdSSsxPDK8Azkrk/ECl5HvdPf6nbZrTS5M= google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= +google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda/go.mod h1:g2LLCvCeCSir/JJSWosk19BR4NVxGqHUC6rxIRsd7Aw= +google.golang.org/genproto v0.0.0-20240528184218-531527333157/go.mod h1:ubQlAQnzejB8uZzszhrTCU2Fyp6Vi7ZE5nn0c3W8+qQ= +google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4/go.mod h1:EvuUDCulqGgV80RvP1BHuom+smhX4qtlhnNatHuroGQ= +google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:RdyHbowztCGQySiCvQPgWQWgWhGnouTdCflKoDBt32U= google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= @@ -1640,9 +2552,15 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go. google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:PVreiBMirk8ypES6aw9d4p6iiBNSIfZEBqr3UGoAi2E= google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2/go.mod h1:O1cOfN1Cy6QEYr7VxtjOyP5AdAuR0aJ/MYZaaof623Y= -google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= +google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae/go.mod h1:FfiGhwUm6CJviekPrc0oJ+7h29e+DmWU6UtjX0ZvI7Y= +google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3/go.mod h1:kdrSS/OiLkPrNUpzD4aHgCq2rVuC/YRxok32HXZ4vRE= +google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4/go.mod h1:px9SlOOZBg1wM1zdnr8jEL4CNGUBZ+ZKYtNPApNQc4c= google.golang.org/genproto/googleapis/bytestream v0.0.0-20240304161311-37d4d3c04a78 h1:YqFWYZXim8bG9v68xU8WjTZmYKb5M5dMeSOWIp6jogI= google.golang.org/genproto/googleapis/bytestream v0.0.0-20240304161311-37d4d3c04a78/go.mod h1:vh/N7795ftP0AkN1w8XKqN4w1OdUKXW5Eummda+ofv8= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20240617180043-68d350f18fd4 h1:Rie8vnNXn/RjOgFacUrolQKaHsN10UPAXBb3IkfDdE4= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20240617180043-68d350f18fd4/go.mod h1:/oe3+SiHAwz6s+M25PyTygWm3lnrhmGqIuIfkoUocqk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= @@ -1652,18 +2570,29 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:YUWgXUFRPfoYK1IHMuxH5K6nPEXSCzIMljnQ59lLRCk= google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240429193739-8cf5692501f6/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v0.0.0-20170208002647-2a6bf6142e96/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 h1:TLkBREm4nIsEcexnCjgQd5GQWaHcqMzwQV0TX9pq8S0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= @@ -1680,18 +2609,45 @@ gopkg.in/cheggaaa/pb.v1 v1.0.27 h1:kJdccidYzt3CaHD1crCFTS1hxyhSi059NhOFUf03YFo= gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/gcfg.v1 v1.2.3 h1:m8OOJ4ccYHnx2f4gQwpno8nAX5OGOh7RLaaz0pj3Ogs= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce h1:xcEWjVhvbDy+nHP67nPDDpbYrY+ILlfndk4bRioVHaU= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= +gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= +gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= honnef.co/go/tools v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA= honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw= +honnef.co/go/tools v0.4.3 h1:o/n5/K5gXqk8Gozvs2cnL0F2S1/g1vcGCAx2vETjITw= +honnef.co/go/tools v0.4.3/go.mod h1:36ZgoUOrqOk1GxwHhyryEkq8FQWkUO2xGuSMhUCcdvA= +k8s.io/api v0.22.5 h1:xk7C+rMjF/EGELiD560jdmwzrB788mfcHiNbMQLIVI8= +k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= +k8s.io/apimachinery v0.22.5 h1:cIPwldOYm1Slq9VLBRPtEYpyhjIm1C6aAMAoENuvN9s= +k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= +k8s.io/apiserver v0.22.5 h1:71krQxCUz218ecb+nPhfDsNB6QgP1/4EMvi1a2uYBlg= +k8s.io/apiserver v0.22.5/go.mod h1:s2WbtgZAkTKt679sYtSudEQrTGWUSQAPe6MupLnlmaQ= +k8s.io/client-go v0.22.5 h1:I8Zn/UqIdi2r02aZmhaJ1hqMxcpfJ3t5VqvHtctHYFo= +k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= +k8s.io/component-base v0.22.5 h1:U0eHqZm7mAFE42hFwYhY6ze/MmVaW00JpMrzVsQmzYE= +k8s.io/component-base v0.22.5/go.mod h1:VK3I+TjuF9eaa+Ln67dKxhGar5ynVbwnGrUiNF4MqCI= +k8s.io/cri-api v0.23.1 h1:0DHL/hpTf4Fp+QkUXFefWcp1fhjXr9OlNdY9X99c+O8= +k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= +k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= +k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b h1:wxEMGetGMur3J1xuGLQY7GEQYg9bZxKn3tKo5k/eYcs= +k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +moul.io/http2curl/v2 v2.3.0 h1:9r3JfDzWPcbIklMOs2TnIFzDYvfAZvjeavG6EzP7jYs= +moul.io/http2curl/v2 v2.3.0/go.mod h1:RW4hyBjTWSYDOxapodpNEtX0g5Eb16sxklBqmd2RHcE= mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM= mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= @@ -1700,9 +2656,13 @@ mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphD mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= mvdan.cc/unparam v0.0.0-20220706161116-678bad134442 h1:seuXWbRB1qPrS3NQnHmFKLJLtskWyueeIzmLXghMGgk= mvdan.cc/unparam v0.0.0-20220706161116-678bad134442/go.mod h1:F/Cxw/6mVrNKqrR2YjFf5CaW0Bw4RL8RfbEf4GRggJk= +mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d h1:3rvTIIM22r9pvXk+q3swxUQAQOxksVMGK7sml4nG57w= +mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d/go.mod h1:IeHQjmn6TOD+e4Z3RFiZMMsLVL+A96Nvptar8Fj71is= rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= +sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= +sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0 h1:ucqkfpjg9WzSUubAO62csmucvxl4/JeW3F4I4909XkM= diff --git a/ibc/module.go b/ibc/module.go index a2688f7f..4d66c6eb 100644 --- a/ibc/module.go +++ b/ibc/module.go @@ -5,10 +5,10 @@ package ibc import ( sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - "github.com/cosmos/ibc-go/v7/modules/core/exported" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + "github.com/cosmos/ibc-go/v8/modules/core/exported" ) var _ porttypes.IBCModule = &Module{} diff --git a/ibc/module_test.go b/ibc/module_test.go index 44df31cc..ec54c361 100644 --- a/ibc/module_test.go +++ b/ibc/module_test.go @@ -7,12 +7,12 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - "github.com/cosmos/ibc-go/v7/modules/core/exported" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + "github.com/cosmos/ibc-go/v8/modules/core/exported" ) var _ porttypes.IBCModule = &MockIBCModule{} diff --git a/ibc/testing/app.go b/ibc/testing/app.go index 862377fd..7915d314 100644 --- a/ibc/testing/app.go +++ b/ibc/testing/app.go @@ -10,18 +10,17 @@ import ( "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibcgotesting "github.com/cosmos/ibc-go/v7/testing" + ibcgotesting "github.com/cosmos/ibc-go/v8/testing" exampleapp "github.com/evmos/os/example_chain" chainutil "github.com/evmos/os/example_chain/testutil" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/constants" evmostypes "github.com/evmos/os/types" "github.com/stretchr/testify/require" ) @@ -35,7 +34,7 @@ var DefaultTestingAppInit func(chainID string) func() (ibcgotesting.TestingApp, // that also act as delegators. For simplicity, each validator is bonded with a delegation // of one consensus engine unit (10^6) in the default token of the simapp from first genesis // account. A Nop logger is set in SimApp. -func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, balances ...banktypes.Balance) ibcgotesting.TestingApp { +func SetupWithGenesisValSet(t *testing.T, valSet *cmttypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, balances ...banktypes.Balance) ibcgotesting.TestingApp { app, genesisState := DefaultTestingAppInit(chainID)() // set genesis accounts authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) @@ -47,7 +46,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs bondAmt := sdk.TokensFromConsensusPower(1, evmostypes.AttoPowerReduction) for _, val := range valSet.Validators { - pk, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) + pk, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) //nolint:staticcheck require.NoError(t, err) pkAny, err := codectypes.NewAnyWithValue(pk) require.NoError(t, err) @@ -65,26 +64,26 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs MinSelfDelegation: math.ZeroInt(), } validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), math.LegacyOneDec())) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), sdk.ValAddress(val.Address).String(), math.LegacyOneDec())) } // set validators and delegations stakingParams := stakingtypes.DefaultParams() // set bond demon to be aevmos - stakingParams.BondDenom = testutil.ExampleAttoDenom + stakingParams.BondDenom = constants.ExampleAttoDenom stakingGenesis := stakingtypes.NewGenesisState(stakingParams, validators, delegations) genesisState[stakingtypes.ModuleName] = app.AppCodec().MustMarshalJSON(stakingGenesis) totalSupply := sdk.NewCoins() for _, b := range balances { // add genesis acc tokens and delegated tokens to total supply - totalSupply = totalSupply.Add(b.Coins.Add(sdk.NewCoin(testutil.ExampleAttoDenom, bondAmt))...) + totalSupply = totalSupply.Add(b.Coins.Add(sdk.NewCoin(constants.ExampleAttoDenom, bondAmt))...) } // add bonded amount to bonded pool module account balances = append(balances, banktypes.Balance{ Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), - Coins: sdk.Coins{sdk.NewCoin(testutil.ExampleAttoDenom, bondAmt)}, + Coins: sdk.Coins{sdk.NewCoin(constants.ExampleAttoDenom, bondAmt)}, }) // update total supply @@ -95,24 +94,25 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs require.NoError(t, err) // init chain will set the validator set and initialize the genesis accounts - app.InitChain( - abci.RequestInitChain{ + _, err = app.InitChain( + &abci.RequestInitChain{ ChainId: chainID, Validators: []abci.ValidatorUpdate{}, ConsensusParams: chainutil.DefaultConsensusParams, AppStateBytes: stateBytes, }, ) + require.NoError(t, err) // commit genesis changes - app.Commit() - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ - ChainID: chainID, - Height: app.LastBlockHeight() + 1, - AppHash: app.LastCommitID().Hash, - ValidatorsHash: valSet.Hash(), + _, err = app.Commit() + require.NoError(t, err) + + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{ + Height: app.LastBlockHeight(), NextValidatorsHash: valSet.Hash(), - }}) + }) + require.NoError(t, err) return app } diff --git a/ibc/testing/chain.go b/ibc/testing/chain.go index dfade4ad..03a7e82b 100644 --- a/ibc/testing/chain.go +++ b/ibc/testing/chain.go @@ -7,22 +7,22 @@ import ( "testing" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibcgotesting "github.com/cosmos/ibc-go/v7/testing" - "github.com/cosmos/ibc-go/v7/testing/mock" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + ibcgotesting "github.com/cosmos/ibc-go/v8/testing" + "github.com/cosmos/ibc-go/v8/testing/mock" "github.com/evmos/os/crypto/ethsecp256k1" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/constants" evmostypes "github.com/evmos/os/types" "github.com/stretchr/testify/require" ) // ChainIDPrefix defines the default chain ID prefix for Evmos test chains var ( - ChainIDPrefix = testutil.ExampleChainID + ChainIDPrefix = constants.ExampleChainID ChainIDSuffix = "" ) @@ -46,9 +46,9 @@ func NewTestChain(t *testing.T, coord *ibcgotesting.Coordinator, chainID string) require.NoError(t, err) // create validator set with single validator - validator := tmtypes.NewValidator(pubKey, 1) - valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) - signers := make(map[string]tmtypes.PrivValidator) + validator := cmttypes.NewValidator(pubKey, 1) + valSet := cmttypes.NewValidatorSet([]*cmttypes.Validator{validator}) + signers := make(map[string]cmttypes.PrivValidator) signers[pubKey.Address().String()] = privVal // generate genesis account @@ -63,7 +63,7 @@ func NewTestChain(t *testing.T, coord *ibcgotesting.Coordinator, chainID string) balance := banktypes.Balance{ Address: baseAcc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, amount)), + Coins: sdk.NewCoins(sdk.NewCoin(constants.ExampleAttoDenom, amount)), } app := SetupWithGenesisValSet(t, valSet, []authtypes.GenesisAccount{baseAcc}, chainID, balance) @@ -79,7 +79,7 @@ func NewTestChain(t *testing.T, coord *ibcgotesting.Coordinator, chainID string) // create an account to send transactions from chain := &ibcgotesting.TestChain{ - T: t, + TB: t, Coordinator: coord, ChainID: chainID, App: app, diff --git a/ibc/testing/coordinator.go b/ibc/testing/coordinator.go index 3205bf20..ac5d1c29 100644 --- a/ibc/testing/coordinator.go +++ b/ibc/testing/coordinator.go @@ -13,7 +13,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + ibctesting "github.com/cosmos/ibc-go/v8/testing" exampleapp "github.com/evmos/os/example_chain" "github.com/stretchr/testify/require" ) @@ -123,19 +123,25 @@ func SetupClients(coord *ibctesting.Coordinator, path *Path) { } func SendMsgs(chain *ibctesting.TestChain, feeAmt int64, msgs ...sdk.Msg) (*sdk.Result, error) { - var bondDenom string + var ( + bondDenom string + err error + ) // ensure the chain has the latest time chain.Coordinator.UpdateTimeForChain(chain) if evmosChain, ok := chain.App.(*exampleapp.ExampleChain); ok { - bondDenom = evmosChain.StakingKeeper.BondDenom(chain.GetContext()) + bondDenom, err = evmosChain.StakingKeeper.BondDenom(chain.GetContext()) } else { - bondDenom = chain.GetSimApp().StakingKeeper.BondDenom(chain.GetContext()) + bondDenom, err = chain.GetSimApp().StakingKeeper.BondDenom(chain.GetContext()) + } + if err != nil { + return nil, err } fee := sdk.Coins{sdk.NewInt64Coin(bondDenom, feeAmt)} _, r, err := SignAndDeliver( - chain.T, + chain.TB, chain.TxConfig, chain.App.GetBaseApp(), msgs, @@ -170,7 +176,7 @@ func SendMsgs(chain *ibctesting.TestChain, feeAmt int64, msgs ...sdk.Msg) (*sdk. // Is a customization of IBC-go function that allows to modify the fee denom and amount // IBC-go implementation: https://github.com/cosmos/ibc-go/blob/d34cef7e075dda1a24a0a3e9b6d3eff406cc606c/testing/simapp/test_helpers.go#L332-L364 func SignAndDeliver( - t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, msgs []sdk.Msg, + t testing.TB, txCfg client.TxConfig, app *baseapp.BaseApp, msgs []sdk.Msg, fee sdk.Coins, chainID string, accNums, accSeqs []uint64, expPass bool, priv ...cryptotypes.PrivKey, ) (sdk.GasInfo, *sdk.Result, error) { diff --git a/ibc/testing/endpoint.go b/ibc/testing/endpoint.go index bb2b7f79..782afaed 100644 --- a/ibc/testing/endpoint.go +++ b/ibc/testing/endpoint.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package ibctesting import ( @@ -9,14 +10,15 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibclightclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + // For now we'll keep this. Pending to review if we can remove it + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" + "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibclightclient "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" + ibctesting "github.com/cosmos/ibc-go/v8/testing" ) // Endpoint is a which represents a channel endpoint and its associated @@ -74,7 +76,7 @@ func (endpoint *Endpoint) QueryProof(key []byte) ([]byte, clienttypes.Height) { // provided func (endpoint *Endpoint) QueryProofAtHeight(key []byte, height uint64) ([]byte, clienttypes.Height) { // query proof on the counterparty using the latest height of the IBC client - return endpoint.Chain.QueryProofAtHeight(key, int64(height)) //#nosec G115 -- int overflow is not a concern here -- gas is not going to exceed int64 max value + return endpoint.Chain.QueryProofAtHeight(key, int64(height)) //#nosec G115 } // CreateClient creates an IBC client on the endpoint. It will update the @@ -82,7 +84,7 @@ func (endpoint *Endpoint) QueryProofAtHeight(key []byte, height uint64) ([]byte, // NOTE: a solo machine client will be created with an empty diversifier. func (endpoint *Endpoint) CreateClient() (err error) { // ensure counterparty has committed state - endpoint.Chain.Coordinator.CommitBlock(endpoint.Counterparty.Chain) + endpoint.Counterparty.Chain.NextBlock() var ( clientState exported.ClientState @@ -92,7 +94,7 @@ func (endpoint *Endpoint) CreateClient() (err error) { switch endpoint.ClientConfig.GetClientType() { case exported.Tendermint: tmConfig, ok := endpoint.ClientConfig.(*ibctesting.TendermintConfig) - require.True(endpoint.Chain.T, ok) + require.True(endpoint.Chain.TB, ok) height := endpoint.Counterparty.Chain.LastHeader.GetHeight().(clienttypes.Height) clientState = ibclightclient.NewClientState( @@ -111,29 +113,29 @@ func (endpoint *Endpoint) CreateClient() (err error) { } require.NotNil( - endpoint.Chain.T, endpoint.Chain.SenderAccount, + endpoint.Chain.TB, endpoint.Chain.SenderAccount, fmt.Sprintf("expected sender account on chain with ID %q not to be nil", endpoint.Chain.ChainID), ) - zeroTimestamp := uint64(time.Time{}.UnixNano()) + zeroTimestamp := uint64(time.Time{}.UnixNano()) //#nosec G115 -- will not exceed uint64 require.NotEqual( - endpoint.Chain.T, consensusState.GetTimestamp(), zeroTimestamp, + endpoint.Chain.TB, consensusState.GetTimestamp(), zeroTimestamp, "current timestamp on the last header is the zero time; it might be necessary to commit blocks with the IBC coordinator", ) msg, err := clienttypes.NewMsgCreateClient( clientState, consensusState, endpoint.Chain.SenderAccount.GetAddress().String(), ) - require.NoError(endpoint.Chain.T, err) - require.NoError(endpoint.Chain.T, msg.ValidateBasic(), "failed to validate create client msg") + require.NoError(endpoint.Chain.TB, err) + require.NoError(endpoint.Chain.TB, msg.ValidateBasic(), "failed to validate create client msg") res, err := SendMsgs(endpoint.Chain, DefaultFeeAmt, msg) if err != nil { return err } - endpoint.ClientID, err = ibctesting.ParseClientIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.T, err) + endpoint.ClientID, err = ibctesting.ParseClientIDFromEvents(res.GetEvents().ToABCIEvents()) + require.NoError(endpoint.Chain.TB, err) return nil } @@ -161,7 +163,7 @@ func (endpoint *Endpoint) UpdateClient() (err error) { endpoint.ClientID, header, endpoint.Chain.SenderAccount.GetAddress().String(), ) - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) _, err = SendMsgs(endpoint.Chain, DefaultFeeAmt, msg) return err @@ -180,8 +182,8 @@ func (endpoint *Endpoint) ConnOpenInit() error { return err } - endpoint.ConnectionID, err = ibctesting.ParseConnectionIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.T, err) + endpoint.ConnectionID, err = ibctesting.ParseConnectionIDFromEvents(res.GetEvents().ToABCIEvents()) + require.NoError(endpoint.Chain.TB, err) return nil } @@ -189,7 +191,7 @@ func (endpoint *Endpoint) ConnOpenInit() error { // ConnOpenTry will construct and execute a MsgConnectionOpenTry on the associated endpoint. func (endpoint *Endpoint) ConnOpenTry() error { err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) counterpartyClient, proofClient, proofConsensus, consensusHeight, proofInit, proofHeight := endpoint.QueryConnectionHandshakeProof() @@ -206,8 +208,8 @@ func (endpoint *Endpoint) ConnOpenTry() error { } if endpoint.ConnectionID == "" { - endpoint.ConnectionID, err = ibctesting.ParseConnectionIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.T, err) + endpoint.ConnectionID, err = ibctesting.ParseConnectionIDFromEvents(res.GetEvents().ToABCIEvents()) + require.NoError(endpoint.Chain.TB, err) } return nil @@ -216,7 +218,7 @@ func (endpoint *Endpoint) ConnOpenTry() error { // ConnOpenAck will construct and execute a MsgConnectionOpenAck on the associated endpoint. func (endpoint *Endpoint) ConnOpenAck() error { err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) counterpartyClient, proofClient, proofConsensus, consensusHeight, proofTry, proofHeight := endpoint.QueryConnectionHandshakeProof() @@ -234,7 +236,7 @@ func (endpoint *Endpoint) ConnOpenAck() error { // ConnOpenConfirm will construct and execute a MsgConnectionOpenConfirm on the associated endpoint. func (endpoint *Endpoint) ConnOpenConfirm() error { err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) connectionKey := host.ConnectionKey(endpoint.Counterparty.ConnectionID) proof, height := endpoint.Counterparty.Chain.QueryProof(connectionKey) @@ -290,8 +292,8 @@ func (endpoint *Endpoint) ChanOpenInit() error { return err } - endpoint.ChannelID, err = ibctesting.ParseChannelIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.T, err) + endpoint.ChannelID, err = ibctesting.ParseChannelIDFromEvents(res.GetEvents().ToABCIEvents()) + require.NoError(endpoint.Chain.TB, err) // update version to selected app version // NOTE: this update must be performed after SendMsgs() @@ -303,7 +305,7 @@ func (endpoint *Endpoint) ChanOpenInit() error { // ChanOpenTry will construct and execute a MsgChannelOpenTry on the associated endpoint. func (endpoint *Endpoint) ChanOpenTry() error { err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) channelKey := host.ChannelKey(endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID) proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey) @@ -321,8 +323,8 @@ func (endpoint *Endpoint) ChanOpenTry() error { } if endpoint.ChannelID == "" { - endpoint.ChannelID, err = ibctesting.ParseChannelIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.T, err) + endpoint.ChannelID, err = ibctesting.ParseChannelIDFromEvents(res.GetEvents().ToABCIEvents()) + require.NoError(endpoint.Chain.TB, err) } // update version to selected app version @@ -335,7 +337,7 @@ func (endpoint *Endpoint) ChanOpenTry() error { // ChanOpenAck will construct and execute a MsgChannelOpenAck on the associated endpoint. func (endpoint *Endpoint) ChanOpenAck() error { err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) channelKey := host.ChannelKey(endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID) proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey) @@ -359,7 +361,7 @@ func (endpoint *Endpoint) ChanOpenAck() error { // ChanOpenConfirm will construct and execute a MsgChannelOpenConfirm on the associated endpoint. func (endpoint *Endpoint) ChanOpenConfirm() error { err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.T, err) + require.NoError(endpoint.Chain.TB, err) channelKey := host.ChannelKey(endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID) proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey) @@ -491,7 +493,7 @@ func (endpoint *Endpoint) TimeoutPacket(packet channeltypes.Packet) error { proof, proofHeight := endpoint.Counterparty.QueryProof(packetKey) nextSeqRecv, found := endpoint.Counterparty.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextSequenceRecv(endpoint.Counterparty.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID) - require.True(endpoint.Chain.T, found) + require.True(endpoint.Chain.TB, found) timeoutMsg := channeltypes.NewMsgTimeout( packet, nextSeqRecv, @@ -522,7 +524,7 @@ func (endpoint *Endpoint) TimeoutOnClose(packet channeltypes.Packet) error { proofClosed, _ := endpoint.Counterparty.QueryProof(channelKey) nextSeqRecv, found := endpoint.Counterparty.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextSequenceRecv(endpoint.Counterparty.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID) - require.True(endpoint.Chain.T, found) + require.True(endpoint.Chain.TB, found) timeoutOnCloseMsg := channeltypes.NewMsgTimeoutOnClose( packet, nextSeqRecv, @@ -560,7 +562,7 @@ func (endpoint *Endpoint) SetClientState(clientState exported.ClientState) { // The consensus state is expected to exist otherwise testing will fail. func (endpoint *Endpoint) GetConsensusState(height exported.Height) exported.ConsensusState { consensusState, found := endpoint.Chain.GetConsensusState(endpoint.ClientID, height) - require.True(endpoint.Chain.T, found) + require.True(endpoint.Chain.TB, found) return consensusState } @@ -574,7 +576,7 @@ func (endpoint *Endpoint) SetConsensusState(consensusState exported.ConsensusSta // connection is expected to exist otherwise testing will fail. func (endpoint *Endpoint) GetConnection() connectiontypes.ConnectionEnd { connection, found := endpoint.Chain.App.GetIBCKeeper().ConnectionKeeper.GetConnection(endpoint.Chain.GetContext(), endpoint.ConnectionID) - require.True(endpoint.Chain.T, found) + require.True(endpoint.Chain.TB, found) return connection } @@ -588,7 +590,7 @@ func (endpoint *Endpoint) SetConnection(connection connectiontypes.ConnectionEnd // is expected to exist otherwise testing will fail. func (endpoint *Endpoint) GetChannel() channeltypes.Channel { channel, found := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.GetChannel(endpoint.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID) - require.True(endpoint.Chain.T, found) + require.True(endpoint.Chain.TB, found) return channel } diff --git a/ibc/testing/path.go b/ibc/testing/path.go index 29221557..89c52e78 100644 --- a/ibc/testing/path.go +++ b/ibc/testing/path.go @@ -1,13 +1,14 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package ibctesting import ( "bytes" "fmt" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v8/testing" ) // Path contains two endpoints representing two chains connected over IBC @@ -55,7 +56,7 @@ func (path *Path) RelayPacket(packet channeltypes.Packet) error { return err } - ack, err := ibctesting.ParseAckFromEvents(res.GetEvents()) + ack, err := ibctesting.ParseAckFromEvents(res.GetEvents().ToABCIEvents()) if err != nil { return err } @@ -76,7 +77,7 @@ func (path *Path) RelayPacket(packet channeltypes.Packet) error { return err } - ack, err := ibctesting.ParseAckFromEvents(res.GetEvents()) + ack, err := ibctesting.ParseAckFromEvents(res.GetEvents().ToABCIEvents()) if err != nil { return err } diff --git a/ibc/utils.go b/ibc/utils.go index 8c6a0a98..31baa9f3 100644 --- a/ibc/utils.go +++ b/ibc/utils.go @@ -10,11 +10,10 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - transferkeeper "github.com/evmos/os/x/ibc/transfer/keeper" - + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" "github.com/evmos/os/utils" + transferkeeper "github.com/evmos/os/x/ibc/transfer/keeper" ) // GetTransferSenderRecipient returns the sender and recipient sdk.AccAddresses @@ -143,7 +142,7 @@ func GetDenomTrace( denom string, ) (transfertypes.DenomTrace, error) { if !strings.HasPrefix(denom, "ibc/") { - return transfertypes.DenomTrace{}, errorsmod.Wrap(ErrNoIBCVoucherDenom, denom) + return transfertypes.DenomTrace{}, errorsmod.Wrapf(ErrNoIBCVoucherDenom, "denom: %s", denom) } hash, err := transfertypes.ParseHexHash(denom[4:]) diff --git a/ibc/utils_test.go b/ibc/utils_test.go index e476bd60..c0576bec 100644 --- a/ibc/utils_test.go +++ b/ibc/utils_test.go @@ -5,9 +5,9 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v8/testing" precompilestestutil "github.com/evmos/os/precompiles/testutil" "github.com/stretchr/testify/require" ) diff --git a/indexer/kv_indexer.go b/indexer/kv_indexer.go index 7d65f799..6e5610f5 100644 --- a/indexer/kv_indexer.go +++ b/indexer/kv_indexer.go @@ -7,10 +7,10 @@ import ( "fmt" errorsmod "cosmossdk.io/errors" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -48,7 +48,7 @@ func NewKVIndexer(db dbm.DB, logger log.Logger, clientCtx client.Context) *KVInd // - Parses eth Tx infos from cosmos-sdk events for every TxResult // - Iterates over all the messages of the Tx // - Builds and stores a indexer.TxResult based on parsed events for every message -func (kv *KVIndexer) IndexBlock(block *tmtypes.Block, txResults []*abci.ResponseDeliverTx) error { +func (kv *KVIndexer) IndexBlock(block *cmttypes.Block, txResults []*abci.ExecTxResult) error { height := block.Header.Height batch := kv.db.NewBatch() @@ -167,8 +167,8 @@ func TxHashKey(hash common.Hash) []byte { // TxIndexKey returns the key for db entry: `(block number, tx index) -> tx hash` func TxIndexKey(blockNumber int64, txIndex int32) []byte { - bz1 := sdk.Uint64ToBigEndian(uint64(blockNumber)) - bz2 := sdk.Uint64ToBigEndian(uint64(txIndex)) + bz1 := sdk.Uint64ToBigEndian(uint64(blockNumber)) //nolint:gosec // G115 // block number won't exceed uint64 + bz2 := sdk.Uint64ToBigEndian(uint64(txIndex)) //nolint:gosec // G115 // index won't exceed uint64 return append(append([]byte{KeyPrefixTxIndex}, bz1...), bz2...) } diff --git a/indexer/kv_indexer_test.go b/indexer/kv_indexer_test.go index 6b25152f..a4daa913 100644 --- a/indexer/kv_indexer_test.go +++ b/indexer/kv_indexer_test.go @@ -4,19 +4,18 @@ import ( "math/big" "testing" - "cosmossdk.io/simapp/params" - dbm "github.com/cometbft/cometbft-db" + "github.com/evmos/os/testutil/constants" + + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - tmlog "github.com/cometbft/cometbft/libs/log" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/evmos/os/crypto/ethsecp256k1" - evmenc "github.com/evmos/os/encoding" - app "github.com/evmos/os/example_chain" "github.com/evmos/os/indexer" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/integration/os/network" utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/evm/types" "github.com/stretchr/testify/require" @@ -41,11 +40,12 @@ func TestKVIndexer(t *testing.T) { require.NoError(t, tx.Sign(ethSigner, signer)) txHash := tx.AsTransaction().Hash() - encodingConfig := MakeEncodingConfig() + nw := network.New() + encodingConfig := nw.GetEncodingConfig() clientCtx := client.Context{}.WithTxConfig(encodingConfig.TxConfig).WithCodec(encodingConfig.Codec) // build cosmos-sdk wrapper tx - tmTx, err := tx.BuildTx(clientCtx.TxConfig.NewTxBuilder(), testutil.ExampleAttoDenom) + tmTx, err := tx.BuildTx(clientCtx.TxConfig.NewTxBuilder(), constants.ExampleAttoDenom) require.NoError(t, err) txBz, err := clientCtx.TxConfig.TxEncoder()(tmTx) require.NoError(t, err) @@ -59,14 +59,14 @@ func TestKVIndexer(t *testing.T) { testCases := []struct { name string - block *tmtypes.Block - blockResult []*abci.ResponseDeliverTx + block *cmttypes.Block + blockResult []*abci.ExecTxResult expSuccess bool }{ { "success, format 1", - &tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + &cmttypes.Block{Header: cmttypes.Header{Height: 1}, Data: cmttypes.Data{Txs: []cmttypes.Tx{txBz}}}, + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -85,8 +85,8 @@ func TestKVIndexer(t *testing.T) { }, { "success, format 2", - &tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + &cmttypes.Block{Header: cmttypes.Header{Height: 1}, Data: cmttypes.Data{Txs: []cmttypes.Tx{txBz}}}, + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -107,8 +107,8 @@ func TestKVIndexer(t *testing.T) { }, { "success, exceed block gas limit", - &tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + &cmttypes.Block{Header: cmttypes.Header{Height: 1}, Data: cmttypes.Data{Txs: []cmttypes.Tx{txBz}}}, + []*abci.ExecTxResult{ { Code: 11, Log: "out of gas in location: block gas meter; gasWanted: 21000", @@ -119,8 +119,8 @@ func TestKVIndexer(t *testing.T) { }, { "fail, failed eth tx", - &tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + &cmttypes.Block{Header: cmttypes.Header{Height: 1}, Data: cmttypes.Data{Txs: []cmttypes.Tx{txBz}}}, + []*abci.ExecTxResult{ { Code: 15, Log: "nonce mismatch", @@ -131,8 +131,8 @@ func TestKVIndexer(t *testing.T) { }, { "fail, invalid events", - &tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + &cmttypes.Block{Header: cmttypes.Header{Height: 1}, Data: cmttypes.Data{Txs: []cmttypes.Tx{txBz}}}, + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{}, @@ -142,8 +142,8 @@ func TestKVIndexer(t *testing.T) { }, { "fail, not eth tx", - &tmtypes.Block{Header: tmtypes.Header{Height: 1}, Data: tmtypes.Data{Txs: []tmtypes.Tx{txBz2}}}, - []*abci.ResponseDeliverTx{ + &cmttypes.Block{Header: cmttypes.Header{Height: 1}, Data: cmttypes.Data{Txs: []cmttypes.Tx{txBz2}}}, + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{}, @@ -156,7 +156,7 @@ func TestKVIndexer(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { db := dbm.NewMemDB() - idxer := indexer.NewKVIndexer(db, tmlog.NewNopLogger(), clientCtx) + idxer := indexer.NewKVIndexer(db, log.NewNopLogger(), clientCtx) err = idxer.IndexBlock(tc.block, tc.blockResult) require.NoError(t, err) @@ -187,8 +187,3 @@ func TestKVIndexer(t *testing.T) { }) } } - -// MakeEncodingConfig creates the EncodingConfig -func MakeEncodingConfig() params.EncodingConfig { - return evmenc.MakeConfig(app.ModuleBasics) -} diff --git a/precompiles/authorization/events.go b/precompiles/authorization/events.go index 61e70d47..b19b7295 100644 --- a/precompiles/authorization/events.go +++ b/precompiles/authorization/events.go @@ -79,7 +79,7 @@ func EmitRevocationEvent(args cmn.EmitEventArgs) error { Address: args.ContractAddr, Topics: topics, Data: packed, - BlockNumber: uint64(args.Ctx.BlockHeight()), + BlockNumber: uint64(args.Ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil @@ -120,7 +120,7 @@ func EmitIBCTransferAuthorizationEvent( Address: precompileAddr, Topics: topics, Data: packed, - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil diff --git a/precompiles/authorization/types_test.go b/precompiles/authorization/types_test.go index 211ac69b..225779ca 100644 --- a/precompiles/authorization/types_test.go +++ b/precompiles/authorization/types_test.go @@ -4,11 +4,12 @@ import ( "fmt" "testing" + "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/precompiles/authorization" cmn "github.com/evmos/os/precompiles/common" - "github.com/evmos/os/testutil" testutiltx "github.com/evmos/os/testutil/tx" "github.com/stretchr/testify/require" ) @@ -56,7 +57,7 @@ func TestCheckApprovalArgs(t *testing.T) { for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - _, _, _, err := authorization.CheckApprovalArgs(tc.args, testutil.ExampleAttoDenom) + _, _, _, err := authorization.CheckApprovalArgs(tc.args, constants.ExampleAttoDenom) if tc.expErr { require.Error(t, err) require.Contains(t, err.Error(), tc.ErrContains) diff --git a/precompiles/bank/bank.go b/precompiles/bank/bank.go index 7c18fd85..337caf3d 100644 --- a/precompiles/bank/bank.go +++ b/precompiles/bank/bank.go @@ -7,7 +7,7 @@ import ( "embed" "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/ethereum/go-ethereum/common" cmn "github.com/evmos/os/precompiles/common" diff --git a/precompiles/bank/integration_test.go b/precompiles/bank/integration_test.go index 6796fcb8..75810db3 100644 --- a/precompiles/bank/integration_test.go +++ b/precompiles/bank/integration_test.go @@ -4,19 +4,20 @@ import ( "math/big" "testing" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/precompiles/bank" "github.com/evmos/os/precompiles/bank/testdata" "github.com/evmos/os/precompiles/testutil" - evmosutil "github.com/evmos/os/testutil" + testconstants "github.com/evmos/os/testutil/constants" "github.com/evmos/os/testutil/integration/os/factory" "github.com/evmos/os/testutil/integration/os/grpc" "github.com/evmos/os/testutil/integration/os/keyring" "github.com/evmos/os/testutil/integration/os/network" - integrationutils "github.com/evmos/os/testutil/integration/os/utils" - evmosutiltx "github.com/evmos/os/testutil/tx" + testutils "github.com/evmos/os/testutil/integration/os/utils" + utiltx "github.com/evmos/os/testutil/tx" evmtypes "github.com/evmos/os/x/evm/types" //nolint:revive // dot imports are fine for Ginkgo @@ -33,8 +34,6 @@ type IntegrationTestSuite struct { bondDenom, tokenDenom string evmosAddr, xmplAddr common.Address - // tokenDenom is the specific token denomination used in testing the Bank precompile. - // This denomination is used to instantiate the precompile. network *network.UnitTestNetwork factory factory.TxFactory grpcHandler grpc.Handler @@ -44,10 +43,17 @@ type IntegrationTestSuite struct { } func (is *IntegrationTestSuite) SetupTest() { + // Mint and register a second coin for testing purposes + // FIXME the RegisterCoin logic will need to be refactored + // once logic is integrated + // with the protocol via genesis and/or a transaction + is.tokenDenom = xmplDenom keyring := keyring.New(2) - genesis := integrationutils.CreateGenesisWithTokenPairs(keyring) + genesis := testutils.CreateGenesisWithTokenPairs(keyring) + integrationNetwork := network.NewUnitTestNetwork( network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), + network.WithOtherDenoms([]string{is.tokenDenom}), // set some funds of other denom to the prefunded accounts network.WithCustomGenesis(genesis), ) grpcHandler := grpc.NewIntegrationHandler(integrationNetwork) @@ -55,11 +61,11 @@ func (is *IntegrationTestSuite) SetupTest() { ctx := integrationNetwork.GetContext() sk := integrationNetwork.App.StakingKeeper - bondDenom := sk.BondDenom(ctx) + bondDenom, err := sk.BondDenom(ctx) + Expect(err).ToNot(HaveOccurred()) Expect(bondDenom).ToNot(BeEmpty(), "bond denom cannot be empty") is.bondDenom = bondDenom - is.tokenDenom = "xmpl" is.factory = txFactory is.grpcHandler = grpcHandler is.keyring = keyring @@ -71,7 +77,7 @@ func (is *IntegrationTestSuite) SetupTest() { is.evmosAddr = common.HexToAddress(tokenPair.Erc20Address) // Mint and register a second coin for testing purposes - err := is.network.App.BankKeeper.MintCoins(is.network.GetContext(), minttypes.ModuleName, sdk.Coins{{Denom: is.tokenDenom, Amount: sdk.NewInt(1e18)}}) + err = is.network.App.BankKeeper.MintCoins(is.network.GetContext(), minttypes.ModuleName, sdk.Coins{{Denom: is.tokenDenom, Amount: math.NewInt(1e18)}}) Expect(err).ToNot(HaveOccurred(), "failed to mint coin") tokenPairID = is.network.App.Erc20Keeper.GetTokenPairID(is.network.GetContext(), is.tokenDenom) @@ -102,6 +108,9 @@ var _ = Describe("Bank Extension -", func() { // different contract instances that are subject to testing here. contractData ContractData passCheck testutil.LogCheckArgs + + evmosTotalSupply, _ = new(big.Int).SetString("200003000000000000000000", 10) + xmplTotalSupply, _ = new(big.Int).SetString("200000000000000000000000", 10) ) BeforeEach(func() { @@ -140,14 +149,14 @@ var _ = Describe("Bank Extension -", func() { Context("Direct precompile queries", func() { Context("balances query", func() { It("should return the correct balance", func() { - balanceBefore, err := is.grpcHandler.GetBalance(sender.AccAddr, is.tokenDenom) - Expect(err).ToNot(HaveOccurred(), "failed to get balance") - Expect(balanceBefore.Balance.Amount).To(Equal(sdk.NewInt(0))) - Expect(balanceBefore.Balance.Denom).To(Equal(is.tokenDenom)) + // New account with 0 balances (does not exist on the chain yet) + receiver := utiltx.GenerateAddress() - is.mintAndSendXMPLCoin(is.keyring.GetAccAddr(0), sdk.NewInt(amount.Int64())) + err := is.factory.FundAccount(sender, receiver.Bytes(), sdk.NewCoins(sdk.NewCoin(is.tokenDenom, math.NewIntFromBigInt(amount)))) + Expect(err).ToNot(HaveOccurred(), "error while funding account") + Expect(is.network.NextBlock()).ToNot(HaveOccurred(), "error on NextBlock") - queryArgs, balancesArgs := getTxAndCallArgs(directCall, contractData, bank.BalancesMethod, sender.Addr) + queryArgs, balancesArgs := getTxAndCallArgs(directCall, contractData, bank.BalancesMethod, receiver) _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, queryArgs, balancesArgs, passCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") @@ -155,14 +164,22 @@ var _ = Describe("Bank Extension -", func() { err = is.precompile.UnpackIntoInterface(&balances, bank.BalancesMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack balances") - balanceAfter, err := is.grpcHandler.GetBalance(sender.AccAddr, is.tokenDenom) + balanceAfter, err := is.grpcHandler.GetBalance(receiver.Bytes(), is.tokenDenom) Expect(err).ToNot(HaveOccurred(), "failed to get balance") - Expect(sdk.NewInt(balances[1].Amount.Int64())).To(Equal(balanceAfter.Balance.Amount)) + Expect(math.NewInt(balances[0].Amount.Int64())).To(Equal(balanceAfter.Balance.Amount)) + Expect(*balances[0].Amount).To(Equal(*amount)) }) It("should return a single token balance", func() { - queryArgs, balancesArgs := getTxAndCallArgs(directCall, contractData, bank.BalancesMethod, sender.Addr) + // New account with 0 balances (does not exist on the chain yet) + receiver := utiltx.GenerateAddress() + + err := testutils.FundAccountWithBaseDenom(is.factory, is.network, sender, receiver.Bytes(), math.NewIntFromBigInt(amount)) + Expect(err).ToNot(HaveOccurred(), "error while funding account") + Expect(is.network.NextBlock()).ToNot(HaveOccurred(), "error on NextBlock") + + queryArgs, balancesArgs := getTxAndCallArgs(directCall, contractData, bank.BalancesMethod, receiver) _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, queryArgs, balancesArgs, passCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") @@ -170,14 +187,15 @@ var _ = Describe("Bank Extension -", func() { err = is.precompile.UnpackIntoInterface(&balances, bank.BalancesMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack balances") - balanceAfter, err := is.grpcHandler.GetBalance(sender.AccAddr, evmosutil.ExampleAttoDenom) + balanceAfter, err := is.grpcHandler.GetBalance(receiver.Bytes(), testconstants.ExampleAttoDenom) Expect(err).ToNot(HaveOccurred(), "failed to get balance") - Expect(sdk.NewInt(balances[0].Amount.Int64())).To(Equal(balanceAfter.Balance.Amount)) + Expect(math.NewInt(balances[0].Amount.Int64())).To(Equal(balanceAfter.Balance.Amount)) + Expect(*balances[0].Amount).To(Equal(*amount)) }) It("should return no balance for new account", func() { - queryArgs, balancesArgs := getTxAndCallArgs(directCall, contractData, bank.BalancesMethod, evmosutiltx.GenerateAddress()) + queryArgs, balancesArgs := getTxAndCallArgs(directCall, contractData, bank.BalancesMethod, utiltx.GenerateAddress()) _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, queryArgs, balancesArgs, passCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") @@ -189,8 +207,6 @@ var _ = Describe("Bank Extension -", func() { }) It("should consume the correct amount of gas", func() { - is.mintAndSendXMPLCoin(is.keyring.GetAccAddr(0), sdk.NewInt(amount.Int64())) - queryArgs, balancesArgs := getTxAndCallArgs(directCall, contractData, bank.BalancesMethod, sender.Addr) res, err := is.factory.ExecuteContractCall(sender.Priv, queryArgs, balancesArgs) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") @@ -218,12 +234,8 @@ var _ = Describe("Bank Extension -", func() { err = is.precompile.UnpackIntoInterface(&balances, bank.TotalSupplyMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack balances") - evmosTotalSupply, ok := new(big.Int).SetString("11000000000000000000", 10) - Expect(ok).To(BeTrue(), "failed to parse evmos total supply") - xmplTotalSupply := amount - - Expect(balances[0].Amount).To(Equal(evmosTotalSupply)) - Expect(balances[1].Amount).To(Equal(xmplTotalSupply)) + Expect(balances[0].Amount.String()).To(Equal(evmosTotalSupply.String())) + Expect(balances[1].Amount.String()).To(Equal(xmplTotalSupply.String())) }) }) @@ -236,10 +248,7 @@ var _ = Describe("Bank Extension -", func() { out, err := is.precompile.Unpack(bank.SupplyOfMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack balances") - evmosTotalSupply, ok := new(big.Int).SetString("11000000000000000000", 10) - Expect(ok).To(BeTrue(), "failed to parse evmos total supply") - - Expect(out[0].(*big.Int)).To(Equal(evmosTotalSupply)) + Expect(out[0].(*big.Int).String()).To(Equal(evmosTotalSupply.String())) }) It("should return the supply of XMPL", func() { @@ -250,11 +259,11 @@ var _ = Describe("Bank Extension -", func() { out, err := is.precompile.Unpack(bank.SupplyOfMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack balances") - Expect(out[0].(*big.Int)).To(Equal(amount)) + Expect(out[0].(*big.Int).String()).To(Equal(xmplTotalSupply.String())) }) It("should return a supply of 0 for a non existing token", func() { - queryArgs, supplyArgs := getTxAndCallArgs(directCall, contractData, bank.SupplyOfMethod, evmosutiltx.GenerateAddress()) + queryArgs, supplyArgs := getTxAndCallArgs(directCall, contractData, bank.SupplyOfMethod, utiltx.GenerateAddress()) _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, queryArgs, supplyArgs, passCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") @@ -284,14 +293,13 @@ var _ = Describe("Bank Extension -", func() { Context("balances query", func() { It("should return the correct balance", func() { - balanceBefore, err := is.grpcHandler.GetBalance(sender.AccAddr, is.tokenDenom) - Expect(err).ToNot(HaveOccurred(), "failed to get balance") - Expect(balanceBefore.Balance.Amount).To(Equal(sdk.NewInt(0))) - Expect(balanceBefore.Balance.Denom).To(Equal(is.tokenDenom)) + receiver := utiltx.GenerateAddress() - is.mintAndSendXMPLCoin(is.keyring.GetAccAddr(0), sdk.NewInt(amount.Int64())) + err := is.factory.FundAccount(sender, receiver.Bytes(), sdk.NewCoins(sdk.NewCoin(is.tokenDenom, math.NewIntFromBigInt(amount)))) + Expect(err).ToNot(HaveOccurred(), "error while funding account") + Expect(is.network.NextBlock()).ToNot(HaveOccurred(), "error on NextBlock") - queryArgs, balancesArgs := getTxAndCallArgs(contractCall, contractData, BalancesFunction, sender.Addr) + queryArgs, balancesArgs := getTxAndCallArgs(contractCall, contractData, BalancesFunction, receiver) _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, queryArgs, balancesArgs, passCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") @@ -299,14 +307,22 @@ var _ = Describe("Bank Extension -", func() { err = is.precompile.UnpackIntoInterface(&balances, bank.BalancesMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack balances") - balanceAfter, err := is.grpcHandler.GetBalance(sender.AccAddr, is.tokenDenom) + balanceAfter, err := is.grpcHandler.GetBalance(receiver.Bytes(), is.tokenDenom) Expect(err).ToNot(HaveOccurred(), "failed to get balance") - Expect(sdk.NewInt(balances[1].Amount.Int64())).To(Equal(balanceAfter.Balance.Amount)) + Expect(math.NewInt(balances[0].Amount.Int64())).To(Equal(balanceAfter.Balance.Amount)) + Expect(*balances[0].Amount).To(Equal(*amount)) }) It("should return a single token balance", func() { - queryArgs, balancesArgs := getTxAndCallArgs(contractCall, contractData, BalancesFunction, sender.Addr) + // New account with 0 balances (does not exist on the chain yet) + receiver := utiltx.GenerateAddress() + + err := testutils.FundAccountWithBaseDenom(is.factory, is.network, sender, receiver.Bytes(), math.NewIntFromBigInt(amount)) + Expect(err).ToNot(HaveOccurred(), "error while funding account") + Expect(is.network.NextBlock()).ToNot(HaveOccurred(), "error on NextBlock") + + queryArgs, balancesArgs := getTxAndCallArgs(contractCall, contractData, BalancesFunction, receiver) _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, queryArgs, balancesArgs, passCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") @@ -314,14 +330,15 @@ var _ = Describe("Bank Extension -", func() { err = is.precompile.UnpackIntoInterface(&balances, bank.BalancesMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack balances") - balanceAfter, err := is.grpcHandler.GetBalance(sender.AccAddr, evmosutil.ExampleAttoDenom) + balanceAfter, err := is.grpcHandler.GetBalance(receiver.Bytes(), testconstants.ExampleAttoDenom) Expect(err).ToNot(HaveOccurred(), "failed to get balance") - Expect(sdk.NewInt(balances[0].Amount.Int64())).To(Equal(balanceAfter.Balance.Amount)) + Expect(math.NewInt(balances[0].Amount.Int64())).To(Equal(balanceAfter.Balance.Amount)) + Expect(*balances[0].Amount).To(Equal(*amount)) }) It("should return no balance for new account", func() { - queryArgs, balancesArgs := getTxAndCallArgs(contractCall, contractData, BalancesFunction, evmosutiltx.GenerateAddress()) + queryArgs, balancesArgs := getTxAndCallArgs(contractCall, contractData, BalancesFunction, utiltx.GenerateAddress()) _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, queryArgs, balancesArgs, passCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") @@ -333,8 +350,6 @@ var _ = Describe("Bank Extension -", func() { }) It("should consume the correct amount of gas", func() { - is.mintAndSendXMPLCoin(is.keyring.GetAccAddr(0), sdk.NewInt(amount.Int64())) - queryArgs, balancesArgs := getTxAndCallArgs(contractCall, contractData, BalancesFunction, sender.Addr) res, err := is.factory.ExecuteContractCall(sender.Priv, queryArgs, balancesArgs) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") @@ -362,12 +377,8 @@ var _ = Describe("Bank Extension -", func() { err = is.precompile.UnpackIntoInterface(&balances, bank.TotalSupplyMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack balances") - evmosTotalSupply, ok := new(big.Int).SetString("11000000000000000000", 10) - Expect(ok).To(BeTrue(), "failed to parse evmos total supply") - xmplTotalSupply := amount - - Expect(balances[0].Amount).To(Equal(evmosTotalSupply)) - Expect(balances[1].Amount).To(Equal(xmplTotalSupply)) + Expect(balances[0].Amount.String()).To(Equal(evmosTotalSupply.String())) + Expect(balances[1].Amount.String()).To(Equal(xmplTotalSupply.String())) }) }) @@ -380,10 +391,7 @@ var _ = Describe("Bank Extension -", func() { out, err := is.precompile.Unpack(bank.SupplyOfMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack balances") - evmosTotalSupply, ok := new(big.Int).SetString("11000000000000000000", 10) - Expect(ok).To(BeTrue(), "failed to parse evmos total supply") - - Expect(out[0].(*big.Int)).To(Equal(evmosTotalSupply)) + Expect(out[0].(*big.Int).String()).To(Equal(evmosTotalSupply.String())) }) It("should return the supply of XMPL", func() { @@ -394,11 +402,11 @@ var _ = Describe("Bank Extension -", func() { out, err := is.precompile.Unpack(bank.SupplyOfMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack balances") - Expect(out[0].(*big.Int)).To(Equal(amount)) + Expect(out[0].(*big.Int).String()).To(Equal(xmplTotalSupply.String())) }) It("should return a supply of 0 for a non existing token", func() { - queryArgs, supplyArgs := getTxAndCallArgs(contractCall, contractData, SupplyOfFunction, evmosutiltx.GenerateAddress()) + queryArgs, supplyArgs := getTxAndCallArgs(contractCall, contractData, SupplyOfFunction, utiltx.GenerateAddress()) _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, queryArgs, supplyArgs, passCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") diff --git a/precompiles/bank/query_test.go b/precompiles/bank/query_test.go index 0780c9af..39a49a90 100644 --- a/precompiles/bank/query_test.go +++ b/precompiles/bank/query_test.go @@ -3,12 +3,19 @@ package bank_test import ( "math/big" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/precompiles/bank" + "github.com/evmos/os/testutil/integration/os/network" evmosutiltx "github.com/evmos/os/testutil/tx" ) func (s *PrecompileTestSuite) TestBalances() { + var ctx sdk.Context + // setup test in order to have s.precompile, s.evmosAddr and s.xmplAddr defined + s.SetupTest() method := s.precompile.Methods[bank.BalancesMethod] testcases := []struct { @@ -16,7 +23,7 @@ func (s *PrecompileTestSuite) TestBalances() { malleate func() []interface{} expPass bool errContains string - expBalances []bank.Balance + expBalances func(evmosAddr, xmplAddr common.Address) []bank.Balance }{ { "fail - invalid number of arguments", @@ -49,10 +56,10 @@ func (s *PrecompileTestSuite) TestBalances() { }, true, "", - []bank.Balance{}, + func(common.Address, common.Address) []bank.Balance { return []bank.Balance{} }, }, { - "pass - EVMOS balance present", + "pass - Initial balances present", func() []interface{} { return []interface{}{ s.keyring.GetAddr(0), @@ -60,37 +67,49 @@ func (s *PrecompileTestSuite) TestBalances() { }, true, "", - []bank.Balance{{ - ContractAddress: s.evmosAddr, - Amount: big.NewInt(4e18), - }}, + func(evmosAddr, xmplAddr common.Address) []bank.Balance { + return []bank.Balance{ + { + ContractAddress: evmosAddr, + Amount: network.PrefundedAccountInitialBalance.BigInt(), + }, + { + ContractAddress: xmplAddr, + Amount: network.PrefundedAccountInitialBalance.BigInt(), + }, + } + }, }, { - "pass - EVMOS and XMPL balances present", + "pass - EVMOS and XMPL balances present - mint extra XMPL", func() []interface{} { - s.mintAndSendXMPLCoin(s.keyring.GetAccAddr(0), sdk.NewInt(1e18)) + ctx = s.mintAndSendXMPLCoin(ctx, s.keyring.GetAccAddr(0), math.NewInt(1e18)) return []interface{}{ s.keyring.GetAddr(0), } }, true, "", - []bank.Balance{{ - ContractAddress: s.evmosAddr, - Amount: big.NewInt(4e18), - }, { - ContractAddress: s.xmplAddr, - Amount: big.NewInt(1e18), - }}, + func(evmosAddr, xmplAddr common.Address) []bank.Balance { + return []bank.Balance{{ + ContractAddress: evmosAddr, + Amount: network.PrefundedAccountInitialBalance.BigInt(), + }, { + ContractAddress: xmplAddr, + Amount: network.PrefundedAccountInitialBalance.Add(math.NewInt(1e18)).BigInt(), + }} + }, }, } for _, tc := range testcases { + tc := tc + s.Run(tc.name, func() { - s.SetupTest() + ctx = s.SetupTest() // reset the chain each test bz, err := s.precompile.Balances( - s.network.GetContext(), + ctx, nil, &method, tc.malleate(), @@ -101,7 +120,7 @@ func (s *PrecompileTestSuite) TestBalances() { var balances []bank.Balance err = s.precompile.UnpackIntoInterface(&balances, method.Name, bz) s.Require().NoError(err) - s.Require().Equal(tc.expBalances, balances) + s.Require().Equal(tc.expBalances(s.evmosAddr, s.xmplAddr), balances) } else { s.Require().Contains(err.Error(), tc.errContains) } @@ -110,37 +129,46 @@ func (s *PrecompileTestSuite) TestBalances() { } func (s *PrecompileTestSuite) TestTotalSupply() { + var ctx sdk.Context + // setup test in order to have s.precompile, s.evmosAddr and s.xmplAddr defined + s.SetupTest() method := s.precompile.Methods[bank.TotalSupplyMethod] - evmosTotalSupply, ok := new(big.Int).SetString("11000000000000000000", 10) - s.Require().True(ok) + totSupplRes, err := s.grpcHandler.GetTotalSupply() + s.Require().NoError(err) + evmosTotalSupply := totSupplRes.Supply.AmountOf(s.bondDenom) + xmplTotalSupply := totSupplRes.Supply.AmountOf(s.tokenDenom) testcases := []struct { name string malleate func() - expSupply []bank.Balance + expSupply func(evmosAddr, xmplAddr common.Address) []bank.Balance }{ { "pass - EVMOS and XMPL total supply", func() { - s.mintAndSendXMPLCoin(s.keyring.GetAccAddr(0), sdk.NewInt(1e18)) + ctx = s.mintAndSendXMPLCoin(ctx, s.keyring.GetAccAddr(0), math.NewInt(1e18)) + }, + func(evmosAddr, xmplAddr common.Address) []bank.Balance { + return []bank.Balance{{ + ContractAddress: evmosAddr, + Amount: evmosTotalSupply.BigInt(), + }, { + ContractAddress: xmplAddr, + Amount: xmplTotalSupply.Add(math.NewInt(1e18)).BigInt(), + }} }, - []bank.Balance{{ - ContractAddress: s.evmosAddr, - Amount: evmosTotalSupply, - }, { - ContractAddress: s.xmplAddr, - Amount: big.NewInt(1e18), - }}, }, } for _, tc := range testcases { - s.Run(tc.name, func() { - s.SetupTest() + tc := tc + s.Run(tc.name, func() { + ctx = s.SetupTest() + tc.malleate() bz, err := s.precompile.TotalSupply( - s.network.GetContext(), + ctx, nil, &method, nil, @@ -150,16 +178,20 @@ func (s *PrecompileTestSuite) TestTotalSupply() { var balances []bank.Balance err = s.precompile.UnpackIntoInterface(&balances, method.Name, bz) s.Require().NoError(err) - s.Require().Equal(tc.expSupply, balances) + s.Require().Equal(tc.expSupply(s.evmosAddr, s.xmplAddr), balances) }) } } func (s *PrecompileTestSuite) TestSupplyOf() { + // setup test in order to have s.precompile, s.evmosAddr and s.xmplAddr defined + s.SetupTest() method := s.precompile.Methods[bank.SupplyOfMethod] - evmosTotalSupply, ok := new(big.Int).SetString("11000000000000000000", 10) - s.Require().True(ok) + totSupplRes, err := s.grpcHandler.GetTotalSupply() + s.Require().NoError(err) + evmosTotalSupply := totSupplRes.Supply.AmountOf(s.bondDenom) + xmplTotalSupply := totSupplRes.Supply.AmountOf(s.tokenDenom) testcases := []struct { name string @@ -210,7 +242,7 @@ func (s *PrecompileTestSuite) TestSupplyOf() { }, false, "", - big.NewInt(1e18), + xmplTotalSupply.BigInt(), }, { @@ -222,16 +254,18 @@ func (s *PrecompileTestSuite) TestSupplyOf() { }, false, "", - evmosTotalSupply, + evmosTotalSupply.BigInt(), }, } for _, tc := range testcases { + tc := tc + s.Run(tc.name, func() { - s.SetupTest() + ctx := s.SetupTest() bz, err := s.precompile.SupplyOf( - s.network.GetContext(), + ctx, nil, &method, tc.malleate(), diff --git a/precompiles/bank/setup_test.go b/precompiles/bank/setup_test.go index 93acbc8c..5423905b 100644 --- a/precompiles/bank/setup_test.go +++ b/precompiles/bank/setup_test.go @@ -3,9 +3,11 @@ package bank_test import ( "testing" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/precompiles/bank" "github.com/evmos/os/testutil/integration/os/factory" @@ -41,27 +43,30 @@ func TestPrecompileTestSuite(t *testing.T) { suite.Run(t, s) } -func (s *PrecompileTestSuite) SetupTest() { +func (s *PrecompileTestSuite) SetupTest() sdk.Context { + s.tokenDenom = xmplDenom + keyring := testkeyring.New(2) genesis := integrationutils.CreateGenesisWithTokenPairs(keyring) - integrationNetwork := network.NewUnitTestNetwork( + unitNetwork := network.NewUnitTestNetwork( network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), network.WithCustomGenesis(genesis), + network.WithOtherDenoms([]string{s.tokenDenom}), ) - grpcHandler := grpc.NewIntegrationHandler(integrationNetwork) - txFactory := factory.New(integrationNetwork, grpcHandler) + grpcHandler := grpc.NewIntegrationHandler(unitNetwork) + txFactory := factory.New(unitNetwork, grpcHandler) - ctx := integrationNetwork.GetContext() - sk := integrationNetwork.App.StakingKeeper - bondDenom := sk.BondDenom(ctx) + ctx := unitNetwork.GetContext() + sk := unitNetwork.App.StakingKeeper + bondDenom, err := sk.BondDenom(ctx) + s.Require().NoError(err, "failed to get bond denom") s.Require().NotEmpty(bondDenom, "bond denom cannot be empty") s.bondDenom = bondDenom - s.tokenDenom = "xmpl" s.factory = txFactory s.grpcHandler = grpcHandler s.keyring = keyring - s.network = integrationNetwork + s.network = unitNetwork tokenPairID := s.network.App.Erc20Keeper.GetTokenPairID(s.network.GetContext(), s.bondDenom) tokenPair, found := s.network.App.Erc20Keeper.GetTokenPair(s.network.GetContext(), tokenPairID) @@ -71,7 +76,7 @@ func (s *PrecompileTestSuite) SetupTest() { s.evmosAddr = tokenPair.GetERC20Contract() // Mint and register a second coin for testing purposes - err := s.network.App.BankKeeper.MintCoins(s.network.GetContext(), minttypes.ModuleName, sdk.Coins{{Denom: "xmpl", Amount: math.NewInt(1e18)}}) + err = s.network.App.BankKeeper.MintCoins(s.network.GetContext(), minttypes.ModuleName, sdk.Coins{{Denom: "xmpl", Amount: math.NewInt(1e18)}}) s.Require().NoError(err) tokenPairID = s.network.App.Erc20Keeper.GetTokenPairID(s.network.GetContext(), s.tokenDenom) @@ -82,4 +87,5 @@ func (s *PrecompileTestSuite) SetupTest() { s.xmplAddr = tokenPair.GetERC20Contract() s.precompile = s.setupBankPrecompile() + return ctx } diff --git a/precompiles/bank/testdata/BankCaller.json b/precompiles/bank/testdata/BankCaller.json index c5f7ecbd..2a956d20 100644 --- a/precompiles/bank/testdata/BankCaller.json +++ b/precompiles/bank/testdata/BankCaller.json @@ -79,8 +79,8 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b50610706806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806389129c6814610046578063acab2f9414610076578063bba60ca014610094575b600080fd5b610060600480360381019061005b91906102c2565b6100c4565b60405161006d91906103f5565b60405180910390f35b61007e61014e565b60405161008b91906103f5565b60405180910390f35b6100ae60048036038101906100a991906102c2565b6101cb565b6040516100bb9190610426565b60405180910390f35b606061080473ffffffffffffffffffffffffffffffffffffffff166327e235e3836040518263ffffffff1660e01b81526004016101019190610450565b600060405180830381865afa15801561011e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610147919061065a565b9050919050565b606061080473ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561019d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906101c6919061065a565b905090565b600061080473ffffffffffffffffffffffffffffffffffffffff166362400e4c836040518263ffffffff1660e01b81526004016102089190610450565b602060405180830381865afa158015610225573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024991906106a3565b9050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061028f82610264565b9050919050565b61029f81610284565b81146102aa57600080fd5b50565b6000813590506102bc81610296565b92915050565b6000602082840312156102d8576102d761025a565b5b60006102e6848285016102ad565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61032481610284565b82525050565b6000819050919050565b61033d8161032a565b82525050565b604082016000820151610359600085018261031b565b50602082015161036c6020850182610334565b50505050565b600061037e8383610343565b60408301905092915050565b6000602082019050919050565b60006103a2826102ef565b6103ac81856102fa565b93506103b78361030b565b8060005b838110156103e85781516103cf8882610372565b97506103da8361038a565b9250506001810190506103bb565b5085935050505092915050565b6000602082019050818103600083015261040f8184610397565b905092915050565b6104208161032a565b82525050565b600060208201905061043b6000830184610417565b92915050565b61044a81610284565b82525050565b60006020820190506104656000830184610441565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6104b982610470565b810181811067ffffffffffffffff821117156104d8576104d7610481565b5b80604052505050565b60006104eb610250565b90506104f782826104b0565b919050565b600067ffffffffffffffff82111561051757610516610481565b5b602082029050602081019050919050565b600080fd5b600080fd5b60008151905061054181610296565b92915050565b6105508161032a565b811461055b57600080fd5b50565b60008151905061056d81610547565b92915050565b6000604082840312156105895761058861052d565b5b61059360406104e1565b905060006105a384828501610532565b60008301525060206105b78482850161055e565b60208301525092915050565b60006105d66105d1846104fc565b6104e1565b905080838252602082019050604084028301858111156105f9576105f8610528565b5b835b81811015610622578061060e8882610573565b8452602084019350506040810190506105fb565b5050509392505050565b600082601f8301126106415761064061046b565b5b81516106518482602086016105c3565b91505092915050565b6000602082840312156106705761066f61025a565b5b600082015167ffffffffffffffff81111561068e5761068d61025f565b5b61069a8482850161062c565b91505092915050565b6000602082840312156106b9576106b861025a565b5b60006106c78482850161055e565b9150509291505056fea264697066735822122069dcf2adfa16b7c11a609b544775058a5caffe57f2d073bb7f7ee7533aea460964736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806389129c6814610046578063acab2f9414610076578063bba60ca014610094575b600080fd5b610060600480360381019061005b91906102c2565b6100c4565b60405161006d91906103f5565b60405180910390f35b61007e61014e565b60405161008b91906103f5565b60405180910390f35b6100ae60048036038101906100a991906102c2565b6101cb565b6040516100bb9190610426565b60405180910390f35b606061080473ffffffffffffffffffffffffffffffffffffffff166327e235e3836040518263ffffffff1660e01b81526004016101019190610450565b600060405180830381865afa15801561011e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610147919061065a565b9050919050565b606061080473ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561019d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906101c6919061065a565b905090565b600061080473ffffffffffffffffffffffffffffffffffffffff166362400e4c836040518263ffffffff1660e01b81526004016102089190610450565b602060405180830381865afa158015610225573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024991906106a3565b9050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061028f82610264565b9050919050565b61029f81610284565b81146102aa57600080fd5b50565b6000813590506102bc81610296565b92915050565b6000602082840312156102d8576102d761025a565b5b60006102e6848285016102ad565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61032481610284565b82525050565b6000819050919050565b61033d8161032a565b82525050565b604082016000820151610359600085018261031b565b50602082015161036c6020850182610334565b50505050565b600061037e8383610343565b60408301905092915050565b6000602082019050919050565b60006103a2826102ef565b6103ac81856102fa565b93506103b78361030b565b8060005b838110156103e85781516103cf8882610372565b97506103da8361038a565b9250506001810190506103bb565b5085935050505092915050565b6000602082019050818103600083015261040f8184610397565b905092915050565b6104208161032a565b82525050565b600060208201905061043b6000830184610417565b92915050565b61044a81610284565b82525050565b60006020820190506104656000830184610441565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6104b982610470565b810181811067ffffffffffffffff821117156104d8576104d7610481565b5b80604052505050565b60006104eb610250565b90506104f782826104b0565b919050565b600067ffffffffffffffff82111561051757610516610481565b5b602082029050602081019050919050565b600080fd5b600080fd5b60008151905061054181610296565b92915050565b6105508161032a565b811461055b57600080fd5b50565b60008151905061056d81610547565b92915050565b6000604082840312156105895761058861052d565b5b61059360406104e1565b905060006105a384828501610532565b60008301525060206105b78482850161055e565b60208301525092915050565b60006105d66105d1846104fc565b6104e1565b905080838252602082019050604084028301858111156105f9576105f8610528565b5b835b81811015610622578061060e8882610573565b8452602084019350506040810190506105fb565b5050509392505050565b600082601f8301126106415761064061046b565b5b81516106518482602086016105c3565b91505092915050565b6000602082840312156106705761066f61025a565b5b600082015167ffffffffffffffff81111561068e5761068d61025f565b5b61069a8482850161062c565b91505092915050565b6000602082840312156106b9576106b861025a565b5b60006106c78482850161055e565b9150509291505056fea264697066735822122069dcf2adfa16b7c11a609b544775058a5caffe57f2d073bb7f7ee7533aea460964736f6c63430008130033", + "bytecode": "0x608060405234801561001057600080fd5b50610706806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806389129c6814610046578063acab2f9414610076578063bba60ca014610094575b600080fd5b610060600480360381019061005b91906102c2565b6100c4565b60405161006d91906103f5565b60405180910390f35b61007e61014e565b60405161008b91906103f5565b60405180910390f35b6100ae60048036038101906100a991906102c2565b6101cb565b6040516100bb9190610426565b60405180910390f35b606061080473ffffffffffffffffffffffffffffffffffffffff166327e235e3836040518263ffffffff1660e01b81526004016101019190610450565b600060405180830381865afa15801561011e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610147919061065a565b9050919050565b606061080473ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561019d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906101c6919061065a565b905090565b600061080473ffffffffffffffffffffffffffffffffffffffff166362400e4c836040518263ffffffff1660e01b81526004016102089190610450565b602060405180830381865afa158015610225573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024991906106a3565b9050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061028f82610264565b9050919050565b61029f81610284565b81146102aa57600080fd5b50565b6000813590506102bc81610296565b92915050565b6000602082840312156102d8576102d761025a565b5b60006102e6848285016102ad565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61032481610284565b82525050565b6000819050919050565b61033d8161032a565b82525050565b604082016000820151610359600085018261031b565b50602082015161036c6020850182610334565b50505050565b600061037e8383610343565b60408301905092915050565b6000602082019050919050565b60006103a2826102ef565b6103ac81856102fa565b93506103b78361030b565b8060005b838110156103e85781516103cf8882610372565b97506103da8361038a565b9250506001810190506103bb565b5085935050505092915050565b6000602082019050818103600083015261040f8184610397565b905092915050565b6104208161032a565b82525050565b600060208201905061043b6000830184610417565b92915050565b61044a81610284565b82525050565b60006020820190506104656000830184610441565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6104b982610470565b810181811067ffffffffffffffff821117156104d8576104d7610481565b5b80604052505050565b60006104eb610250565b90506104f782826104b0565b919050565b600067ffffffffffffffff82111561051757610516610481565b5b602082029050602081019050919050565b600080fd5b600080fd5b60008151905061054181610296565b92915050565b6105508161032a565b811461055b57600080fd5b50565b60008151905061056d81610547565b92915050565b6000604082840312156105895761058861052d565b5b61059360406104e1565b905060006105a384828501610532565b60008301525060206105b78482850161055e565b60208301525092915050565b60006105d66105d1846104fc565b6104e1565b905080838252602082019050604084028301858111156105f9576105f8610528565b5b835b81811015610622578061060e8882610573565b8452602084019350506040810190506105fb565b5050509392505050565b600082601f8301126106415761064061046b565b5b81516106518482602086016105c3565b91505092915050565b6000602082840312156106705761066f61025a565b5b600082015167ffffffffffffffff81111561068e5761068d61025f565b5b61069a8482850161062c565b91505092915050565b6000602082840312156106b9576106b861025a565b5b60006106c78482850161055e565b9150509291505056fea2646970667358221220f70daf3d24c9078a0794dd53b6122acaa31b9de6d1f9bce599773c1e50f6ea6064736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806389129c6814610046578063acab2f9414610076578063bba60ca014610094575b600080fd5b610060600480360381019061005b91906102c2565b6100c4565b60405161006d91906103f5565b60405180910390f35b61007e61014e565b60405161008b91906103f5565b60405180910390f35b6100ae60048036038101906100a991906102c2565b6101cb565b6040516100bb9190610426565b60405180910390f35b606061080473ffffffffffffffffffffffffffffffffffffffff166327e235e3836040518263ffffffff1660e01b81526004016101019190610450565b600060405180830381865afa15801561011e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610147919061065a565b9050919050565b606061080473ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561019d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906101c6919061065a565b905090565b600061080473ffffffffffffffffffffffffffffffffffffffff166362400e4c836040518263ffffffff1660e01b81526004016102089190610450565b602060405180830381865afa158015610225573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024991906106a3565b9050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061028f82610264565b9050919050565b61029f81610284565b81146102aa57600080fd5b50565b6000813590506102bc81610296565b92915050565b6000602082840312156102d8576102d761025a565b5b60006102e6848285016102ad565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61032481610284565b82525050565b6000819050919050565b61033d8161032a565b82525050565b604082016000820151610359600085018261031b565b50602082015161036c6020850182610334565b50505050565b600061037e8383610343565b60408301905092915050565b6000602082019050919050565b60006103a2826102ef565b6103ac81856102fa565b93506103b78361030b565b8060005b838110156103e85781516103cf8882610372565b97506103da8361038a565b9250506001810190506103bb565b5085935050505092915050565b6000602082019050818103600083015261040f8184610397565b905092915050565b6104208161032a565b82525050565b600060208201905061043b6000830184610417565b92915050565b61044a81610284565b82525050565b60006020820190506104656000830184610441565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6104b982610470565b810181811067ffffffffffffffff821117156104d8576104d7610481565b5b80604052505050565b60006104eb610250565b90506104f782826104b0565b919050565b600067ffffffffffffffff82111561051757610516610481565b5b602082029050602081019050919050565b600080fd5b600080fd5b60008151905061054181610296565b92915050565b6105508161032a565b811461055b57600080fd5b50565b60008151905061056d81610547565b92915050565b6000604082840312156105895761058861052d565b5b61059360406104e1565b905060006105a384828501610532565b60008301525060206105b78482850161055e565b60208301525092915050565b60006105d66105d1846104fc565b6104e1565b905080838252602082019050604084028301858111156105f9576105f8610528565b5b835b81811015610622578061060e8882610573565b8452602084019350506040810190506105fb565b5050509392505050565b600082601f8301126106415761064061046b565b5b81516106518482602086016105c3565b91505092915050565b6000602082840312156106705761066f61025a565b5b600082015167ffffffffffffffff81111561068e5761068d61025f565b5b61069a8482850161062c565b91505092915050565b6000602082840312156106b9576106b861025a565b5b60006106c78482850161055e565b9150509291505056fea2646970667358221220f70daf3d24c9078a0794dd53b6122acaa31b9de6d1f9bce599773c1e50f6ea6064736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/bank/utils_test.go b/precompiles/bank/utils_test.go index f79848a4..f168ca3d 100644 --- a/precompiles/bank/utils_test.go +++ b/precompiles/bank/utils_test.go @@ -40,16 +40,17 @@ func (is *IntegrationTestSuite) setupBankPrecompile() *bank.Precompile { } // mintAndSendXMPLCoin is a helper function to mint and send a coin to a given address. -func (s *PrecompileTestSuite) mintAndSendXMPLCoin(addr sdk.AccAddress, amount math.Int) { +func (s *PrecompileTestSuite) mintAndSendXMPLCoin(ctx sdk.Context, addr sdk.AccAddress, amount math.Int) sdk.Context { coins := sdk.NewCoins(sdk.NewCoin(s.tokenDenom, amount)) - err := s.network.App.BankKeeper.MintCoins(s.network.GetContext(), minttypes.ModuleName, coins) + err := s.network.App.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) s.Require().NoError(err) - err = s.network.App.BankKeeper.SendCoinsFromModuleToAccount(s.network.GetContext(), minttypes.ModuleName, addr, coins) + err = s.network.App.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, coins) s.Require().NoError(err) + return ctx } // mintAndSendXMPLCoin is a helper function to mint and send a coin to a given address. -func (is *IntegrationTestSuite) mintAndSendXMPLCoin(addr sdk.AccAddress, amount math.Int) { +func (is *IntegrationTestSuite) mintAndSendXMPLCoin(addr sdk.AccAddress, amount math.Int) { //nolint:unused coins := sdk.NewCoins(sdk.NewCoin(is.tokenDenom, amount)) err := is.network.App.BankKeeper.MintCoins(is.network.GetContext(), minttypes.ModuleName, coins) Expect(err).ToNot(HaveOccurred()) @@ -106,3 +107,9 @@ func Max(x, y int) int { } return y } + +// XMPL Token metadata to use on tests +const ( + xmplDenom = "xmpl" + xmplErc20Addr = "0x5db67696C3c088DfBf588d3dd849f44266ffffff" +) diff --git a/precompiles/bech32/bech32_test.go b/precompiles/bech32/bech32_test.go index 06fbc9b4..3c32e49b 100644 --- a/precompiles/bech32/bech32_test.go +++ b/precompiles/bech32/bech32_test.go @@ -130,9 +130,12 @@ func (s *PrecompileTestSuite) TestRun() { { "pass - hex to bech32 validator operator (evmosvaloper)", func() *vm.Contract { + valAddrCodec := s.network.App.StakingKeeper.ValidatorAddressCodec() + valAddrBz, err := valAddrCodec.StringToBytes(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err, "failed to convert string to bytes") input, err := s.precompile.Pack( bech32.HexToBech32Method, - common.BytesToAddress(s.network.GetValidators()[0].GetOperator().Bytes()), + common.BytesToAddress(valAddrBz), chainconfig.Bech32PrefixValAddr, ) s.Require().NoError(err, "failed to pack input") @@ -207,12 +210,16 @@ func (s *PrecompileTestSuite) TestRun() { return contract }, func(data []byte) { + valAddrCodec := s.network.App.StakingKeeper.ValidatorAddressCodec() + valAddrBz, err := valAddrCodec.StringToBytes(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err, "failed to convert string to bytes") + args, err := s.precompile.Unpack(bech32.Bech32ToHexMethod, data) s.Require().NoError(err, "failed to unpack output") s.Require().Len(args, 1) addr, ok := args[0].(common.Address) s.Require().True(ok) - s.Require().Equal(common.BytesToAddress(s.network.GetValidators()[0].GetOperator().Bytes()), addr) + s.Require().Equal(common.BytesToAddress(valAddrBz), addr) }, true, "", diff --git a/precompiles/common/precompile.go b/precompiles/common/precompile.go index d34d2494..050516fc 100644 --- a/precompiles/common/precompile.go +++ b/precompiles/common/precompile.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package common import ( @@ -7,7 +8,7 @@ import ( "math/big" "time" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" "github.com/ethereum/go-ethereum/accounts/abi" @@ -51,7 +52,7 @@ func NewBalanceChangeEntry(acc common.Address, amt *big.Int, op Operation) balan // This is needed to allow us to revert the changes // during the EVM execution type snapshot struct { - MultiStore sdk.CacheMultiStore + MultiStore storetypes.CacheMultiStore Events sdk.Events } @@ -159,7 +160,7 @@ func HandleGasError(ctx sdk.Context, contract *vm.Contract, initialGas storetype return func() { if r := recover(); r != nil { switch r.(type) { - case sdk.ErrorOutOfGas: + case storetypes.ErrorOutOfGas: // update contract gas usedGas := ctx.GasMeter().GasConsumed() - initialGas _ = contract.UseGas(usedGas) diff --git a/precompiles/common/types.go b/precompiles/common/types.go index 94a6491c..c2f717cb 100644 --- a/precompiles/common/types.go +++ b/precompiles/common/types.go @@ -93,7 +93,13 @@ func HexAddressFromBech32String(addr string) (res common.Address, err error) { } return common.BytesToAddress(valAddr.Bytes()), nil } - return common.BytesToAddress(sdk.MustAccAddressFromBech32(addr)), nil + + accAddr, err := sdk.AccAddressFromBech32(addr) + if err != nil { + return res, err + } + + return common.BytesToAddress(accAddr), nil } // SafeAdd adds two integers and returns a boolean if an overflow occurs to avoid panic. diff --git a/precompiles/common/types_test.go b/precompiles/common/types_test.go index b94bcc92..d5d8d1d1 100644 --- a/precompiles/common/types_test.go +++ b/precompiles/common/types_test.go @@ -3,10 +3,11 @@ package common_test import ( "testing" + "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/evmos/os/precompiles/common" - "github.com/evmos/os/testutil" "github.com/stretchr/testify/require" ) @@ -21,7 +22,7 @@ func TestNewCoinsResponse(t *testing.T) { } for _, tc := range testCases { - coin := sdk.NewCoin(testutil.ExampleAttoDenom, tc.amount) + coin := sdk.NewCoin(constants.ExampleAttoDenom, tc.amount) coins := sdk.NewCoins(coin) res := common.NewCoinsResponse(coins) require.Equal(t, 1, len(res)) @@ -38,7 +39,7 @@ func TestNewDecCoinsResponse(t *testing.T) { } for _, tc := range testCases { - coin := sdk.NewDecCoin(testutil.ExampleAttoDenom, tc.amount) + coin := sdk.NewDecCoin(constants.ExampleAttoDenom, tc.amount) coins := sdk.NewDecCoins(coin) res := common.NewDecCoinsResponse(coins) require.Equal(t, 1, len(res)) diff --git a/precompiles/distribution/distribution.go b/precompiles/distribution/distribution.go index ae042e23..87a392fb 100644 --- a/precompiles/distribution/distribution.go +++ b/precompiles/distribution/distribution.go @@ -7,7 +7,7 @@ import ( "embed" "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" diff --git a/precompiles/distribution/distribution_test.go b/precompiles/distribution/distribution_test.go index c0b29b6e..bb1017f0 100644 --- a/precompiles/distribution/distribution_test.go +++ b/precompiles/distribution/distribution_test.go @@ -3,14 +3,16 @@ package distribution_test import ( "math/big" + chainutil "github.com/evmos/os/example_chain/testutil" + "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - chainutil "github.com/evmos/os/example_chain/testutil" + gethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/evmos/os/precompiles/distribution" - "github.com/evmos/os/testutil" "github.com/evmos/os/x/evm/core/vm" evmtypes "github.com/evmos/os/x/evm/types" ) @@ -62,6 +64,10 @@ func (s *PrecompileTestSuite) TestIsTransaction() { // TestRun tests the precompile's Run method. func (s *PrecompileTestSuite) TestRun() { + var ( + ctx sdk.Context + err error + ) testcases := []struct { name string malleate func() (common.Address, []byte) @@ -72,19 +78,19 @@ func (s *PrecompileTestSuite) TestRun() { { name: "pass - set withdraw address transaction", malleate: func() (common.Address, []byte) { - valAddr, err := sdk.ValAddressFromBech32(s.validators[0].OperatorAddress) + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].OperatorAddress) s.Require().NoError(err) - val, _ := s.app.StakingKeeper.GetValidator(s.ctx, valAddr) - coins := sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1e18))) - s.app.DistrKeeper.AllocateTokensToValidator(s.ctx, val, sdk.NewDecCoinsFromCoins(coins...)) + val, _ := s.network.App.StakingKeeper.GetValidator(ctx, valAddr) + coins := sdk.NewCoins(sdk.NewCoin(constants.ExampleAttoDenom, math.NewInt(1e18))) + s.Require().NoError(s.network.App.DistrKeeper.AllocateTokensToValidator(ctx, val, sdk.NewDecCoinsFromCoins(coins...))) input, err := s.precompile.Pack( distribution.SetWithdrawAddressMethod, - s.address, - s.address.String(), + s.keyring.GetAddr(0), + s.keyring.GetAddr(0).String(), ) s.Require().NoError(err, "failed to pack input") - return s.address, input + return s.keyring.GetAddr(0), input }, readOnly: false, expPass: true, @@ -92,16 +98,22 @@ func (s *PrecompileTestSuite) TestRun() { { name: "pass - withdraw validator commissions transaction", malleate: func() (common.Address, []byte) { - hexAddr := common.Bytes2Hex(s.address.Bytes()) + hexAddr := common.Bytes2Hex(s.keyring.GetAddr(0).Bytes()) valAddr, err := sdk.ValAddressFromHex(hexAddr) s.Require().NoError(err) caller := common.BytesToAddress(valAddr) - valCommission := sdk.DecCoins{sdk.NewDecCoinFromDec(testutil.ExampleAttoDenom, math.LegacyNewDecWithPrec(1000000000000000000, 1))} + commAmt := math.LegacyNewDecWithPrec(1000000000000000000, 1) + valCommission := sdk.DecCoins{sdk.NewDecCoinFromDec(constants.ExampleAttoDenom, commAmt)} // set outstanding rewards - s.app.DistrKeeper.SetValidatorOutstandingRewards(s.ctx, valAddr, types.ValidatorOutstandingRewards{Rewards: valCommission}) + s.Require().NoError(s.network.App.DistrKeeper.SetValidatorOutstandingRewards(ctx, valAddr, types.ValidatorOutstandingRewards{Rewards: valCommission})) // set commission - s.app.DistrKeeper.SetValidatorAccumulatedCommission(s.ctx, valAddr, types.ValidatorAccumulatedCommission{Commission: valCommission}) + s.Require().NoError(s.network.App.DistrKeeper.SetValidatorAccumulatedCommission(ctx, valAddr, types.ValidatorAccumulatedCommission{Commission: valCommission})) + + // set distribution module account balance which pays out the rewards + coins := sdk.NewCoins(sdk.NewCoin(s.bondDenom, commAmt.RoundInt())) + err = s.mintCoinsForDistrMod(ctx, coins) + s.Require().NoError(err, "failed to fund distr module account") input, err := s.precompile.Pack( distribution.WithdrawValidatorCommissionMethod, @@ -116,20 +128,25 @@ func (s *PrecompileTestSuite) TestRun() { { name: "pass - withdraw delegator rewards transaction", malleate: func() (common.Address, []byte) { - valAddr, err := sdk.ValAddressFromBech32(s.validators[0].OperatorAddress) - s.Require().NoError(err) - val, _ := s.app.StakingKeeper.GetValidator(s.ctx, valAddr) - coins := sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1e18))) - s.app.DistrKeeper.AllocateTokensToValidator(s.ctx, val, sdk.NewDecCoinsFromCoins(coins...)) + val := s.network.GetValidators()[0] + ctx, err = s.prepareStakingRewards( + ctx, + stakingRewards{ + Delegator: s.keyring.GetAccAddr(0), + Validator: val, + RewardAmt: testRewardsAmt, + }, + ) + s.Require().NoError(err, "failed to prepare staking rewards") input, err := s.precompile.Pack( distribution.WithdrawDelegatorRewardsMethod, - s.address, - valAddr.String(), + s.keyring.GetAddr(0), + val.OperatorAddress, ) s.Require().NoError(err, "failed to pack input") - return s.address, input + return s.keyring.GetAddr(0), input }, readOnly: false, expPass: true, @@ -137,20 +154,39 @@ func (s *PrecompileTestSuite) TestRun() { { name: "pass - claim rewards transaction", malleate: func() (common.Address, []byte) { - valAddr, err := sdk.ValAddressFromBech32(s.validators[0].OperatorAddress) - s.Require().NoError(err) - val, _ := s.app.StakingKeeper.GetValidator(s.ctx, valAddr) - coins := sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1e18))) - s.app.DistrKeeper.AllocateTokensToValidator(s.ctx, val, sdk.NewDecCoinsFromCoins(coins...)) + ctx, err = s.prepareStakingRewards( + ctx, + stakingRewards{ + Delegator: s.keyring.GetAccAddr(0), + Validator: s.network.GetValidators()[0], + RewardAmt: testRewardsAmt, + }, + ) + s.Require().NoError(err, "failed to prepare staking rewards") input, err := s.precompile.Pack( distribution.ClaimRewardsMethod, - s.address, + s.keyring.GetAddr(0), uint32(2), ) s.Require().NoError(err, "failed to pack input") - return s.address, input + return s.keyring.GetAddr(0), input + }, + readOnly: false, + expPass: true, + }, + { + name: "pass - fund community pool transaction", + malleate: func() (common.Address, []byte) { + input, err := s.precompile.Pack( + distribution.FundCommunityPoolMethod, + s.keyring.GetAddr(0), + big.NewInt(1e18), + ) + s.Require().NoError(err, "failed to pack input") + + return s.keyring.GetAddr(0), input }, readOnly: false, expPass: true, @@ -160,12 +196,12 @@ func (s *PrecompileTestSuite) TestRun() { malleate: func() (common.Address, []byte) { input, err := s.precompile.Pack( distribution.FundCommunityPoolMethod, - s.address, + s.keyring.GetAddr(0), big.NewInt(1e18), ) s.Require().NoError(err, "failed to pack input") - return s.address, input + return s.keyring.GetAddr(0), input }, readOnly: false, expPass: true, @@ -177,8 +213,8 @@ func (s *PrecompileTestSuite) TestRun() { s.Run(tc.name, func() { // setup basic test suite s.SetupTest() - - baseFee := s.app.FeeMarketKeeper.GetBaseFee(s.ctx) + ctx = s.network.GetContext() + baseFee := s.network.App.FeeMarketKeeper.GetBaseFee(ctx) // malleate testcase caller, input := tc.malleate() @@ -189,7 +225,7 @@ func (s *PrecompileTestSuite) TestRun() { contractAddr := contract.Address() // Build and sign Ethereum transaction txArgs := evmtypes.EvmTxArgs{ - ChainID: s.app.EVMKeeper.ChainID(), + ChainID: s.network.App.EVMKeeper.ChainID(), Nonce: 0, To: &contractAddr, Amount: nil, @@ -197,28 +233,30 @@ func (s *PrecompileTestSuite) TestRun() { GasPrice: chainutil.ExampleMinGasPrices.BigInt(), GasFeeCap: baseFee, GasTipCap: big.NewInt(1), - Accesses: ðtypes.AccessList{}, + Accesses: &gethtypes.AccessList{}, } - msgEthereumTx := evmtypes.NewTx(&txArgs) + msgEthereumTx, err := s.factory.GenerateMsgEthereumTx(s.keyring.GetPrivKey(0), txArgs) + s.Require().NoError(err, "failed to generate Ethereum message") - msgEthereumTx.From = s.address.String() - err := msgEthereumTx.Sign(s.ethSigner, s.signer) + signedMsg, err := s.factory.SignMsgEthereumTx(s.keyring.GetPrivKey(0), msgEthereumTx) s.Require().NoError(err, "failed to sign Ethereum message") // Instantiate config - proposerAddress := s.ctx.BlockHeader().ProposerAddress - cfg, err := s.app.EVMKeeper.EVMConfig(s.ctx, proposerAddress, s.app.EVMKeeper.ChainID()) + proposerAddress := ctx.BlockHeader().ProposerAddress + cfg, err := s.network.App.EVMKeeper.EVMConfig(ctx, proposerAddress, s.network.App.EVMKeeper.ChainID()) s.Require().NoError(err, "failed to instantiate EVM config") - msg, err := msgEthereumTx.AsMessage(s.ethSigner, baseFee) + ethChainID := s.network.GetEIP155ChainID() + signer := gethtypes.LatestSignerForChainID(ethChainID) + msg, err := signedMsg.AsMessage(signer, baseFee) s.Require().NoError(err, "failed to instantiate Ethereum message") // Instantiate EVM - evm := s.app.EVMKeeper.NewEVM( - s.ctx, msg, cfg, nil, s.stateDB, + evm := s.network.App.EVMKeeper.NewEVM( + ctx, msg, cfg, nil, s.network.GetStateDB(), ) - precompiles, found, err := s.app.EVMKeeper.GetPrecompileInstance(s.ctx, contractAddr) + precompiles, found, err := s.network.App.EVMKeeper.GetPrecompileInstance(ctx, contractAddr) s.Require().NoError(err, "failed to instantiate precompile") s.Require().True(found, "not found precompile") evm.WithPrecompiles(precompiles.Map, precompiles.Addresses) diff --git a/precompiles/distribution/events.go b/precompiles/distribution/events.go index c3bc1c42..9c3ac71b 100644 --- a/precompiles/distribution/events.go +++ b/precompiles/distribution/events.go @@ -43,7 +43,12 @@ func (p Precompile) EmitClaimRewardsEvent(ctx sdk.Context, stateDB vm.StateDB, d return err } - totalAmount := totalCoins.AmountOf(p.stakingKeeper.BondDenom(ctx)) + bondDenom, err := p.stakingKeeper.BondDenom(ctx) + if err != nil { + return err + } + totalAmount := totalCoins.AmountOf(bondDenom) + // Pack the arguments to be used as the Data field arguments := abi.Arguments{event.Inputs[1]} packed, err := arguments.Pack(totalAmount.BigInt()) @@ -55,7 +60,7 @@ func (p Precompile) EmitClaimRewardsEvent(ctx sdk.Context, stateDB vm.StateDB, d Address: p.Address(), Topics: topics, Data: packed, - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil @@ -87,7 +92,7 @@ func (p Precompile) EmitSetWithdrawAddressEvent(ctx sdk.Context, stateDB vm.Stat Address: p.Address(), Topics: topics, Data: packed, - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil @@ -125,7 +130,7 @@ func (p Precompile) EmitWithdrawDelegatorRewardsEvent(ctx sdk.Context, stateDB v Address: p.Address(), Topics: topics, Data: b.Bytes(), - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil @@ -154,7 +159,7 @@ func (p Precompile) EmitWithdrawValidatorCommissionEvent(ctx sdk.Context, stateD Address: p.Address(), Topics: topics, Data: b.Bytes(), - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil @@ -183,7 +188,7 @@ func (p Precompile) EmitFundCommunityPoolEvent(ctx sdk.Context, stateDB vm.State Address: p.Address(), Topics: topics, Data: b.Bytes(), - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil diff --git a/precompiles/distribution/events_test.go b/precompiles/distribution/events_test.go index 36dbeeb8..ca2ba1fc 100644 --- a/precompiles/distribution/events_test.go +++ b/precompiles/distribution/events_test.go @@ -3,19 +3,27 @@ package distribution_test import ( "math/big" + chainconfig "github.com/evmos/os/example_chain/osd/config" + "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - chainconfig "github.com/evmos/os/example_chain/osd/config" cmn "github.com/evmos/os/precompiles/common" "github.com/evmos/os/precompiles/distribution" - "github.com/evmos/os/testutil" "github.com/evmos/os/x/evm/core/vm" + "github.com/evmos/os/x/evm/statedb" ) func (s *PrecompileTestSuite) TestSetWithdrawAddressEvent() { + var ( + ctx sdk.Context + stDB *statedb.StateDB + ) method := s.precompile.Methods[distribution.SetWithdrawAddressMethod] testCases := []struct { name string @@ -29,25 +37,25 @@ func (s *PrecompileTestSuite) TestSetWithdrawAddressEvent() { "success - the correct event is emitted", func(string) []interface{} { return []interface{}{ - s.address, - s.address.String(), + s.keyring.GetAddr(0), + s.keyring.GetAddr(0).String(), } }, func() { - log := s.stateDB.Logs()[0] + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[distribution.EventTypeSetWithdrawAddress] s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 // Check the fully unpacked event matches the one emitted var setWithdrawerAddrEvent distribution.EventSetWithdrawAddress err := cmn.UnpackLog(s.precompile.ABI, &setWithdrawerAddrEvent, distribution.EventTypeSetWithdrawAddress, *log) s.Require().NoError(err) - s.Require().Equal(s.address, setWithdrawerAddrEvent.Caller) - s.Require().Equal(sdk.MustBech32ifyAddressBytes(chainconfig.Bech32Prefix, s.address.Bytes()), setWithdrawerAddrEvent.WithdrawerAddress) + s.Require().Equal(s.keyring.GetAddr(0), setWithdrawerAddrEvent.Caller) + s.Require().Equal(sdk.MustBech32ifyAddressBytes(chainconfig.Bech32Prefix, s.keyring.GetAddr(0).Bytes()), setWithdrawerAddrEvent.WithdrawerAddress) }, 20000, false, @@ -57,13 +65,15 @@ func (s *PrecompileTestSuite) TestSetWithdrawAddressEvent() { for _, tc := range testCases { s.SetupTest() + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) - s.ctx = s.ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) - initialGas := s.ctx.GasMeter().GasConsumed() + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) + ctx = ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()) + initialGas := ctx.GasMeter().GasConsumed() s.Require().Zero(initialGas) - _, err := s.precompile.SetWithdrawAddress(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate(s.validators[0].OperatorAddress)) + _, err := s.precompile.SetWithdrawAddress(ctx, s.keyring.GetAddr(0), contract, stDB, &method, tc.malleate(s.network.GetValidators()[0].OperatorAddress)) if tc.expError { s.Require().Error(err) @@ -76,10 +86,14 @@ func (s *PrecompileTestSuite) TestSetWithdrawAddressEvent() { } func (s *PrecompileTestSuite) TestWithdrawDelegatorRewardsEvent() { + var ( + ctx sdk.Context + stDB *statedb.StateDB + ) method := s.precompile.Methods[distribution.WithdrawDelegatorRewardsMethod] testCases := []struct { name string - malleate func(operatorAddress string) []interface{} + malleate func(val stakingtypes.Validator) []interface{} postCheck func() gas uint64 expError bool @@ -87,27 +101,30 @@ func (s *PrecompileTestSuite) TestWithdrawDelegatorRewardsEvent() { }{ { "success - the correct event is emitted", - func(operatorAddress string) []interface{} { - valAddr, err := sdk.ValAddressFromBech32(operatorAddress) + func(val stakingtypes.Validator) []interface{} { + var err error + + ctx, err = s.prepareStakingRewards(ctx, stakingRewards{ + Validator: val, + Delegator: s.keyring.GetAccAddr(0), + RewardAmt: testRewardsAmt, + }) s.Require().NoError(err) - val, _ := s.app.StakingKeeper.GetValidator(s.ctx, valAddr) - coins := sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1e18))) - s.app.DistrKeeper.AllocateTokensToValidator(s.ctx, val, sdk.NewDecCoinsFromCoins(coins...)) return []interface{}{ - s.address, - operatorAddress, + s.keyring.GetAddr(0), + val.OperatorAddress, } }, func() { - log := s.stateDB.Logs()[0] + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[distribution.EventTypeWithdrawDelegatorRewards] s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 - optAddr, err := sdk.ValAddressFromBech32(s.validators[0].OperatorAddress) + optAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].OperatorAddress) s.Require().NoError(err) optHexAddr := common.BytesToAddress(optAddr) @@ -115,9 +132,9 @@ func (s *PrecompileTestSuite) TestWithdrawDelegatorRewardsEvent() { var delegatorRewards distribution.EventWithdrawDelegatorRewards err = cmn.UnpackLog(s.precompile.ABI, &delegatorRewards, distribution.EventTypeWithdrawDelegatorRewards, *log) s.Require().NoError(err) - s.Require().Equal(s.address, delegatorRewards.DelegatorAddress) + s.Require().Equal(s.keyring.GetAddr(0), delegatorRewards.DelegatorAddress) s.Require().Equal(optHexAddr, delegatorRewards.ValidatorAddress) - s.Require().Equal(big.NewInt(1000000000000000000), delegatorRewards.Amount) + s.Require().Equal(expRewardsAmt.BigInt(), delegatorRewards.Amount) }, 20000, false, @@ -127,13 +144,15 @@ func (s *PrecompileTestSuite) TestWithdrawDelegatorRewardsEvent() { for _, tc := range testCases { s.SetupTest() + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) - s.ctx = s.ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) - initialGas := s.ctx.GasMeter().GasConsumed() + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) + ctx = ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()) + initialGas := ctx.GasMeter().GasConsumed() s.Require().Zero(initialGas) - _, err := s.precompile.WithdrawDelegatorRewards(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate(s.validators[0].OperatorAddress)) + _, err := s.precompile.WithdrawDelegatorRewards(ctx, s.keyring.GetAddr(0), contract, stDB, &method, tc.malleate(s.network.GetValidators()[0])) if tc.expError { s.Require().Error(err) @@ -146,6 +165,11 @@ func (s *PrecompileTestSuite) TestWithdrawDelegatorRewardsEvent() { } func (s *PrecompileTestSuite) TestWithdrawValidatorCommissionEvent() { + var ( + ctx sdk.Context + stDB *statedb.StateDB + amt = math.NewInt(1e18) + ) method := s.precompile.Methods[distribution.WithdrawValidatorCommissionMethod] testCases := []struct { name string @@ -160,30 +184,34 @@ func (s *PrecompileTestSuite) TestWithdrawValidatorCommissionEvent() { func(operatorAddress string) []interface{} { valAddr, err := sdk.ValAddressFromBech32(operatorAddress) s.Require().NoError(err) - valCommission := sdk.DecCoins{sdk.NewDecCoinFromDec(testutil.ExampleAttoDenom, math.LegacyNewDecWithPrec(1000000000000000000, 1))} + valCommission := sdk.DecCoins{sdk.NewDecCoinFromDec(constants.ExampleAttoDenom, math.LegacyNewDecFromInt(amt))} // set outstanding rewards - s.app.DistrKeeper.SetValidatorOutstandingRewards(s.ctx, valAddr, types.ValidatorOutstandingRewards{Rewards: valCommission}) + s.Require().NoError(s.network.App.DistrKeeper.SetValidatorOutstandingRewards(ctx, valAddr, types.ValidatorOutstandingRewards{Rewards: valCommission})) // set commission - s.app.DistrKeeper.SetValidatorAccumulatedCommission(s.ctx, valAddr, types.ValidatorAccumulatedCommission{Commission: valCommission}) + s.Require().NoError(s.network.App.DistrKeeper.SetValidatorAccumulatedCommission(ctx, valAddr, types.ValidatorAccumulatedCommission{Commission: valCommission})) + // set funds to distr mod to pay for commission + coins := sdk.NewCoins(sdk.NewCoin(constants.ExampleAttoDenom, amt)) + err = s.mintCoinsForDistrMod(ctx, coins) + s.Require().NoError(err) return []interface{}{ operatorAddress, } }, func() { - log := s.stateDB.Logs()[0] + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[distribution.EventTypeWithdrawValidatorCommission] s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 // Check the fully unpacked event matches the one emitted var validatorRewards distribution.EventWithdrawValidatorRewards err := cmn.UnpackLog(s.precompile.ABI, &validatorRewards, distribution.EventTypeWithdrawValidatorCommission, *log) s.Require().NoError(err) - s.Require().Equal(crypto.Keccak256Hash([]byte(s.validators[0].OperatorAddress)), validatorRewards.ValidatorAddress) - s.Require().Equal(big.NewInt(100000000000000000), validatorRewards.Commission) + s.Require().Equal(crypto.Keccak256Hash([]byte(s.network.GetValidators()[0].OperatorAddress)), validatorRewards.ValidatorAddress) + s.Require().Equal(amt.BigInt(), validatorRewards.Commission) }, 20000, false, @@ -193,14 +221,18 @@ func (s *PrecompileTestSuite) TestWithdrawValidatorCommissionEvent() { for _, tc := range testCases { s.SetupTest() + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() - validatorAddress := common.BytesToAddress(s.validators[0].GetOperator().Bytes()) + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) + validatorAddress := common.BytesToAddress(valAddr) contract := vm.NewContract(vm.AccountRef(validatorAddress), s.precompile, big.NewInt(0), tc.gas) - s.ctx = s.ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) - initialGas := s.ctx.GasMeter().GasConsumed() + ctx = ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()) + initialGas := ctx.GasMeter().GasConsumed() s.Require().Zero(initialGas) - _, err := s.precompile.WithdrawValidatorCommission(s.ctx, validatorAddress, contract, s.stateDB, &method, tc.malleate(s.validators[0].OperatorAddress)) + _, err = s.precompile.WithdrawValidatorCommission(ctx, validatorAddress, contract, stDB, &method, tc.malleate(s.network.GetValidators()[0].OperatorAddress)) if tc.expError { s.Require().Error(err) @@ -212,8 +244,11 @@ func (s *PrecompileTestSuite) TestWithdrawValidatorCommissionEvent() { } } -//nolint:dupl func (s *PrecompileTestSuite) TestClaimRewardsEvent() { + var ( + ctx sdk.Context + stDB *statedb.StateDB + ) testCases := []struct { name string coins sdk.Coins @@ -221,19 +256,19 @@ func (s *PrecompileTestSuite) TestClaimRewardsEvent() { }{ { "success", - sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1e18))), + sdk.NewCoins(sdk.NewCoin(constants.ExampleAttoDenom, math.NewInt(1e18))), func() { - log := s.stateDB.Logs()[0] + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[distribution.EventTypeClaimRewards] s.Require().Equal(event.ID, common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 var claimRewardsEvent distribution.EventClaimRewards err := cmn.UnpackLog(s.precompile.ABI, &claimRewardsEvent, distribution.EventTypeClaimRewards, *log) s.Require().NoError(err) - s.Require().Equal(common.BytesToAddress(s.address.Bytes()), claimRewardsEvent.DelegatorAddress) + s.Require().Equal(common.BytesToAddress(s.keyring.GetAddr(0).Bytes()), claimRewardsEvent.DelegatorAddress) s.Require().Equal(big.NewInt(1e18), claimRewardsEvent.Amount) }, }, @@ -242,16 +277,20 @@ func (s *PrecompileTestSuite) TestClaimRewardsEvent() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() - - err := s.precompile.EmitClaimRewardsEvent(s.ctx, s.stateDB, s.address, tc.coins) + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() + err := s.precompile.EmitClaimRewardsEvent(ctx, stDB, s.keyring.GetAddr(0), tc.coins) s.Require().NoError(err) tc.postCheck() }) } } -//nolint:dupl func (s *PrecompileTestSuite) TestFundCommunityPoolEvent() { + var ( + ctx sdk.Context + stDB *statedb.StateDB + ) testCases := []struct { name string coins sdk.Coins @@ -259,19 +298,19 @@ func (s *PrecompileTestSuite) TestFundCommunityPoolEvent() { }{ { "success - the correct event is emitted", - sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1e18))), + sdk.NewCoins(sdk.NewCoin(constants.ExampleAttoDenom, math.NewInt(1e18))), func() { - log := s.stateDB.Logs()[0] + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[distribution.EventTypeFundCommunityPool] s.Require().Equal(event.ID, common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 var fundCommunityPoolEvent distribution.EventFundCommunityPool err := cmn.UnpackLog(s.precompile.ABI, &fundCommunityPoolEvent, distribution.EventTypeFundCommunityPool, *log) s.Require().NoError(err) - s.Require().Equal(common.BytesToAddress(s.address.Bytes()), fundCommunityPoolEvent.Depositor) + s.Require().Equal(s.keyring.GetAddr(0), fundCommunityPoolEvent.Depositor) s.Require().Equal(big.NewInt(1e18), fundCommunityPoolEvent.Amount) }, }, @@ -280,8 +319,10 @@ func (s *PrecompileTestSuite) TestFundCommunityPoolEvent() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() - err := s.precompile.EmitFundCommunityPoolEvent(s.ctx, s.stateDB, s.address, tc.coins) + err := s.precompile.EmitFundCommunityPoolEvent(ctx, stDB, s.keyring.GetAddr(0), tc.coins) s.Require().NoError(err) tc.postCheck() }) diff --git a/precompiles/distribution/integration_test.go b/precompiles/distribution/integration_test.go index b2548167..43decdb2 100644 --- a/precompiles/distribution/integration_test.go +++ b/precompiles/distribution/integration_test.go @@ -3,22 +3,22 @@ package distribution_test import ( - "fmt" "math/big" + "testing" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/ethereum/go-ethereum/common" - chainutil "github.com/evmos/os/example_chain/testutil" + "github.com/evmos/os/precompiles/authorization" cmn "github.com/evmos/os/precompiles/common" "github.com/evmos/os/precompiles/distribution" + "github.com/evmos/os/precompiles/staking" "github.com/evmos/os/precompiles/testutil" "github.com/evmos/os/precompiles/testutil/contracts" - evmosutil "github.com/evmos/os/testutil" + testconstants "github.com/evmos/os/testutil/constants" + "github.com/evmos/os/testutil/integration/os/factory" + testutils "github.com/evmos/os/testutil/integration/os/utils" testutiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/evm/core/vm" evmtypes "github.com/evmos/os/x/evm/types" @@ -32,15 +32,13 @@ import ( // General variables used for integration tests var ( // differentAddr is an address generated for testing purposes that e.g. raises the different origin error - differentAddr = testutiltx.GenerateAddress() - // expRewardAmt is the expected amount of rewards - expRewardAmt = big.NewInt(2000000000000000000) + differentAddr, diffKey = testutiltx.NewAddrKey() // gasPrice is the gas price used for the transactions - gasPrice = big.NewInt(1e9) - // defaultCallArgs are the default arguments for calling the smart contract + gasPrice = math.NewInt(1e9) + // callArgs are the default arguments for calling the smart contract // // NOTE: this has to be populated in a BeforeEach block because the contractAddr would otherwise be a nil address. - defaultCallArgs contracts.CallArgs + callArgs factory.CallArgs // defaultLogCheck instantiates a log check arguments struct with the precompile ABI events populated. defaultLogCheck testutil.LogCheckArgs @@ -48,20 +46,28 @@ var ( passCheck testutil.LogCheckArgs // outOfGasCheck defines the arguments to check if the precompile returns out of gas error outOfGasCheck testutil.LogCheckArgs + // txArgs are the EVM transaction arguments to use in the transactions + txArgs evmtypes.EvmTxArgs + // minExpRewardOrCommission is the minimun coins expected for validator's rewards or commission + // required for the tests + minExpRewardOrCommission = sdk.NewDecCoins(sdk.NewDecCoin(testconstants.ExampleAttoDenom, testRewardsAmt)) ) +func TestPrecompileIntegrationTestSuite(t *testing.T) { + // Run Ginkgo integration tests + RegisterFailHandler(Fail) + RunSpecs(t, "Distribution Precompile Suite") +} + var _ = Describe("Calling distribution precompile from EOA", func() { + s := new(PrecompileTestSuite) + BeforeEach(func() { s.SetupTest() - initialBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - fmt.Println("Fist Before each: ", initialBalance) - // set the default call arguments - defaultCallArgs = contracts.CallArgs{ - ContractAddr: s.precompile.Address(), - ContractABI: s.precompile.ABI, - PrivKey: s.privKey, + callArgs = factory.CallArgs{ + ContractABI: s.precompile.ABI, } defaultLogCheck = testutil.LogCheckArgs{ @@ -70,8 +76,12 @@ var _ = Describe("Calling distribution precompile from EOA", func() { passCheck = defaultLogCheck.WithExpPass(true) outOfGasCheck = defaultLogCheck.WithErrContains(vm.ErrOutOfGas.Error()) - initialBalance = s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - fmt.Println("Fist Before each: ", initialBalance) + // reset tx args each test to avoid keeping custom + // values of previous tests (e.g. gasLimit) + precompileAddr := s.precompile.Address() + txArgs = evmtypes.EvmTxArgs{ + To: &precompileAddr, + } }) // ===================================== @@ -79,108 +89,226 @@ var _ = Describe("Calling distribution precompile from EOA", func() { // ===================================== Describe("Execute SetWithdrawAddress transaction", func() { const method = distribution.SetWithdrawAddressMethod - // defaultSetWithdrawArgs are the default arguments to set the withdraw address - // - // NOTE: this has to be populated in the BeforeEach block because the private key otherwise is not yet initialized. - var defaultSetWithdrawArgs contracts.CallArgs BeforeEach(func() { // set the default call arguments - defaultSetWithdrawArgs = defaultCallArgs.WithMethodName(method) + callArgs.MethodName = method }) It("should return error if the provided gasLimit is too low", func() { - setWithdrawArgs := defaultSetWithdrawArgs. - WithGasLimit(30000). - WithArgs(s.address, differentAddr.String()) + txArgs.GasLimit = 30000 - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, setWithdrawArgs, outOfGasCheck) - Expect(err).To(HaveOccurred(), "error while calling the precompile") - Expect(err.Error()).To(ContainSubstring("out of gas"), "expected out of gas error") + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), + differentAddr.String(), + } + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + outOfGasCheck, + ) + Expect(err).To(BeNil(), "error while calling the precompile") + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock") // withdraw address should remain unchanged - withdrawAddr := s.app.DistrKeeper.GetDelegatorWithdrawAddr(s.ctx, s.address.Bytes()) - Expect(withdrawAddr.Bytes()).To(Equal(s.address.Bytes()), "expected withdraw address to remain unchanged") + delAddr := s.keyring.GetAccAddr(0).String() + res, err := s.grpcHandler.GetDelegatorWithdrawAddr(delAddr) + Expect(err).To(BeNil(), "error while calling the precompile") + Expect(res.WithdrawAddress).To(Equal(delAddr), "expected withdraw address to remain unchanged") }) It("should return error if the origin is different than the delegator", func() { - setWithdrawArgs := defaultSetWithdrawArgs.WithArgs(differentAddr, s.address.String()) + callArgs.Args = []interface{}{ + differentAddr, + s.keyring.GetAddr(0).String(), + } - withdrawAddrSetCheck := defaultLogCheck.WithErrContains(cmn.ErrDelegatorDifferentOrigin, s.address.String(), differentAddr.String()) + withdrawAddrSetCheck := defaultLogCheck.WithErrContains(cmn.ErrDelegatorDifferentOrigin, s.keyring.GetAddr(0).String(), differentAddr.String()) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, setWithdrawArgs, withdrawAddrSetCheck) - Expect(err).To(HaveOccurred(), "error while calling the precompile") - Expect(err.Error()).To(ContainSubstring(fmt.Sprintf(cmn.ErrDelegatorDifferentOrigin, s.address, differentAddr)), "expected different origin error") + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + withdrawAddrSetCheck, + ) + Expect(err).To(BeNil(), "error while calling the precompile") }) It("should set withdraw address", func() { // initially, withdraw address should be same as address - withdrawAddr := s.app.DistrKeeper.GetDelegatorWithdrawAddr(s.ctx, s.address.Bytes()) - Expect(withdrawAddr.Bytes()).To(Equal(s.address.Bytes())) + res, err := s.grpcHandler.GetDelegatorWithdrawAddr(s.keyring.GetAccAddr(0).String()) + Expect(err).To(BeNil(), "error while querying withdraw address") + Expect(res.WithdrawAddress).To(Equal(s.keyring.GetAccAddr(0).String())) - setWithdrawArgs := defaultSetWithdrawArgs.WithArgs(s.address, differentAddr.String()) + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), + differentAddr.String(), + } withdrawAddrSetCheck := passCheck. WithExpEvents(distribution.EventTypeSetWithdrawAddress) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, setWithdrawArgs, withdrawAddrSetCheck) + _, _, err = s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + withdrawAddrSetCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") + // persist state changes + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock") + // withdraw should be updated - withdrawAddr = s.app.DistrKeeper.GetDelegatorWithdrawAddr(s.ctx, s.address.Bytes()) - Expect(withdrawAddr.Bytes()).To(Equal(differentAddr.Bytes()), "expected different withdraw address") + res, err = s.grpcHandler.GetDelegatorWithdrawAddr(s.keyring.GetAccAddr(0).String()) + Expect(err).To(BeNil(), "error while querying withdraw address") + Expect(res.WithdrawAddress).To(Equal(sdk.AccAddress(differentAddr.Bytes()).String()), "expected different withdraw address") }) }) Describe("Execute WithdrawDelegatorRewards transaction", func() { - // defaultWithdrawRewardsArgs are the default arguments to withdraw rewards - // - // NOTE: this has to be populated in the BeforeEach block because the private key otherwise is not yet initialized. - var defaultWithdrawRewardsArgs contracts.CallArgs + var accruedRewards sdk.DecCoins BeforeEach(func() { + var err error // set the default call arguments - defaultWithdrawRewardsArgs = defaultCallArgs.WithMethodName(distribution.WithdrawDelegatorRewardsMethod) - s.prepareStakingRewards(stakingRewards{s.address.Bytes(), s.validators[0], rewards}) + callArgs.MethodName = distribution.WithdrawDelegatorRewardsMethod + + accruedRewards, err = testutils.WaitToAccrueRewards(s.network, s.grpcHandler, s.keyring.GetAccAddr(0).String(), minExpRewardOrCommission) + Expect(err).To(BeNil()) }) It("should return error if the origin is different than the delegator", func() { - withdrawRewardsArgs := defaultWithdrawRewardsArgs.WithArgs(differentAddr, s.validators[0].OperatorAddress) + callArgs.Args = []interface{}{ + differentAddr, + s.network.GetValidators()[0].OperatorAddress, + } - withdrawalCheck := defaultLogCheck.WithErrContains(cmn.ErrDelegatorDifferentOrigin, s.address.String(), differentAddr.String()) + withdrawalCheck := defaultLogCheck.WithErrContains( + cmn.ErrDelegatorDifferentOrigin, + s.keyring.GetAddr(0).String(), + differentAddr.String(), + ) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawRewardsArgs, withdrawalCheck) - Expect(err).To(HaveOccurred(), "error while calling the precompile") - Expect(err.Error()).To(ContainSubstring(fmt.Sprintf(cmn.ErrDelegatorDifferentOrigin, s.address, differentAddr)), "expected different origin error") + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + withdrawalCheck, + ) + Expect(err).To(BeNil(), "error while calling the precompile") }) It("should withdraw delegation rewards", func() { // get initial balance - initialBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - Expect(initialBalance.Amount).To(Equal(initialBalance.Amount)) + queryRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + initialBalance := queryRes.Balance + + txArgs.GasPrice = gasPrice.BigInt() + txArgs.GasLimit = 100_000 - withdrawRewardsArgs := defaultWithdrawRewardsArgs. - WithArgs(s.address, s.validators[0].OperatorAddress). - WithGasPrice(gasPrice) + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), + s.network.GetValidators()[0].OperatorAddress, + } withdrawalCheck := passCheck. WithExpEvents(distribution.EventTypeWithdrawDelegatorRewards) - res, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawRewardsArgs, withdrawalCheck) + res, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + withdrawalCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock") var rewards []cmn.Coin err = s.precompile.UnpackIntoInterface(&rewards, distribution.WithdrawDelegatorRewardsMethod, ethRes.Ret) Expect(err).To(BeNil()) Expect(len(rewards)).To(Equal(1)) + + // The accrued rewards are based on 3 equal delegations to the existing 3 validators + // The query is from only 1 validator, thus, the expected reward + // for this delegation is totalAccruedRewards / validatorsCount (3) + valCount := len(s.network.GetValidators()) + accruedRewardsAmt := accruedRewards.AmountOf(s.bondDenom) + expRewardPerValidator := accruedRewardsAmt.Quo(math.LegacyNewDec(int64(valCount))) + Expect(rewards[0].Denom).To(Equal(s.bondDenom)) - Expect(rewards[0].Amount).To(Equal(expRewardAmt)) + Expect(rewards[0].Amount).To(Equal(expRewardPerValidator.TruncateInt().BigInt())) // check that the rewards were added to the balance - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - fees := gasPrice.Int64() * res.GasUsed - expFinal := initialBalance.Amount.Int64() + expRewardAmt.Int64() - fees - Expect(finalBalance.Amount.Equal(math.NewInt(expFinal))).To(BeTrue(), "expected final balance to be equal to initial balance + rewards - fees") + queryRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + fees := gasPrice.Mul(math.NewInt(res.GasUsed)) + expFinal := initialBalance.Amount.Add(expRewardPerValidator.TruncateInt()).Sub(fees) + Expect(queryRes.Balance.Amount).To(Equal(expFinal), "expected final balance to be equal to initial balance + rewards - fees") + }) + + It("should withdraw rewards successfully to the new withdrawer address", func() { + balRes, err := s.grpcHandler.GetBalance(differentAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + withdrawerInitialBalance := balRes.Balance + // Set new withdrawer address + err = s.factory.SetWithdrawAddress(s.keyring.GetPrivKey(0), differentAddr.Bytes()) + Expect(err).To(BeNil()) + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) + + // get initial balance + queryRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + initialBalance := queryRes.Balance + + // get rewards + rwRes, err := s.grpcHandler.GetDelegationRewards(s.keyring.GetAccAddr(0).String(), s.network.GetValidators()[0].OperatorAddress) + Expect(err).To(BeNil()) + expRewardsAmt := rwRes.Rewards.AmountOf(s.bondDenom).TruncateInt() + + txArgs.GasPrice = gasPrice.BigInt() + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), + s.network.GetValidators()[0].OperatorAddress, + } + + withdrawalCheck := passCheck. + WithExpEvents(distribution.EventTypeWithdrawDelegatorRewards) + + txArgs.GasLimit = 300_000 + res, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + withdrawalCheck, + ) + Expect(err).To(BeNil(), "error while calling the precompile") + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock") + + var rewards []cmn.Coin + err = s.precompile.UnpackIntoInterface(&rewards, distribution.WithdrawDelegatorRewardsMethod, ethRes.Ret) + Expect(err).To(BeNil()) + Expect(len(rewards)).To(Equal(1)) + + Expect(rewards[0].Denom).To(Equal(s.bondDenom)) + Expect(rewards[0].Amount).To(Equal(expRewardsAmt.BigInt())) + + // check that the delegator final balance is initialBalance - fee + queryRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + fees := gasPrice.Mul(math.NewInt(res.GasUsed)) + expDelgatorFinal := initialBalance.Amount.Sub(fees) + Expect(queryRes.Balance.Amount).To(Equal(expDelgatorFinal), "expected delegator final balance to be equal to initial balance - fees") + + // check that the rewards were added to the withdrawer balance + queryRes, err = s.grpcHandler.GetBalance(differentAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + expWithdrawerFinal := withdrawerInitialBalance.Amount.Add(expRewardsAmt) + + Expect(queryRes.Balance.Amount).To(Equal(expWithdrawerFinal), "expected withdrawer final balance to be equal to initial balance + rewards") }) It("should withdraw delegation rewards to a smart contract", func() { @@ -188,117 +316,160 @@ var _ = Describe("Calling distribution precompile from EOA", func() { distributionCallerContract, err := contracts.LoadDistributionCallerContract() Expect(err).To(BeNil(), "error while loading the smart contract: %v", err) - contractAddr, err := s.DeployContract(distributionCallerContract) + contractAddr, err := s.factory.DeployContract( + s.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values + factory.ContractDeploymentData{ + Contract: distributionCallerContract, + }, + ) Expect(err).To(BeNil(), "error while deploying the smart contract: %v", err) + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) - initialWithdrawerBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) - Expect(initialWithdrawerBalance.Amount).To(Equal(sdk.ZeroInt())) + balRes, err := s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + initialWithdrawerBalance := balRes.Balance + Expect(initialWithdrawerBalance.Amount).To(Equal(math.ZeroInt())) // set contract address as withdrawer address - err = s.app.DistrKeeper.SetWithdrawAddr(s.ctx, s.address.Bytes(), contractAddr.Bytes()) + err = s.factory.SetWithdrawAddress(s.keyring.GetPrivKey(0), contractAddr.Bytes()) Expect(err).To(BeNil()) + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) // get tx sender initial balance - initialBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + initialBalance := balRes.Balance - withdrawRewardsArgs := defaultWithdrawRewardsArgs. - WithArgs(s.address, s.validators[0].OperatorAddress). - WithGasPrice(gasPrice) + // get rewards + rwRes, err := s.grpcHandler.GetDelegationRewards(s.keyring.GetAccAddr(0).String(), s.network.GetValidators()[0].OperatorAddress) + Expect(err).To(BeNil()) + expRewardsAmt := rwRes.Rewards.AmountOf(s.bondDenom).TruncateInt() + + txArgs.GasPrice = gasPrice.BigInt() + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), + s.network.GetValidators()[0].OperatorAddress, + } withdrawalCheck := passCheck. WithExpEvents(distribution.EventTypeWithdrawDelegatorRewards) - res, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawRewardsArgs, withdrawalCheck) + txArgs.GasLimit = 300_000 + res, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + withdrawalCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock") var rewards []cmn.Coin err = s.precompile.UnpackIntoInterface(&rewards, distribution.WithdrawDelegatorRewardsMethod, ethRes.Ret) Expect(err).To(BeNil()) Expect(len(rewards)).To(Equal(1)) Expect(rewards[0].Denom).To(Equal(s.bondDenom)) - Expect(rewards[0].Amount).To(Equal(expRewardAmt)) + Expect(rewards[0].Amount).To(Equal(expRewardsAmt.BigInt())) // check tx sender balance is reduced by fees paid - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - fees := sdk.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + finalBalance := balRes.Balance + fees := gasPrice.MulRaw(res.GasUsed) expFinal := initialBalance.Amount.Sub(fees) Expect(finalBalance.Amount).To(Equal(expFinal), "expected final balance to be equal to initial balance - fees") // check that the rewards were added to the withdrawer balance - finalWithdrawerBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) - Expect(finalWithdrawerBalance.Amount.BigInt()).To(Equal(expRewardAmt)) + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + finalWithdrawerBalance := balRes.Balance + Expect(finalWithdrawerBalance.Amount).To(Equal(expRewardsAmt)) }) }) Describe("Validator Commission: Execute WithdrawValidatorCommission tx", func() { - var ( - // defaultWithdrawCommissionArgs are the default arguments to withdraw commission - // - // NOTE: this has to be populated in the BeforeEach block because the private key otherwise is not yet initialized. - defaultWithdrawCommissionArgs contracts.CallArgs - - // expCommAmt is the expected commission amount - expCommAmt = big.NewInt(1) - // commDec is the commission rate - commDec = math.LegacyNewDec(1) - valAddr sdk.ValAddress - stakeAmt math.Int - ) + // expCommAmt is the expected commission amount + expCommAmt := math.NewInt(1) BeforeEach(func() { // set the default call arguments - defaultWithdrawCommissionArgs = defaultCallArgs.WithMethodName( - distribution.WithdrawValidatorCommissionMethod, - ) - - // create a validator with s.address and s.privKey because this account is - // used for signing txs - stakeAmt = math.NewInt(100) - testutil.CreateValidator(s.ctx, s.T(), s.privKey.PubKey(), *s.app.StakingKeeper, stakeAmt) + callArgs.MethodName = distribution.WithdrawValidatorCommissionMethod + valAddr := sdk.ValAddress(s.validatorsKeys[0].AccAddr) - // set some validator commission - valAddr = s.address.Bytes() - val := s.app.StakingKeeper.Validator(s.ctx, valAddr) - valCommission := sdk.DecCoins{sdk.NewDecCoinFromDec(s.bondDenom, commDec)} + _, err := testutils.WaitToAccrueCommission( + s.network, s.grpcHandler, + valAddr.String(), + sdk.NewDecCoins(sdk.NewDecCoin(s.bondDenom, expCommAmt)), + ) + Expect(err).To(BeNil()) - s.app.DistrKeeper.SetValidatorAccumulatedCommission(s.ctx, valAddr, distrtypes.ValidatorAccumulatedCommission{Commission: valCommission}) - s.app.DistrKeeper.AllocateTokensToValidator(s.ctx, val, sdk.DecCoins{sdk.NewDecCoin(s.bondDenom, stakeAmt)}) + // Send some funds to the validator to pay for fees + err = testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), s.validatorsKeys[0].AccAddr, math.NewInt(1e17)) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) }) It("should return error if the provided gasLimit is too low", func() { - withdrawCommissionArgs := defaultWithdrawCommissionArgs. - WithGasLimit(50000). - WithArgs(valAddr.String()) + txArgs.GasLimit = 50000 + callArgs.Args = []interface{}{ + s.network.GetValidators()[0].OperatorAddress, + } - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawCommissionArgs, outOfGasCheck) - Expect(err).To(HaveOccurred(), "error while calling the precompile") - Expect(err.Error()).To(ContainSubstring("out of gas"), "expected out of gas error") + _, _, err := s.factory.CallContractAndCheckLogs( + s.validatorsKeys[0].Priv, + txArgs, + callArgs, + outOfGasCheck, + ) + Expect(err).To(BeNil(), "error while calling the precompile") }) It("should return error if the origin is different than the validator", func() { - withdrawCommissionArgs := defaultWithdrawCommissionArgs.WithArgs(s.validators[0].OperatorAddress) - validatorHexAddr := common.BytesToAddress(s.validators[0].GetOperator()) + callArgs.Args = []interface{}{ + s.network.GetValidators()[0].OperatorAddress, + } + + validatorHexAddr := common.BytesToAddress(s.validatorsKeys[0].AccAddr) - withdrawalCheck := defaultLogCheck.WithErrContains(cmn.ErrDelegatorDifferentOrigin, s.address.String(), validatorHexAddr.String()) + withdrawalCheck := defaultLogCheck.WithErrContains(cmn.ErrDelegatorDifferentOrigin, s.keyring.GetAddr(0).String(), validatorHexAddr.String()) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawCommissionArgs, withdrawalCheck) - Expect(err).To(HaveOccurred(), "error while calling the precompile") - Expect(err.Error()).To(ContainSubstring(fmt.Sprintf(cmn.ErrDelegatorDifferentOrigin, s.address, validatorHexAddr)), "expected different origin error") + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + withdrawalCheck, + ) + Expect(err).To(BeNil(), "error while calling the precompile") }) It("should withdraw validator commission", func() { // initial balance should be the initial amount minus the staked amount used to create the validator - initialBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - Expect(initialBalance.Amount).To(Equal(math.NewInt(4999999999999999900))) + queryRes, err := s.grpcHandler.GetBalance(s.validatorsKeys[0].AccAddr, s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + + initialBalance := queryRes.Balance - withdrawCommissionArgs := defaultWithdrawCommissionArgs. - WithArgs(valAddr.String()). - WithGasPrice(gasPrice) + // get the accrued commission amount + commRes, err := s.grpcHandler.GetValidatorCommission(s.network.GetValidators()[0].OperatorAddress) + Expect(err).To(BeNil()) + expCommAmt := commRes.Commission.Commission.AmountOf(s.bondDenom).TruncateInt() + + callArgs.Args = []interface{}{s.network.GetValidators()[0].OperatorAddress} + txArgs.GasPrice = gasPrice.BigInt() withdrawalCheck := passCheck. WithExpEvents(distribution.EventTypeWithdrawValidatorCommission) - res, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawCommissionArgs, withdrawalCheck) + txArgs.GasLimit = 300_000 + res, ethRes, err := s.factory.CallContractAndCheckLogs( + s.validatorsKeys[0].Priv, + txArgs, + callArgs, + withdrawalCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") var comm []cmn.Coin @@ -306,12 +477,18 @@ var _ = Describe("Calling distribution precompile from EOA", func() { Expect(err).To(BeNil()) Expect(len(comm)).To(Equal(1)) Expect(comm[0].Denom).To(Equal(s.bondDenom)) - Expect(comm[0].Amount).To(Equal(expCommAmt)) + Expect(comm[0].Amount).To(Equal(expCommAmt.BigInt())) - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - fees := gasPrice.Int64() * res.GasUsed - expFinal := initialBalance.Amount.Int64() + expCommAmt.Int64() - fees - Expect(finalBalance.Amount.Equal(math.NewInt(expFinal))).To(BeTrue(), "expected final balance to be equal to the final balance after withdrawing commission") + Expect(s.network.NextBlock()).To(BeNil()) + + queryRes, err = s.grpcHandler.GetBalance(s.validatorsKeys[0].AccAddr, s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + finalBalance := queryRes.Balance + + fees := gasPrice.Mul(math.NewInt(res.GasUsed)) + expFinal := initialBalance.Amount.Add(expCommAmt).Sub(fees) + + Expect(finalBalance.Amount).To(Equal(expFinal), "expected final balance to be equal to the final balance after withdrawing commission") }) It("should withdraw validator commission to a smart contract", func() { @@ -319,44 +496,75 @@ var _ = Describe("Calling distribution precompile from EOA", func() { distributionCallerContract, err := contracts.LoadDistributionCallerContract() Expect(err).To(BeNil(), "error while loading the smart contract: %v", err) - contractAddr, err := s.DeployContract(distributionCallerContract) + contractAddr, err := s.factory.DeployContract( + s.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values + factory.ContractDeploymentData{ + Contract: distributionCallerContract, + }, + ) Expect(err).To(BeNil(), "error while deploying the smart contract: %v", err) + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) - initialWithdrawerBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) - Expect(initialWithdrawerBalance.Amount).To(Equal(sdk.ZeroInt())) + balRes, err := s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + initialWithdrawerBalance := balRes.Balance + Expect(initialWithdrawerBalance.Amount).To(Equal(math.ZeroInt())) // set contract address as withdrawer address - err = s.app.DistrKeeper.SetWithdrawAddr(s.ctx, s.address.Bytes(), contractAddr.Bytes()) + err = s.factory.SetWithdrawAddress(s.validatorsKeys[0].Priv, contractAddr.Bytes()) Expect(err).To(BeNil()) + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) // get validator initial balance - initialBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(s.validatorsKeys[0].AccAddr, s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + initialBalance := balRes.Balance + + // get the accrued commission amount + commRes, err := s.grpcHandler.GetValidatorCommission(s.network.GetValidators()[0].OperatorAddress) + Expect(err).To(BeNil()) + expCommAmt := commRes.Commission.Commission.AmountOf(s.bondDenom).TruncateInt() - withdrawCommissionArgs := defaultWithdrawCommissionArgs. - WithArgs(valAddr.String()). - WithGasPrice(gasPrice) + callArgs.Args = []interface{}{s.network.GetValidators()[0].OperatorAddress} + txArgs.GasPrice = gasPrice.BigInt() withdrawalCheck := passCheck. WithExpEvents(distribution.EventTypeWithdrawValidatorCommission) - res, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawCommissionArgs, withdrawalCheck) + txArgs.GasLimit = 300_000 + res, ethRes, err := s.factory.CallContractAndCheckLogs( + s.validatorsKeys[0].Priv, + txArgs, + callArgs, + withdrawalCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) var comm []cmn.Coin err = s.precompile.UnpackIntoInterface(&comm, distribution.WithdrawValidatorCommissionMethod, ethRes.Ret) Expect(err).To(BeNil()) Expect(len(comm)).To(Equal(1)) Expect(comm[0].Denom).To(Equal(s.bondDenom)) - Expect(comm[0].Amount).To(Equal(expCommAmt)) + Expect(comm[0].Amount).To(Equal(expCommAmt.BigInt())) + + balRes, err = s.grpcHandler.GetBalance(s.validatorsKeys[0].AccAddr, s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + finalBalance := balRes.Balance - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - fees := sdk.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) + fees := gasPrice.MulRaw(res.GasUsed) expFinal := initialBalance.Amount.Sub(fees) Expect(finalBalance.Amount).To(Equal(expFinal), "expected final balance to be equal to the final balance after withdrawing commission") // check that the commission was added to the withdrawer balance - finalWithdrawerBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) - Expect(finalWithdrawerBalance.Amount.BigInt()).To(Equal(expCommAmt)) + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + finalWithdrawerBalance := balRes.Balance + Expect(finalWithdrawerBalance.Amount).To(Equal(expCommAmt)) }) }) @@ -364,43 +572,78 @@ var _ = Describe("Calling distribution precompile from EOA", func() { // defaultWithdrawRewardsArgs are the default arguments to withdraw rewards // // NOTE: this has to be populated in the BeforeEach block because the private key otherwise is not yet initialized. - var defaultClaimRewardsArgs contracts.CallArgs - // starting balance minus delegated tokens - startingBalance := math.NewInt(5e18) - expectedBalance := math.NewInt(8999665039062500000) + var accruedRewards sdk.DecCoins BeforeEach(func() { + var err error // set the default call arguments - defaultClaimRewardsArgs = defaultCallArgs.WithMethodName(distribution.ClaimRewardsMethod) - initialBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - fmt.Println("BeforeEach: ", initialBalance) - s.prepareStakingRewards(stakingRewards{s.address.Bytes(), s.validators[0], rewards}) - s.prepareStakingRewards(stakingRewards{s.address.Bytes(), s.validators[1], rewards}) + callArgs.MethodName = distribution.ClaimRewardsMethod + accruedRewards, err = testutils.WaitToAccrueRewards( + s.network, + s.grpcHandler, + s.keyring.GetAccAddr(0).String(), + minExpRewardOrCommission) + Expect(err).To(BeNil(), "error waiting to accrue rewards") }) It("should return err if the origin is different than the delegator", func() { - claimRewardsArgs := defaultClaimRewardsArgs.WithArgs(differentAddr, uint32(1)) + callArgs.Args = []interface{}{ + differentAddr, uint32(1), + } - claimRewardsCheck := defaultLogCheck.WithErrContains(cmn.ErrDelegatorDifferentOrigin, s.address.String(), differentAddr.String()) + claimRewardsCheck := defaultLogCheck.WithErrContains(cmn.ErrDelegatorDifferentOrigin, s.keyring.GetAddr(0).String(), differentAddr.String()) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, claimRewardsArgs, claimRewardsCheck) - Expect(err).To(HaveOccurred(), "error while calling the precompile") - Expect(err.Error()).To(ContainSubstring(fmt.Sprintf(cmn.ErrDelegatorDifferentOrigin, s.address, differentAddr)), "expected different origin error") + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + claimRewardsCheck, + ) + Expect(err).To(BeNil(), "error while calling the precompile") }) It("should claim all rewards from all validators", func() { - initialBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - Expect(initialBalance.Amount).To(Equal(startingBalance)) + queryRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + initialBalance := queryRes.Balance + + valCount := len(s.network.GetValidators()) + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), uint32(valCount), + } + txArgs.GasLimit = 250_000 + + // get base fee to use in tx to then calculate fee paid + bfQuery, err := s.grpcHandler.GetBaseFee() + Expect(err).To(BeNil(), "error while calling BaseFee") + gasPrice := bfQuery.BaseFee + txArgs.GasPrice = gasPrice.BigInt() - claimRewardsArgs := defaultClaimRewardsArgs.WithArgs(s.address, uint32(2)) claimRewardsCheck := passCheck.WithExpEvents(distribution.EventTypeClaimRewards) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, claimRewardsArgs, claimRewardsCheck) + txRes, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + claimRewardsCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") + // persist state change + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock") + // check that the rewards were added to the balance - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount.Equal(expectedBalance)).To(BeTrue(), "expected final balance to be equal to initial balance + rewards - fees") + queryRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + + // get the fee paid and calculate the expFinalBalance + fee := gasPrice.Mul(math.NewInt(txRes.GasUsed)) + accruedRewardsAmt := accruedRewards.AmountOf(s.bondDenom).TruncateInt() + // expected balance is initial + rewards - fee + expBalanceAmt := initialBalance.Amount.Add(accruedRewardsAmt).Sub(fee) + + finalBalance := queryRes.Balance + Expect(finalBalance.Amount).To(Equal(expBalanceAmt), "expected final balance to be equal to initial balance + rewards - fees") }) }) // ===================================== @@ -408,62 +651,97 @@ var _ = Describe("Calling distribution precompile from EOA", func() { // ===================================== Describe("Execute queries", func() { It("should get validator distribution info - validatorDistributionInfo query", func() { - addr := sdk.AccAddress(s.validators[0].GetOperator()) // fund validator account to make self-delegation - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, addr, 10) + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), s.validatorsKeys[0].AccAddr, math.NewInt(1e17)) Expect(err).To(BeNil()) + // persist changes + Expect(s.network.NextBlock()).To(BeNil()) + + opAddr := s.network.GetValidators()[0].OperatorAddress + // use the validator priv key // make a self delegation - _, err = s.app.StakingKeeper.Delegate(s.ctx, addr, math.NewInt(1), stakingtypes.Unspecified, s.validators[0], true) + err = s.factory.Delegate(s.validatorsKeys[0].Priv, opAddr, sdk.NewCoin(s.bondDenom, math.NewInt(1))) Expect(err).To(BeNil()) - - valDistArgs := defaultCallArgs. - WithMethodName(distribution.ValidatorDistributionInfoMethod). - WithArgs(s.validators[0].OperatorAddress) - - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, valDistArgs, passCheck) + // persist changes + Expect(s.network.NextBlock()).To(BeNil()) + + callArgs.MethodName = distribution.ValidatorDistributionInfoMethod + callArgs.Args = []interface{}{opAddr} + txArgs.GasLimit = 200_000 + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.validatorsKeys[0].Priv, + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") var out distribution.ValidatorDistributionInfoOutput err = s.precompile.UnpackIntoInterface(&out, distribution.ValidatorDistributionInfoMethod, ethRes.Ret) Expect(err).To(BeNil()) - expAddr := sdk.AccAddress(s.validators[0].GetOperator()) - Expect(expAddr.String()).To(Equal(out.DistributionInfo.OperatorAddress)) - Expect(0).To(Equal(len(out.DistributionInfo.Commission))) - Expect(0).To(Equal(len(out.DistributionInfo.SelfBondRewards))) + expAddr := s.validatorsKeys[0].AccAddr.String() + Expect(expAddr).To(Equal(out.DistributionInfo.OperatorAddress)) + Expect(1).To(Equal(len(out.DistributionInfo.Commission))) + Expect(1).To(Equal(len(out.DistributionInfo.SelfBondRewards))) }) - It("should get validator outstanding rewards - validatorOutstandingRewards query", func() { //nolint:dupl - valRewards := sdk.DecCoins{sdk.NewDecCoinFromDec(s.bondDenom, math.LegacyNewDec(1))} - // set outstanding rewards - s.app.DistrKeeper.SetValidatorOutstandingRewards(s.ctx, s.validators[0].GetOperator(), distrtypes.ValidatorOutstandingRewards{Rewards: valRewards}) - - valOutRewardsArgs := defaultCallArgs. - WithMethodName(distribution.ValidatorOutstandingRewardsMethod). - WithArgs(s.validators[0].OperatorAddress) - - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, valOutRewardsArgs, passCheck) + It("should get validator outstanding rewards - validatorOutstandingRewards query", func() { + accruedRewards, err := testutils.WaitToAccrueRewards( + s.network, + s.grpcHandler, + s.keyring.GetAccAddr(0).String(), + minExpRewardOrCommission) + Expect(err).To(BeNil(), "error waiting to accrue rewards") + + callArgs.MethodName = distribution.ValidatorOutstandingRewardsMethod + callArgs.Args = []interface{}{s.network.GetValidators()[0].OperatorAddress} + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") var rewards []cmn.DecCoin err = s.precompile.UnpackIntoInterface(&rewards, distribution.ValidatorOutstandingRewardsMethod, ethRes.Ret) Expect(err).To(BeNil()) Expect(len(rewards)).To(Equal(1)) + Expect(uint8(18)).To(Equal(rewards[0].Precision)) Expect(s.bondDenom).To(Equal(rewards[0].Denom)) - Expect(expValAmount).To(Equal(rewards[0].Amount.Int64())) - }) - It("should get validator commission - validatorCommission query", func() { //nolint:dupl - // set commission - valCommission := sdk.DecCoins{sdk.NewDecCoinFromDec(s.bondDenom, math.LegacyNewDec(1))} - s.app.DistrKeeper.SetValidatorAccumulatedCommission(s.ctx, s.validators[0].GetOperator(), distrtypes.ValidatorAccumulatedCommission{Commission: valCommission}) + // the expected rewards should be the accruedRewards per validator + // plus the 5% commission + expRewardAmt := accruedRewards.AmountOf(s.bondDenom). + Quo(math.LegacyNewDec(3)). // divide by validators count + Quo(math.LegacyNewDecWithPrec(95, 2)). // add 5% commission + TruncateInt() - valCommArgs := defaultCallArgs. - WithMethodName(distribution.ValidatorCommissionMethod). - WithArgs(s.validators[0].OperatorAddress) + Expect(rewards[0].Amount.String()).To(Equal(expRewardAmt.BigInt().String())) + }) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, valCommArgs, passCheck) + It("should get validator commission - validatorCommission query", func() { + opAddr := s.network.GetValidators()[0].OperatorAddress + accruedCommission, err := testutils.WaitToAccrueCommission( + s.network, + s.grpcHandler, + opAddr, + minExpRewardOrCommission) + Expect(err).To(BeNil(), "error waiting to accrue rewards") + + callArgs.MethodName = distribution.ValidatorCommissionMethod + callArgs.Args = []interface{}{opAddr} + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") var commission []cmn.DecCoin @@ -472,170 +750,213 @@ var _ = Describe("Calling distribution precompile from EOA", func() { Expect(len(commission)).To(Equal(1)) Expect(uint8(18)).To(Equal(commission[0].Precision)) Expect(s.bondDenom).To(Equal(commission[0].Denom)) - Expect(expValAmount).To(Equal(commission[0].Amount.Int64())) + + expCommissionAmt := accruedCommission.AmountOf(s.bondDenom).TruncateInt() + Expect(commission[0].Amount).To(Equal(expCommissionAmt.BigInt())) }) - Context("validatorSlashes query query", func() { + Context("validatorSlashes query query", Ordered, func() { + BeforeAll(func() { + s.withValidatorSlashes = true + s.SetupTest() + }) + AfterAll(func() { + s.withValidatorSlashes = false + }) + It("should get validator slashing events (default pagination)", func() { - // set slash event - slashEvent := distrtypes.ValidatorSlashEvent{ValidatorPeriod: 1, Fraction: math.LegacyNewDec(5)} - s.app.DistrKeeper.SetValidatorSlashEvent(s.ctx, s.validators[0].GetOperator(), 2, 1, slashEvent) - - valSlashArgs := defaultCallArgs. - WithMethodName(distribution.ValidatorSlashesMethod). - WithArgs( - s.validators[0].OperatorAddress, - uint64(1), uint64(5), - query.PageRequest{}, - ) + callArgs.MethodName = distribution.ValidatorSlashesMethod + callArgs.Args = []interface{}{ + s.network.GetValidators()[0].OperatorAddress, + uint64(1), uint64(5), + query.PageRequest{}, + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, valSlashArgs, passCheck) - Expect(err).To(BeNil(), "error while calling the precompile") + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) + Expect(err).To(BeNil()) var out distribution.ValidatorSlashesOutput err = s.precompile.UnpackIntoInterface(&out, distribution.ValidatorSlashesMethod, ethRes.Ret) Expect(err).To(BeNil()) - Expect(len(out.Slashes)).To(Equal(1)) - Expect(slashEvent.Fraction.BigInt()).To(Equal(out.Slashes[0].Fraction.Value)) - Expect(slashEvent.ValidatorPeriod).To(Equal(out.Slashes[0].ValidatorPeriod)) - Expect(uint64(1)).To(Equal(out.PageResponse.Total)) + Expect(len(out.Slashes)).To(Equal(2)) + // expected values according to the values used on test setup (custom genesis) + for _, s := range out.Slashes { + Expect(s.Fraction.Value).To(Equal(math.LegacyNewDecWithPrec(5, 2).BigInt())) + Expect(s.ValidatorPeriod).To(Equal(uint64(1))) + } + Expect(uint64(2)).To(Equal(out.PageResponse.Total)) Expect(out.PageResponse.NextKey).To(BeEmpty()) }) It("should get validator slashing events - query w/pagination limit = 1)", func() { - // set 2 slashing events for validator[0] - slashEvent := s.setupValidatorSlashes(s.validators[0].GetOperator(), 2) - - valSlashArgs := defaultCallArgs. - WithMethodName(distribution.ValidatorSlashesMethod). - WithArgs( - s.validators[0].OperatorAddress, - uint64(1), uint64(5), - query.PageRequest{ - Limit: 1, - CountTotal: true, - }, - ) + callArgs.MethodName = distribution.ValidatorSlashesMethod + callArgs.Args = []interface{}{ + s.network.GetValidators()[0].OperatorAddress, + uint64(1), uint64(5), + query.PageRequest{ + Limit: 1, + CountTotal: true, + }, + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, valSlashArgs, passCheck) - Expect(err).To(BeNil(), "error while calling the precompile") + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) + Expect(err).To(BeNil()) var out distribution.ValidatorSlashesOutput err = s.precompile.UnpackIntoInterface(&out, distribution.ValidatorSlashesMethod, ethRes.Ret) Expect(err).To(BeNil()) Expect(len(out.Slashes)).To(Equal(1)) - Expect(slashEvent.Fraction.BigInt()).To(Equal(out.Slashes[0].Fraction.Value)) - Expect(slashEvent.ValidatorPeriod).To(Equal(out.Slashes[0].ValidatorPeriod)) + Expect(out.Slashes[0].Fraction.Value).To(Equal(math.LegacyNewDecWithPrec(5, 2).BigInt())) + Expect(out.Slashes[0].ValidatorPeriod).To(Equal(uint64(1))) // total slashes count is 2 Expect(uint64(2)).To(Equal(out.PageResponse.Total)) Expect(out.PageResponse.NextKey).NotTo(BeEmpty()) }) }) + It("should get empty delegation rewards - delegationRewards query", func() { + callArgs.MethodName = distribution.DelegationRewardsMethod + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), + s.network.GetValidators()[0].OperatorAddress, + } + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) + Expect(err).To(BeNil(), "error while calling the precompile") + + var rewards []cmn.DecCoin + err = s.precompile.UnpackIntoInterface(&rewards, distribution.DelegationRewardsMethod, ethRes.Ret) + Expect(err).To(BeNil()) + Expect(len(rewards)).To(Equal(0)) + }) + It("should get delegation rewards - delegationRewards query", func() { - s.prepareStakingRewards(stakingRewards{s.address.Bytes(), s.validators[0], rewards}) + accruedRewards, err := testutils.WaitToAccrueRewards(s.network, s.grpcHandler, s.keyring.GetAccAddr(0).String(), minExpRewardOrCommission) + Expect(err).To(BeNil()) - delRewardsArgs := defaultCallArgs. - WithMethodName(distribution.DelegationRewardsMethod). - WithArgs(s.address, s.validators[0].OperatorAddress) + callArgs.MethodName = distribution.DelegationRewardsMethod + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), + s.network.GetValidators()[0].OperatorAddress, + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, delRewardsArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") var rewards []cmn.DecCoin err = s.precompile.UnpackIntoInterface(&rewards, distribution.DelegationRewardsMethod, ethRes.Ret) Expect(err).To(BeNil()) Expect(len(rewards)).To(Equal(1)) + + // The accrued rewards are based on 3 equal delegations to the existing 3 validators + // The query is from only 1 validator, thus, the expected reward + // for this delegation is totalAccruedRewards / validatorsCount (3) + expRewardAmt := accruedRewards.AmountOf(s.bondDenom).Quo(math.LegacyNewDec(3)) + Expect(rewards[0].Denom).To(Equal(s.bondDenom)) - Expect(rewards[0].Amount.Int64()).To(Equal(expDelegationRewards)) + Expect(rewards[0].Amount).To(Equal(expRewardAmt.TruncateInt().BigInt())) }) It("should get delegators's total rewards - delegationTotalRewards query", func() { - // set rewards - s.prepareStakingRewards(stakingRewards{s.address.Bytes(), s.validators[0], rewards}) + // wait for rewards to accrue + accruedRewards, err := testutils.WaitToAccrueRewards(s.network, s.grpcHandler, s.keyring.GetAccAddr(0).String(), minExpRewardOrCommission) + Expect(err).To(BeNil()) - delTotalRewardsArgs := defaultCallArgs. - WithMethodName(distribution.DelegationTotalRewardsMethod). - WithArgs(s.address) + callArgs.MethodName = distribution.DelegationTotalRewardsMethod + callArgs.Args = []interface{}{s.keyring.GetAddr(0)} - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, delTotalRewardsArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") - var ( - out distribution.DelegationTotalRewardsOutput - i int - ) + var out distribution.DelegationTotalRewardsOutput + err = s.precompile.UnpackIntoInterface(&out, distribution.DelegationTotalRewardsMethod, ethRes.Ret) Expect(err).To(BeNil()) - Expect(2).To(Equal(len(out.Rewards))) + Expect(3).To(Equal(len(out.Rewards))) + + // The accrued rewards are based on 3 equal delegations to the existing 3 validators + // The query is from only 1 validator, thus, the expected reward + // for this delegation is totalAccruedRewards / validatorsCount (3) + accruedRewardsAmt := accruedRewards.AmountOf(s.bondDenom) + expRewardPerValidator := accruedRewardsAmt.Quo(math.LegacyNewDec(3)) // the response order may change - if out.Rewards[0].ValidatorAddress == s.validators[0].OperatorAddress { - Expect(s.validators[0].OperatorAddress).To(Equal(out.Rewards[0].ValidatorAddress)) - Expect(s.validators[1].OperatorAddress).To(Equal(out.Rewards[1].ValidatorAddress)) - Expect(0).To(Equal(len(out.Rewards[1].Reward))) - } else { - i = 1 - Expect(s.validators[0].OperatorAddress).To(Equal(out.Rewards[1].ValidatorAddress)) - Expect(s.validators[1].OperatorAddress).To(Equal(out.Rewards[0].ValidatorAddress)) - Expect(0).To(Equal(len(out.Rewards[0].Reward))) + for _, or := range out.Rewards { + Expect(1).To(Equal(len(or.Reward))) + Expect(or.Reward[0].Denom).To(Equal(s.bondDenom)) + Expect(or.Reward[0].Amount).To(Equal(expRewardPerValidator.TruncateInt().BigInt())) } - // only validator[i] has rewards - Expect(1).To(Equal(len(out.Rewards[i].Reward))) - Expect(s.bondDenom).To(Equal(out.Rewards[i].Reward[0].Denom)) - Expect(uint8(math.LegacyPrecision)).To(Equal(out.Rewards[i].Reward[0].Precision)) - Expect(expDelegationRewards).To(Equal(out.Rewards[i].Reward[0].Amount.Int64())) - Expect(1).To(Equal(len(out.Total))) - Expect(expDelegationRewards).To(Equal(out.Total[0].Amount.Int64())) + Expect(out.Total[0].Amount).To(Equal(accruedRewardsAmt.TruncateInt().BigInt())) }) It("should get all validators a delegators has delegated to - delegatorValidators query", func() { - delValArgs := defaultCallArgs. - WithMethodName(distribution.DelegatorValidatorsMethod). - WithArgs(s.address) - - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, delValArgs, passCheck) + callArgs.MethodName = distribution.DelegatorValidatorsMethod + callArgs.Args = []interface{}{s.keyring.GetAddr(0)} + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") var validators []string err = s.precompile.UnpackIntoInterface(&validators, distribution.DelegatorValidatorsMethod, ethRes.Ret) Expect(err).To(BeNil()) - Expect(2).To(Equal(len(validators))) - - // the response order may change - if validators[0] == s.validators[0].OperatorAddress { - Expect(s.validators[0].OperatorAddress).To(Equal(validators[0])) - Expect(s.validators[1].OperatorAddress).To(Equal(validators[1])) - } else { - Expect(s.validators[1].OperatorAddress).To(Equal(validators[0])) - Expect(s.validators[0].OperatorAddress).To(Equal(validators[1])) - } + Expect(3).To(Equal(len(validators))) }) It("should get withdraw address - delegatorWithdrawAddress query", func() { - // set the withdraw address - err := s.app.DistrKeeper.SetWithdrawAddr(s.ctx, s.address.Bytes(), differentAddr.Bytes()) - Expect(err).To(BeNil()) - - delWithdrawAddrArgs := defaultCallArgs. - WithMethodName(distribution.DelegatorWithdrawAddressMethod). - WithArgs(s.address) - - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, delWithdrawAddrArgs, passCheck) + callArgs.MethodName = distribution.DelegatorWithdrawAddressMethod + callArgs.Args = []interface{}{s.keyring.GetAddr(0)} + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the precompile") withdrawAddr, err := s.precompile.Unpack(distribution.DelegatorWithdrawAddressMethod, ethRes.Ret) Expect(err).To(BeNil()) // get the bech32 encoding - expAddr := sdk.AccAddress(differentAddr.Bytes()) + expAddr := s.keyring.GetAccAddr(0) Expect(withdrawAddr[0]).To(Equal(expAddr.String())) }) }) }) -var _ = Describe("Calling distribution precompile from another contract", func() { +var _ = Describe("Calling distribution precompile from another contract", Ordered, func() { + s := new(PrecompileTestSuite) // testCase is a struct used for cases of contracts calls that have some operation // performed before and/or after the precompile call type testCase struct { @@ -645,39 +966,50 @@ var _ = Describe("Calling distribution precompile from another contract", func() } var ( - // initBalanceAmt is the initial balance for testing - initBalanceAmt = math.NewInt(5000000000000000000) - + distrCallerContract evmtypes.CompiledContract // contractAddr is the address of the smart contract that will be deployed contractAddr common.Address + err error // execRevertedCheck defines the default log checking arguments which includes the // standard revert message. execRevertedCheck testutil.LogCheckArgs ) + BeforeAll(func() { + distrCallerContract, err = contracts.LoadDistributionCallerContract() + Expect(err).To(BeNil(), "error while loading the smart contract: %v", err) + }) + BeforeEach(func() { s.SetupTest() - distributionCallerContract, err := contracts.LoadDistributionCallerContract() - Expect(err).To(BeNil(), "error while loading the smart contract: %v", err) - - contractAddr, err = s.DeployContract(distributionCallerContract) + contractAddr, err = s.factory.DeployContract( + s.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values + factory.ContractDeploymentData{ + Contract: distrCallerContract, + }, + ) Expect(err).To(BeNil(), "error while deploying the smart contract: %v", err) // NextBlock the smart contract - s.NextBlock() + Expect(s.network.NextBlock()).To(BeNil(), "error calling NextBlock: %v", err) // check contract was correctly deployed - cAcc := s.app.EVMKeeper.GetAccount(s.ctx, contractAddr) + cAcc := s.network.App.EVMKeeper.GetAccount(s.network.GetContext(), contractAddr) Expect(cAcc).ToNot(BeNil(), "contract account should exist") Expect(cAcc.IsContract()).To(BeTrue(), "account should be a contract") // populate default call args - defaultCallArgs = contracts.CallArgs{ - ContractAddr: contractAddr, - ContractABI: distributionCallerContract.ABI, - PrivKey: s.privKey, + callArgs = factory.CallArgs{ + ContractABI: distrCallerContract.ABI, + } + + // reset tx args each test to avoid keeping custom + // values of previous tests (e.g. gasLimit) + txArgs = evmtypes.EvmTxArgs{ + To: &contractAddr, } // default log check arguments @@ -690,152 +1022,231 @@ var _ = Describe("Calling distribution precompile from another contract", func() // TRANSACTIONS // ===================================== Context("setWithdrawAddress", func() { - var ( - // defaultSetWithdrawAddrArgs are the default arguments for the set withdraw address call - // - // NOTE: this has to be populated in a BeforeEach block because the contractAddr would otherwise be a nil address. - defaultSetWithdrawAddrArgs contracts.CallArgs - // newWithdrawer is the address to set the withdraw address to - newWithdrawer = differentAddr - ) + // newWithdrawer is the address to set the withdraw address to + newWithdrawer := differentAddr BeforeEach(func() { // withdraw address should be same as address - withdrawer := s.app.DistrKeeper.GetDelegatorWithdrawAddr(s.ctx, s.address.Bytes()) - Expect(withdrawer.Bytes()).To(Equal(s.address.Bytes())) + res, err := s.grpcHandler.GetDelegatorWithdrawAddr(s.keyring.GetAccAddr(0).String()) + Expect(err).To(BeNil(), "error while calling the precompile") + Expect(res.WithdrawAddress).To(Equal(s.keyring.GetAccAddr(0).String())) // populate default arguments - defaultSetWithdrawAddrArgs = defaultCallArgs.WithMethodName( - "testSetWithdrawAddress", - ) + callArgs.MethodName = "testSetWithdrawAddress" }) It("should set withdraw address successfully", func() { - setWithdrawAddrArgs := defaultSetWithdrawAddrArgs.WithArgs( - s.address, newWithdrawer.String(), - ) + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), newWithdrawer.String(), + } setWithdrawCheck := passCheck.WithExpEvents(distribution.EventTypeSetWithdrawAddress) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, setWithdrawAddrArgs, setWithdrawCheck) + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + setWithdrawCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock: %v", err) - withdrawer := s.app.DistrKeeper.GetDelegatorWithdrawAddr(s.ctx, s.address.Bytes()) - Expect(withdrawer.Bytes()).To(Equal(newWithdrawer.Bytes())) + queryRes, err := s.grpcHandler.GetDelegatorWithdrawAddr(s.keyring.GetAccAddr(0).String()) + Expect(err).To(BeNil(), "error while calling the precompile") + Expect(queryRes.WithdrawAddress).To(Equal(sdk.AccAddress(newWithdrawer.Bytes()).String())) }) }) Context("setWithdrawerAddress with contract as delegator", func() { - var ( - // defaultSetWithdrawAddrArgs are the default arguments for the set withdraw address call - // - // NOTE: this has to be populated in a BeforeEach block because the contractAddr would otherwise be a nil address. - defaultSetWithdrawAddrArgs contracts.CallArgs - // newWithdrawer is the address to set the withdraw address to - newWithdrawer = differentAddr - ) + // newWithdrawer is the address to set the withdraw address to + newWithdrawer := differentAddr BeforeEach(func() { // withdraw address should be same as address - withdrawer := s.app.DistrKeeper.GetDelegatorWithdrawAddr(s.ctx, s.address.Bytes()) - Expect(withdrawer.Bytes()).To(Equal(s.address.Bytes())) + res, err := s.grpcHandler.GetDelegatorWithdrawAddr(s.keyring.GetAccAddr(0).String()) + Expect(err).To(BeNil(), "error while calling the precompile") + Expect(res.WithdrawAddress).To(Equal(s.keyring.GetAccAddr(0).String())) // populate default arguments - defaultSetWithdrawAddrArgs = defaultCallArgs.WithMethodName( - "testSetWithdrawAddressFromContract", - ) + callArgs.MethodName = "testSetWithdrawAddressFromContract" }) It("should set withdraw address successfully without origin check", func() { - setWithdrawAddrArgs := defaultSetWithdrawAddrArgs.WithArgs(newWithdrawer.String()) - + callArgs.Args = []interface{}{newWithdrawer.String()} setWithdrawCheck := passCheck.WithExpEvents(distribution.EventTypeSetWithdrawAddress) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, setWithdrawAddrArgs, setWithdrawCheck) + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + setWithdrawCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock: %v", err) - withdrawer := s.app.DistrKeeper.GetDelegatorWithdrawAddr(s.ctx, contractAddr.Bytes()) - Expect(withdrawer.Bytes()).To(Equal(newWithdrawer.Bytes())) + res, err := s.grpcHandler.GetDelegatorWithdrawAddr(sdk.AccAddress(contractAddr.Bytes()).String()) + Expect(err).To(BeNil(), "error while calling GetDelegatorWithdrawAddr: %v", err) + Expect(res.WithdrawAddress).To(Equal(sdk.AccAddress(newWithdrawer.Bytes()).String())) }) }) Context("withdrawDelegatorRewards", func() { - var ( - // defaultWithdrawDelRewardsArgs are the default arguments for the withdraw delegator rewards call - // - // NOTE: this has to be populated in a BeforeEach block because the contractAddr would otherwise be a nil address. - defaultWithdrawDelRewardsArgs contracts.CallArgs - // initialBalance is the initial balance of the delegator - initialBalance sdk.Coin - ) + // initialBalance is the initial balance of the delegator + var initialBalance *sdk.Coin BeforeEach(func() { - // set some rewards for s.address & another address - s.prepareStakingRewards([]stakingRewards{ - {s.address.Bytes(), s.validators[0], rewards}, - {differentAddr.Bytes(), s.validators[0], rewards}, - }...) + // fund the diffAddr + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), differentAddr.Bytes(), math.NewInt(2e18)) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) - initialBalance = s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + // make a delegation + err = s.factory.Delegate(diffKey, s.network.GetValidators()[0].OperatorAddress, sdk.NewCoin(s.bondDenom, math.NewInt(1e18))) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) - // populate default arguments - defaultWithdrawDelRewardsArgs = defaultCallArgs.WithMethodName( - "testWithdrawDelegatorRewards", - ) + // wait to accrue some rewards for s.keyring.GetAddr(0) & another address + _, err = testutils.WaitToAccrueRewards(s.network, s.grpcHandler, sdk.AccAddress(differentAddr.Bytes()).String(), minExpRewardOrCommission) + Expect(err).To(BeNil()) + + // check if s.keyring.GetAddr(0) accrued rewards too + _, err = testutils.WaitToAccrueRewards(s.network, s.grpcHandler, s.keyring.GetAccAddr(0).String(), minExpRewardOrCommission) + Expect(err).To(BeNil()) + + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + initialBalance = balRes.Balance + + callArgs.MethodName = "testWithdrawDelegatorRewards" + + // set gas price to calculate fees paid + txArgs.GasPrice = gasPrice.BigInt() }) It("should not withdraw rewards when sending from a different address", func() { - withdrawDelRewardsArgs := defaultWithdrawDelRewardsArgs.WithArgs( - differentAddr, s.validators[0].OperatorAddress, - ) + balRes, err := s.grpcHandler.GetBalance(differentAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + differentAddrInitialBalance := balRes.Balance + + callArgs.Args = []interface{}{ + differentAddr, s.network.GetValidators()[0].OperatorAddress, + } - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawDelRewardsArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + res, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock: %v", err) // balance should be equal as initial balance or less (because of fees) - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount.Uint64() <= initialBalance.Amount.Uint64()).To(BeTrue()) + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + finalBalance := balRes.Balance + fees := gasPrice.Mul(math.NewInt(res.GasUsed)) + Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Sub(fees))) // differentAddr balance should remain unchanged - differentAddrFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, differentAddr.Bytes(), s.bondDenom) - Expect(differentAddrFinalBalance.Amount).To(Equal(math.ZeroInt())) + balRes, err = s.grpcHandler.GetBalance(differentAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + differentAddrFinalBalance := balRes.Balance + Expect(differentAddrFinalBalance.Amount).To(Equal(differentAddrInitialBalance.Amount)) }) It("should withdraw rewards successfully", func() { - withdrawDelRewardsArgs := defaultWithdrawDelRewardsArgs.WithArgs( - s.address, s.validators[0].OperatorAddress, - ) + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + initBalanceAmt := balRes.Balance.Amount + + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), s.network.GetValidators()[0].OperatorAddress, + } + + rwRes, err := s.grpcHandler.GetDelegationRewards(s.keyring.GetAccAddr(0).String(), s.network.GetValidators()[0].OperatorAddress) + Expect(err).To(BeNil()) + expRewardsAmt := rwRes.Rewards.AmountOf(s.bondDenom).TruncateInt() logCheckArgs := passCheck. WithExpEvents(distribution.EventTypeWithdrawDelegatorRewards) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawDelRewardsArgs, logCheckArgs) + res, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock: %v", err) - // balance should remain unchanged - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount.GT(initialBalance.Amount)).To(BeTrue(), "expected final balance to be greater than initial balance after withdrawing rewards") + // balance should increase + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + + fees := gasPrice.Mul(math.NewInt(res.GasUsed)) + + Expect(balRes.Balance.Amount).To(Equal(initBalanceAmt.Add(expRewardsAmt).Sub(fees)), "expected final balance to be greater than initial balance after withdrawing rewards") }) DescribeTable("should withdraw rewards successfully to the new withdrawer address", func(tc testCase) { - initialBalance := s.app.BankKeeper.GetBalance(s.ctx, tc.withdrawer.Bytes(), s.bondDenom) + balRes, err := s.grpcHandler.GetBalance(tc.withdrawer.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + withdrawerInitialBalance := balRes.Balance + // Set new withdrawer address - err := s.app.DistrKeeper.SetWithdrawAddr(s.ctx, s.address.Bytes(), tc.withdrawer.Bytes()) + err = s.factory.SetWithdrawAddress(s.keyring.GetPrivKey(0), tc.withdrawer.Bytes()) Expect(err).To(BeNil()) + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) - withdrawDelRewardsArgs := defaultWithdrawDelRewardsArgs.WithArgs( - s.address, s.validators[0].OperatorAddress, - ) + // get delegator initial balance + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + delegatorInitialBalance := balRes.Balance + + // get the expected rewards for the delegation + rwRes, err := s.grpcHandler.GetDelegationRewards(s.keyring.GetAccAddr(0).String(), s.network.GetValidators()[0].OperatorAddress) + Expect(err).To(BeNil()) + expRewardsAmt := rwRes.Rewards.AmountOf(s.bondDenom).TruncateInt() + + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), s.network.GetValidators()[0].OperatorAddress, + } logCheckArgs := passCheck. WithExpEvents(distribution.EventTypeWithdrawDelegatorRewards) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawDelRewardsArgs, logCheckArgs) + res, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock: %v", err) - // should increase balance by rewards - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, tc.withdrawer.Bytes(), s.bondDenom) - Expect(finalBalance.Amount.GT(initialBalance.Amount)).To(BeTrue(), "expected final balance to be greater than initial balance after withdrawing rewards") + var rewards []cmn.Coin + err = s.precompile.UnpackIntoInterface(&rewards, distribution.WithdrawDelegatorRewardsMethod, ethRes.Ret) + Expect(err).To(BeNil()) + Expect(len(rewards)).To(Equal(1)) + + Expect(rewards[0].Denom).To(Equal(s.bondDenom)) + Expect(rewards[0].Amount).To(Equal(expRewardsAmt.BigInt())) + + // should increase withdrawer balance by rewards + balRes, err = s.grpcHandler.GetBalance(tc.withdrawer.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + + Expect(balRes.Balance.Amount).To(Equal(withdrawerInitialBalance.Amount.Add(expRewardsAmt)), "expected final balance to be greater than initial balance after withdrawing rewards") + + // check that the delegator final balance is initialBalance - fee + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil(), "error while calling GetBalance") + fees := gasPrice.Mul(math.NewInt(res.GasUsed)) + + expDelgatorFinal := delegatorInitialBalance.Amount.Sub(fees) + Expect(balRes.Balance.Amount).To(Equal(expDelgatorFinal), "expected delegator final balance to be equal to initial balance - fees") }, Entry("withdrawer addr is existing acc", testCase{ withdrawer: &differentAddr, @@ -850,48 +1261,58 @@ var _ = Describe("Calling distribution precompile from another contract", func() // Specific BeforeEach for table-driven tests Context("Table-driven tests for Withdraw Delegator Rewards", func() { - var ( - args contracts.CallArgs - contractInitialBalance = math.NewInt(100) - ) + contractInitialBalance := math.NewInt(100) + BeforeEach(func() { - args = defaultWithdrawDelRewardsArgs. - WithMethodName("testWithdrawDelegatorRewardsWithTransfer"). - WithGasPrice(gasPrice) + callArgs.MethodName = "testWithdrawDelegatorRewardsWithTransfer" // send some funds to the contract - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, contractAddr.Bytes(), contractInitialBalance.Int64()) + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), contractAddr.Bytes(), contractInitialBalance) Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) }) DescribeTable("withdraw delegation rewards with internal transfers to delegator - should withdraw rewards successfully to the withdrawer address", func(tc testCase) { - withdrawerInitialBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) if tc.withdrawer != nil { // Set new withdrawer address - err := s.app.DistrKeeper.SetWithdrawAddr(s.ctx, s.address.Bytes(), tc.withdrawer.Bytes()) + err = s.factory.SetWithdrawAddress(s.keyring.GetPrivKey(0), tc.withdrawer.Bytes()) + Expect(err).To(BeNil()) + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) + balRes, err = s.grpcHandler.GetBalance(tc.withdrawer.Bytes(), s.bondDenom) Expect(err).To(BeNil()) - withdrawerInitialBalance = s.app.BankKeeper.GetBalance(s.ctx, tc.withdrawer.Bytes(), s.bondDenom) } + withdrawerInitialBalance := balRes.Balance - delInitialBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + delInitialBalance := balRes.Balance // get the pending rewards to claim - qr := distrkeeper.Querier{Keeper: s.app.DistrKeeper} - qRes, err := qr.DelegationRewards(s.ctx, &distrtypes.QueryDelegationRewardsRequest{DelegatorAddress: sdk.AccAddress(s.address.Bytes()).String(), ValidatorAddress: s.validators[0].OperatorAddress}) + qRes, err := s.grpcHandler.GetDelegationRewards(s.keyring.GetAccAddr(0).String(), s.network.GetValidators()[0].OperatorAddress) Expect(err).To(BeNil()) expRewards := qRes.Rewards.AmountOf(s.bondDenom).TruncateInt() - withdrawDelRewardsArgs := args.WithArgs( - s.address, s.validators[0].OperatorAddress, tc.before, tc.after, - ) + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), s.network.GetValidators()[0].OperatorAddress, tc.before, tc.after, + } logCheckArgs := passCheck. WithExpEvents(distribution.EventTypeWithdrawDelegatorRewards) - res, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawDelRewardsArgs, logCheckArgs) + res, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock: %v", err) + + fees := gasPrice.MulRaw(res.GasUsed) // check balances contractTransferredAmt := math.ZeroInt() @@ -901,7 +1322,9 @@ var _ = Describe("Calling distribution precompile from another contract", func() } } // contract balance be updated according to the transferred amount - contractFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + contractFinalBalance := balRes.Balance Expect(contractFinalBalance.Amount).To(Equal(contractInitialBalance.Sub(contractTransferredAmt))) expDelFinalBalance := delInitialBalance.Amount.Sub(fees).Add(contractTransferredAmt).Add(expRewards) @@ -909,12 +1332,16 @@ var _ = Describe("Calling distribution precompile from another contract", func() expDelFinalBalance = delInitialBalance.Amount.Sub(fees).Add(contractTransferredAmt) expWithdrawerFinalBalance := withdrawerInitialBalance.Amount.Add(expRewards) // withdrawer balance should have the rewards - withdrawerFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, tc.withdrawer.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(tc.withdrawer.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + withdrawerFinalBalance := balRes.Balance Expect(withdrawerFinalBalance.Amount).To(Equal(expWithdrawerFinalBalance), "expected final balance to be greater than initial balance after withdrawing rewards") } // delegator balance should have the transferred amt - fees + rewards (when is the withdrawer) - delFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + delFinalBalance := balRes.Balance Expect(delFinalBalance.Amount).To(Equal(expDelFinalBalance), "expected final balance to be greater than initial balance after withdrawing rewards") }, @@ -952,49 +1379,66 @@ var _ = Describe("Calling distribution precompile from another contract", func() ) DescribeTable("should revert withdraw rewards successfully and update correspondingly the withdrawer and contract's balances", func(tc testCase) { + // Set new withdrawer address + err = s.factory.SetWithdrawAddress(s.keyring.GetPrivKey(0), tc.withdrawer.Bytes()) + Expect(err).To(BeNil()) + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) + // get the pending rewards to claim - qr := distrkeeper.Querier{Keeper: s.app.DistrKeeper} - qRes, err := qr.DelegationRewards(s.ctx, &distrtypes.QueryDelegationRewardsRequest{DelegatorAddress: sdk.AccAddress(s.address.Bytes()).String(), ValidatorAddress: s.validators[0].OperatorAddress}) + qRes, err := s.grpcHandler.GetDelegationRewards(s.keyring.GetAccAddr(0).String(), s.network.GetValidators()[0].OperatorAddress) Expect(err).To(BeNil()) initRewards := qRes.Rewards.AmountOf(s.bondDenom).TruncateInt() - delInitBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - withdrawerInitBalance := s.app.BankKeeper.GetBalance(s.ctx, tc.withdrawer.Bytes(), s.bondDenom) - // Set new withdrawer address - err = s.app.DistrKeeper.SetWithdrawAddr(s.ctx, s.address.Bytes(), tc.withdrawer.Bytes()) + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + delInitBalance := balRes.Balance + balRes, err = s.grpcHandler.GetBalance(tc.withdrawer.Bytes(), s.bondDenom) Expect(err).To(BeNil()) + withdrawerInitBalance := balRes.Balance // update args to call the corresponding contract method - callArgs := args. - WithMethodName("revertWithdrawRewardsAndTransfer"). - WithArgs( - s.address, *tc.withdrawer, s.validators[0].OperatorAddress, true, - ) + callArgs.MethodName = "revertWithdrawRewardsAndTransfer" + callArgs.Args = []interface{}{ + s.keyring.GetAddr(0), *tc.withdrawer, s.network.GetValidators()[0].OperatorAddress, true, + } - res, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, callArgs, passCheck) + res, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock: %v", err) + fees := gasPrice.MulRaw(res.GasUsed) // check balances contractTransferredAmt := math.NewInt(15) // contract balance be updated according to the transferred amount - contractFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + contractFinalBalance := balRes.Balance Expect(contractFinalBalance.Amount).To(Equal(contractInitialBalance.Sub(contractTransferredAmt))) // delegator balance should be initial_balance - fees - delFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + delFinalBalance := balRes.Balance Expect(delFinalBalance.Amount).To(Equal(delInitBalance.Amount.Sub(fees))) // withdrawer balance should increase by the transferred amount only // the rewards withdrawal should revert - withdrawerFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, tc.withdrawer.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(tc.withdrawer.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + withdrawerFinalBalance := balRes.Balance Expect(withdrawerFinalBalance.Amount).To(Equal(withdrawerInitBalance.Amount.Add(contractTransferredAmt)), "expected final balance to be greater than initial balance after withdrawing rewards") - // rewards to claim should remain unchanged - qRes, err = qr.DelegationRewards(s.ctx, &distrtypes.QueryDelegationRewardsRequest{DelegatorAddress: sdk.AccAddress(s.address.Bytes()).String(), ValidatorAddress: s.validators[0].OperatorAddress}) + // rewards to claim should be the same or more than before + qRes, err = s.grpcHandler.GetDelegationRewards(s.keyring.GetAccAddr(0).String(), s.network.GetValidators()[0].OperatorAddress) Expect(err).To(BeNil()) finalRewards := qRes.Rewards.AmountOf(s.bondDenom).TruncateInt() - Expect(finalRewards).To(Equal(initRewards)) + Expect(finalRewards.GTE(initRewards)).To(BeTrue()) }, Entry("withdrawer addr is existing acc", testCase{ withdrawer: &differentAddr, @@ -1011,294 +1455,503 @@ var _ = Describe("Calling distribution precompile from another contract", func() Context("withdrawDelegatorRewards with contract as delegator", func() { var ( - // defaultWithdrawDelRewardsArgs are the default arguments for the withdraw delegator rewards call - // - // NOTE: this has to be populated in a BeforeEach block because the contractAddr would otherwise be a nil address. - defaultWithdrawDelRewardsArgs contracts.CallArgs // initialBalance is the initial balance of the delegator - initialBalance sdk.Coin + initialBalance *sdk.Coin + accruedRewardsAmt math.Int ) - BeforeEach(func() { - // set some rewards for s.address & another address - s.prepareStakingRewards([]stakingRewards{ - { - Delegator: contractAddr.Bytes(), - Validator: s.validators[0], - RewardAmt: rewards, + BeforeEach(func() { //nolint:dupl + // send funds to the contract + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), contractAddr.Bytes(), math.NewInt(2e18)) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) + + stkPrecompile, err := s.getStakingPrecompile() + Expect(err).To(BeNil()) + // make a delegation with contract as delegator + logCheck := testutil.LogCheckArgs{ + ExpPass: true, + ABIEvents: stkPrecompile.ABI.Events, + ExpEvents: []string{authorization.EventTypeApproval, staking.EventTypeDelegate}, + } + _, _, err = s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + factory.CallArgs{ + ContractABI: distrCallerContract.ABI, + MethodName: "testDelegateFromContract", + Args: []interface{}{ + s.network.GetValidators()[0].OperatorAddress, + big.NewInt(1e18), + }, }, - }...) + logCheck, + ) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) - initialBalance = s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) + // wait to accrue some rewards for contract address + rwRes, err := testutils.WaitToAccrueRewards(s.network, s.grpcHandler, sdk.AccAddress(contractAddr.Bytes()).String(), minExpRewardOrCommission) + Expect(err).To(BeNil()) + + // contract's accrued rewards amt + accruedRewardsAmt = rwRes.AmountOf(s.bondDenom).TruncateInt() + + balRes, err := s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + initialBalance = balRes.Balance // populate default arguments - defaultWithdrawDelRewardsArgs = defaultCallArgs.WithMethodName( - "testWithdrawDelegatorRewardsFromContract", - ) + callArgs.MethodName = "testWithdrawDelegatorRewardsFromContract" }) It("should withdraw rewards successfully without origin check", func() { - withdrawDelRewardsArgs := defaultWithdrawDelRewardsArgs.WithArgs(s.validators[0].OperatorAddress) + callArgs.Args = []interface{}{s.network.GetValidators()[0].OperatorAddress} logCheckArgs := passCheck.WithExpEvents(distribution.EventTypeWithdrawDelegatorRewards) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawDelRewardsArgs, logCheckArgs) + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock: %v", err) // balance should increase - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) - Expect(finalBalance.Amount.GT(initialBalance.Amount)).To(BeTrue(), "expected final balance to be greater than initial balance after withdrawing rewards") + balRes, err := s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + finalBalance := balRes.Balance + Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Add(accruedRewardsAmt)), "expected final balance to be greater than initial balance after withdrawing rewards") }) It("should withdraw rewards successfully without origin check to a withdrawer address", func() { withdrawerAddr, _ := testutiltx.NewAccAddressAndKey() - initialWithdrawerBalance := s.app.BankKeeper.GetBalance(s.ctx, withdrawerAddr.Bytes(), s.bondDenom) - Expect(initialWithdrawerBalance.Amount).To(Equal(sdk.ZeroInt())) - - err := s.app.DistrKeeper.SetWithdrawAddr(s.ctx, contractAddr.Bytes(), withdrawerAddr.Bytes()) + balRes, err := s.grpcHandler.GetBalance(withdrawerAddr.Bytes(), s.bondDenom) Expect(err).To(BeNil()) + initialWithdrawerBalance := balRes.Balance + Expect(initialWithdrawerBalance.Amount).To(Equal(math.ZeroInt())) - withdrawDelRewardsArgs := defaultWithdrawDelRewardsArgs.WithArgs(s.validators[0].OperatorAddress) + // call the smart contract to update the withdrawer + // Set new withdrawer address for the contract + setWithdrawCheck := passCheck.WithExpEvents(distribution.EventTypeSetWithdrawAddress) + res1, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + factory.CallArgs{ + ContractABI: distrCallerContract.ABI, + MethodName: "testSetWithdrawAddressFromContract", + Args: []interface{}{withdrawerAddr.String()}, + }, + setWithdrawCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(res1.IsOK()).To(BeTrue(), "error while calling the smart contract") + Expect(s.network.NextBlock()).To(BeNil()) + // get accrued rewards prev to tx + rwRes, err := s.grpcHandler.GetDelegationRewards(sdk.AccAddress(contractAddr.Bytes()).String(), s.network.GetValidators()[0].OperatorAddress) + Expect(err).To(BeNil()) + accruedRewardsAmt = rwRes.Rewards.AmountOf(s.bondDenom).TruncateInt() + + callArgs.Args = []interface{}{s.network.GetValidators()[0].OperatorAddress} logCheckArgs := passCheck.WithExpEvents(distribution.EventTypeWithdrawDelegatorRewards) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawDelRewardsArgs, logCheckArgs) + txArgs.GasLimit = 300_000 + _, _, err = s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock: %v", err) // withdrawer balance should increase with the rewards amt - finalWithdrawerBalance := s.app.BankKeeper.GetBalance(s.ctx, withdrawerAddr.Bytes(), s.bondDenom) - Expect(finalWithdrawerBalance.Amount.Equal(rewards)).To(BeTrue(), "expected final balance to be greater than initial balance after withdrawing rewards") + balRes, err = s.grpcHandler.GetBalance(withdrawerAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + finalWithdrawerBalance := balRes.Balance + Expect(finalWithdrawerBalance.Amount).To(Equal(accruedRewardsAmt), "expected final balance to be greater than initial balance after withdrawing rewards") // delegator balance (contract) should remain unchanged - finalDelegatorBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + finalDelegatorBalance := balRes.Balance Expect(finalDelegatorBalance.Amount.Equal(initialBalance.Amount)).To(BeTrue(), "expected delegator final balance remain unchanged after withdrawing rewards to withdrawer") }) Context("Withdraw Delegator Rewards with another smart contract (different than the contract calling the precompile) as delegator", func() { var ( delContractAddr common.Address - args contracts.CallArgs contractInitialBalance = math.NewInt(100) ) BeforeEach(func() { - args = defaultWithdrawDelRewardsArgs. - WithMethodName("testWithdrawDelegatorRewardsWithTransfer"). - WithGasPrice(gasPrice) + callArgs.MethodName = "testWithdrawDelegatorRewardsWithTransfer" + + // deploy another delegator contract + delContractAddr, err = s.factory.DeployContract( + s.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values + factory.ContractDeploymentData{ + Contract: distrCallerContract, + }, + ) + Expect(err).To(BeNil(), "error while deploying the smart contract: %v", err) + // NextBlock the smart contract + Expect(s.network.NextBlock()).To(BeNil(), "error calling NextBlock: %v", err) - // deploy a contract to use as delegator contract - delegatorContract, err := contracts.LoadInterchainSenderContract() + // send funds to the contract + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), delContractAddr.Bytes(), math.NewInt(2e18)) Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) - delContractAddr, err = s.DeployContract(delegatorContract) - Expect(err).To(BeNil(), "error while deploying the smart contract: %v", err) + stkPrecompile, err := s.getStakingPrecompile() + Expect(err).To(BeNil()) + // make a delegation with contract as delegator + logCheck := testutil.LogCheckArgs{ + ExpPass: true, + ABIEvents: stkPrecompile.ABI.Events, + ExpEvents: []string{authorization.EventTypeApproval, staking.EventTypeDelegate}, + } + _, _, err = s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{ + To: &delContractAddr, + }, + factory.CallArgs{ + ContractABI: distrCallerContract.ABI, + MethodName: "testDelegateFromContract", + Args: []interface{}{ + s.network.GetValidators()[0].OperatorAddress, + big.NewInt(1e18), + }, + }, + logCheck, + ) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) - // send some funds to the contract - err = chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, contractAddr.Bytes(), contractInitialBalance.Int64()) + // wait to accrue some rewards for contract address + rwRes, err := testutils.WaitToAccrueRewards(s.network, s.grpcHandler, sdk.AccAddress(delContractAddr.Bytes()).String(), minExpRewardOrCommission) Expect(err).To(BeNil()) - // set some rewards for the delegator contract - s.prepareStakingRewards([]stakingRewards{ - { - Delegator: delContractAddr.Bytes(), - Validator: s.validators[0], - RewardAmt: rewards, - }, - }...) + // contract's accrued rewards amt + accruedRewardsAmt = rwRes.AmountOf(s.bondDenom).TruncateInt() + + balRes, err := s.grpcHandler.GetBalance(delContractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + initialBalance = balRes.Balance + + // send some funds to the contract + err = testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), contractAddr.Bytes(), contractInitialBalance) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) }) It("should NOT allow to withdraw rewards", func() { - txSenderInitialBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - delInitialBalance := s.app.BankKeeper.GetBalance(s.ctx, delContractAddr.Bytes(), s.bondDenom) + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + txSenderInitialBalance := balRes.Balance + balRes, err = s.grpcHandler.GetBalance(delContractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + delInitialBalance := balRes.Balance + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + callerContractInitialBal := balRes.Balance // get the pending rewards to claim - qr := distrkeeper.Querier{Keeper: s.app.DistrKeeper} - qRes, err := qr.DelegationRewards(s.ctx, &distrtypes.QueryDelegationRewardsRequest{DelegatorAddress: sdk.AccAddress(delContractAddr.Bytes()).String(), ValidatorAddress: s.validators[0].OperatorAddress}) + rwRes, err := s.grpcHandler.GetDelegationRewards(sdk.AccAddress(delContractAddr.Bytes()).String(), s.network.GetValidators()[0].OperatorAddress) Expect(err).To(BeNil()) - expRewards := qRes.Rewards.AmountOf(s.bondDenom).TruncateInt() - - withdrawDelRewardsArgs := args.WithArgs( - delContractAddr, s.validators[0].OperatorAddress, true, true, - ) + expRewards := rwRes.Rewards.AmountOf(s.bondDenom).TruncateInt() - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawDelRewardsArgs, execRevertedCheck) - Expect(err).NotTo(BeNil(), "error while calling the smart contract: %v", err) + callArgs.Args = []interface{}{delContractAddr, s.network.GetValidators()[0].OperatorAddress, true, true} + res, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock: %v", err) + fees := gasPrice.MulRaw(res.GasUsed) // check balances // tx signer final balance should be the initial balance - fees - txSignerFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - Expect(txSignerFinalBalance.Amount.LT(txSenderInitialBalance.Amount)).To(BeTrue()) + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + txSignerFinalBalance := balRes.Balance + Expect(txSignerFinalBalance.Amount).To(Equal(txSenderInitialBalance.Amount.Sub(fees))) - // contract balance be updated according to the transferred amount - contractFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) - Expect(contractFinalBalance.Amount).To(Equal(contractInitialBalance)) + // caller contract balance should remain unchanged + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + contractFinalBalance := balRes.Balance + Expect(contractFinalBalance).To(Equal(callerContractInitialBal)) - // delegator balance should have the transferred amt + rewards (when is the withdrawer) - delFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, delContractAddr.Bytes(), s.bondDenom) - Expect(delFinalBalance.Amount).To(Equal(delInitialBalance.Amount)) + // delegator balance should remain unchanged + balRes, err = s.grpcHandler.GetBalance(delContractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + delFinalBalance := balRes.Balance + Expect(delFinalBalance).To(Equal(delInitialBalance)) - // delegation rewards should remain unchanged - qRes, err = qr.DelegationRewards(s.ctx, &distrtypes.QueryDelegationRewardsRequest{DelegatorAddress: sdk.AccAddress(delContractAddr.Bytes()).String(), ValidatorAddress: s.validators[0].OperatorAddress}) + // delegation rewards should remain be the same or higher + rwRes, err = s.grpcHandler.GetDelegationRewards(sdk.AccAddress(delContractAddr.Bytes()).String(), s.network.GetValidators()[0].OperatorAddress) Expect(err).To(BeNil()) - Expect(qRes.Rewards.AmountOf(s.bondDenom).TruncateInt()).To(Equal(expRewards)) + finalRewards := rwRes.Rewards.AmountOf(s.bondDenom).TruncateInt() + Expect(finalRewards.GTE(expRewards)).To(BeTrue()) }) }) + + It("should withdraw rewards successfully without origin check to a withdrawer address", func() { + withdrawerAddr, _ := testutiltx.NewAccAddressAndKey() + + balRes, err := s.grpcHandler.GetBalance(withdrawerAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + initialWithdrawerBalance := balRes.Balance + Expect(initialWithdrawerBalance.Amount).To(Equal(math.ZeroInt())) + + // Set new withdrawer address for the contract + setWithdrawCheck := passCheck.WithExpEvents(distribution.EventTypeSetWithdrawAddress) + res1, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + factory.CallArgs{ + ContractABI: distrCallerContract.ABI, + MethodName: "testSetWithdrawAddressFromContract", + Args: []interface{}{withdrawerAddr.String()}, + }, + setWithdrawCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(res1.IsOK()).To(BeTrue(), "error while calling the smart contract") + Expect(s.network.NextBlock()).To(BeNil()) + + // get the pending rewards to claim + rwRes, err := s.grpcHandler.GetDelegationRewards(sdk.AccAddress(contractAddr.Bytes()).String(), s.network.GetValidators()[0].OperatorAddress) + Expect(err).To(BeNil()) + expRewards := rwRes.Rewards.AmountOf(s.bondDenom).TruncateInt() + + logCheckArgs := passCheck.WithExpEvents(distribution.EventTypeWithdrawDelegatorRewards) + + callArgs.Args = []interface{}{s.network.GetValidators()[0].OperatorAddress} + + txArgs.GasLimit = 500_000 + _, _, err = s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil(), "error on NextBlock: %v", err) + + // withdrawer balance should increase with the rewards amt + balRes, err = s.grpcHandler.GetBalance(withdrawerAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + finalWithdrawerBalance := balRes.Balance + Expect(finalWithdrawerBalance.Amount.Equal(expRewards)).To(BeTrue(), "expected final balance to be greater than initial balance after withdrawing rewards") + + // delegator balance (contract) should remain unchanged + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + finalDelegatorBalance := balRes.Balance + Expect(finalDelegatorBalance.Amount.Equal(initialBalance.Amount)).To(BeTrue(), "expected delegator final balance remain unchanged after withdrawing rewards to withdrawer") + }) }) Context("withdrawValidatorCommission", func() { var ( - // defaultWithdrawValCommArgs are the default arguments for the withdraw validator commission call - // - // NOTE: this has to be populated in a BeforeEach block because the contractAddr would otherwise be a nil address. - defaultWithdrawValCommArgs contracts.CallArgs - // commDec is the commission rate of the validator - commDec = math.LegacyNewDec(1) - // valAddr is the address of the validator - valAddr sdk.ValAddress // initialBalance is the initial balance of the delegator - initialBalance sdk.Coin + initialBalance *sdk.Coin + // valInitialBalance is the initial balance of the validator + valInitialBalance *sdk.Coin + accruedCommissionAmt math.Int ) BeforeEach(func() { - // create a validator with s.address because is the address - // used for signing txs - valAddr = s.address.Bytes() - stakeAmt := math.NewInt(100) - testutil.CreateValidator(s.ctx, s.T(), s.privKey.PubKey(), *s.app.StakingKeeper, stakeAmt) - - // set some commissions to validators - var valAddresses []sdk.ValAddress - valAddresses = append( - valAddresses, - valAddr, - s.validators[0].GetOperator(), - s.validators[1].GetOperator(), - ) + // fund validator's account to pay for fees + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), s.validatorsKeys[0].AccAddr, math.NewInt(1e18)) + Expect(err).To(BeNil()) - for _, addr := range valAddresses { - val := s.app.StakingKeeper.Validator(s.ctx, addr) - valCommission := sdk.DecCoins{sdk.NewDecCoinFromDec(s.bondDenom, commDec)} + res, err := testutils.WaitToAccrueCommission(s.network, s.grpcHandler, s.network.GetValidators()[0].OperatorAddress, minExpRewardOrCommission) + Expect(err).To(BeNil()) + accruedCommissionAmt = res.AmountOf(s.bondDenom).TruncateInt() - s.app.DistrKeeper.SetValidatorAccumulatedCommission( - s.ctx, addr, - distrtypes.ValidatorAccumulatedCommission{Commission: valCommission}, - ) - s.app.DistrKeeper.AllocateTokensToValidator(s.ctx, val, sdk.DecCoins{sdk.NewDecCoin(s.bondDenom, stakeAmt)}) - } + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + initialBalance = balRes.Balance - initialBalance = s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + // get validators initial balance + balRes, err = s.grpcHandler.GetBalance(s.validatorsKeys[0].AccAddr, s.bondDenom) + Expect(err).To(BeNil()) + valInitialBalance = balRes.Balance // populate default arguments - defaultWithdrawValCommArgs = defaultCallArgs.WithMethodName( - "testWithdrawValidatorCommission", - ) + callArgs.MethodName = "testWithdrawValidatorCommission" }) It("should not withdraw commission from validator when sending from a different address", func() { - withdrawValCommArgs := defaultWithdrawValCommArgs.WithArgs( - s.validators[0].OperatorAddress, - ) + callArgs.Args = []interface{}{ + s.network.GetValidators()[0].OperatorAddress, + } - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawValCommArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + res, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // balance should be equal as initial balance or less (because of fees) - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount.Uint64() <= initialBalance.Amount.Uint64()).To(BeTrue()) + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + finalBalance := balRes.Balance + + fees := gasPrice.Mul(math.NewInt(res.GasUsed)) + Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Sub(fees))) // validator's balance should remain unchanged - valFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, sdk.AccAddress(s.validators[0].GetOperator()), s.bondDenom) - Expect(valFinalBalance.Amount).To(Equal(math.ZeroInt())) + balRes, err = s.grpcHandler.GetBalance(s.validatorsKeys[0].AccAddr, s.bondDenom) + Expect(err).To(BeNil()) + valFinalBalance := balRes.Balance + Expect(valFinalBalance.Amount).To(Equal(valInitialBalance.Amount)) }) It("should withdraw commission successfully", func() { - withdrawValCommArgs := defaultWithdrawValCommArgs. - WithArgs(valAddr.String()). - WithGasPrice(gasPrice) + callArgs.Args = []interface{}{s.network.GetValidators()[0].OperatorAddress} + logCheckArgs := passCheck. WithExpEvents(distribution.EventTypeWithdrawValidatorCommission) - res, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawValCommArgs, logCheckArgs) + txArgs.GasPrice = gasPrice.BigInt() + res, _, err := s.factory.CallContractAndCheckLogs( + s.validatorsKeys[0].Priv, + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - fees := gasPrice.Int64() * res.GasUsed - expFinal := initialBalance.Amount.Int64() + expValAmount - fees - Expect(finalBalance.Amount).To(Equal(math.NewInt(expFinal)), "expected final balance to be equal to initial balance + validator commission - fees") + balRes, err := s.grpcHandler.GetBalance(s.validatorsKeys[0].AccAddr, s.bondDenom) + Expect(err).To(BeNil()) + valFinalBalance := balRes.Balance + fees := gasPrice.Mul(math.NewInt(res.GasUsed)) + expFinal := valInitialBalance.Amount.Add(accruedCommissionAmt).Sub(fees) + Expect(valFinalBalance.Amount).To(Equal(expFinal), "expected final balance to be equal to initial balance + validator commission - fees") }) It("should withdraw commission successfully to withdrawer address (contract)", func() { - initialWithdrawerBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) - Expect(initialWithdrawerBalance.Amount).To(Equal(sdk.ZeroInt())) + balRes, err := s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + initialWithdrawerBalance := balRes.Balance + Expect(initialWithdrawerBalance.Amount).To(Equal(math.ZeroInt())) + + // Set new withdrawer address + err = s.factory.SetWithdrawAddress(s.validatorsKeys[0].Priv, contractAddr.Bytes()) + Expect(err).To(BeNil()) + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) + + qRes, err := s.grpcHandler.GetValidatorCommission(s.network.GetValidators()[0].OperatorAddress) + Expect(err).To(BeNil()) + accruedCommissionAmt = qRes.Commission.Commission.AmountOf(s.bondDenom).TruncateInt() - err := s.app.DistrKeeper.SetWithdrawAddr(s.ctx, s.address.Bytes(), contractAddr.Bytes()) + // validator acc balance before the tx + balRes, err = s.grpcHandler.GetBalance(s.validatorsKeys[0].AccAddr, s.bondDenom) Expect(err).To(BeNil()) + initialBalance := balRes.Balance + + callArgs.Args = []interface{}{s.network.GetValidators()[0].OperatorAddress} - withdrawValCommArgs := defaultWithdrawValCommArgs. - WithArgs(valAddr.String()). - WithGasPrice(gasPrice) logCheckArgs := passCheck. WithExpEvents(distribution.EventTypeWithdrawValidatorCommission) - res, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawValCommArgs, logCheckArgs) + txArgs.GasLimit = 500_000 + txArgs.GasPrice = gasPrice.BigInt() + res, _, err := s.factory.CallContractAndCheckLogs( + s.validatorsKeys[0].Priv, + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - finalWithdrawerBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) - Expect(finalWithdrawerBalance.Amount).To(Equal(math.NewInt(expValAmount)), "expected final balance to be equal to initial balance + validator commission") + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + finalWithdrawerBalance := balRes.Balance + Expect(finalWithdrawerBalance.Amount).To(Equal(initialWithdrawerBalance.Amount.Add(accruedCommissionAmt)), "expected final balance to be equal to initial balance + validator commission") - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - fees := gasPrice.Int64() * res.GasUsed - expFinal := initialBalance.Amount.Int64() - fees - Expect(finalBalance.Amount).To(Equal(math.NewInt(expFinal)), "expected final balance to be equal to initial balance - fees") + balRes, err = s.grpcHandler.GetBalance(s.validatorsKeys[0].AccAddr, s.bondDenom) + Expect(err).To(BeNil()) + finalBalance := balRes.Balance + fees := gasPrice.MulRaw(res.GasUsed) + expFinal := initialBalance.Amount.Sub(fees) + Expect(finalBalance.Amount).To(Equal(expFinal), "expected final balance to be equal to initial balance - fees") }) // Specific BeforeEach for table-driven tests Context("Table-driven tests for Withdraw Validator Commission", func() { - var ( - args contracts.CallArgs - contractInitialBalance = math.NewInt(100) - ) + contractInitialBalance := math.NewInt(100) BeforeEach(func() { - args = defaultWithdrawValCommArgs. - WithMethodName("testWithdrawValidatorCommissionWithTransfer"). - WithGasPrice(gasPrice) + callArgs.MethodName = "testWithdrawValidatorCommissionWithTransfer" // send some funds to the contract - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, contractAddr.Bytes(), contractInitialBalance.Int64()) + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), contractAddr.Bytes(), contractInitialBalance) Expect(err).To(BeNil()) + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) }) DescribeTable("withdraw validator commission with state changes in withdrawer - should withdraw commission successfully to the withdrawer address", func(tc testCase) { - withdrawerAddr := s.address - withdrawerInitialBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + withdrawerAddr := s.validatorsKeys[0].Addr + balRes, err := s.grpcHandler.GetBalance(s.validatorsKeys[0].AccAddr, s.bondDenom) + Expect(err).To(BeNil()) if tc.withdrawer != nil { withdrawerAddr = *tc.withdrawer // Set new withdrawer address - err := s.app.DistrKeeper.SetWithdrawAddr(s.ctx, s.address.Bytes(), tc.withdrawer.Bytes()) + err = s.factory.SetWithdrawAddress(s.validatorsKeys[0].Priv, tc.withdrawer.Bytes()) + Expect(err).To(BeNil()) + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) + balRes, err = s.grpcHandler.GetBalance(tc.withdrawer.Bytes(), s.bondDenom) Expect(err).To(BeNil()) - withdrawerInitialBalance = s.app.BankKeeper.GetBalance(s.ctx, tc.withdrawer.Bytes(), s.bondDenom) } + withdrawerInitialBalance := balRes.Balance - valInitialBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + // validator acc balance before the tx + balRes, err = s.grpcHandler.GetBalance(s.validatorsKeys[0].AccAddr, s.bondDenom) + Expect(err).To(BeNil()) + valInitialBalance := balRes.Balance // get the pending commission to claim - valAccAddr := sdk.ValAddress(s.address.Bytes()) - qr := distrkeeper.Querier{Keeper: s.app.DistrKeeper} - qRes, err := qr.ValidatorCommission(s.ctx, &distrtypes.QueryValidatorCommissionRequest{ValidatorAddress: valAccAddr.String()}) + qRes, err := s.grpcHandler.GetValidatorCommission(s.network.GetValidators()[0].OperatorAddress) Expect(err).To(BeNil()) expCommission := qRes.Commission.Commission.AmountOf(s.bondDenom).TruncateInt() - withdrawValCommissionArgs := args.WithArgs( - valAccAddr.String(), withdrawerAddr, tc.before, tc.after, - ) + callArgs.Args = []interface{}{s.network.GetValidators()[0].OperatorAddress, withdrawerAddr, tc.before, tc.after} logCheckArgs := passCheck. WithExpEvents(distribution.EventTypeWithdrawValidatorCommission) - res, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, withdrawValCommissionArgs, logCheckArgs) + txArgs.GasPrice = gasPrice.BigInt() + txArgs.GasLimit = 600_000 + res, _, err := s.factory.CallContractAndCheckLogs( + s.validatorsKeys[0].Priv, + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) + Expect(s.network.NextBlock()).To(BeNil()) + + fees := gasPrice.MulRaw(res.GasUsed) // calculate the transferred amt during the call contractTransferredAmt := math.ZeroInt() @@ -1319,17 +1972,23 @@ var _ = Describe("Calling distribution precompile from another contract", func() } else { expWithdrawerFinalBalance := withdrawerInitialBalance.Amount.Add(expCommission).Add(contractTransferredAmt) // withdrawer balance should have the rewards - withdrawerFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, tc.withdrawer.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(tc.withdrawer.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + withdrawerFinalBalance := balRes.Balance Expect(withdrawerFinalBalance.Amount).To(Equal(expWithdrawerFinalBalance), "expected final balance to be greater than initial balance after withdrawing rewards") } } // contract balance be updated according to the transferred amount - contractFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + contractFinalBalance := balRes.Balance Expect(contractFinalBalance.Amount).To(Equal(expContractFinalBalance)) // validator balance should have the transferred amt - fees + rewards (when is the withdrawer) - valFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(s.validatorsKeys[0].AccAddr, s.bondDenom) + Expect(err).To(BeNil()) + valFinalBalance := balRes.Balance Expect(valFinalBalance.Amount).To(Equal(expValFinalBalance), "expected final balance to be greater than initial balance after withdrawing rewards") }, @@ -1387,94 +2046,140 @@ var _ = Describe("Calling distribution precompile from another contract", func() Context("claimRewards", func() { var ( - // defaultClaimRewardsArgs are the default arguments for the claim rewards call - // - // NOTE: this has to be populated in a BeforeEach block because the contractAddr would otherwise be a nil address. - defaultClaimRewardsArgs contracts.CallArgs // initialBalance is the initial balance of the delegator - initialBalance sdk.Coin + initialBalance *sdk.Coin + // diffAddrInitialBalance is the initial balance of the different address + diffAddrInitialBalance *sdk.Coin + accruedRewardsAmt math.Int ) BeforeEach(func() { - // set some rewards for s.address & another address - s.prepareStakingRewards([]stakingRewards{ - {s.address.Bytes(), s.validators[0], rewards}, - {differentAddr.Bytes(), s.validators[0], rewards}, - }...) + // fund the diffAddr + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), differentAddr.Bytes(), math.NewInt(2e18)) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) + + // make a delegation + err = s.factory.Delegate(diffKey, s.network.GetValidators()[0].OperatorAddress, sdk.NewCoin(s.bondDenom, math.NewInt(1e18))) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) + + // wait to accrue some rewards for s.keyring.GetAddr(0) & another address + _, err = testutils.WaitToAccrueRewards(s.network, s.grpcHandler, sdk.AccAddress(differentAddr.Bytes()).String(), minExpRewardOrCommission) + Expect(err).To(BeNil()) + + // check if s.keyring.GetAddr(0) accrued rewards too + res, err := s.grpcHandler.GetDelegationTotalRewards(s.keyring.GetAccAddr(0).String()) + Expect(err).To(BeNil()) - initialBalance = s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + accruedRewardsAmt = res.Total.AmountOf(s.bondDenom).TruncateInt() + Expect(accruedRewardsAmt.IsPositive()).To(BeTrue()) + + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + initialBalance = balRes.Balance + + balRes, err = s.grpcHandler.GetBalance(differentAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + diffAddrInitialBalance = balRes.Balance // populate default arguments - defaultClaimRewardsArgs = defaultCallArgs.WithMethodName( - "testClaimRewards", - ) + callArgs.MethodName = "testClaimRewards" + txArgs.GasPrice = gasPrice.BigInt() }) It("should not claim rewards when sending from a different address", func() { - claimRewardsArgs := defaultClaimRewardsArgs.WithArgs( - differentAddr, uint32(1), - ) + callArgs.Args = []interface{}{differentAddr, uint32(1)} - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, claimRewardsArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + res, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // balance should be equal as initial balance or less (because of fees) - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount.Uint64() <= initialBalance.Amount.Uint64()).To(BeTrue()) + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + finalBalance := balRes.Balance + fees := gasPrice.Mul(math.NewInt(res.GasUsed)) + Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Sub(fees))) // differentAddr balance should remain unchanged - differentAddrFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, differentAddr.Bytes(), s.bondDenom) - Expect(differentAddrFinalBalance.Amount).To(Equal(math.ZeroInt())) + balRes, err = s.grpcHandler.GetBalance(differentAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + differentAddrFinalBalance := balRes.Balance + Expect(differentAddrFinalBalance.Amount).To(Equal(diffAddrInitialBalance.Amount)) }) It("should claim rewards successfully", func() { - claimRewardsArgs := defaultClaimRewardsArgs.WithArgs( - s.address, uint32(2), - ) + callArgs.Args = []interface{}{s.keyring.GetAddr(0), uint32(2)} logCheckArgs := passCheck. WithExpEvents(distribution.EventTypeClaimRewards) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, claimRewardsArgs, logCheckArgs) + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // balance should remain unchanged - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + finalBalance := balRes.Balance Expect(finalBalance.Amount.GT(initialBalance.Amount)).To(BeTrue(), "expected final balance to be greater than initial balance after claiming rewards") }) Context("Table driven tests", func() { - var ( - args contracts.CallArgs - contractInitialBalance = math.NewInt(100) - ) + contractInitialBalance := math.NewInt(100) BeforeEach(func() { - args = defaultClaimRewardsArgs. - WithMethodName("testClaimRewardsWithTransfer"). - WithGasPrice(gasPrice) + callArgs.MethodName = "testClaimRewardsWithTransfer" // send some funds to the contract - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, contractAddr.Bytes(), contractInitialBalance.Int64()) + err = testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), contractAddr.Bytes(), contractInitialBalance) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) + + // make a delegation with key 1 + err = s.factory.Delegate(s.keyring.GetKey(1).Priv, s.network.GetValidators()[0].OperatorAddress, sdk.NewCoin(s.bondDenom, math.NewInt(1e18))) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) + + // wait to accrue some rewards for key 1 + _, err := testutils.WaitToAccrueRewards(s.network, s.grpcHandler, s.keyring.GetAccAddr(1).String(), minExpRewardOrCommission) Expect(err).To(BeNil()) }) DescribeTable("claimRewards with transfer to withdrawer", func(tc testCase) { + initialBalance := s.network.App.BankKeeper.GetBalance(s.network.GetContext(), s.keyring.GetAccAddr(1), s.bondDenom) + // get the pending rewards to claim - qr := distrkeeper.Querier{Keeper: s.app.DistrKeeper} - qRes, err := qr.DelegationTotalRewards(s.ctx, &distrtypes.QueryDelegationTotalRewardsRequest{DelegatorAddress: sdk.AccAddress(s.address.Bytes()).String()}) + res, err := s.grpcHandler.GetDelegationTotalRewards(s.keyring.GetAccAddr(1).String()) Expect(err).To(BeNil()) - expRewards := qRes.Total.AmountOf(s.bondDenom).TruncateInt() + expRewards := res.Total.AmountOf(s.bondDenom).TruncateInt() - claimRewardsArgs := args.WithArgs( - s.address, uint32(2), tc.before, tc.after, - ) + callArgs.Args = []interface{}{s.keyring.GetAddr(1), uint32(2), tc.before, tc.after} logCheckArgs := passCheck. WithExpEvents(distribution.EventTypeClaimRewards) - - res, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, claimRewardsArgs, logCheckArgs) + txArgs.GasLimit = 400_000 // set gas limit to avoid out of gas error + _, ethres, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(1), + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) + err = s.network.NextBlock() + Expect(err).To(BeNil()) + + fees := math.NewIntFromBigInt(txArgs.GasPrice).MulRaw(int64(ethres.GasUsed)) // calculate the transferred amt during the call contractTransferredAmt := math.ZeroInt() @@ -1489,11 +2194,11 @@ var _ = Describe("Calling distribution precompile from another contract", func() expDelFinalBalance := initialBalance.Amount.Sub(fees).Add(contractTransferredAmt).Add(expRewards) // contract balance be updated according to the transferred amount - contractFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) + contractFinalBalance := s.network.App.BankKeeper.GetBalance(s.network.GetContext(), contractAddr.Bytes(), s.bondDenom) Expect(contractFinalBalance.Amount).To(Equal(expContractFinalBalance)) // delegator (and withdrawer) balance should be updated - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + finalBalance := s.network.App.BankKeeper.GetBalance(s.network.GetContext(), s.keyring.GetAccAddr(1), s.bondDenom) Expect(finalBalance.Amount).To(Equal(expDelFinalBalance), "expected final balance to be greater than initial balance after claiming rewards") }, Entry("claim rewards with transfer to withdrawer before and after precompile call", testCase{ @@ -1514,235 +2219,360 @@ var _ = Describe("Calling distribution precompile from another contract", func() Context("claimRewards with contract as delegator", func() { var ( - // defaultClaimRewardsArgs are the default arguments for the claim rewards call - // - // NOTE: this has to be populated in a BeforeEach block because the contractAddr would otherwise be a nil address. - defaultClaimRewardsArgs contracts.CallArgs - // expectedBalance is the total after claiming from both validators - expectedBalance sdk.Coin + initialBalance *sdk.Coin + accruedRewardsAmt math.Int ) - BeforeEach(func() { - // set some rewards for s.address & another address - s.prepareStakingRewards([]stakingRewards{ - { - Delegator: contractAddr.Bytes(), - Validator: s.validators[0], - RewardAmt: rewards, - }, { - Delegator: contractAddr.Bytes(), - Validator: s.validators[1], - RewardAmt: rewards, + BeforeEach(func() { //nolint:dupl + // send funds to the contract + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), contractAddr.Bytes(), math.NewInt(2e18)) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) + + stkPrecompile, err := s.getStakingPrecompile() + Expect(err).To(BeNil()) + // make a delegation with contract as delegator + logCheck := testutil.LogCheckArgs{ + ExpPass: true, + ABIEvents: stkPrecompile.ABI.Events, + ExpEvents: []string{authorization.EventTypeApproval, staking.EventTypeDelegate}, + } + _, _, err = s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + factory.CallArgs{ + ContractABI: distrCallerContract.ABI, + MethodName: "testDelegateFromContract", + Args: []interface{}{ + s.network.GetValidators()[0].OperatorAddress, + big.NewInt(1e18), + }, }, - }...) + logCheck, + ) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) + + // wait to accrue some rewards for contract address + rwRes, err := testutils.WaitToAccrueRewards(s.network, s.grpcHandler, sdk.AccAddress(contractAddr.Bytes()).String(), minExpRewardOrCommission) + Expect(err).To(BeNil()) + + // contract's accrued rewards amt + accruedRewardsAmt = rwRes.AmountOf(s.bondDenom).TruncateInt() + + balRes, err := s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + initialBalance = balRes.Balance - expectedBalance = sdk.Coin{Denom: evmosutil.ExampleAttoDenom, Amount: math.NewInt(2e18)} // populate default arguments - defaultClaimRewardsArgs = defaultCallArgs.WithMethodName( - "testClaimRewards", - ) + callArgs.MethodName = "testClaimRewards" }) It("should withdraw rewards successfully without origin check", func() { - claimRewardsArgs := defaultClaimRewardsArgs.WithArgs(contractAddr, uint32(2)) + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + signerInitialBalance := balRes.Balance + + callArgs.Args = []interface{}{contractAddr, uint32(2)} + txArgs.GasPrice = gasPrice.BigInt() logCheckArgs := passCheck.WithExpEvents(distribution.EventTypeClaimRewards) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, claimRewardsArgs, logCheckArgs) + res, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - // balance should increase - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) - Expect(finalBalance.Amount.Equal(expectedBalance.Amount)).To(BeTrue(), "expected final balance to be greater than initial balance after withdrawing rewards") + // tx signer should have paid the fees + fees := gasPrice.Mul(math.NewInt(res.GasUsed)) + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + signerFinalBalance := balRes.Balance + Expect(signerFinalBalance.Amount).To(Equal(signerInitialBalance.Amount.Sub(fees))) + + // contract's balance should increase + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + finalBalance := balRes.Balance + Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Add(accruedRewardsAmt)), "expected final balance to be greater than initial balance after withdrawing rewards") }) It("should withdraw rewards successfully to a different address without origin check", func() { - withdrawerAddr, _ := testutiltx.NewAccAddressAndKey() - initialWithdrawerBalance := s.app.BankKeeper.GetBalance(s.ctx, withdrawerAddr.Bytes(), s.bondDenom) - Expect(initialWithdrawerBalance.Amount).To(Equal(sdk.ZeroInt())) + balanceRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + signerInitialBalance := balanceRes.Balance - initialDelegatorBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) + balRes, err := s.grpcHandler.GetBalance(differentAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + withdrawerInitialBalance := balRes.Balance - err := s.app.DistrKeeper.SetWithdrawAddr(s.ctx, contractAddr.Bytes(), withdrawerAddr.Bytes()) + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) Expect(err).To(BeNil()) + contractInitialBalance := balRes.Balance + + txArgs.GasPrice = gasPrice.BigInt() + + // Set new withdrawer address for the contract + setWithdrawCheck := passCheck.WithExpEvents(distribution.EventTypeSetWithdrawAddress) + res1, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + factory.CallArgs{ + ContractABI: distrCallerContract.ABI, + MethodName: "testSetWithdrawAddressFromContract", + Args: []interface{}{differentAddr.String()}, + }, + setWithdrawCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - claimRewardsArgs := defaultClaimRewardsArgs.WithArgs(contractAddr, uint32(2)) + callArgs.Args = []interface{}{contractAddr, uint32(2)} logCheckArgs := passCheck.WithExpEvents(distribution.EventTypeClaimRewards) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, claimRewardsArgs, logCheckArgs) + rwRes, err := s.grpcHandler.GetDelegationRewards(sdk.AccAddress(contractAddr.Bytes()).String(), s.network.GetValidators()[0].OperatorAddress) + Expect(err).To(BeNil()) + accruedRewardsAmt = rwRes.Rewards.AmountOf(s.bondDenom).TruncateInt() + + txArgs.GasLimit = 200_000 + res2, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) + + // signer balance should decrease - paid for fees + fees := gasPrice.Mul(math.NewInt(res1.GasUsed)).Add(gasPrice.Mul(math.NewInt(res2.GasUsed))) + + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + signerFinalBalance := balRes.Balance + Expect(signerFinalBalance.Amount).To(Equal(signerInitialBalance.Amount.Sub(fees)), "expected signer's final balance to be less than initial balance after withdrawing rewards") // withdrawer balance should increase - finalWithdrawerBalance := s.app.BankKeeper.GetBalance(s.ctx, withdrawerAddr.Bytes(), s.bondDenom) - Expect(finalWithdrawerBalance.Equal(expectedBalance)).To(BeTrue(), "expected final withdrawer balance to be greater than initial balance after withdrawing rewards") + balRes, err = s.grpcHandler.GetBalance(differentAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + withdrawerFinalBalance := balRes.Balance + Expect(withdrawerFinalBalance.Amount).To(Equal(withdrawerInitialBalance.Amount.Add(accruedRewardsAmt))) - // delegator (contract) balance should remain unchanged - finalDelegatorBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) - Expect(finalDelegatorBalance.Amount.Equal(initialDelegatorBalance.Amount)).To(BeTrue(), "expected final delegator balance to same as initial balance after withdrawing rewards") + // contract balance should remain unchanged + balRes, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + contractFinalBalance := balRes.Balance + Expect(contractFinalBalance.Amount).To(Equal(contractInitialBalance.Amount)) }) }) Context("Forbidden operations", func() { It("should revert state: modify withdraw address & then try to withdraw rewards corresponding to another user", func() { - // set rewards to another user - s.prepareStakingRewards(stakingRewards{differentAddr.Bytes(), s.validators[0], rewards}) + // check signer address balance should've decreased (fees paid) + balanceRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + initBalanceAmt := balanceRes.Balance.Amount - revertArgs := defaultCallArgs. - WithMethodName("testRevertState"). - WithArgs( - differentAddr.String(), differentAddr, s.validators[0].OperatorAddress, - ) + _, err = testutils.WaitToAccrueRewards(s.network, s.grpcHandler, s.keyring.GetAccAddr(0).String(), minExpRewardOrCommission) + Expect(err).To(BeNil()) + + callArgs.MethodName = "testRevertState" + callArgs.Args = []interface{}{ + differentAddr.String(), differentAddr, s.network.GetValidators()[0].OperatorAddress, + } - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, revertArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // check withdraw address didn't change - withdrawer := s.app.DistrKeeper.GetDelegatorWithdrawAddr(s.ctx, s.address.Bytes()) - Expect(withdrawer.Bytes()).To(Equal(s.address.Bytes())) + res, err := s.grpcHandler.GetDelegatorWithdrawAddr(s.keyring.GetAccAddr(0).String()) + Expect(err).To(BeNil(), "error while calling the precompile") + Expect(res.WithdrawAddress).To(Equal(s.keyring.GetAccAddr(0).String())) // check signer address balance should've decreased (fees paid) - finalBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount.Uint64() <= initBalanceAmt.Uint64()).To(BeTrue()) + balanceRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + Expect(balanceRes.Balance.Amount.LTE(initBalanceAmt)).To(BeTrue()) // check other address' balance remained unchanged - finalBalance = s.app.BankKeeper.GetBalance(s.ctx, differentAddr.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(math.ZeroInt())) + balanceRes, err = s.grpcHandler.GetBalance(differentAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + Expect(balanceRes.Balance.Amount).To(Equal(math.ZeroInt())) }) It("should not allow to call SetWithdrawAddress using delegatecall", func() { - setWithdrawAddrArgs := defaultCallArgs. - WithMethodName("delegateCallSetWithdrawAddress"). - WithArgs(s.address, differentAddr.String()) - - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, setWithdrawAddrArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + callArgs.MethodName = "delegateCallSetWithdrawAddress" + callArgs.Args = []interface{}{s.keyring.GetAddr(0), differentAddr.String()} + + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // check withdraw address didn't change - withdrawer := s.app.DistrKeeper.GetDelegatorWithdrawAddr(s.ctx, s.address.Bytes()) - Expect(withdrawer.Bytes()).To(Equal(s.address.Bytes())) + res, err := s.grpcHandler.GetDelegatorWithdrawAddr(s.keyring.GetAccAddr(0).String()) + Expect(err).To(BeNil(), "error while calling the precompile") + Expect(res.WithdrawAddress).To(Equal(s.keyring.GetAccAddr(0).String())) }) It("should not allow to call txs (SetWithdrawAddress) using staticcall", func() { - setWithdrawAddrArgs := defaultCallArgs. - WithMethodName("staticCallSetWithdrawAddress"). - WithArgs(s.address, differentAddr.String()) - - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, setWithdrawAddrArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + callArgs.MethodName = "staticCallSetWithdrawAddress" + callArgs.Args = []interface{}{s.keyring.GetAddr(0), differentAddr.String()} + + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // check withdraw address didn't change - withdrawer := s.app.DistrKeeper.GetDelegatorWithdrawAddr(s.ctx, s.address.Bytes()) - Expect(withdrawer.Bytes()).To(Equal(s.address.Bytes())) + res, err := s.grpcHandler.GetDelegatorWithdrawAddr(s.keyring.GetAccAddr(0).String()) + Expect(err).To(BeNil(), "error while calling the precompile") + Expect(res.WithdrawAddress).To(Equal(s.keyring.GetAccAddr(0).String())) }) }) // =================================== // QUERIES // =================================== - Context("Distribution precompile queries", func() { - Context("get validator distribution info", func() { - // defaultValDistArgs are the default arguments for the getValidatorDistributionInfo query - // - // NOTE: this has to be populated in BeforeEach because the test suite setup is not available prior to that. - var defaultValDistArgs contracts.CallArgs - - BeforeEach(func() { - addr := sdk.AccAddress(s.validators[0].GetOperator()) - // fund validator account to make self-delegation - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, addr, 10) - Expect(err).To(BeNil()) - // make a self delegation - _, err = s.app.StakingKeeper.Delegate(s.ctx, addr, math.NewInt(1), stakingtypes.Unspecified, s.validators[0], true) - Expect(err).To(BeNil()) + Context("Distribution precompile queries", Ordered, func() { + It("should get validator distribution info", func() { + // fund validator account to make self-delegation + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), s.validatorsKeys[0].AccAddr, math.NewInt(1e17)) + Expect(err).To(BeNil()) + // persist changes + Expect(s.network.NextBlock()).To(BeNil()) - defaultValDistArgs = defaultCallArgs. - WithMethodName("getValidatorDistributionInfo"). - WithArgs(s.validators[0].OperatorAddress) - }) + opAddr := s.network.GetValidators()[0].OperatorAddress + // use the validator priv key + // make a self delegation + err = s.factory.Delegate(s.validatorsKeys[0].Priv, opAddr, sdk.NewCoin(s.bondDenom, math.NewInt(1))) + Expect(err).To(BeNil()) + // persist changes + Expect(s.network.NextBlock()).To(BeNil()) + + callArgs.MethodName = "getValidatorDistributionInfo" + callArgs.Args = []interface{}{opAddr} + txArgs.GasLimit = 200_000 + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.validatorsKeys[0].Priv, + txArgs, + callArgs, + passCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - It("should get validator distribution info", func() { - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultValDistArgs, passCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + var out distribution.ValidatorDistributionInfoOutput + err = s.precompile.UnpackIntoInterface(&out, distribution.ValidatorDistributionInfoMethod, ethRes.Ret) + Expect(err).To(BeNil()) - var out distribution.ValidatorDistributionInfoOutput - err = s.precompile.UnpackIntoInterface(&out, distribution.ValidatorDistributionInfoMethod, ethRes.Ret) - Expect(err).To(BeNil()) + expAddr := s.validatorsKeys[0].AccAddr.String() - expAddr := sdk.AccAddress(s.validators[0].GetOperator()) - Expect(expAddr.String()).To(Equal(out.DistributionInfo.OperatorAddress)) - Expect(0).To(Equal(len(out.DistributionInfo.Commission))) - Expect(0).To(Equal(len(out.DistributionInfo.SelfBondRewards))) - }) + Expect(expAddr).To(Equal(out.DistributionInfo.OperatorAddress)) + Expect(1).To(Equal(len(out.DistributionInfo.Commission))) + Expect(1).To(Equal(len(out.DistributionInfo.SelfBondRewards))) }) - Context("get validator outstanding rewards", func() { //nolint:dupl - // defaultValOutRewardsArgs are the default arguments for the getValidatorOutstandingRewards query - // - // NOTE: this has to be populated in BeforeEach because the test suite setup is not available prior to that. - var defaultValOutRewardsArgs contracts.CallArgs - - BeforeEach(func() { - defaultValOutRewardsArgs = defaultCallArgs. - WithMethodName("getValidatorOutstandingRewards"). - WithArgs(s.validators[0].OperatorAddress) - }) + It("should get validator outstanding rewards", func() { + opAddr := s.network.GetValidators()[0].OperatorAddress + callArgs.MethodName = "getValidatorOutstandingRewards" + callArgs.Args = []interface{}{opAddr} - It("should not get rewards - validator without outstanding rewards", func() { - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultValOutRewardsArgs, passCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + _, err := testutils.WaitToAccrueRewards(s.network, s.grpcHandler, s.keyring.GetAccAddr(0).String(), minExpRewardOrCommission) + Expect(err).To(BeNil(), "error while calling the precompile") - var rewards []cmn.DecCoin - err = s.precompile.UnpackIntoInterface(&rewards, distribution.ValidatorOutstandingRewardsMethod, ethRes.Ret) - Expect(err).To(BeNil()) - Expect(len(rewards)).To(Equal(0)) - }) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - It("should get rewards - validator with outstanding rewards", func() { - valRewards := sdk.DecCoins{sdk.NewDecCoinFromDec(s.bondDenom, math.LegacyNewDec(1))} - // set outstanding rewards - s.app.DistrKeeper.SetValidatorOutstandingRewards(s.ctx, s.validators[0].GetOperator(), distrtypes.ValidatorOutstandingRewards{Rewards: valRewards}) + var rewards []cmn.DecCoin + err = s.precompile.UnpackIntoInterface(&rewards, distribution.ValidatorOutstandingRewardsMethod, ethRes.Ret) + Expect(err).To(BeNil()) + Expect(len(rewards)).To(Equal(1)) + Expect(uint8(18)).To(Equal(rewards[0].Precision)) + Expect(s.bondDenom).To(Equal(rewards[0].Denom)) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultValOutRewardsArgs, passCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + res, err := s.grpcHandler.GetValidatorOutstandingRewards(opAddr) + Expect(err).To(BeNil()) - var rewards []cmn.DecCoin - err = s.precompile.UnpackIntoInterface(&rewards, distribution.ValidatorOutstandingRewardsMethod, ethRes.Ret) - Expect(err).To(BeNil()) - Expect(len(rewards)).To(Equal(1)) - Expect(uint8(18)).To(Equal(rewards[0].Precision)) - Expect(s.bondDenom).To(Equal(rewards[0].Denom)) - Expect(expValAmount).To(Equal(rewards[0].Amount.Int64())) - }) + expRewardsAmt := res.Rewards.Rewards.AmountOf(s.bondDenom).TruncateInt() + Expect(expRewardsAmt.IsPositive()).To(BeTrue()) + Expect(rewards[0].Amount).To(Equal(expRewardsAmt.BigInt())) }) - Context("get validator commission", func() { //nolint:dupl - // defaultValCommArgs are the default arguments for the getValidatorCommission query - // - // NOTE: this has to be populated in BeforeEach because the test suite setup is not available prior to that. - var defaultValCommArgs contracts.CallArgs - + Context("get validator commission", func() { BeforeEach(func() { - defaultValCommArgs = defaultCallArgs. - WithMethodName("getValidatorCommission"). - WithArgs(s.validators[0].OperatorAddress) + callArgs.MethodName = "getValidatorCommission" + callArgs.Args = []interface{}{s.network.GetValidators()[0].OperatorAddress} }) - It("should not get commission - validator without commission", func() { - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultValCommArgs, passCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + // // TODO: currently does not work because the minting happens on the Beginning of each block + // // In future SDK releases this will be possible to adjust by passing a custom `MintFn` -> check + // // https://docs.cosmos.network/main/build/modules/mint#epoch-minting + // + // It("should not get commission - validator without commission", func() { + // // fund validator account to claim commission (if any) + // err = testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), s.validatorsKeys[0].AccAddr, math.NewInt(1e18)) + // Expect(err).To(BeNil()) + // Expect(s.network.NextBlock()).To(BeNil()) + // + // // withdraw validator commission + // err = s.factory.WithdrawValidatorCommission(s.validatorsKeys[0].Priv) + // Expect(err).To(BeNil()) + // Expect(s.network.NextBlock()).To(BeNil()) + // + // _, ethRes, err := s.factory.CallContractAndCheckLogs( + // s.keyring.GetPrivKey(0), + // txArgs, + // callArgs, + // passCheck, + // ) + // Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + // + // var commission []cmn.DecCoin + // err = s.precompile.UnpackIntoInterface(&commission, distribution.ValidatorCommissionMethod, ethRes.Ret) + // Expect(err).To(BeNil()) + // Expect(len(commission)).To(Equal(1)) + // Expect(commission[0].Amount.Int64()).To(Equal(int64(0))) + // }) - var commission []cmn.DecCoin - err = s.precompile.UnpackIntoInterface(&commission, distribution.ValidatorCommissionMethod, ethRes.Ret) + It("should get commission - validator with commission", func() { + _, err = testutils.WaitToAccrueCommission(s.network, s.grpcHandler, s.network.GetValidators()[0].OperatorAddress, minExpRewardOrCommission) Expect(err).To(BeNil()) - Expect(len(commission)).To(Equal(0)) - }) - It("should get commission - validator with commission", func() { - // set commission - valCommission := sdk.DecCoins{sdk.NewDecCoinFromDec(s.bondDenom, math.LegacyNewDec(1))} - s.app.DistrKeeper.SetValidatorAccumulatedCommission(s.ctx, s.validators[0].GetOperator(), distrtypes.ValidatorAccumulatedCommission{Commission: valCommission}) + commRes, err := s.grpcHandler.GetValidatorCommission(s.network.GetValidators()[0].OperatorAddress) + Expect(err).To(BeNil()) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultValCommArgs, passCheck) + accruedCommission := commRes.Commission.Commission + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var commission []cmn.DecCoin @@ -1751,28 +2581,40 @@ var _ = Describe("Calling distribution precompile from another contract", func() Expect(len(commission)).To(Equal(1)) Expect(uint8(18)).To(Equal(commission[0].Precision)) Expect(s.bondDenom).To(Equal(commission[0].Denom)) - Expect(expValAmount).To(Equal(commission[0].Amount.Int64())) + + accruedCommissionAmt := accruedCommission.AmountOf(s.bondDenom).TruncateInt() + + Expect(commission[0].Amount).To(Equal(accruedCommissionAmt.BigInt())) }) }) - Context("get validator slashing events", func() { - // defaultValSlashArgs are the default arguments for the getValidatorSlashes query - // - // NOTE: this has to be populated in BeforeEach because the test suite setup is not available prior to that. - var defaultValSlashArgs contracts.CallArgs - + Context("get validator slashing events", Ordered, func() { BeforeEach(func() { - defaultValSlashArgs = defaultCallArgs. - WithMethodName("getValidatorSlashes"). - WithArgs( - s.validators[0].OperatorAddress, - uint64(1), uint64(5), - query.PageRequest{}, - ) + callArgs.MethodName = "getValidatorSlashes" + callArgs.Args = []interface{}{ + s.network.GetValidators()[0].OperatorAddress, + uint64(1), uint64(5), + query.PageRequest{}, + } + }) + + AfterEach(func() { + // NOTE: The first test case will not have the slashes + // so keep this in mind when adding/removing new testcases + s.withValidatorSlashes = true + }) + + AfterAll(func() { + s.withValidatorSlashes = false }) It("should not get slashing events - validator without slashes", func() { - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultValSlashArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var out distribution.ValidatorSlashesOutput @@ -1782,29 +2624,31 @@ var _ = Describe("Calling distribution precompile from another contract", func() }) It("should get slashing events - validator with slashes (default pagination)", func() { - // set slash event - slashEvent := s.setupValidatorSlashes(s.validators[0].GetOperator(), 1) - - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultValSlashArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var out distribution.ValidatorSlashesOutput err = s.precompile.UnpackIntoInterface(&out, distribution.ValidatorSlashesMethod, ethRes.Ret) Expect(err).To(BeNil()) - Expect(len(out.Slashes)).To(Equal(1)) - Expect(slashEvent.Fraction.BigInt()).To(Equal(out.Slashes[0].Fraction.Value)) - Expect(slashEvent.ValidatorPeriod).To(Equal(out.Slashes[0].ValidatorPeriod)) - Expect(uint64(1)).To(Equal(out.PageResponse.Total)) + Expect(len(out.Slashes)).To(Equal(2)) + // expected values according to the values used on test setup (custom genesis) + for _, s := range out.Slashes { + Expect(s.Fraction.Value).To(Equal(math.LegacyNewDecWithPrec(5, 2).BigInt())) + Expect(s.ValidatorPeriod).To(Equal(uint64(1))) + } + Expect(uint64(2)).To(Equal(out.PageResponse.Total)) Expect(out.PageResponse.NextKey).To(BeEmpty()) }) It("should get slashing events - validator with slashes w/pagination", func() { - // set 2 slashing events - slashEvent := s.setupValidatorSlashes(s.validators[0].GetOperator(), 2) - // set pagination - defaultValSlashArgs.Args = []interface{}{ - s.validators[0].OperatorAddress, + callArgs.Args = []interface{}{ + s.network.GetValidators()[0].OperatorAddress, uint64(1), uint64(5), query.PageRequest{ Limit: 1, @@ -1812,45 +2656,67 @@ var _ = Describe("Calling distribution precompile from another contract", func() }, } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultValSlashArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var out distribution.ValidatorSlashesOutput err = s.precompile.UnpackIntoInterface(&out, distribution.ValidatorSlashesMethod, ethRes.Ret) Expect(err).To(BeNil()) Expect(len(out.Slashes)).To(Equal(1)) - Expect(slashEvent.Fraction.BigInt()).To(Equal(out.Slashes[0].Fraction.Value)) - Expect(slashEvent.ValidatorPeriod).To(Equal(out.Slashes[0].ValidatorPeriod)) + Expect(out.Slashes[0].Fraction.Value).To(Equal(math.LegacyNewDecWithPrec(5, 2).BigInt())) + Expect(out.Slashes[0].ValidatorPeriod).To(Equal(uint64(1))) Expect(uint64(2)).To(Equal(out.PageResponse.Total)) Expect(out.PageResponse.NextKey).NotTo(BeEmpty()) }) }) Context("get delegation rewards", func() { - // defaultDelRewardsArgs are the default arguments for the getDelegationRewards query - // - // NOTE: this has to be populated in BeforeEach because the test suite setup is not available prior to that. - var defaultDelRewardsArgs contracts.CallArgs - BeforeEach(func() { - defaultDelRewardsArgs = defaultCallArgs. - WithMethodName("getDelegationRewards"). - WithArgs(s.address, s.validators[0].OperatorAddress) + callArgs.MethodName = "getDelegationRewards" + callArgs.Args = []interface{}{s.keyring.GetAddr(0), s.network.GetValidators()[0].OperatorAddress} }) - It("should not get rewards - no rewards available", func() { - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultDelRewardsArgs, passCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + // // TODO: currently does not work because the minting happens on the Beginning of each block + // // In future SDK releases this will be possible to adjust by passing a custom `MintFn` -> check + // // https://docs.cosmos.network/main/build/modules/mint#epoch-minting + // + // It("should not get rewards - no rewards available", func() { + // // withdraw rewards if available + // err := s.factory.WithdrawDelegationRewards(s.keyring.GetPrivKey(0), s.network.GetValidators()[0].OperatorAddress) + // Expect(err).To(BeNil()) + // Expect(s.network.NextBlock()).To(BeNil()) + // + // // add gas limit to avoid out of gas error + // txArgs.GasLimit = 200_000 + // _, ethRes, err := s.factory.CallContractAndCheckLogs( + // s.keyring.GetPrivKey(0), + // txArgs, + // callArgs, + // passCheck, + // ) + // Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + // + // var rewards []cmn.DecCoin + // err = s.precompile.UnpackIntoInterface(&rewards, distribution.DelegationRewardsMethod, ethRes.Ret) + // Expect(err).To(BeNil()) + // Expect(len(rewards)).To(Equal(0)) + // }) - var rewards []cmn.DecCoin - err = s.precompile.UnpackIntoInterface(&rewards, distribution.DelegationRewardsMethod, ethRes.Ret) - Expect(err).To(BeNil()) - Expect(len(rewards)).To(Equal(0)) - }) It("should get rewards", func() { - s.prepareStakingRewards(stakingRewards{s.address.Bytes(), s.validators[0], rewards}) + accruedRewards, err := testutils.WaitToAccrueRewards(s.network, s.grpcHandler, s.keyring.GetAccAddr(0).String(), minExpRewardOrCommission) + Expect(err).To(BeNil()) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultDelRewardsArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var rewards []cmn.DecCoin @@ -1859,67 +2725,81 @@ var _ = Describe("Calling distribution precompile from another contract", func() Expect(len(rewards)).To(Equal(1)) Expect(len(rewards)).To(Equal(1)) Expect(rewards[0].Denom).To(Equal(s.bondDenom)) - Expect(rewards[0].Amount.Int64()).To(Equal(expDelegationRewards)) + + // The accrued rewards are based on 3 equal delegations to the existing 3 validators + // The query is from only 1 validator, thus, the expected reward + // for this delegation is totalAccruedRewards / validatorsCount (3) + accruedRewardsAmt := accruedRewards.AmountOf(s.bondDenom) + expRewardPerValidator := accruedRewardsAmt.Quo(math.LegacyNewDec(3)).TruncateInt() + + Expect(rewards[0].Amount).To(Equal(expRewardPerValidator.BigInt())) }) }) Context("get delegator's total rewards", func() { - // defaultDelTotalRewardsArgs are the default arguments for the getDelegationTotalRewards query - // - // NOTE: this has to be populated in BeforeEach because the test suite setup is not available prior to that. - var defaultDelTotalRewardsArgs contracts.CallArgs - BeforeEach(func() { - defaultDelTotalRewardsArgs = defaultCallArgs. - WithMethodName("getDelegationTotalRewards"). - WithArgs(s.address) + callArgs.MethodName = "getDelegationTotalRewards" + callArgs.Args = []interface{}{s.keyring.GetAddr(0)} }) - It("should not get rewards - no rewards available", func() { - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultDelTotalRewardsArgs, passCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + // // TODO: currently does not work because the minting happens on the Beginning of each block + // // In future SDK releases this will be possible to adjust by passing a custom `MintFn` -> check + // // https://docs.cosmos.network/main/build/modules/mint#epoch-minting + // + // It("should not get rewards - no rewards available", func() { + // // Create a delegation + // err := s.factory.Delegate(s.keyring.GetPrivKey(1), s.network.GetValidators()[0].OperatorAddress, sdk.NewCoin(s.bondDenom, math.NewInt(1))) + // Expect(err).To(BeNil()) + // Expect(s.network.NextBlock()).To(BeNil()) + // + // callArgs.Args = []interface{}{s.keyring.GetAddr(1)} + // txArgs.GasLimit = 200_000 // set gas limit to avoid out of gas error + // _, ethRes, err := s.factory.CallContractAndCheckLogs( + // s.keyring.GetPrivKey(1), + // txArgs, + // callArgs, + // passCheck, + // ) + // Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + // + // var out distribution.DelegationTotalRewardsOutput + // err = s.precompile.UnpackIntoInterface(&out, distribution.DelegationTotalRewardsMethod, ethRes.Ret) + // Expect(err).To(BeNil()) + // Expect(len(out.Rewards)).To(Equal(1)) + // Expect(len(out.Rewards[0].Reward)).To(Equal(0)) + // }) - var out distribution.DelegationTotalRewardsOutput - err = s.precompile.UnpackIntoInterface(&out, distribution.DelegationTotalRewardsMethod, ethRes.Ret) - Expect(err).To(BeNil()) - Expect(len(out.Rewards)).To(Equal(2)) - Expect(len(out.Rewards[0].Reward)).To(Equal(0)) - Expect(len(out.Rewards[1].Reward)).To(Equal(0)) - }) It("should get total rewards", func() { - // set rewards - s.prepareStakingRewards(stakingRewards{s.address.Bytes(), s.validators[0], rewards}) + // wait to get rewards + accruedRewards, err := testutils.WaitToAccrueRewards(s.network, s.grpcHandler, s.keyring.GetAccAddr(0).String(), minExpRewardOrCommission) + Expect(err).To(BeNil()) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultDelTotalRewardsArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - var ( - out distribution.DelegationTotalRewardsOutput - i int - ) + var out distribution.DelegationTotalRewardsOutput + err = s.precompile.UnpackIntoInterface(&out, distribution.DelegationTotalRewardsMethod, ethRes.Ret) Expect(err).To(BeNil()) + // The accrued rewards are based on 3 equal delegations to the existing 3 validators + accruedRewardsAmt := accruedRewards.AmountOf(s.bondDenom) + expRewardPerValidator := accruedRewardsAmt.Quo(math.LegacyNewDec(3)) + // the response order may change - if out.Rewards[0].ValidatorAddress == s.validators[0].OperatorAddress { - Expect(s.validators[0].OperatorAddress).To(Equal(out.Rewards[0].ValidatorAddress)) - Expect(s.validators[1].OperatorAddress).To(Equal(out.Rewards[1].ValidatorAddress)) - Expect(0).To(Equal(len(out.Rewards[1].Reward))) - } else { - i = 1 - Expect(s.validators[0].OperatorAddress).To(Equal(out.Rewards[1].ValidatorAddress)) - Expect(s.validators[1].OperatorAddress).To(Equal(out.Rewards[0].ValidatorAddress)) - Expect(0).To(Equal(len(out.Rewards[0].Reward))) + for _, or := range out.Rewards { + Expect(1).To(Equal(len(or.Reward))) + Expect(or.Reward[0].Denom).To(Equal(s.bondDenom)) + Expect(or.Reward[0].Amount).To(Equal(expRewardPerValidator.TruncateInt().BigInt())) } - // only validator[i] has rewards - Expect(1).To(Equal(len(out.Rewards[i].Reward))) - Expect(s.bondDenom).To(Equal(out.Rewards[i].Reward[0].Denom)) - Expect(uint8(math.LegacyPrecision)).To(Equal(out.Rewards[i].Reward[0].Precision)) - Expect(expDelegationRewards).To(Equal(out.Rewards[i].Reward[0].Amount.Int64())) - Expect(1).To(Equal(len(out.Total))) - Expect(expDelegationRewards).To(Equal(out.Total[0].Amount.Int64())) + Expect(out.Total[0].Amount).To(Equal(accruedRewardsAmt.TruncateInt().BigInt())) }) Context("query call with revert - all changes should revert to corresponding stateDB snapshot", func() { @@ -1934,101 +2814,109 @@ var _ = Describe("Calling distribution precompile from another contract", func() reverterContract, err = contracts.LoadReverterContract() Expect(err).To(BeNil(), "error while loading the Reverter contract") - reverterAddr, err = s.DeployContract(reverterContract) - Expect(err).To(BeNil(), "error while deploying the Reverter contract") - s.NextBlock() + reverterAddr, err = s.factory.DeployContract( + s.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values + factory.ContractDeploymentData{ + Contract: reverterContract, + }, + ) + Expect(err).To(BeNil(), "error while deploying the smart contract: %v", err) + // persist state change + Expect(s.network.NextBlock()).To(BeNil()) // send some funds to the Reverter contracts to transfer to the // delegator during the tx - err = chainutil.FundAccount(s.ctx, s.app.BankKeeper, reverterAddr.Bytes(), sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, testContractInitialBalance))) + err = testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), reverterAddr.Bytes(), testContractInitialBalance) Expect(err).To(BeNil(), "error while funding the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) }) It("should revert the execution - Reverter contract", func() { - args := contracts.CallArgs{ - ContractAddr: reverterAddr, - ContractABI: reverterContract.ABI, - PrivKey: s.privKey, - MethodName: "run", - GasPrice: gasPrice, + args := factory.CallArgs{ + ContractABI: reverterContract.ABI, + MethodName: "run", } + _, _, err = s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{ + To: &reverterAddr, + GasPrice: gasPrice.BigInt(), + }, + args, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, args, execRevertedCheck) - Expect(err).NotTo(BeNil(), "error while calling the smart contract: %v", err) + balRes, err := s.grpcHandler.GetBalance(reverterAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) - contractFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, reverterAddr.Bytes(), s.bondDenom) + contractFinalBalance := balRes.Balance Expect(contractFinalBalance.Amount).To(Equal(testContractInitialBalance)) }) }) }) Context("get all delegator validators", func() { - // defaultDelValArgs are the default arguments for the getDelegatorValidators query - // - // NOTE: this has to be populated in BeforeEach because the test suite setup is not available prior to that. - var defaultDelValArgs contracts.CallArgs - BeforeEach(func() { - defaultDelValArgs = defaultCallArgs. - WithMethodName("getDelegatorValidators"). - WithArgs(s.address) + callArgs.MethodName = "getDelegatorValidators" + callArgs.Args = []interface{}{s.keyring.GetAddr(0)} }) It("should get all validators a delegator has delegated to", func() { - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultDelValArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var validators []string err = s.precompile.UnpackIntoInterface(&validators, distribution.DelegatorValidatorsMethod, ethRes.Ret) Expect(err).To(BeNil()) - Expect(2).To(Equal(len(validators))) - - // the response order may change - if validators[0] == s.validators[0].OperatorAddress { - Expect(s.validators[0].OperatorAddress).To(Equal(validators[0])) - Expect(s.validators[1].OperatorAddress).To(Equal(validators[1])) - } else { - Expect(s.validators[1].OperatorAddress).To(Equal(validators[0])) - Expect(s.validators[0].OperatorAddress).To(Equal(validators[1])) - } + Expect(3).To(Equal(len(validators))) }) }) Context("get withdraw address", func() { - // defaultWithdrawAddrArgs are the default arguments for the getDelegatorWithdrawAddress query - // - // NOTE: this has to be populated in BeforeEach because the test suite setup is not available prior to that. - var defaultWithdrawAddrArgs contracts.CallArgs - BeforeEach(func() { - defaultWithdrawAddrArgs = defaultCallArgs. - WithMethodName("getDelegatorWithdrawAddress"). - WithArgs(s.address) + callArgs.MethodName = "getDelegatorWithdrawAddress" + callArgs.Args = []interface{}{s.keyring.GetAddr(0)} }) It("should get withdraw address", func() { - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, defaultWithdrawAddrArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) withdrawAddr, err := s.precompile.Unpack(distribution.DelegatorWithdrawAddressMethod, ethRes.Ret) Expect(err).To(BeNil()) // get the bech32 encoding - expAddr := sdk.AccAddress(s.address.Bytes()) + expAddr := sdk.AccAddress(s.keyring.GetAddr(0).Bytes()) Expect(withdrawAddr[0]).To(Equal(expAddr.String())) }) It("should call GetWithdrawAddress using staticcall", func() { - staticCallArgs := defaultCallArgs. - WithMethodName("staticCallGetWithdrawAddress"). - WithArgs(s.address) - - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, staticCallArgs, passCheck) + callArgs.MethodName = "staticCallGetWithdrawAddress" + callArgs.Args = []interface{}{s.keyring.GetAddr(0)} + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) withdrawAddr, err := s.precompile.Unpack(distribution.DelegatorWithdrawAddressMethod, ethRes.Ret) Expect(err).To(BeNil()) // get the bech32 encoding - expAddr := sdk.AccAddress(s.address.Bytes()) + expAddr := sdk.AccAddress(s.keyring.GetAddr(0).Bytes()) Expect(withdrawAddr[0]).To(ContainSubstring(expAddr.String())) }) }) diff --git a/precompiles/distribution/query_test.go b/precompiles/distribution/query_test.go index b1e50f2f..3f89f25d 100644 --- a/precompiles/distribution/query_test.go +++ b/precompiles/distribution/query_test.go @@ -10,20 +10,14 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - chainutil "github.com/evmos/os/example_chain/testutil" "github.com/evmos/os/x/evm/core/vm" - testutiltx "github.com/evmos/os/testutil/tx" - cmn "github.com/evmos/os/precompiles/common" "github.com/evmos/os/precompiles/distribution" + testutiltx "github.com/evmos/os/testutil/tx" ) -var ( - expDelegationRewards int64 = 2000000000000000000 - expValAmount int64 = 1 - rewards, _ = math.NewIntFromString("1000000000000000000") -) +var expValAmount int64 = 1 type distrTestCases struct { name string @@ -60,6 +54,7 @@ var baseTestCases = []distrTestCases{ } func (s *PrecompileTestSuite) TestValidatorDistributionInfo() { + var ctx sdk.Context method := s.precompile.Methods[distribution.ValidatorDistributionInfoMethod] testCases := []distrTestCases{ @@ -82,34 +77,42 @@ func (s *PrecompileTestSuite) TestValidatorDistributionInfo() { "fail - existent validator but without self delegation", func() []interface{} { return []interface{}{ - s.validators[0].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, } }, func([]byte) {}, 100000, true, - "delegation does not exist", + "no delegation for (address, validator) tuple", }, { "success", func() []interface{} { - addr := sdk.AccAddress(s.validators[0].GetOperator()) - // fund del account to make self-delegation - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, addr, 10) + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) s.Require().NoError(err) + + // fund account for self delegation + amt := math.NewInt(1) + err = s.fundAccountWithBaseDenom(ctx, valAddr.Bytes(), amt) + s.Require().NoError(err) + // make a self delegation - _, err = s.app.StakingKeeper.Delegate(s.ctx, addr, math.NewInt(1), stakingtypes.Unspecified, s.validators[0], true) + _, err = s.network.App.StakingKeeper.Delegate(ctx, valAddr.Bytes(), amt, stakingtypes.Unspecified, s.network.GetValidators()[0], true) s.Require().NoError(err) return []interface{}{ - s.validators[0].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, } }, func(bz []byte) { var out distribution.ValidatorDistributionInfoOutput err := s.precompile.UnpackIntoInterface(&out, distribution.ValidatorDistributionInfoMethod, bz) s.Require().NoError(err, "failed to unpack output", err) - expAddr := sdk.AccAddress(s.validators[0].GetOperator()) - s.Require().Equal(expAddr.String(), out.DistributionInfo.OperatorAddress) + + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) + + s.Require().Equal(sdk.AccAddress(valAddr.Bytes()).String(), out.DistributionInfo.OperatorAddress) s.Require().Equal(0, len(out.DistributionInfo.Commission)) s.Require().Equal(0, len(out.DistributionInfo.SelfBondRewards)) }, @@ -123,9 +126,10 @@ func (s *PrecompileTestSuite) TestValidatorDistributionInfo() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + ctx = s.network.GetContext() + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - bz, err := s.precompile.ValidatorDistributionInfo(s.ctx, contract, &method, tc.malleate()) + bz, err := s.precompile.ValidatorDistributionInfo(ctx, contract, &method, tc.malleate()) if tc.expErr { s.Require().Error(err) @@ -139,12 +143,13 @@ func (s *PrecompileTestSuite) TestValidatorDistributionInfo() { } } -func (s *PrecompileTestSuite) TestValidatorOutstandingRewards() { //nolint:dupl +func (s *PrecompileTestSuite) TestValidatorOutstandingRewards() { + var ctx sdk.Context method := s.precompile.Methods[distribution.ValidatorOutstandingRewardsMethod] testCases := []distrTestCases{ { - "success - nonexistent validator address", + "fail - nonexistent validator address", func() []interface{} { pv := mock.NewPV() pk, err := pv.GetPubKey() @@ -160,14 +165,14 @@ func (s *PrecompileTestSuite) TestValidatorOutstandingRewards() { //nolint:dupl s.Require().Equal(0, len(out)) }, 100000, - false, - "", + true, + "validator does not exist", }, { "success - existent validator, no outstanding rewards", func() []interface{} { return []interface{}{ - s.validators[0].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, } }, func(bz []byte) { @@ -185,9 +190,14 @@ func (s *PrecompileTestSuite) TestValidatorOutstandingRewards() { //nolint:dupl func() []interface{} { valRewards := sdk.DecCoins{sdk.NewDecCoinFromDec(s.bondDenom, math.LegacyNewDec(1))} // set outstanding rewards - s.app.DistrKeeper.SetValidatorOutstandingRewards(s.ctx, s.validators[0].GetOperator(), types.ValidatorOutstandingRewards{Rewards: valRewards}) + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) + + err = s.network.App.DistrKeeper.SetValidatorOutstandingRewards(ctx, valAddr, types.ValidatorOutstandingRewards{Rewards: valRewards}) + s.Require().NoError(err) + return []interface{}{ - s.validators[0].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, } }, func(bz []byte) { @@ -209,9 +219,10 @@ func (s *PrecompileTestSuite) TestValidatorOutstandingRewards() { //nolint:dupl for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + ctx = s.network.GetContext() + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - bz, err := s.precompile.ValidatorOutstandingRewards(s.ctx, contract, &method, tc.malleate()) + bz, err := s.precompile.ValidatorOutstandingRewards(ctx, contract, &method, tc.malleate()) if tc.expErr { s.Require().Error(err) @@ -225,12 +236,13 @@ func (s *PrecompileTestSuite) TestValidatorOutstandingRewards() { //nolint:dupl } } -func (s *PrecompileTestSuite) TestValidatorCommission() { //nolint:dupl +func (s *PrecompileTestSuite) TestValidatorCommission() { + var ctx sdk.Context method := s.precompile.Methods[distribution.ValidatorCommissionMethod] testCases := []distrTestCases{ { - "success - nonexistent validator address", + "fail - nonexistent validator address", func() []interface{} { pv := mock.NewPV() pk, err := pv.GetPubKey() @@ -246,14 +258,14 @@ func (s *PrecompileTestSuite) TestValidatorCommission() { //nolint:dupl s.Require().Equal(0, len(out)) }, 100000, - false, - "", + true, + "validator does not exist", }, { "success - existent validator, no accumulated commission", func() []interface{} { return []interface{}{ - s.validators[0].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, } }, func(bz []byte) { @@ -269,10 +281,21 @@ func (s *PrecompileTestSuite) TestValidatorCommission() { //nolint:dupl { "success - with accumulated commission", func() []interface{} { - valCommission := sdk.DecCoins{sdk.NewDecCoinFromDec(s.bondDenom, math.LegacyNewDec(1))} - s.app.DistrKeeper.SetValidatorAccumulatedCommission(s.ctx, s.validators[0].GetOperator(), types.ValidatorAccumulatedCommission{Commission: valCommission}) + commAmt := math.LegacyNewDec(1) + validator := s.network.GetValidators()[0] + valAddr, err := sdk.ValAddressFromBech32(validator.GetOperator()) + s.Require().NoError(err) + valCommission := sdk.DecCoins{sdk.NewDecCoinFromDec(s.bondDenom, commAmt)} + err = s.network.App.DistrKeeper.SetValidatorAccumulatedCommission(ctx, valAddr, types.ValidatorAccumulatedCommission{Commission: valCommission}) + s.Require().NoError(err) + + // set distribution module account balance which pays out the commission + coins := sdk.NewCoins(sdk.NewCoin(s.bondDenom, commAmt.RoundInt())) + err = s.mintCoinsForDistrMod(ctx, coins) + s.Require().NoError(err) + return []interface{}{ - s.validators[0].OperatorAddress, + validator.OperatorAddress, } }, func(bz []byte) { @@ -294,9 +317,10 @@ func (s *PrecompileTestSuite) TestValidatorCommission() { //nolint:dupl for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + ctx = s.network.GetContext() + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - bz, err := s.precompile.ValidatorCommission(s.ctx, contract, &method, tc.malleate()) + bz, err := s.precompile.ValidatorCommission(ctx, contract, &method, tc.malleate()) if tc.expErr { s.Require().Error(err) @@ -311,6 +335,7 @@ func (s *PrecompileTestSuite) TestValidatorCommission() { //nolint:dupl } func (s *PrecompileTestSuite) TestValidatorSlashes() { + var ctx sdk.Context method := s.precompile.Methods[distribution.ValidatorSlashesMethod] testCases := []distrTestCases{ @@ -331,7 +356,7 @@ func (s *PrecompileTestSuite) TestValidatorSlashes() { "fail - invalid starting height type", func() []interface{} { return []interface{}{ - s.validators[0].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, int64(1), uint64(5), query.PageRequest{}, } @@ -346,7 +371,7 @@ func (s *PrecompileTestSuite) TestValidatorSlashes() { "fail - starting height greater than ending height", func() []interface{} { return []interface{}{ - s.validators[0].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, uint64(6), uint64(5), query.PageRequest{}, } @@ -385,7 +410,7 @@ func (s *PrecompileTestSuite) TestValidatorSlashes() { "success - existent validator, no slashes", func() []interface{} { return []interface{}{ - s.validators[0].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, uint64(1), uint64(5), query.PageRequest{}, @@ -405,9 +430,12 @@ func (s *PrecompileTestSuite) TestValidatorSlashes() { { "success - with slashes", func() []interface{} { - s.app.DistrKeeper.SetValidatorSlashEvent(s.ctx, s.validators[0].GetOperator(), 2, 1, types.ValidatorSlashEvent{ValidatorPeriod: 1, Fraction: math.LegacyNewDec(5)}) + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) + err = s.network.App.DistrKeeper.SetValidatorSlashEvent(ctx, valAddr, 2, 1, types.ValidatorSlashEvent{ValidatorPeriod: 1, Fraction: math.LegacyNewDec(5)}) + s.Require().NoError(err) return []interface{}{ - s.validators[0].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, uint64(1), uint64(5), query.PageRequest{}, } @@ -428,9 +456,12 @@ func (s *PrecompileTestSuite) TestValidatorSlashes() { { "success - with slashes w/pagination", func() []interface{} { - s.app.DistrKeeper.SetValidatorSlashEvent(s.ctx, s.validators[0].GetOperator(), 2, 1, types.ValidatorSlashEvent{ValidatorPeriod: 1, Fraction: math.LegacyNewDec(5)}) + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) + err = s.network.App.DistrKeeper.SetValidatorSlashEvent(ctx, valAddr, 2, 1, types.ValidatorSlashEvent{ValidatorPeriod: 1, Fraction: math.LegacyNewDec(5)}) + s.Require().NoError(err) return []interface{}{ - s.validators[0].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, uint64(1), uint64(5), query.PageRequest{Limit: 1, CountTotal: true}, @@ -455,9 +486,10 @@ func (s *PrecompileTestSuite) TestValidatorSlashes() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + ctx = s.network.GetContext() + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - bz, err := s.precompile.ValidatorSlashes(s.ctx, contract, &method, tc.malleate()) + bz, err := s.precompile.ValidatorSlashes(ctx, contract, &method, tc.malleate()) if tc.expErr { s.Require().Error(err) @@ -472,6 +504,10 @@ func (s *PrecompileTestSuite) TestValidatorSlashes() { } func (s *PrecompileTestSuite) TestDelegationRewards() { + var ( + ctx sdk.Context + err error + ) method := s.precompile.Methods[distribution.DelegationRewardsMethod] testCases := []distrTestCases{ @@ -479,7 +515,7 @@ func (s *PrecompileTestSuite) TestDelegationRewards() { "fail - invalid validator address", func() []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), "invalid", } }, @@ -495,7 +531,7 @@ func (s *PrecompileTestSuite) TestDelegationRewards() { pk, err := pv.GetPubKey() s.Require().NoError(err) return []interface{}{ - s.address, + s.keyring.GetAddr(0), sdk.ValAddress(pk.Address().Bytes()).String(), } }, @@ -510,20 +546,20 @@ func (s *PrecompileTestSuite) TestDelegationRewards() { newAddr, _ := testutiltx.NewAddrKey() return []interface{}{ newAddr, - s.validators[0].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, } }, func([]byte) {}, 100000, true, - "delegation does not exist", + "no delegation for (address, validator) tuple", }, { "success - existent validator & delegation, but no rewards", func() []interface{} { return []interface{}{ - s.address, - s.validators[0].OperatorAddress, + s.keyring.GetAddr(0), + s.network.GetValidators()[0].OperatorAddress, } }, func(bz []byte) { @@ -539,10 +575,11 @@ func (s *PrecompileTestSuite) TestDelegationRewards() { { "success - with rewards", func() []interface{} { - s.prepareStakingRewards(stakingRewards{s.address.Bytes(), s.validators[0], rewards}) + ctx, err = s.prepareStakingRewards(ctx, stakingRewards{s.keyring.GetAddr(0).Bytes(), s.network.GetValidators()[0], testRewardsAmt}) + s.Require().NoError(err, "failed to prepare staking rewards", err) return []interface{}{ - s.address, - s.validators[0].OperatorAddress, + s.keyring.GetAddr(0), + s.network.GetValidators()[0].OperatorAddress, } }, func(bz []byte) { @@ -552,7 +589,7 @@ func (s *PrecompileTestSuite) TestDelegationRewards() { s.Require().Equal(1, len(out)) s.Require().Equal(uint8(18), out[0].Precision) s.Require().Equal(s.bondDenom, out[0].Denom) - s.Require().Equal(expDelegationRewards, out[0].Amount.Int64()) + s.Require().Equal(expRewardsAmt.Int64(), out[0].Amount.Int64()) }, 100000, false, @@ -564,9 +601,11 @@ func (s *PrecompileTestSuite) TestDelegationRewards() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + ctx = s.network.GetContext() + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - bz, err := s.precompile.DelegationRewards(s.ctx, contract, &method, tc.malleate()) + args := tc.malleate() + bz, err := s.precompile.DelegationRewards(ctx, contract, &method, args) if tc.expErr { s.Require().Error(err) @@ -581,6 +620,10 @@ func (s *PrecompileTestSuite) TestDelegationRewards() { } func (s *PrecompileTestSuite) TestDelegationTotalRewards() { + var ( + ctx sdk.Context + err error + ) method := s.precompile.Methods[distribution.DelegationTotalRewardsMethod] testCases := []distrTestCases{ @@ -619,25 +662,21 @@ func (s *PrecompileTestSuite) TestDelegationTotalRewards() { "success - existent validator & delegation, but no rewards", func() []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), } }, func(bz []byte) { var out distribution.DelegationTotalRewardsOutput err := s.precompile.UnpackIntoInterface(&out, distribution.DelegationTotalRewardsMethod, bz) s.Require().NoError(err, "failed to unpack output", err) - s.Require().Equal(2, len(out.Rewards)) - // the response order may change - if out.Rewards[0].ValidatorAddress == s.validators[0].OperatorAddress { - s.Require().Equal(s.validators[0].OperatorAddress, out.Rewards[0].ValidatorAddress) - s.Require().Equal(s.validators[1].OperatorAddress, out.Rewards[1].ValidatorAddress) - } else { - s.Require().Equal(s.validators[1].OperatorAddress, out.Rewards[0].ValidatorAddress) - s.Require().Equal(s.validators[0].OperatorAddress, out.Rewards[1].ValidatorAddress) - } + + validatorsCount := len(s.network.GetValidators()) + s.Require().Equal(validatorsCount, len(out.Rewards)) + // no rewards s.Require().Equal(0, len(out.Rewards[0].Reward)) s.Require().Equal(0, len(out.Rewards[1].Reward)) + s.Require().Equal(0, len(out.Rewards[2].Reward)) s.Require().Equal(0, len(out.Total)) }, 100000, @@ -647,9 +686,11 @@ func (s *PrecompileTestSuite) TestDelegationTotalRewards() { { "success - with rewards", func() []interface{} { - s.prepareStakingRewards(stakingRewards{s.address.Bytes(), s.validators[0], rewards}) + ctx, err = s.prepareStakingRewards(ctx, stakingRewards{s.keyring.GetAccAddr(0), s.network.GetValidators()[0], testRewardsAmt}) + s.Require().NoError(err, "failed to prepare staking rewards", err) + return []interface{}{ - s.address, + s.keyring.GetAddr(0), } }, func(bz []byte) { @@ -659,28 +700,29 @@ func (s *PrecompileTestSuite) TestDelegationTotalRewards() { ) err := s.precompile.UnpackIntoInterface(&out, distribution.DelegationTotalRewardsMethod, bz) s.Require().NoError(err, "failed to unpack output", err) - s.Require().Equal(2, len(out.Rewards)) + + validators := s.network.GetValidators() + valWithRewards := validators[0] + validatorsCount := len(s.network.GetValidators()) + s.Require().Equal(validatorsCount, len(out.Rewards)) // the response order may change - if out.Rewards[0].ValidatorAddress == s.validators[0].OperatorAddress { - s.Require().Equal(s.validators[0].OperatorAddress, out.Rewards[0].ValidatorAddress) - s.Require().Equal(s.validators[1].OperatorAddress, out.Rewards[1].ValidatorAddress) - s.Require().Equal(0, len(out.Rewards[1].Reward)) - } else { - i = 1 - s.Require().Equal(s.validators[0].OperatorAddress, out.Rewards[1].ValidatorAddress) - s.Require().Equal(s.validators[1].OperatorAddress, out.Rewards[0].ValidatorAddress) - s.Require().Equal(0, len(out.Rewards[0].Reward)) + for index, or := range out.Rewards { + if or.ValidatorAddress == valWithRewards.OperatorAddress { + i = index + } else { + s.Require().Equal(0, len(out.Rewards[index].Reward)) + } } // only validator[i] has rewards s.Require().Equal(1, len(out.Rewards[i].Reward)) s.Require().Equal(s.bondDenom, out.Rewards[i].Reward[0].Denom) s.Require().Equal(uint8(math.LegacyPrecision), out.Rewards[i].Reward[0].Precision) - s.Require().Equal(expDelegationRewards, out.Rewards[i].Reward[0].Amount.Int64()) + s.Require().Equal(expRewardsAmt.Int64(), out.Rewards[i].Reward[0].Amount.Int64()) s.Require().Equal(1, len(out.Total)) - s.Require().Equal(expDelegationRewards, out.Total[0].Amount.Int64()) + s.Require().Equal(expRewardsAmt.Int64(), out.Total[0].Amount.Int64()) }, 100000, false, @@ -692,9 +734,12 @@ func (s *PrecompileTestSuite) TestDelegationTotalRewards() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + ctx = s.network.GetContext() + + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - bz, err := s.precompile.DelegationTotalRewards(s.ctx, contract, &method, tc.malleate()) + args := tc.malleate() + bz, err := s.precompile.DelegationTotalRewards(ctx, contract, &method, args) if tc.expErr { s.Require().Error(err) @@ -709,6 +754,7 @@ func (s *PrecompileTestSuite) TestDelegationTotalRewards() { } func (s *PrecompileTestSuite) TestDelegatorValidators() { + var ctx sdk.Context method := s.precompile.Methods[distribution.DelegatorValidatorsMethod] testCases := []distrTestCases{ @@ -746,21 +792,21 @@ func (s *PrecompileTestSuite) TestDelegatorValidators() { "success - existent delegations", func() []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), } }, func(bz []byte) { var out []string err := s.precompile.UnpackIntoInterface(&out, distribution.DelegatorValidatorsMethod, bz) s.Require().NoError(err, "failed to unpack output", err) - s.Require().Equal(2, len(out)) - // the order may change - if out[0] == s.validators[0].OperatorAddress { - s.Require().Equal(s.validators[0].OperatorAddress, out[0]) - s.Require().Equal(s.validators[1].OperatorAddress, out[1]) - } else { - s.Require().Equal(s.validators[1].OperatorAddress, out[0]) - s.Require().Equal(s.validators[0].OperatorAddress, out[1]) + s.Require().Equal(3, len(out)) + for _, val := range s.network.GetValidators() { + s.Require().Contains( + out, + val.OperatorAddress, + "expected operator address %q to be in output", + val.OperatorAddress, + ) } }, 100000, @@ -773,9 +819,10 @@ func (s *PrecompileTestSuite) TestDelegatorValidators() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + ctx = s.network.GetContext() + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - bz, err := s.precompile.DelegatorValidators(s.ctx, contract, &method, tc.malleate()) + bz, err := s.precompile.DelegatorValidators(ctx, contract, &method, tc.malleate()) if tc.expErr { s.Require().Error(err) @@ -790,6 +837,7 @@ func (s *PrecompileTestSuite) TestDelegatorValidators() { } func (s *PrecompileTestSuite) TestDelegatorWithdrawAddress() { + var ctx sdk.Context method := s.precompile.Methods[distribution.DelegatorWithdrawAddressMethod] testCases := []distrTestCases{ @@ -809,14 +857,14 @@ func (s *PrecompileTestSuite) TestDelegatorWithdrawAddress() { "success - withdraw address same as delegator address", func() []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), } }, func(bz []byte) { var out string err := s.precompile.UnpackIntoInterface(&out, distribution.DelegatorWithdrawAddressMethod, bz) s.Require().NoError(err, "failed to unpack output", err) - s.Require().Equal(sdk.AccAddress(s.address.Bytes()).String(), out) + s.Require().Equal(sdk.AccAddress(s.keyring.GetAddr(0).Bytes()).String(), out) }, 100000, false, @@ -828,9 +876,10 @@ func (s *PrecompileTestSuite) TestDelegatorWithdrawAddress() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + ctx = s.network.GetContext() + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - bz, err := s.precompile.DelegatorWithdrawAddress(s.ctx, contract, &method, tc.malleate()) + bz, err := s.precompile.DelegatorWithdrawAddress(ctx, contract, &method, tc.malleate()) if tc.expErr { s.Require().Error(err) diff --git a/precompiles/distribution/setup_test.go b/precompiles/distribution/setup_test.go index bc11d8d1..f4da1f04 100644 --- a/precompiles/distribution/setup_test.go +++ b/precompiles/distribution/setup_test.go @@ -3,56 +3,100 @@ package distribution_test import ( "testing" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/evmos/os/precompiles/distribution" - "github.com/evmos/os/x/evm/statedb" - - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/ginkgo/v2" - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/gomega" + testconstants "github.com/evmos/os/testutil/constants" + "github.com/evmos/os/testutil/integration/os/factory" + "github.com/evmos/os/testutil/integration/os/grpc" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" + "github.com/evmos/os/testutil/integration/os/network" - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - exampleapp "github.com/evmos/os/example_chain" - evmtypes "github.com/evmos/os/x/evm/types" "github.com/stretchr/testify/suite" ) -var s *PrecompileTestSuite - type PrecompileTestSuite struct { suite.Suite - ctx sdk.Context - app *exampleapp.ExampleChain - address common.Address - validators []stakingtypes.Validator - valSet *tmtypes.ValidatorSet - ethSigner ethtypes.Signer - privKey cryptotypes.PrivKey - signer keyring.Signer - bondDenom string - - precompile *distribution.Precompile - stateDB *statedb.StateDB + network *network.UnitTestNetwork + factory factory.TxFactory + grpcHandler grpc.Handler + keyring testkeyring.Keyring - queryClientEVM evmtypes.QueryClient + precompile *distribution.Precompile + bondDenom string + validatorsKeys []testkeyring.Key + withValidatorSlashes bool } -func TestPrecompileTestSuite(t *testing.T) { - s = new(PrecompileTestSuite) - suite.Run(t, s) - - // Run Ginkgo integration tests - RegisterFailHandler(Fail) - RunSpecs(t, "Distribution Precompile Suite") +func TestPrecompileUnitTestSuite(t *testing.T) { + suite.Run(t, new(PrecompileTestSuite)) } func (s *PrecompileTestSuite) SetupTest() { - s.DoSetupTest() + keyring := testkeyring.New(2) + s.validatorsKeys = generateKeys(3) + customGen := network.CustomGenesisState{} + + // set some slashing events for integration test + distrGen := distrtypes.DefaultGenesisState() + if s.withValidatorSlashes { + distrGen.ValidatorSlashEvents = []distrtypes.ValidatorSlashEventRecord{ + { + ValidatorAddress: sdk.ValAddress(s.validatorsKeys[0].Addr.Bytes()).String(), + Height: 0, + Period: 1, + ValidatorSlashEvent: distrtypes.NewValidatorSlashEvent(1, math.LegacyNewDecWithPrec(5, 2)), + }, + { + ValidatorAddress: sdk.ValAddress(s.validatorsKeys[0].Addr.Bytes()).String(), + Height: 1, + Period: 1, + ValidatorSlashEvent: distrtypes.NewValidatorSlashEvent(1, math.LegacyNewDecWithPrec(5, 2)), + }, + } + } + customGen[distrtypes.ModuleName] = distrGen + + // set non-zero inflation for rewards to accrue (use defaults from SDK for values) + mintGen := minttypes.DefaultGenesisState() + mintGen.Params.MintDenom = testconstants.ExampleAttoDenom + customGen[minttypes.ModuleName] = mintGen + + operatorsAddr := make([]sdk.AccAddress, 3) + for i, k := range s.validatorsKeys { + operatorsAddr[i] = k.AccAddr + } + + nw := network.NewUnitTestNetwork( + network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), + network.WithCustomGenesis(customGen), + network.WithValidatorOperators(operatorsAddr), + ) + grpcHandler := grpc.NewIntegrationHandler(nw) + txFactory := factory.New(nw, grpcHandler) + + ctx := nw.GetContext() + sk := nw.App.StakingKeeper + bondDenom, err := sk.BondDenom(ctx) + if err != nil { + panic(err) + } + + s.bondDenom = bondDenom + s.factory = txFactory + s.grpcHandler = grpcHandler + s.keyring = keyring + s.network = nw + s.precompile, err = distribution.NewPrecompile( + s.network.App.DistrKeeper, + *s.network.App.StakingKeeper, + s.network.App.AuthzKeeper, + s.network.App.EVMKeeper, + ) + if err != nil { + panic(err) + } } diff --git a/precompiles/distribution/tx.go b/precompiles/distribution/tx.go index dfc1d424..c2d6a6ca 100644 --- a/precompiles/distribution/tx.go +++ b/precompiles/distribution/tx.go @@ -44,21 +44,27 @@ func (p *Precompile) ClaimRewards( return nil, err } - maxVals := p.stakingKeeper.MaxValidators(ctx) + maxVals, err := p.stakingKeeper.MaxValidators(ctx) + if err != nil { + return nil, err + } if maxRetrieve > maxVals { return nil, fmt.Errorf("maxRetrieve (%d) parameter exceeds the maximum number of validators (%d)", maxRetrieve, maxVals) } // If the contract is the delegator, we don't need an origin check // Otherwise check if the origin matches the delegator address - isContractDelegator := contract.CallerAddress == delegatorAddr && origin != delegatorAddr + isContractDelegator := (contract.CallerAddress == delegatorAddr) && (origin != delegatorAddr) if !isContractDelegator && origin != delegatorAddr { return nil, fmt.Errorf(cmn.ErrDelegatorDifferentOrigin, origin.String(), delegatorAddr.String()) } - validators := p.stakingKeeper.GetDelegatorValidators(ctx, delegatorAddr.Bytes(), maxRetrieve) + res, err := p.stakingKeeper.GetDelegatorValidators(ctx, delegatorAddr.Bytes(), maxRetrieve) + if err != nil { + return nil, err + } totalCoins := sdk.Coins{} - for _, validator := range validators { + for _, validator := range res.Validators { // Convert the validator operator address into an ValAddress valAddr, err := sdk.ValAddressFromBech32(validator.OperatorAddress) if err != nil { @@ -79,7 +85,11 @@ func (p *Precompile) ClaimRewards( // this happens when the precompile is called from a smart contract if contract.CallerAddress != origin { // rewards go to the withdrawer address - withdrawerHexAddr := p.getWithdrawerHexAddr(ctx, delegatorAddr) + withdrawerHexAddr, err := p.getWithdrawerHexAddr(ctx, delegatorAddr) + if err != nil { + return nil, err + } + evmDenom := p.evmKeeper.GetParams(ctx).EvmDenom p.SetBalanceChangeEntries(cmn.NewBalanceChangeEntry(withdrawerHexAddr, totalCoins.AmountOf(evmDenom).BigInt(), cmn.Add)) } @@ -113,7 +123,7 @@ func (p Precompile) SetWithdrawAddress( } msgSrv := distributionkeeper.NewMsgServerImpl(p.distributionKeeper) - if _, err = msgSrv.SetWithdrawAddress(sdk.WrapSDKContext(ctx), msg); err != nil { + if _, err = msgSrv.SetWithdrawAddress(ctx, msg); err != nil { return nil, err } @@ -146,7 +156,7 @@ func (p *Precompile) WithdrawDelegatorRewards( } msgSrv := distributionkeeper.NewMsgServerImpl(p.distributionKeeper) - res, err := msgSrv.WithdrawDelegatorReward(sdk.WrapSDKContext(ctx), msg) + res, err := msgSrv.WithdrawDelegatorReward(ctx, msg) if err != nil { return nil, err } @@ -156,7 +166,11 @@ func (p *Precompile) WithdrawDelegatorRewards( // This prevents the stateDB from overwriting the changed balance in the bank keeper when committing the EVM state. if contract.CallerAddress != origin { // rewards go to the withdrawer address - withdrawerHexAddr := p.getWithdrawerHexAddr(ctx, delegatorHexAddr) + withdrawerHexAddr, err := p.getWithdrawerHexAddr(ctx, delegatorHexAddr) + if err != nil { + return nil, err + } + p.SetBalanceChangeEntries(cmn.NewBalanceChangeEntry(withdrawerHexAddr, res.Amount[0].Amount.BigInt(), cmn.Add)) } @@ -189,7 +203,7 @@ func (p *Precompile) WithdrawValidatorCommission( } msgSrv := distributionkeeper.NewMsgServerImpl(p.distributionKeeper) - res, err := msgSrv.WithdrawValidatorCommission(sdk.WrapSDKContext(ctx), msg) + res, err := msgSrv.WithdrawValidatorCommission(ctx, msg) if err != nil { return nil, err } @@ -199,7 +213,11 @@ func (p *Precompile) WithdrawValidatorCommission( // This prevents the stateDB from overwriting the changed balance in the bank keeper when committing the EVM state. if contract.CallerAddress != origin { // commissions go to the withdrawer address - withdrawerHexAddr := p.getWithdrawerHexAddr(ctx, validatorHexAddr) + withdrawerHexAddr, err := p.getWithdrawerHexAddr(ctx, validatorHexAddr) + if err != nil { + return nil, err + } + p.SetBalanceChangeEntries(cmn.NewBalanceChangeEntry(withdrawerHexAddr, res.Amount[0].Amount.BigInt(), cmn.Add)) } @@ -233,7 +251,7 @@ func (p *Precompile) FundCommunityPool( } msgSrv := distributionkeeper.NewMsgServerImpl(p.distributionKeeper) - _, err = msgSrv.FundCommunityPool(sdk.WrapSDKContext(ctx), msg) + _, err = msgSrv.FundCommunityPool(ctx, msg) if err != nil { return nil, err } @@ -254,7 +272,11 @@ func (p *Precompile) FundCommunityPool( // getWithdrawerHexAddr is a helper function to get the hex address // of the withdrawer for the specified account address -func (p Precompile) getWithdrawerHexAddr(ctx sdk.Context, delegatorAddr common.Address) common.Address { - withdrawerAccAddr := p.distributionKeeper.GetDelegatorWithdrawAddr(ctx, delegatorAddr.Bytes()) - return common.BytesToAddress(withdrawerAccAddr) +func (p Precompile) getWithdrawerHexAddr(ctx sdk.Context, delegatorAddr common.Address) (common.Address, error) { + withdrawerAccAddr, err := p.distributionKeeper.GetDelegatorWithdrawAddr(ctx, delegatorAddr.Bytes()) + if err != nil { + return common.Address{}, err + } + + return common.BytesToAddress(withdrawerAccAddr), nil } diff --git a/precompiles/distribution/tx_test.go b/precompiles/distribution/tx_test.go index 732879a2..267ca903 100644 --- a/precompiles/distribution/tx_test.go +++ b/precompiles/distribution/tx_test.go @@ -4,21 +4,25 @@ import ( "fmt" "math/big" + testconstants "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" - precompiletestutil "github.com/evmos/os/precompiles/testutil" - "github.com/evmos/os/testutil" + "github.com/evmos/os/precompiles/testutil" "github.com/evmos/os/x/evm/core/vm" "github.com/ethereum/go-ethereum/common" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" cmn "github.com/evmos/os/precompiles/common" "github.com/evmos/os/precompiles/distribution" + "github.com/evmos/os/testutil/integration/os/network" utiltx "github.com/evmos/os/testutil/tx" ) func (s *PrecompileTestSuite) TestSetWithdrawAddress() { + var ctx sdk.Context method := s.precompile.Methods[distribution.SetWithdrawAddressMethod] newWithdrawerAddr := utiltx.GenerateAddress() @@ -45,7 +49,7 @@ func (s *PrecompileTestSuite) TestSetWithdrawAddress() { func() []interface{} { return []interface{}{ "", - s.address.String(), + s.keyring.GetAddr(0).String(), } }, func() {}, @@ -57,7 +61,7 @@ func (s *PrecompileTestSuite) TestSetWithdrawAddress() { "fail - invalid withdrawer address", func() []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), nil, } }, @@ -70,13 +74,14 @@ func (s *PrecompileTestSuite) TestSetWithdrawAddress() { "success - using the same address withdrawer address", func() []interface{} { return []interface{}{ - s.address, - s.address.String(), + s.keyring.GetAddr(0), + s.keyring.GetAddr(0).String(), } }, func() { - withdrawerAddr := s.app.DistrKeeper.GetDelegatorWithdrawAddr(s.ctx, s.address.Bytes()) - s.Require().Equal(withdrawerAddr.Bytes(), s.address.Bytes()) + withdrawerAddr, err := s.network.App.DistrKeeper.GetDelegatorWithdrawAddr(ctx, s.keyring.GetAccAddr(0)) + s.Require().NoError(err) + s.Require().Equal(withdrawerAddr.String(), s.keyring.GetAccAddr(0).String()) }, 20000, false, @@ -86,12 +91,13 @@ func (s *PrecompileTestSuite) TestSetWithdrawAddress() { "success - using a different withdrawer address", func() []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), newWithdrawerAddr.String(), } }, func() { - withdrawerAddr := s.app.DistrKeeper.GetDelegatorWithdrawAddr(s.ctx, s.address.Bytes()) + withdrawerAddr, err := s.network.App.DistrKeeper.GetDelegatorWithdrawAddr(ctx, s.keyring.GetAddr(0).Bytes()) + s.Require().NoError(err) s.Require().Equal(withdrawerAddr.Bytes(), newWithdrawerAddr.Bytes()) }, 20000, @@ -103,11 +109,12 @@ func (s *PrecompileTestSuite) TestSetWithdrawAddress() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() + ctx = s.network.GetContext() var contract *vm.Contract - contract, s.ctx = precompiletestutil.NewPrecompileContract(s.T(), s.ctx, s.address, s.precompile, tc.gas) + contract, ctx = testutil.NewPrecompileContract(s.T(), ctx, s.keyring.GetAddr(0), s.precompile, tc.gas) - _, err := s.precompile.SetWithdrawAddress(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate()) + _, err := s.precompile.SetWithdrawAddress(ctx, s.keyring.GetAddr(0), contract, s.network.GetStateDB(), &method, tc.malleate()) if tc.expError { s.Require().ErrorContains(err, tc.errContains) @@ -120,11 +127,15 @@ func (s *PrecompileTestSuite) TestSetWithdrawAddress() { } func (s *PrecompileTestSuite) TestWithdrawDelegatorRewards() { + var ( + ctx sdk.Context + err error + ) method := s.precompile.Methods[distribution.WithdrawDelegatorRewardsMethod] testCases := []struct { name string - malleate func(operatorAddress string) []interface{} + malleate func(val stakingtypes.Validator) []interface{} postCheck func(data []byte) gas uint64 expError bool @@ -132,7 +143,7 @@ func (s *PrecompileTestSuite) TestWithdrawDelegatorRewards() { }{ { "fail - empty input args", - func(string) []interface{} { + func(stakingtypes.Validator) []interface{} { return []interface{}{} }, func([]byte) {}, @@ -142,10 +153,10 @@ func (s *PrecompileTestSuite) TestWithdrawDelegatorRewards() { }, { "fail - invalid delegator address", - func(operatorAddress string) []interface{} { + func(val stakingtypes.Validator) []interface{} { return []interface{}{ "", - operatorAddress, + val.OperatorAddress, } }, func([]byte) {}, @@ -155,9 +166,9 @@ func (s *PrecompileTestSuite) TestWithdrawDelegatorRewards() { }, { "fail - invalid validator address", - func(string) []interface{} { + func(stakingtypes.Validator) []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), nil, } }, @@ -168,26 +179,30 @@ func (s *PrecompileTestSuite) TestWithdrawDelegatorRewards() { }, { "success - withdraw rewards from a single validator without commission", - func(operatorAddress string) []interface{} { - valAddr, err := sdk.ValAddressFromBech32(operatorAddress) - s.Require().NoError(err) - val, _ := s.app.StakingKeeper.GetValidator(s.ctx, valAddr) - coins := sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1e18))) - s.app.DistrKeeper.AllocateTokensToValidator(s.ctx, val, sdk.NewDecCoinsFromCoins(coins...)) + func(val stakingtypes.Validator) []interface{} { + ctx, err = s.prepareStakingRewards( + ctx, + stakingRewards{ + Validator: val, + Delegator: s.keyring.GetAccAddr(0), + RewardAmt: testRewardsAmt, + }, + ) + s.Require().NoError(err, "failed to unpack output") return []interface{}{ - s.address, - operatorAddress, + s.keyring.GetAddr(0), + val.OperatorAddress, } }, func(data []byte) { var coins []cmn.Coin err := s.precompile.UnpackIntoInterface(&coins, distribution.WithdrawDelegatorRewardsMethod, data) s.Require().NoError(err, "failed to unpack output") - s.Require().Equal(coins[0].Denom, testutil.ExampleAttoDenom) - s.Require().Equal(coins[0].Amount, big.NewInt(1000000000000000000)) + s.Require().Equal(coins[0].Denom, testconstants.ExampleAttoDenom) + s.Require().Equal(coins[0].Amount.Int64(), expRewardsAmt.Int64()) // Check bank balance after the withdrawal of rewards - balance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount.BigInt(), big.NewInt(6000000000000000000)) + balance := s.network.App.BankKeeper.GetBalance(ctx, s.keyring.GetAddr(0).Bytes(), testconstants.ExampleAttoDenom) + s.Require().True(balance.Amount.GT(network.PrefundedAccountInitialBalance)) }, 20000, false, @@ -198,15 +213,13 @@ func (s *PrecompileTestSuite) TestWithdrawDelegatorRewards() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() - - // sanity check to make sure the starting balance is always 5 EVMOS - balance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount.BigInt(), big.NewInt(5000000000000000000)) + ctx = s.network.GetContext() var contract *vm.Contract - contract, s.ctx = precompiletestutil.NewPrecompileContract(s.T(), s.ctx, s.address, s.precompile, tc.gas) + contract, ctx = testutil.NewPrecompileContract(s.T(), ctx, s.keyring.GetAddr(0), s.precompile, tc.gas) - bz, err := s.precompile.WithdrawDelegatorRewards(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate(s.validators[0].OperatorAddress)) + args := tc.malleate(s.network.GetValidators()[0]) + bz, err := s.precompile.WithdrawDelegatorRewards(ctx, s.keyring.GetAddr(0), contract, s.network.GetStateDB(), &method, args) if tc.expError { s.Require().ErrorContains(err, tc.errContains) @@ -219,6 +232,10 @@ func (s *PrecompileTestSuite) TestWithdrawDelegatorRewards() { } func (s *PrecompileTestSuite) TestWithdrawValidatorCommission() { + var ( + ctx sdk.Context + prevBalance sdk.Coin + ) method := s.precompile.Methods[distribution.WithdrawDelegatorRewardsMethod] testCases := []struct { @@ -249,32 +266,42 @@ func (s *PrecompileTestSuite) TestWithdrawValidatorCommission() { func([]byte) {}, 200000, true, - "invalid validator address", + "empty address string is not allowed", }, { "success - withdraw all commission from a single validator", func(operatorAddress string) []interface{} { valAddr, err := sdk.ValAddressFromBech32(operatorAddress) s.Require().NoError(err) - valCommission := sdk.DecCoins{sdk.NewDecCoinFromDec(testutil.ExampleAttoDenom, math.LegacyNewDecWithPrec(1000000000000000000, 1))} + amt := math.LegacyNewDecWithPrec(1000000000000000000, 1) + valCommission := sdk.DecCoins{sdk.NewDecCoinFromDec(testconstants.ExampleAttoDenom, amt)} // set outstanding rewards - s.app.DistrKeeper.SetValidatorOutstandingRewards(s.ctx, valAddr, types.ValidatorOutstandingRewards{Rewards: valCommission}) + s.Require().NoError(s.network.App.DistrKeeper.SetValidatorOutstandingRewards(ctx, valAddr, types.ValidatorOutstandingRewards{Rewards: valCommission})) // set commission - s.app.DistrKeeper.SetValidatorAccumulatedCommission(s.ctx, valAddr, types.ValidatorAccumulatedCommission{Commission: valCommission}) + s.Require().NoError(s.network.App.DistrKeeper.SetValidatorAccumulatedCommission(ctx, valAddr, types.ValidatorAccumulatedCommission{Commission: valCommission})) + + // fund distr mod to pay for rewards + commission + coins := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, amt.Mul(math.LegacyNewDec(2)).RoundInt())) + err = s.mintCoinsForDistrMod(ctx, coins) + s.Require().NoError(err) return []interface{}{ operatorAddress, } }, func(data []byte) { var coins []cmn.Coin + amt := math.NewInt(100000000000000000) err := s.precompile.UnpackIntoInterface(&coins, distribution.WithdrawValidatorCommissionMethod, data) s.Require().NoError(err, "failed to unpack output") - s.Require().Equal(coins[0].Denom, testutil.ExampleAttoDenom) - s.Require().Equal(coins[0].Amount, big.NewInt(100000000000000000)) + s.Require().Equal(coins[0].Denom, testconstants.ExampleAttoDenom) + s.Require().Equal(coins[0].Amount, amt.BigInt()) + // Check bank balance after the withdrawal of commission - balance := s.app.BankKeeper.GetBalance(s.ctx, s.validators[0].GetOperator().Bytes(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount.BigInt(), big.NewInt(100000000000000000)) - s.Require().Equal(balance.Denom, testutil.ExampleAttoDenom) + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) + balance := s.network.App.BankKeeper.GetBalance(ctx, valAddr.Bytes(), testconstants.ExampleAttoDenom) + s.Require().Equal(balance.Amount, prevBalance.Amount.Add(amt)) + s.Require().Equal(balance.Denom, testconstants.ExampleAttoDenom) }, 20000, false, @@ -285,17 +312,18 @@ func (s *PrecompileTestSuite) TestWithdrawValidatorCommission() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() + ctx = s.network.GetContext() + + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) - // Sanity check to make sure the starting balance is always 0 - balance := s.app.BankKeeper.GetBalance(s.ctx, s.validators[0].GetOperator().Bytes(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount.BigInt(), big.NewInt(0)) - s.Require().Equal(balance.Denom, testutil.ExampleAttoDenom) + prevBalance = s.network.App.BankKeeper.GetBalance(ctx, valAddr.Bytes(), testconstants.ExampleAttoDenom) - validatorAddress := common.BytesToAddress(s.validators[0].GetOperator().Bytes()) + validatorAddress := common.BytesToAddress(valAddr.Bytes()) var contract *vm.Contract - contract, s.ctx = precompiletestutil.NewPrecompileContract(s.T(), s.ctx, validatorAddress, s.precompile, tc.gas) + contract, ctx = testutil.NewPrecompileContract(s.T(), ctx, validatorAddress, s.precompile, tc.gas) - bz, err := s.precompile.WithdrawValidatorCommission(s.ctx, validatorAddress, contract, s.stateDB, &method, tc.malleate(s.validators[0].OperatorAddress)) + bz, err := s.precompile.WithdrawValidatorCommission(ctx, validatorAddress, contract, s.network.GetStateDB(), &method, tc.malleate(s.network.GetValidators()[0].OperatorAddress)) if tc.expError { s.Require().ErrorContains(err, tc.errContains) @@ -308,6 +336,10 @@ func (s *PrecompileTestSuite) TestWithdrawValidatorCommission() { } func (s *PrecompileTestSuite) TestClaimRewards() { + var ( + ctx sdk.Context + prevBalance sdk.Coin + ) method := s.precompile.Methods[distribution.ClaimRewardsMethod] testCases := []struct { @@ -345,7 +377,7 @@ func (s *PrecompileTestSuite) TestClaimRewards() { "fail - invalid type for maxRetrieve: expected uint32", func() []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), big.NewInt(100000000000000000), } }, @@ -354,27 +386,11 @@ func (s *PrecompileTestSuite) TestClaimRewards() { true, "invalid type for maxRetrieve: expected uint32", }, - { - "pass - withdraw from validators with maxRetrieve higher than number of validators", - func() []interface{} { - return []interface{}{ - s.address, - uint32(10), - } - }, - func([]byte) { - balance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount.BigInt(), big.NewInt(7e18)) - }, - 20000, - false, - "", - }, { "fail - too many retrieved results", func() []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), uint32(32_000_000), } }, @@ -384,16 +400,36 @@ func (s *PrecompileTestSuite) TestClaimRewards() { "maxRetrieve (32000000) parameter exceeds the maximum number of validators (100)", }, { - "success - withdraw from all validators - 2", + "success - withdraw from all validators - 3", func() []interface{} { return []interface{}{ - s.address, - uint32(2), + s.keyring.GetAddr(0), + uint32(3), + } + }, + func(_ []byte) { + balance := s.network.App.BankKeeper.GetBalance(ctx, s.keyring.GetAccAddr(0), testconstants.ExampleAttoDenom) + // rewards from 3 validators - 5% commission + expRewards := expRewardsAmt.Mul(math.NewInt(3)) + s.Require().Equal(balance.Amount, prevBalance.Amount.Add(expRewards)) + }, + 20000, + false, + "", + }, + { + "pass - withdraw from validators with maxRetrieve higher than number of validators", + func() []interface{} { + return []interface{}{ + s.keyring.GetAddr(0), + uint32(10), } }, func([]byte) { - balance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount.BigInt(), big.NewInt(7e18)) + balance := s.network.App.BankKeeper.GetBalance(ctx, s.keyring.GetAccAddr(0), testconstants.ExampleAttoDenom) + // rewards from 3 validators - 5% commission + expRewards := expRewardsAmt.Mul(math.NewInt(3)) + s.Require().Equal(balance.Amount, prevBalance.Amount.Add(expRewards)) }, 20000, false, @@ -403,13 +439,13 @@ func (s *PrecompileTestSuite) TestClaimRewards() { "success - withdraw from only 1 validator", func() []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), uint32(1), } }, func([]byte) { - balance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount.BigInt(), big.NewInt(6e18)) + balance := s.network.App.BankKeeper.GetBalance(ctx, s.keyring.GetAccAddr(0), testconstants.ExampleAttoDenom) + s.Require().Equal(balance.Amount, prevBalance.Amount.Add(expRewardsAmt)) }, 20000, false, @@ -420,21 +456,32 @@ func (s *PrecompileTestSuite) TestClaimRewards() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() + ctx = s.network.GetContext() + + var ( + contract *vm.Contract + err error + ) + addr := s.keyring.GetAddr(0) + contract, ctx = testutil.NewPrecompileContract(s.T(), ctx, addr, s.precompile, tc.gas) + + validators := s.network.GetValidators() + srs := make([]stakingRewards, len(validators)) + for i, val := range validators { + srs[i] = stakingRewards{ + Delegator: addr.Bytes(), + Validator: val, + RewardAmt: testRewardsAmt, + } + } - var contract *vm.Contract - contract, s.ctx = precompiletestutil.NewPrecompileContract(s.T(), s.ctx, s.address, s.precompile, tc.gas) - - // Sanity check to make sure the starting balance is always 5 EVMOS - balance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount.BigInt(), big.NewInt(5e18)) + ctx, err = s.prepareStakingRewards(ctx, srs...) + s.Require().NoError(err) - // Distribute rewards to the 2 validators, 1 EVMOS each - for _, val := range s.validators { - coins := sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1e18))) - s.app.DistrKeeper.AllocateTokensToValidator(s.ctx, val, sdk.NewDecCoinsFromCoins(coins...)) - } + // get previous balance to compare final balance in the postCheck func + prevBalance = s.network.App.BankKeeper.GetBalance(ctx, addr.Bytes(), testconstants.ExampleAttoDenom) - bz, err := s.precompile.ClaimRewards(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate()) + bz, err := s.precompile.ClaimRewards(ctx, addr, contract, s.network.GetStateDB(), &method, tc.malleate()) if tc.expError { s.Require().ErrorContains(err, tc.errContains) @@ -447,6 +494,7 @@ func (s *PrecompileTestSuite) TestClaimRewards() { } func (s *PrecompileTestSuite) TestFundCommunityPool() { + var ctx sdk.Context method := s.precompile.Methods[distribution.FundCommunityPoolMethod] testCases := []struct { @@ -484,16 +532,18 @@ func (s *PrecompileTestSuite) TestFundCommunityPool() { "success - fund the community pool 1 EVMOS", func() []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), big.NewInt(1e18), } }, func([]byte) { - coins := s.app.DistrKeeper.GetFeePoolCommunityCoins(s.ctx) - expectedAmount := new(big.Int).Mul(big.NewInt(1e18), new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(sdk.Precision)), nil)) - s.Require().Equal(expectedAmount, coins.AmountOf(testutil.ExampleAttoDenom).BigInt()) - userBalance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), testutil.ExampleAttoDenom) - s.Require().Equal(big.NewInt(4e18), userBalance.Amount.BigInt()) + pool, err := s.network.App.DistrKeeper.FeePool.Get(ctx) + s.Require().NoError(err) + coins := pool.CommunityPool + expectedAmount := new(big.Int).Mul(big.NewInt(1e18), new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(math.LegacyPrecision)), nil)) + s.Require().Equal(expectedAmount, coins.AmountOf(testconstants.ExampleAttoDenom).BigInt()) + userBalance := s.network.App.BankKeeper.GetBalance(ctx, s.keyring.GetAddr(0).Bytes(), testconstants.ExampleAttoDenom) + s.Require().Equal(network.PrefundedAccountInitialBalance.Sub(math.NewInt(1e18)), userBalance.Amount) }, 20000, false, @@ -504,15 +554,16 @@ func (s *PrecompileTestSuite) TestFundCommunityPool() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() + ctx = s.network.GetContext() var contract *vm.Contract - contract, s.ctx = precompiletestutil.NewPrecompileContract(s.T(), s.ctx, s.address, s.precompile, tc.gas) + contract, ctx = testutil.NewPrecompileContract(s.T(), ctx, s.keyring.GetAddr(0), s.precompile, tc.gas) - // Sanity check to make sure the starting balance is always 5 EVMOS - balance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount.BigInt(), big.NewInt(5e18)) + // Sanity check to make sure the starting balance is always 100k EVMOS + balance := s.network.App.BankKeeper.GetBalance(ctx, s.keyring.GetAddr(0).Bytes(), testconstants.ExampleAttoDenom) + s.Require().Equal(balance.Amount, network.PrefundedAccountInitialBalance) - bz, err := s.precompile.FundCommunityPool(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate()) + bz, err := s.precompile.FundCommunityPool(ctx, s.keyring.GetAddr(0), contract, s.network.GetStateDB(), &method, tc.malleate()) if tc.expError { s.Require().ErrorContains(err, tc.errContains) diff --git a/precompiles/distribution/types.go b/precompiles/distribution/types.go index fd9dac96..119fcc98 100644 --- a/precompiles/distribution/types.go +++ b/precompiles/distribution/types.go @@ -93,10 +93,6 @@ func NewMsgSetWithdrawAddress(args []interface{}) (*distributiontypes.MsgSetWith WithdrawAddress: withdrawerAddress, } - if err := msg.ValidateBasic(); err != nil { - return nil, common.Address{}, err - } - return msg, delegatorAddress, nil } @@ -118,10 +114,6 @@ func NewMsgWithdrawDelegatorReward(args []interface{}) (*distributiontypes.MsgWi ValidatorAddress: validatorAddress, } - if err := msg.ValidateBasic(); err != nil { - return nil, common.Address{}, err - } - return msg, delegatorAddress, nil } @@ -137,10 +129,6 @@ func NewMsgWithdrawValidatorCommission(args []interface{}) (*distributiontypes.M ValidatorAddress: validatorAddress, } - if err := msg.ValidateBasic(); err != nil { - return nil, common.Address{}, err - } - validatorHexAddr, err := cmn.HexAddressFromBech32String(msg.ValidatorAddress) if err != nil { return nil, common.Address{}, err @@ -170,10 +158,6 @@ func NewMsgFundCommunityPool(denom string, args []interface{}) (*distributiontyp Amount: sdk.Coins{sdk.Coin{Denom: denom, Amount: math.NewIntFromBigInt(amount)}}, } - if err := msg.ValidateBasic(); err != nil { - return nil, common.Address{}, err - } - return msg, depositorAddress, nil } diff --git a/precompiles/distribution/utils_test.go b/precompiles/distribution/utils_test.go index f34084ff..69d0b152 100644 --- a/precompiles/distribution/utils_test.go +++ b/precompiles/distribution/utils_test.go @@ -1,211 +1,15 @@ package distribution_test import ( - "encoding/json" - "time" - "cosmossdk.io/math" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/crypto/tmhash" - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/baseapp" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - "github.com/cosmos/cosmos-sdk/testutil/mock" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - exampleapp "github.com/evmos/os/example_chain" - chainutil "github.com/evmos/os/example_chain/testutil" - "github.com/evmos/os/precompiles/distribution" - evmosutil "github.com/evmos/os/testutil" - evmosutiltx "github.com/evmos/os/testutil/tx" - evmostypes "github.com/evmos/os/types" - "github.com/evmos/os/x/evm/statedb" - evmtypes "github.com/evmos/os/x/evm/types" -) - -// SetupWithGenesisValSet initializes a new evmOS application with a validator set and genesis accounts -// that also act as delegators. For simplicity, each validator is bonded with a delegation -// of one consensus engine unit (10^6) in the default token of the simapp from first genesis -// account. A Nop logger is set in SimApp. -func (s *PrecompileTestSuite) SetupWithGenesisValSet(valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) { - appI, genesisState := exampleapp.SetupTestingApp(evmosutil.ExampleChainID)() - app, ok := appI.(*exampleapp.ExampleChain) - s.Require().True(ok) - - // set genesis accounts - authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) - genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis) - - validators := make([]stakingtypes.Validator, 0, len(valSet.Validators)) - delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators)) - - bondAmt := sdk.TokensFromConsensusPower(1, evmostypes.AttoPowerReduction) - - for _, val := range valSet.Validators { - pk, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) - s.Require().NoError(err) - pkAny, err := codectypes.NewAnyWithValue(pk) - s.Require().NoError(err) - validator := stakingtypes.Validator{ - OperatorAddress: sdk.ValAddress(val.Address).String(), - ConsensusPubkey: pkAny, - Jailed: false, - Status: stakingtypes.Bonded, - Tokens: bondAmt, - DelegatorShares: math.LegacyOneDec(), - Description: stakingtypes.Description{}, - UnbondingHeight: int64(0), - UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()), - MinSelfDelegation: math.ZeroInt(), - } - validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), math.LegacyOneDec())) - } - s.validators = validators - - // set validators and delegations - stakingParams := stakingtypes.DefaultParams() - // set bond demon to be aevmos - stakingParams.BondDenom = evmosutil.ExampleAttoDenom - stakingGenesis := stakingtypes.NewGenesisState(stakingParams, validators, delegations) - genesisState[stakingtypes.ModuleName] = app.AppCodec().MustMarshalJSON(stakingGenesis) - - totalBondAmt := bondAmt.Add(bondAmt) - totalSupply := sdk.NewCoins() - for _, b := range balances { - // add genesis acc tokens and delegated tokens to total supply - totalSupply = totalSupply.Add(b.Coins.Add(sdk.NewCoin(evmosutil.ExampleAttoDenom, totalBondAmt))...) - } - - // add bonded amount to bonded pool module account - balances = append(balances, banktypes.Balance{ - Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), - Coins: sdk.Coins{sdk.NewCoin(evmosutil.ExampleAttoDenom, totalBondAmt)}, - }) - - // update total supply - bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{}, []banktypes.SendEnabled{}) - genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) - - stateBytes, err := json.MarshalIndent(genesisState, "", " ") - s.Require().NoError(err) - - // init chain will set the validator set and initialize the genesis accounts - app.InitChain( - abci.RequestInitChain{ - ChainId: evmosutil.ExampleChainID, - Validators: []abci.ValidatorUpdate{}, - ConsensusParams: chainutil.DefaultConsensusParams, - AppStateBytes: stateBytes, - }, - ) - app.Commit() - - // instantiate new header - header := evmosutil.NewHeader( - 2, - time.Now().UTC(), - evmosutil.ExampleChainID, - sdk.ConsAddress(validators[0].GetOperator()), - tmhash.Sum([]byte("app")), - tmhash.Sum([]byte("validators")), - ) - - app.BeginBlock(abci.RequestBeginBlock{ - Header: header, - }) - - // create Context - s.ctx = app.BaseApp.NewContext(false, header) - s.app = app -} - -func (s *PrecompileTestSuite) DoSetupTest() { - // generate validator private/public key - privVal := mock.NewPV() - pubKey, err := privVal.GetPubKey() - s.Require().NoError(err) - - privVal2 := mock.NewPV() - pubKey2, err := privVal2.GetPubKey() - s.Require().NoError(err) - - // create validator set with two validators - validator := tmtypes.NewValidator(pubKey, 1) - validator2 := tmtypes.NewValidator(pubKey2, 2) - s.valSet = tmtypes.NewValidatorSet([]*tmtypes.Validator{validator, validator2}) - signers := make(map[string]tmtypes.PrivValidator) - signers[pubKey.Address().String()] = privVal - signers[pubKey2.Address().String()] = privVal2 - - // generate genesis account - addr, priv := evmosutiltx.NewAddrKey() - s.privKey = priv - s.address = addr - s.signer = evmosutiltx.NewSigner(priv) - - baseAcc := authtypes.NewBaseAccount(priv.PubKey().Address().Bytes(), priv.PubKey(), 0, 0) - amount := sdk.TokensFromConsensusPower(5, evmostypes.AttoPowerReduction) - - balance := banktypes.Balance{ - Address: baseAcc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, amount)), - } - - s.SetupWithGenesisValSet(s.valSet, []authtypes.GenesisAccount{baseAcc}, balance) - - // Create StateDB - s.stateDB = statedb.New(s.ctx, s.app.EVMKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(s.ctx.HeaderHash().Bytes()))) - - // bond denom - stakingParams := s.app.StakingKeeper.GetParams(s.ctx) - stakingParams.BondDenom = evmosutil.ExampleAttoDenom - s.bondDenom = stakingParams.BondDenom - err = s.app.StakingKeeper.SetParams(s.ctx, stakingParams) - s.Require().NoError(err) - - s.ethSigner = ethtypes.LatestSignerForChainID(s.app.EVMKeeper.ChainID()) - - precompile, err := distribution.NewPrecompile(s.app.DistrKeeper, *s.app.StakingKeeper, s.app.AuthzKeeper, s.app.EVMKeeper) - s.Require().NoError(err) - s.precompile = precompile - - coins := sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, math.NewInt(5_000_000_000_000_000_000))) - inflCoins := sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, math.NewInt(2_000_000_000_000_000_000))) - distrCoins := sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, math.NewInt(3_000_000_000_000_000_000))) - err = s.app.BankKeeper.MintCoins(s.ctx, minttypes.ModuleName, coins) - s.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, minttypes.ModuleName, authtypes.FeeCollectorName, inflCoins) - s.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, minttypes.ModuleName, distrtypes.ModuleName, distrCoins) - s.Require().NoError(err) - - queryHelperEvm := baseapp.NewQueryServerTestHelper(s.ctx, s.app.InterfaceRegistry()) - evmtypes.RegisterQueryServer(queryHelperEvm, s.app.EVMKeeper) - s.queryClientEVM = evmtypes.NewQueryClient(queryHelperEvm) -} - -// DeployContract deploys a contract that calls the distribution precompile's methods for testing purposes. -func (s *PrecompileTestSuite) DeployContract(contract evmtypes.CompiledContract) (addr common.Address, err error) { - addr, err = chainutil.DeployContract( - s.ctx, - s.app, - s.privKey, - s.queryClientEVM, - contract, - ) - return -} + "github.com/evmos/os/precompiles/staking" + "github.com/evmos/os/testutil/integration/os/keyring" +) type stakingRewards struct { Delegator sdk.AccAddress @@ -213,58 +17,80 @@ type stakingRewards struct { RewardAmt math.Int } +var ( + testRewardsAmt, _ = math.NewIntFromString("100000000000") + validatorCommPercentage = math.LegacyNewDecWithPrec(5, 2) // 5% commission + validatorCommAmt = math.LegacyNewDecFromInt(testRewardsAmt).Mul(validatorCommPercentage).TruncateInt() + expRewardsAmt = testRewardsAmt.Sub(validatorCommAmt) // testRewardsAmt - commission +) + // prepareStakingRewards prepares the test suite for testing delegation rewards. // // Specified rewards amount are allocated to the specified validator using the distribution keeper, // such that the given amount of tokens is outstanding as a staking reward for the account. // // The setup is done in the following way: -// - Fund the account with the given address with the given rewards amount. -// - Delegate the rewards amount to the validator specified +// - Fund distribution module to pay for rewards. // - Allocate rewards to the validator. -func (s *PrecompileTestSuite) prepareStakingRewards(stkRs ...stakingRewards) { +func (s *PrecompileTestSuite) prepareStakingRewards(ctx sdk.Context, stkRs ...stakingRewards) (sdk.Context, error) { for _, r := range stkRs { - // fund account to make delegation - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, r.Delegator, r.RewardAmt.Int64()) - s.Require().NoError(err) // set distribution module account balance which pays out the rewards - distrAcc := s.app.DistrKeeper.GetDistributionAccount(s.ctx) - err = chainutil.FundModuleAccount(s.ctx, s.app.BankKeeper, distrAcc.GetName(), sdk.NewCoins(sdk.NewCoin(s.bondDenom, r.RewardAmt))) - s.Require().NoError(err) + coins := sdk.NewCoins(sdk.NewCoin(s.bondDenom, r.RewardAmt)) + if err := s.mintCoinsForDistrMod(ctx, coins); err != nil { + return ctx, err + } - // make a delegation - _, err = s.app.StakingKeeper.Delegate(s.ctx, r.Delegator, r.RewardAmt, stakingtypes.Unspecified, r.Validator, true) - s.Require().NoError(err) + // allocate rewards to validator + allocatedRewards := sdk.NewDecCoins(sdk.NewDecCoin(s.bondDenom, r.RewardAmt)) + if err := s.network.App.DistrKeeper.AllocateTokensToValidator(ctx, r.Validator, allocatedRewards); err != nil { + return ctx, err + } + } + return ctx, nil +} - // end block to bond validator and increase block height - sdkstaking.EndBlocker(s.ctx, s.app.StakingKeeper) - // allocate rewards to validator (of these 50% will be paid out to the delegator) - allocatedRewards := sdk.NewDecCoins(sdk.NewDecCoin(s.bondDenom, r.RewardAmt.Mul(math.NewInt(2)))) - s.app.DistrKeeper.AllocateTokensToValidator(s.ctx, r.Validator, allocatedRewards) +// mintCoinsForDistrMod is a helper function to mint a specific amount of coins from the +// distribution module to pay for staking rewards. +func (s *PrecompileTestSuite) mintCoinsForDistrMod(ctx sdk.Context, amount sdk.Coins) error { + // Minting tokens for the FeeCollector to simulate fee accrued. + if err := s.network.App.BankKeeper.MintCoins( + ctx, + minttypes.ModuleName, + amount, + ); err != nil { + return err } - s.NextBlock() + + return s.network.App.BankKeeper.SendCoinsFromModuleToModule( + ctx, + minttypes.ModuleName, + distrtypes.ModuleName, + amount, + ) } -// NextBlock commits the current block and sets up the next block. -func (s *PrecompileTestSuite) NextBlock() { - var err error - s.ctx, err = chainutil.CommitAndCreateNewCtx(s.ctx, s.app, time.Second, s.valSet) - s.Require().NoError(err) +// fundAccountWithBaseDenom is a helper function to fund a given address with the chain's +// base denomination. +func (s *PrecompileTestSuite) fundAccountWithBaseDenom(ctx sdk.Context, addr sdk.AccAddress, amount math.Int) error { + coins := sdk.NewCoins(sdk.NewCoin(s.bondDenom, amount)) + if err := s.network.App.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins); err != nil { + return err + } + return s.network.App.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, coins) } -// setupValidatorSlashes sets slashes events for the provided validator -// returns the slash event set -func (s *PrecompileTestSuite) setupValidatorSlashes(valAddr sdk.ValAddress, slashesCount uint64) distrtypes.ValidatorSlashEvent { - const ( - initialHeight uint64 = 2 - initialPeriod uint64 = 1 +func (s *PrecompileTestSuite) getStakingPrecompile() (*staking.Precompile, error) { + return staking.NewPrecompile( + *s.network.App.StakingKeeper, + s.network.App.AuthzKeeper, ) +} - slashEvent := distrtypes.ValidatorSlashEvent{ValidatorPeriod: 1, Fraction: math.LegacyNewDec(5)} - - for i := uint64(0); i < slashesCount; i++ { - s.app.DistrKeeper.SetValidatorSlashEvent(s.ctx, valAddr, initialHeight+i, initialPeriod+i, slashEvent) +func generateKeys(count int) []keyring.Key { + accs := make([]keyring.Key, 0, count) + for i := 0; i < count; i++ { + acc := keyring.NewKey() + accs = append(accs, acc) } - - return slashEvent + return accs } diff --git a/precompiles/erc20/erc20.go b/precompiles/erc20/erc20.go index 6f398099..4473c1eb 100644 --- a/precompiles/erc20/erc20.go +++ b/precompiles/erc20/erc20.go @@ -7,7 +7,7 @@ import ( "embed" "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" diff --git a/precompiles/erc20/events.go b/precompiles/erc20/events.go index dd630a45..7b886bd5 100644 --- a/precompiles/erc20/events.go +++ b/precompiles/erc20/events.go @@ -52,7 +52,7 @@ func (p Precompile) EmitTransferEvent(ctx sdk.Context, stateDB vm.StateDB, from, Address: p.Address(), Topics: topics, Data: packed, - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // block height won't exceed uint64 }) return nil @@ -89,7 +89,7 @@ func (p Precompile) EmitApprovalEvent(ctx sdk.Context, stateDB vm.StateDB, owner Address: p.Address(), Topics: topics, Data: packed, - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // block height won't exceed uint64 }) return nil diff --git a/precompiles/erc20/events_test.go b/precompiles/erc20/events_test.go index f188d589..894ed630 100644 --- a/precompiles/erc20/events_test.go +++ b/precompiles/erc20/events_test.go @@ -44,7 +44,7 @@ func (s *PrecompileTestSuite) TestEmitTransferEvent() { // Check event signature matches the one emitted event := s.precompile.ABI.Events[erc20precompile.EventTypeTransfer] s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.network.GetContext().BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(s.network.GetContext().BlockHeight())) //nolint:gosec // G115 // Check the fully unpacked event matches the one emitted var transferEvent erc20precompile.EventTransfer @@ -92,7 +92,7 @@ func (s *PrecompileTestSuite) TestEmitApprovalEvent() { // Check event signature matches the one emitted event := s.precompile.ABI.Events[authorization.EventTypeApproval] s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.network.GetContext().BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(s.network.GetContext().BlockHeight())) //nolint:gosec // G115 // Check the fully unpacked event matches the one emitted var approvalEvent erc20precompile.EventApproval diff --git a/precompiles/erc20/integration_test.go b/precompiles/erc20/integration_test.go index 19431989..3ea3a192 100644 --- a/precompiles/erc20/integration_test.go +++ b/precompiles/erc20/integration_test.go @@ -3,11 +3,13 @@ package erc20_test import ( "fmt" "math/big" + "slices" "strings" "testing" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/contracts" @@ -15,12 +17,12 @@ import ( "github.com/evmos/os/precompiles/erc20" "github.com/evmos/os/precompiles/erc20/testdata" "github.com/evmos/os/precompiles/testutil" - contractutils "github.com/evmos/os/precompiles/testutil/contracts" + testconstants "github.com/evmos/os/testutil/constants" "github.com/evmos/os/testutil/integration/os/factory" "github.com/evmos/os/testutil/integration/os/grpc" "github.com/evmos/os/testutil/integration/os/keyring" "github.com/evmos/os/testutil/integration/os/network" - "github.com/evmos/os/testutil/integration/os/utils" + integrationutils "github.com/evmos/os/testutil/integration/os/utils" utiltx "github.com/evmos/os/testutil/tx" erc20types "github.com/evmos/os/x/erc20/types" "github.com/evmos/os/x/evm/core/vm" @@ -42,39 +44,39 @@ type IntegrationTestSuite struct { keyring keyring.Keyring factory factory.TxFactory - bondDenom string - tokenDenom string + bondDenom string + tokenDenom string // erc20 precompile denom with supply + tokenDenomTwo string // erc20 precompile denom with zero supply - precompile *erc20.Precompile + precompile *erc20.Precompile // erc20 precompile with supply + precompileTwo *erc20.Precompile // erc20 precompile with zero supply } func (is *IntegrationTestSuite) SetupTest() { + is.tokenDenom = "xmpl" + is.tokenDenomTwo = "xmpl2" + keys := keyring.New(2) + genesis := integrationutils.CreateGenesisWithTokenPairs(keys, is.tokenDenom, is.tokenDenomTwo) + nw := network.NewUnitTestNetwork( network.WithPreFundedAccounts(keys.GetAllAccAddrs()...), + network.WithOtherDenoms([]string{is.tokenDenom}), // add balance (supply) to is.tokenDenom + network.WithCustomGenesis(genesis), ) gh := grpc.NewIntegrationHandler(nw) tf := factory.New(nw, gh) - // Set up min deposit in Evmos - params, err := gh.GetGovParams("deposit") - Expect(err).ToNot(HaveOccurred(), "failed to get gov params") - Expect(params).ToNot(BeNil(), "returned gov params are nil") - - updatedParams := params.Params - updatedParams.MinDeposit = sdk.NewCoins(sdk.NewCoin(nw.GetDenom(), math.NewInt(1e18))) - err = nw.UpdateGovParams(*updatedParams) - Expect(err).ToNot(HaveOccurred(), "failed to update the min deposit") - is.network = nw is.factory = tf is.handler = gh is.keyring = keys is.bondDenom = nw.GetDenom() - is.tokenDenom = "xmpl" - is.precompile = is.setupERC20Precompile(is.tokenDenom) + erc20Gen := genesis[erc20types.ModuleName].(*erc20types.GenesisState) + is.precompile = is.setupERC20Precompile(is.tokenDenom, erc20Gen.TokenPairs) + is.precompileTwo = is.setupERC20Precompile(is.tokenDenomTwo, erc20Gen.TokenPairs) } func TestIntegrationSuite(t *testing.T) { @@ -86,11 +88,9 @@ func TestIntegrationSuite(t *testing.T) { } var ( - defaultCallArgs contractutils.CallArgs - wevmosAddress common.Address revertContractAddr common.Address - gasLimit uint64 - gasPrice *big.Int + gasLimit = uint64(5000000) + gasPrice = big.NewInt(800_000_000) ) var _ = Describe("ERC20 Extension -", func() { @@ -134,6 +134,26 @@ var _ = Describe("ERC20 Extension -", func() { ) Expect(err).ToNot(HaveOccurred(), "failed to deploy contract") + // commit the changes to update state (account nonce mostly) + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "failed to advance block") + + contractAddrTokenTwo, err := is.factory.DeployContract( + sender.Priv, + evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values + factory.ContractDeploymentData{ + Contract: allowanceCallerContract, + // NOTE: we're passing the precompile address to the constructor because that initiates the contract + // to make calls to the correct ERC20 precompile. + ConstructorArgs: []interface{}{is.precompileTwo.Address()}, + }, + ) + Expect(err).ToNot(HaveOccurred(), "failed to deploy contract") + + // commit the changes to update state (account nonce mostly) + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "failed to advance block") + erc20MinterBurnerAddr, err := is.factory.DeployContract( sender.Priv, evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values @@ -146,6 +166,10 @@ var _ = Describe("ERC20 Extension -", func() { ) Expect(err).ToNot(HaveOccurred(), "failed to deploy ERC20 minter burner contract") + // commit the changes to update state (account nonce mostly) + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "failed to advance block") + ERC20MinterV5Addr, err := is.factory.DeployContract( sender.Priv, evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values @@ -158,6 +182,10 @@ var _ = Describe("ERC20 Extension -", func() { ) Expect(err).ToNot(HaveOccurred(), "failed to deploy ERC20 minter contract") + // commit the changes to update state (account nonce mostly) + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "failed to advance block") + erc20MinterV5CallerAddr, err := is.factory.DeployContract( sender.Priv, evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values @@ -170,6 +198,10 @@ var _ = Describe("ERC20 Extension -", func() { ) Expect(err).ToNot(HaveOccurred(), "failed to deploy ERC20 minter caller contract") + // commit the changes to update state (account nonce mostly) + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "failed to advance block") + // Store the data of the deployed contracts contractsData = ContractsData{ ownerPriv: sender.Priv, @@ -178,10 +210,18 @@ var _ = Describe("ERC20 Extension -", func() { Address: is.precompile.Address(), ABI: is.precompile.ABI, }, + directCallToken2: { + Address: is.precompileTwo.Address(), + ABI: is.precompileTwo.ABI, + }, contractCall: { Address: contractAddr, ABI: allowanceCallerContract.ABI, }, + contractCallToken2: { + Address: contractAddrTokenTwo, + ABI: allowanceCallerContract.ABI, + }, erc20Call: { Address: erc20MinterBurnerAddr, ABI: contracts.ERC20MinterBurnerDecimalsContract.ABI, @@ -203,8 +243,8 @@ var _ = Describe("ERC20 Extension -", func() { erc20Params := is.network.App.Erc20Keeper.GetParams(is.network.GetContext()) Expect(len(erc20Params.NativePrecompiles)).To(Equal(1)) + Expect(common.HexToAddress(erc20Params.NativePrecompiles[0])).To(Equal(common.HexToAddress(testconstants.WEVMOSContractMainnet))) - wevmosAddress = common.HexToAddress(erc20Params.NativePrecompiles[0]) revertContractAddr, err = is.factory.DeployContract( sender.Priv, evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values @@ -217,16 +257,6 @@ var _ = Describe("ERC20 Extension -", func() { ) Expect(err).ToNot(HaveOccurred(), "failed to deploy reverter contract") - gasLimit = uint64(4991202) - gasPrice = big.NewInt(765625001) - defaultCallArgs = contractutils.CallArgs{ - ContractAddr: revertContractAddr, - ContractABI: revertCallerContract.ABI, - PrivKey: sender.Priv, - GasLimit: gasLimit, - GasPrice: gasPrice, - } - err = is.network.NextBlock() Expect(err).ToNot(HaveOccurred(), "failed to advance block") }) @@ -258,8 +288,8 @@ var _ = Describe("ERC20 Extension -", func() { fundCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, 300)} transferCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, 100)} - // Fund account with some tokens - is.fundWithTokens(callType, contractsData, sender.Addr, fundCoins) + senderInitialAmt := is.fundWithTokens(callType, contractsData, sender.Addr, fundCoins) + senderInitialBalance := sdk.Coins{sdk.NewCoin(is.tokenDenom, senderInitialAmt)} // Transfer tokens txArgs, transferArgs := is.getTxAndCallArgs(callType, contractsData, erc20.TransferMethod, receiver, transferCoins[0].Amount.BigInt()) @@ -269,11 +299,14 @@ var _ = Describe("ERC20 Extension -", func() { res, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, transferArgs, transferCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, erc20.TransferMethod) is.ExpectBalancesForContract( callType, contractsData, []ExpectedBalance{ - {address: sender.AccAddr, expCoins: fundCoins.Sub(transferCoins...)}, + {address: sender.AccAddr, expCoins: senderInitialBalance.Sub(transferCoins...)}, {address: receiver.Bytes(), expCoins: transferCoins}, }, ) @@ -295,8 +328,11 @@ var _ = Describe("ERC20 Extension -", func() { transferCoin := sdk.NewInt64Coin(is.tokenDenom, 100) // Fund accounts with some tokens - is.fundWithTokens(callType, contractsData, sender.Addr, fundCoinsSender) - is.fundWithTokens(callType, contractsData, receiver.Addr, fundCoinsReceiver) + receiverInitialAmt := is.fundWithTokens(callType, contractsData, receiver.Addr, fundCoinsReceiver) + receiverInitialBalance := sdk.Coins{sdk.NewCoin(is.tokenDenom, receiverInitialAmt)} + + senderInitialAmt := is.fundWithTokens(callType, contractsData, sender.Addr, fundCoinsSender) + senderInitialBalance := sdk.Coins{sdk.NewCoin(is.tokenDenom, senderInitialAmt)} // Transfer tokens txArgs, transferArgs := is.getTxAndCallArgs(callType, contractsData, erc20.TransferMethod, receiver.Addr, transferCoin.Amount.BigInt()) @@ -306,12 +342,15 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, transferArgs, transferCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, erc20.TransferMethod) is.ExpectBalancesForContract( callType, contractsData, []ExpectedBalance{ - {address: sender.AccAddr, expCoins: fundCoinsSender.Sub(transferCoin)}, - {address: receiver.AccAddr, expCoins: fundCoinsReceiver.Add(transferCoin)}, + {address: sender.AccAddr, expCoins: senderInitialBalance.Sub(transferCoin)}, + {address: receiver.AccAddr, expCoins: receiverInitialBalance.Add(transferCoin)}, }, ) }, @@ -347,10 +386,12 @@ var _ = Describe("ERC20 Extension -", func() { sender := is.keyring.GetKey(0) receiver := is.keyring.GetAddr(1) fundCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, 200)} - transferCoin := sdk.NewInt64Coin(is.tokenDenom, 300) // Fund account with some tokens - is.fundWithTokens(callType, contractsData, sender.Addr, fundCoins) + senderInitialAmt := is.fundWithTokens(callType, contractsData, sender.Addr, fundCoins) + senderInitialBalance := sdk.NewCoin(is.tokenDenom, senderInitialAmt) + + transferCoin := senderInitialBalance.Add(sdk.NewInt64Coin(is.tokenDenom, 100)) // Transfer tokens txArgs, transferArgs := is.getTxAndCallArgs(callType, contractsData, erc20.TransferMethod, receiver, transferCoin.Amount.BigInt()) @@ -373,37 +414,66 @@ var _ = Describe("ERC20 Extension -", func() { }) When("calling reverter contract", func() { Context("in a direct call to the WEVMOS contract", func() { + var ( + args factory.CallArgs + txArgs evmtypes.EvmTxArgs + ) + BeforeEach(func() { + args = factory.CallArgs{ + ContractABI: revertCallerContract.ABI, + } + + txArgs = evmtypes.EvmTxArgs{ + To: &revertContractAddr, + GasLimit: gasLimit, + GasPrice: gasPrice, + } + }) It("should transfer tokens", func() { sender := is.keyring.GetKey(0) - receiver := is.keyring.GetAddr(1) + receiver := is.keyring.GetKey(1) amountToSend := big.NewInt(100) - denomInitialBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), receiver.Bytes(), is.bondDenom) - senderInitialBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), sender.AccAddr, is.bondDenom) - - cArgs := defaultCallArgs. - WithPrivKey(sender.Priv). - WithMethodName("transferWithRevert"). - WithArgs( - receiver, - amountToSend, - false, - false, - ). - WithAmount(amountToSend) + + balRes, err := is.handler.GetBalance(receiver.AccAddr, is.bondDenom) + Expect(err).To(BeNil()) + denomInitialBalance := balRes.Balance + balRes, err = is.handler.GetBalance(sender.AccAddr, is.bondDenom) + Expect(err).To(BeNil()) + senderInitialBalance := balRes.Balance + + args.MethodName = "transferWithRevert" + args.Args = []interface{}{ + receiver.Addr, + amountToSend, + false, + false, + } + txArgs.Amount = amountToSend transferCheck := passCheck.WithExpEvents( erc20.EventTypeTransfer, ) - res, _, err := contractutils.CallContractAndCheckLogs(is.network.GetContext(), is.network.App, cArgs, transferCheck) + res, _, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, args, transferCheck) + Expect(err).To(BeNil()) + Expect(is.network.NextBlock()).To(BeNil()) + fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) + + Expect(is.network.NextBlock()).ToNot(HaveOccurred(), "failed to advance block") + + balRes, err = is.handler.GetBalance(receiver.AccAddr, is.bondDenom) Expect(err).To(BeNil()) - denomFinalBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), receiver.Bytes(), is.bondDenom) + denomFinalBalance := balRes.Balance Expect(denomFinalBalance.Amount).To(Equal(denomInitialBalance.Amount.Add(math.NewInt(amountToSend.Int64())))) - contractBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), revertContractAddr.Bytes(), is.bondDenom) + balRes, err = is.handler.GetBalance(revertContractAddr.Bytes(), is.bondDenom) + Expect(err).To(BeNil()) + contractBalance := balRes.Balance Expect(contractBalance.Amount).To(Equal(math.ZeroInt())) - senderFinalBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), sender.AccAddr, is.bondDenom) - denomSpent := math.NewInt((res.GasUsed*gasPrice.Int64() + amountToSend.Int64())) + balRes, err = is.handler.GetBalance(sender.AccAddr, is.bondDenom) + Expect(err).To(BeNil()) + senderFinalBalance := balRes.Balance + denomSpent := fees.Add(math.NewIntFromBigInt(amountToSend)) Expect(senderFinalBalance.Amount).To(Equal(senderInitialBalance.Amount.Sub(denomSpent))) }, ) @@ -411,31 +481,43 @@ var _ = Describe("ERC20 Extension -", func() { sender := is.keyring.GetKey(0) receiver := is.keyring.GetAddr(1) amountToSend := big.NewInt(100) - denomInitialBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), receiver.Bytes(), is.bondDenom) - senderInitialBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), sender.AccAddr, is.bondDenom) - - cArgs := defaultCallArgs. - WithPrivKey(sender.Priv). - WithMethodName("transferWithRevert"). - WithArgs( - receiver, - amountToSend, - before, - after, - ). - WithAmount(amountToSend) - - res, _, err := contractutils.CallContractAndCheckLogs(is.network.GetContext(), is.network.App, cArgs, execRevertedCheck) - Expect(err).NotTo(BeNil()) + balRes, err := is.handler.GetBalance(receiver.Bytes(), is.bondDenom) + Expect(err).To(BeNil()) + denomInitialBalance := balRes.Balance + balRes, err = is.handler.GetBalance(sender.AccAddr, is.bondDenom) + Expect(err).To(BeNil()) + senderInitialBalance := balRes.Balance + + args.MethodName = "transferWithRevert" + args.Args = []interface{}{ + receiver, + amountToSend, + before, + after, + } + txArgs.Amount = amountToSend + + res, _, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, args, execRevertedCheck) + Expect(err).To(BeNil()) + Expect(is.network.NextBlock()).To(BeNil()) + + fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) + // contract balance should remain unchanged - denomFinalBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), receiver.Bytes(), is.bondDenom) + balRes, err = is.handler.GetBalance(receiver.Bytes(), is.bondDenom) + Expect(err).To(BeNil()) + denomFinalBalance := balRes.Balance Expect(denomFinalBalance.Amount).To(Equal(denomInitialBalance.Amount)) - contractBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), revertContractAddr.Bytes(), is.bondDenom) + balRes, err = is.handler.GetBalance(revertContractAddr.Bytes(), is.bondDenom) + Expect(err).To(BeNil()) + contractBalance := balRes.Balance Expect(contractBalance.Amount).To(Equal(math.ZeroInt())) - senderFinalBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), sender.AccAddr, is.bondDenom) - Expect(senderFinalBalance.Amount).To(Equal(senderInitialBalance.Amount.Sub(math.NewInt((res.GasUsed * gasPrice.Int64()))))) + balRes, err = is.handler.GetBalance(sender.AccAddr, is.bondDenom) + Expect(err).To(BeNil()) + senderFinalBalance := balRes.Balance + Expect(senderFinalBalance.Amount).To(Equal(senderInitialBalance.Amount.Sub(fees))) }, Entry("revert before", true, false), Entry("revert after", false, true), @@ -444,69 +526,91 @@ var _ = Describe("ERC20 Extension -", func() { sender := is.keyring.GetKey(0) receiver := is.keyring.GetAddr(1) totalToSend := int64(350) - denomInitialBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), receiver.Bytes(), is.bondDenom) - senderInitialBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), sender.AccAddr, is.bondDenom) - - cArgs := defaultCallArgs. - WithPrivKey(sender.Priv). - WithMethodName("testTransferAndSend"). - WithArgs( - receiver, - big.NewInt(100), - big.NewInt(100), - big.NewInt(150), - false, - false, - ). - WithAmount(big.NewInt(totalToSend)) + balRes, err := is.handler.GetBalance(receiver.Bytes(), is.bondDenom) + Expect(err).To(BeNil()) + denomInitialBalance := balRes.Balance + balRes, err = is.handler.GetBalance(sender.AccAddr, is.bondDenom) + Expect(err).To(BeNil()) + senderInitialBalance := balRes.Balance + + args.MethodName = "testTransferAndSend" + args.Args = []interface{}{ + receiver, + big.NewInt(100), + big.NewInt(100), + big.NewInt(150), + false, + false, + } + txArgs.Amount = big.NewInt(totalToSend) transferCheck := passCheck.WithExpEvents( erc20.EventTypeTransfer, ) - res, _, err := contractutils.CallContractAndCheckLogs(is.network.GetContext(), is.network.App, cArgs, transferCheck) + res, _, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, args, transferCheck) Expect(err).To(BeNil()) + Expect(is.network.NextBlock()).To(BeNil()) + fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) + // contract balance should remain unchanged - denomFinalBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), receiver.Bytes(), is.bondDenom) + balRes, err = is.handler.GetBalance(receiver.Bytes(), is.bondDenom) + Expect(err).To(BeNil()) + denomFinalBalance := balRes.Balance Expect(denomFinalBalance.Amount).To(Equal(denomInitialBalance.Amount.Add(math.NewInt(totalToSend)))) - contractBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), revertContractAddr.Bytes(), is.bondDenom) + balRes, err = is.handler.GetBalance(revertContractAddr.Bytes(), is.bondDenom) + Expect(err).To(BeNil()) + contractBalance := balRes.Balance Expect(contractBalance.Amount).To(Equal(math.ZeroInt())) - senderFinalBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), sender.AccAddr, is.bondDenom) - denomSpent := math.NewInt((res.GasUsed*gasPrice.Int64() + totalToSend)) + balRes, err = is.handler.GetBalance(sender.AccAddr, is.bondDenom) + Expect(err).To(BeNil()) + senderFinalBalance := balRes.Balance + denomSpent := fees.AddRaw(totalToSend) Expect(senderFinalBalance.Amount).To(Equal(senderInitialBalance.Amount.Sub(denomSpent))) }, ) DescribeTable("it should revert token transfer and send from WEVMOS contract", func(before bool, after bool) { sender := is.keyring.GetKey(0) receiver := is.keyring.GetAddr(1) - denomInitialBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), receiver.Bytes(), is.bondDenom) - senderInitialBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), sender.AccAddr, is.bondDenom) - - cArgs := defaultCallArgs. - WithPrivKey(sender.Priv). - WithMethodName("testTransferAndSend"). - WithArgs( - receiver, - big.NewInt(100), - big.NewInt(100), - big.NewInt(100), - before, - after, - ). - WithAmount(big.NewInt(300)) - - res, _, err := contractutils.CallContractAndCheckLogs(is.network.GetContext(), is.network.App, cArgs, execRevertedCheck) - Expect(err).NotTo(BeNil()) + balRes, err := is.handler.GetBalance(receiver.Bytes(), is.bondDenom) + Expect(err).To(BeNil()) + denomInitialBalance := balRes.Balance + balRes, err = is.handler.GetBalance(sender.AccAddr, is.bondDenom) + Expect(err).To(BeNil()) + senderInitialBalance := balRes.Balance + + args.MethodName = "testTransferAndSend" + args.Args = []interface{}{ + receiver, + big.NewInt(100), + big.NewInt(100), + big.NewInt(100), + before, + after, + } + txArgs.Amount = big.NewInt(300) + + res, _, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, args, execRevertedCheck) + Expect(err).To(BeNil()) + Expect(is.network.NextBlock()).To(BeNil()) + fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) + // contract balance should remain unchanged - denomFinalBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), receiver.Bytes(), is.bondDenom) + balRes, err = is.handler.GetBalance(receiver.Bytes(), is.bondDenom) + Expect(err).To(BeNil()) + denomFinalBalance := balRes.Balance Expect(denomFinalBalance.Amount).To(Equal(denomInitialBalance.Amount)) - contractBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), revertContractAddr.Bytes(), is.bondDenom) + balRes, err = is.handler.GetBalance(revertContractAddr.Bytes(), is.bondDenom) + Expect(err).To(BeNil()) + contractBalance := balRes.Balance Expect(contractBalance.Amount).To(Equal(math.ZeroInt())) - senderFinalBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), sender.AccAddr, is.bondDenom) - Expect(senderFinalBalance.Amount).To(Equal(senderInitialBalance.Amount.Sub(math.NewInt((res.GasUsed * gasPrice.Int64()))))) + balRes, err = is.handler.GetBalance(sender.AccAddr, is.bondDenom) + Expect(err).To(BeNil()) + senderFinalBalance := balRes.Balance + Expect(senderFinalBalance.Amount).To(Equal(senderInitialBalance.Amount.Sub(fees))) }, Entry("revert before", true, false), Entry("revert after", false, true), @@ -515,32 +619,43 @@ var _ = Describe("ERC20 Extension -", func() { sender := is.keyring.GetKey(0) receiver := is.keyring.GetAddr(1) amountToSend := big.NewInt(100) - denomInitialBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), receiver.Bytes(), is.bondDenom) - senderInitialBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), sender.AccAddr, is.bondDenom) - - cArgs := defaultCallArgs. - WithPrivKey(sender.Priv). - WithMethodName("transfersWithTry"). - WithArgs( - receiver, - amountToSend, - amountToSend, - ). - WithAmount(big.NewInt(200)) + balRes, err := is.handler.GetBalance(receiver.Bytes(), is.bondDenom) + Expect(err).To(BeNil()) + denomInitialBalance := balRes.Balance + balRes, err = is.handler.GetBalance(sender.AccAddr, is.bondDenom) + Expect(err).To(BeNil()) + senderInitialBalance := balRes.Balance + + args.MethodName = "transfersWithTry" + args.Args = []interface{}{ + receiver, + amountToSend, + amountToSend, + } + txArgs.Amount = big.NewInt(200) transferCheck := passCheck.WithExpEvents( erc20.EventTypeTransfer, ) - res, _, err := contractutils.CallContractAndCheckLogs(is.network.GetContext(), is.network.App, cArgs, transferCheck) + res, _, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, args, transferCheck) + Expect(err).To(BeNil()) + Expect(is.network.NextBlock()).To(BeNil()) + fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) + + balRes, err = is.handler.GetBalance(receiver.Bytes(), is.bondDenom) Expect(err).To(BeNil()) - denomFinalBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), receiver.Bytes(), is.bondDenom) + denomFinalBalance := balRes.Balance Expect(denomFinalBalance.Amount).To(Equal(denomInitialBalance.Amount.Add(math.NewInt(amountToSend.Int64())))) - contractBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), revertContractAddr.Bytes(), is.bondDenom) + balRes, err = is.handler.GetBalance(revertContractAddr.Bytes(), is.bondDenom) + Expect(err).To(BeNil()) + contractBalance := balRes.Balance Expect(contractBalance.Amount.Int64()).To(Equal(amountToSend.Int64())) - senderFinalBalance := is.network.App.BankKeeper.GetBalance(is.network.GetContext(), sender.AccAddr, is.bondDenom) - denomSpent := math.NewInt((res.GasUsed*gasPrice.Int64() + amountToSend.Int64() + amountToSend.Int64())) + balRes, err = is.handler.GetBalance(sender.AccAddr, is.bondDenom) + Expect(err).To(BeNil()) + senderFinalBalance := balRes.Balance + denomSpent := fees.AddRaw(amountToSend.Int64() + amountToSend.Int64()) Expect(senderFinalBalance.Amount).To(Equal(senderInitialBalance.Amount.Sub(denomSpent))) }) }) @@ -557,7 +672,8 @@ var _ = Describe("ERC20 Extension -", func() { transferCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, 100)} // Fund account with some tokens - is.fundWithTokens(callType, contractsData, owner.Addr, fundCoins) + ownerInitialAmt := is.fundWithTokens(callType, contractsData, owner.Addr, fundCoins) + ownerInitialBalance := sdk.Coins{sdk.NewCoin(is.tokenDenom, ownerInitialAmt)} // Set allowance is.setupSendAuthzForContract(callType, contractsData, spender.Addr, owner.Priv, transferCoins) @@ -577,11 +693,15 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(spender.Priv, txArgs, transferArgs, transferCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit the changes to the chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, erc20.TransferFromMethod) is.ExpectBalancesForContract( callType, contractsData, []ExpectedBalance{ - {address: owner.AccAddr, expCoins: fundCoins.Sub(transferCoins...)}, + {address: owner.AccAddr, expCoins: ownerInitialBalance.Sub(transferCoins...)}, {address: receiver.Bytes(), expCoins: transferCoins}, }, ) @@ -609,7 +729,8 @@ var _ = Describe("ERC20 Extension -", func() { transferCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, 100)} // Fund account with some tokens - is.fundWithTokens(directCall, contractsData, owner.Addr, fundCoins) + ownerInitialAmt := is.fundWithTokens(directCall, contractsData, owner.Addr, fundCoins) + ownerInitialBalance := sdk.Coins{sdk.NewCoin(is.tokenDenom, ownerInitialAmt)} // Transfer tokens txArgs, transferArgs := is.getTxAndCallArgs( @@ -625,11 +746,15 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(spender.Priv, txArgs, transferArgs, transferCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, erc20.TransferMethod) is.ExpectBalancesForContract( directCall, contractsData, []ExpectedBalance{ - {address: owner.AccAddr, expCoins: fundCoins.Sub(transferCoins...)}, + {address: owner.AccAddr, expCoins: ownerInitialBalance.Sub(transferCoins...)}, {address: receiver.Bytes(), expCoins: transferCoins}, }, ) @@ -643,7 +768,8 @@ var _ = Describe("ERC20 Extension -", func() { transferCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, 100)} // Fund account with some tokens - is.fundWithTokens(callType, contractsData, owner.Addr, fundCoins) + ownerInitialAmt := is.fundWithTokens(callType, contractsData, owner.Addr, fundCoins) + ownerInitialBalance := sdk.Coins{sdk.NewCoin(is.tokenDenom, ownerInitialAmt)} // NOTE: Here we set up the allowance using the contract calls instead of the helper utils, // because the `MsgGrant` used there doesn't allow the sender to be the same as the spender, @@ -659,11 +785,18 @@ var _ = Describe("ERC20 Extension -", func() { _, _, err := is.factory.CallContractAndCheckLogs(owner.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // create new block to commit the changes in the state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectSendAuthzForContract( callType, contractsData, owner.Addr, owner.Addr, transferCoins, ) + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + // Transfer tokens txArgs, transferArgs := is.getTxAndCallArgs( callType, contractsData, @@ -679,11 +812,15 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(owner.Priv, txArgs, transferArgs, transferCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, erc20.TransferFromMethod) is.ExpectBalancesForContract( callType, contractsData, []ExpectedBalance{ - {address: owner.AccAddr, expCoins: fundCoins.Sub(transferCoins...)}, + {address: owner.AccAddr, expCoins: ownerInitialBalance.Sub(transferCoins...)}, {address: receiver.Bytes(), expCoins: transferCoins}, }, ) @@ -763,6 +900,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, transferArgs, insufficientAllowanceCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") }, Entry(" - direct call", directCall), // NOTE: we are not passing the contract call here because this test case only covers direct calls @@ -778,10 +919,11 @@ var _ = Describe("ERC20 Extension -", func() { from := is.keyring.GetKey(1) receiver := utiltx.GenerateAddress() fundCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, 200)} - transferCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, 300)} // Fund account with some tokens - is.fundWithTokens(callType, contractsData, from.Addr, fundCoins) + senderInitialAmt := is.fundWithTokens(callType, contractsData, from.Addr, fundCoins) + senderInitialBalance := sdk.Coins{sdk.NewCoin(is.tokenDenom, senderInitialAmt)} + transferCoins := senderInitialBalance.Add(sdk.NewInt64Coin(is.tokenDenom, 100)) // Set allowance is.setupSendAuthzForContract( @@ -799,6 +941,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, transferArgs, insufficientBalanceCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") }, Entry(" - direct call", directCall), // NOTE: we are not passing the contract call here because this test case only covers direct calls @@ -821,7 +967,8 @@ var _ = Describe("ERC20 Extension -", func() { spender := contractsData.GetContractData(callType).Address // Fund account with some tokens - is.fundWithTokens(callType, contractsData, owner.Addr, fundCoin) + ownerInitialAmt := is.fundWithTokens(callType, contractsData, owner.Addr, fundCoin) + ownerInitialBalance := sdk.Coins{sdk.NewCoin(is.tokenDenom, ownerInitialAmt)} // Set allowance is.setupSendAuthzForContract( @@ -844,11 +991,15 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(owner.Priv, txArgs, transferArgs, transferCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, erc20.TransferFromMethod) is.ExpectBalancesForContract( callType, contractsData, []ExpectedBalance{ - {address: owner.AccAddr, expCoins: fundCoin.Sub(transferCoins...)}, + {address: owner.AccAddr, expCoins: ownerInitialBalance.Sub(transferCoins...)}, {address: receiver.Bytes(), expCoins: transferCoins}, }, ) @@ -878,7 +1029,8 @@ var _ = Describe("ERC20 Extension -", func() { transferCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, 100)} // Fund account with some tokens - is.fundWithTokens(callType, contractsData, owner.Addr, fundCoins) + ownerInitialAmt := is.fundWithTokens(callType, contractsData, owner.Addr, fundCoins) + ownerInitialBalance := sdk.Coins{sdk.NewCoin(is.tokenDenom, ownerInitialAmt)} // Set allowance is.setupSendAuthzForContract( @@ -901,11 +1053,15 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(msgSender.Priv, txArgs, transferArgs, transferCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, erc20.TransferFromMethod) is.ExpectBalancesForContract( callType, contractsData, []ExpectedBalance{ - {address: owner.AccAddr, expCoins: fundCoins.Sub(transferCoins...)}, + {address: owner.AccAddr, expCoins: ownerInitialBalance.Sub(transferCoins...)}, {address: receiver.Bytes(), expCoins: transferCoins}, }, ) @@ -948,6 +1104,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(from.Priv, txArgs, transferArgs, execRevertedCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") }, // NOTE: we are not passing the direct call here because this test is for contract calls only Entry(" - through contract", contractCall), @@ -959,11 +1119,11 @@ var _ = Describe("ERC20 Extension -", func() { When("querying balance", func() { DescribeTable("it should return an existing balance", func(callType CallType) { sender := is.keyring.GetKey(0) - expBalance := big.NewInt(100) - fundCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, expBalance.Int64())} + addedAmt := big.NewInt(100) + fundCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, addedAmt.Int64())} // Fund account with some tokens - is.fundWithTokens(callType, contractsData, sender.Addr, fundCoins) + ownerInitialAmt := is.fundWithTokens(callType, contractsData, sender.Addr, fundCoins) // Query the balance txArgs, balancesArgs := is.getTxAndCallArgs(callType, contractsData, erc20.BalanceOfMethod, sender.Addr) @@ -974,7 +1134,7 @@ var _ = Describe("ERC20 Extension -", func() { var balance *big.Int err = is.precompile.UnpackIntoInterface(&balance, erc20.BalanceOfMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack result") - Expect(balance).To(Equal(expBalance), "expected different balance") + Expect(math.NewIntFromBigInt(balance)).To(Equal(ownerInitialAmt), "expected different balance") }, Entry(" - direct call", directCall), Entry(" - through contract", contractCall), @@ -989,8 +1149,9 @@ var _ = Describe("ERC20 Extension -", func() { fundCoins := sdk.Coins{sdk.NewInt64Coin(is.network.GetDenom(), 100)} // Fund account with some tokens - err := is.network.FundAccount(sender.AccAddr, fundCoins) + err := is.factory.FundAccount(is.keyring.GetKey(0), sender.AccAddr, fundCoins) Expect(err).ToNot(HaveOccurred(), "failed to fund account") + Expect(is.network.NextBlock()).To(BeNil()) // Query the balance txArgs, balancesArgs := is.getTxAndCallArgs(callType, contractsData, erc20.BalanceOfMethod, address) @@ -1176,6 +1337,15 @@ var _ = Describe("ERC20 Extension -", func() { // Fund account with some tokens is.fundWithTokens(callType, contractsData, sender.Addr, fundCoins) + // if is native coin, get expSupply from the bank mod + if slices.Contains(nativeCallTypes, callType) { + qc := is.network.GetBankClient() + qRes, err := qc.SupplyOf(is.network.GetContext(), &banktypes.QuerySupplyOfRequest{Denom: is.tokenDenom}) + Expect(err).To(BeNil()) + Expect(qRes).NotTo(BeNil()) + expSupply = qRes.Amount.Amount.BigInt() + } + // Query the balance txArgs, supplyArgs := is.getTxAndCallArgs(callType, contractsData, erc20.TotalSupplyMethod) @@ -1206,8 +1376,8 @@ var _ = Describe("ERC20 Extension -", func() { Expect(err).ToNot(HaveOccurred(), "failed to unpack result") Expect(supply.Int64()).To(BeZero(), "expected zero supply") }, - Entry(" - direct call", directCall), - Entry(" - through contract", contractCall), + Entry(" - direct call", directCallToken2), + Entry(" - through contract", contractCallToken2), Entry(" - through erc20 contract", erc20Call), Entry(" - through erc20 v5 contract", erc20V5Call), Entry(" - through erc20 v5 caller contract", erc20V5CallerCall), @@ -1229,6 +1399,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) is.ExpectSendAuthzForContract( callType, contractsData, @@ -1257,6 +1431,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) // Check allowance contains both spend limits is.expectSendAuthz(grantee.AccAddr, granter.AccAddr, bondCoins.Add(tokenCoins...)) @@ -1285,6 +1463,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) // Check allowance contains both spend limits is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granter.Addr, bondCoins.Add(tokenCoins...)) @@ -1312,6 +1494,11 @@ var _ = Describe("ERC20 Extension -", func() { Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) + + // commit the changes to state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + // Check allowance contains only the spend limit in network denomination is.expectSendAuthz(grantee.AccAddr, granter.AccAddr, bondCoins) }, @@ -1336,6 +1523,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) // Check allowance was deleted is.expectNoSendAuthz(grantee.AccAddr, granter.AccAddr) @@ -1358,6 +1549,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) // Check still no authorization exists is.ExpectNoSendAuthzForContract(callType, contractsData, grantee.Addr, granter.Addr) @@ -1391,6 +1586,10 @@ var _ = Describe("ERC20 Extension -", func() { Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectNoSendAuthzForContract( directCall, contractsData, grantee.Addr, granter.Addr, @@ -1414,6 +1613,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, approveArgs, approvalCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) is.ExpectSendAuthzForContract( callType, contractsData, @@ -1443,6 +1646,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, approveArgs, notFoundCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") }, Entry(" - direct call", directCall), // NOTE: we are not passing the erc20 contract call here because the ERC20 contract @@ -1468,6 +1675,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) // Check allowance is.ExpectSendAuthzForContract( @@ -1492,6 +1703,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) // Set up a second approval which should overwrite the initial one @@ -1501,6 +1716,10 @@ var _ = Describe("ERC20 Extension -", func() { Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + // Check allowance has been updated is.ExpectSendAuthzForContract( callType, contractsData, @@ -1525,6 +1744,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) // Approve allowance @@ -1532,6 +1755,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err = is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) // Check allowance was deleted from the keeper / is returning 0 for smart contracts @@ -1555,6 +1782,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) // Check still no authorization exists is.ExpectNoSendAuthzForContract(callType, contractsData, grantee.Addr, granter) @@ -1587,6 +1818,10 @@ var _ = Describe("ERC20 Extension -", func() { Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectNoSendAuthzForContract( callType, contractsData, grantee, granter, @@ -1611,6 +1846,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(sender.Priv, txArgs, approveArgs, approvalCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) is.ExpectSendAuthzForContract( callType, contractsData, @@ -1640,6 +1879,10 @@ var _ = Describe("ERC20 Extension -", func() { ) Expect(err).ToNot(HaveOccurred(), "failed to deploy contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + // NOTE: update the address but leave the ABI as it is, so that the ABI includes // the metadata methods but the contract doesn't have them. contractsData.contractData[erc20Call] = ContractData{ @@ -1687,7 +1930,6 @@ var _ = Describe("ERC20 Extension -", func() { Context("for a token with available metadata", func() { const ( - denom = "axmpl" expSymbol = "Xmpl" expDecimals = uint8(18) ) @@ -1702,17 +1944,21 @@ var _ = Describe("ERC20 Extension -", func() { expName = erc20types.CreateDenom(erc20Addr.String()) // Register ERC20 token pair for this test - tokenPair, err := utils.RegisterERC20(is.factory, is.network, utils.ERC20RegistrationData{ - Address: erc20Addr, - Denom: denom, + tokenPairs, err := integrationutils.RegisterERC20(is.factory, is.network, integrationutils.ERC20RegistrationData{ + Addresses: []string{erc20Addr.Hex()}, ProposerPriv: is.keyring.GetPrivKey(0), }) Expect(err).ToNot(HaveOccurred(), "failed to register ERC20 token") + Expect(tokenPairs).To(HaveLen(1)) // overwrite the other precompile with this one, so that the test utils like is.getTxAndCallArgs still work. - is.precompile, err = setupERC20PrecompileForTokenPair(*is.network, tokenPair) + is.precompile, err = setupNewERC20PrecompileForTokenPair(is.keyring.GetPrivKey(0), is.network, is.factory, tokenPairs[0]) Expect(err).ToNot(HaveOccurred(), "failed to set up erc20 precompile") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + // update this in the global contractsData contractsData.contractData[directCall] = ContractData{ Address: is.precompile.Address(), @@ -1732,6 +1978,10 @@ var _ = Describe("ERC20 Extension -", func() { ) Expect(err).ToNot(HaveOccurred(), "failed to deploy contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + contractsData.contractData[contractCall] = ContractData{ Address: callerAddr, ABI: allowanceCallerContract.ABI, @@ -1806,6 +2056,10 @@ var _ = Describe("ERC20 Extension -", func() { ) Expect(err).ToNot(HaveOccurred(), "failed to deploy contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + contractsData.contractData[erc20CallerCall] = ContractData{ Address: contractAddr, ABI: allowanceCallerContract.ABI, @@ -1840,6 +2094,10 @@ var _ = Describe("ERC20 Extension -", func() { Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectNoSendAuthzForContract( directCall, contractsData, grantee.Addr, granter.Addr, @@ -1863,6 +2121,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, increaseArgs, approvalCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.IncreaseAllowanceMethod) is.ExpectSendAuthzForContract( callType, contractsData, @@ -1897,6 +2159,9 @@ var _ = Describe("ERC20 Extension -", func() { directCall, contractsData, grantee.Addr, granter.Addr, ) + // commit the changes to state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") }) DescribeTable("it should decrease an existing allowance", func(callType CallType) { @@ -1922,6 +2187,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, decreaseArgs, approvalCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit the changes to state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + is.ExpectTrueToBeReturned(ethRes, auth.IncreaseAllowanceMethod) is.ExpectSendAuthzForContract( callType, contractsData, @@ -1950,6 +2219,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, decreaseArgs, notFoundCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") }, Entry(" - direct call", directCall), Entry(" - through erc20 contract", erc20Call), @@ -1972,6 +2245,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, increaseArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.ApproveMethod) is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granter.Addr, authzCoins) }, @@ -1994,6 +2271,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, increaseArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.IncreaseAllowanceMethod) is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, contractAddr, authzCoins) }, @@ -2021,6 +2302,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, increaseArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.IncreaseAllowanceMethod) is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granter.Addr, bondCoins.Add(increaseCoins...)) }, @@ -2044,6 +2329,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, decreaseArgs, notFoundCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") }, Entry(" - direct call", directCall), // NOTE: we are not passing the erc20 contract call here because the ERC20 contract @@ -2073,6 +2362,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, increaseArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.IncreaseAllowanceMethod) is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granter.Addr, authzCoins.Add(increaseCoins...)) }, @@ -2091,6 +2384,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, decreaseArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + is.ExpectTrueToBeReturned(ethRes, auth.DecreaseAllowanceMethod) is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granter.Addr, authzCoins.Sub(decreaseCoins...)) }, @@ -2106,6 +2403,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, increaseArgs, execRevertedCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") }, Entry(" - direct call", directCall), // NOTE: we are not passing the erc20 contract call here because the ERC20 contract @@ -2122,6 +2423,10 @@ var _ = Describe("ERC20 Extension -", func() { is.ExpectTrueToBeReturned(ethRes, auth.DecreaseAllowanceMethod) + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + // Check that only the spend limit in the network denomination remains bondDenom := is.network.GetDenom() expCoins := sdk.Coins{sdk.NewCoin(bondDenom, authzCoins.AmountOf(bondDenom))} @@ -2141,6 +2446,10 @@ var _ = Describe("ERC20 Extension -", func() { Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + // Check that the allowance was not changed is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granter.Addr, authzCoins) }, @@ -2172,6 +2481,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, increaseArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit the changes to state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + is.ExpectTrueToBeReturned(ethRes, auth.DecreaseAllowanceMethod) is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granter.Addr, authzCoins.Add(increaseCoins...)) }, @@ -2189,6 +2502,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, decreaseArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit the changes to state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + is.ExpectTrueToBeReturned(ethRes, auth.DecreaseAllowanceMethod) is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granter.Addr, authzCoins.Sub(decreaseCoins...)) }, @@ -2204,6 +2521,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, decreaseArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit the changes to state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + is.ExpectTrueToBeReturned(ethRes, auth.DecreaseAllowanceMethod) is.ExpectNoSendAuthzForContract(callType, contractsData, grantee.Addr, granter.Addr) }, @@ -2223,6 +2544,10 @@ var _ = Describe("ERC20 Extension -", func() { Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + // commit the changes to state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + // Check that the allowance was not changed is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granter.Addr, authzCoins) }, @@ -2240,6 +2565,9 @@ var _ = Describe("ERC20 Extension -", func() { Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + // Check that the allowance was not changed is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granter.Addr, authzCoins) }, @@ -2270,16 +2598,26 @@ var _ = Describe("ERC20 Extension -", func() { approveCheck := passCheck.WithExpEvents(auth.EventTypeApproval) _, _, err := is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + + // commit the changes to state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + is.ExpectSendAuthzForContract(contractCall, contractsData, grantee.Addr, callerContractAddr, authzCoins) // Create the authorization for the ERC20 caller contract txArgs, approveArgs = is.getTxAndCallArgs(erc20CallerCall, contractsData, auth.ApproveMethod, grantee.Addr, authzCoins[0].Amount.BigInt()) _, _, err = is.factory.CallContractAndCheckLogs(granter.Priv, txArgs, approveArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + + // commit the changes to state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + is.ExpectSendAuthzForContract(erc20CallerCall, contractsData, grantee.Addr, erc20CallerContractAddr, authzCoins) }) - DescribeTable("increasing the allowance should increase the spend limit", func(callType CallType) { + DescribeTable("increasing the allowance should increase the spend limit", func(callType CallType) { //nolint:dupl senderPriv := is.keyring.GetPrivKey(0) granterAddr := contractsData.GetContractData(callType).Address increaseCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, 100)} @@ -2289,6 +2627,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(senderPriv, txArgs, increaseArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit the changes to state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + is.ExpectTrueToBeReturned(ethRes, auth.IncreaseAllowanceMethod) is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granterAddr, authzCoins.Add(increaseCoins...)) }, @@ -2306,6 +2648,9 @@ var _ = Describe("ERC20 Extension -", func() { Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + // Check that the allowance was not changed is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granterAddr, authzCoins) }, @@ -2313,7 +2658,7 @@ var _ = Describe("ERC20 Extension -", func() { Entry(" - through erc20 caller contract", erc20CallerCall), ) - DescribeTable("decreasing the allowance should decrease the spend limit", func(callType CallType) { + DescribeTable("decreasing the allowance should decrease the spend limit", func(callType CallType) { //nolint:dupl senderPriv := is.keyring.GetPrivKey(0) granterAddr := contractsData.GetContractData(callType).Address decreaseCoins := sdk.Coins{sdk.NewInt64Coin(is.tokenDenom, 50)} @@ -2323,6 +2668,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(senderPriv, txArgs, decreaseArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit the changes to state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + is.ExpectTrueToBeReturned(ethRes, auth.DecreaseAllowanceMethod) is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granterAddr, authzCoins.Sub(decreaseCoins...)) }, @@ -2339,6 +2688,10 @@ var _ = Describe("ERC20 Extension -", func() { _, ethRes, err := is.factory.CallContractAndCheckLogs(senderPriv, txArgs, decreaseArgs, approveCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") + // commit the changes to state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + is.ExpectTrueToBeReturned(ethRes, auth.DecreaseAllowanceMethod) is.ExpectNoSendAuthzForContract(callType, contractsData, grantee.Addr, granterAddr) }, @@ -2356,6 +2709,9 @@ var _ = Describe("ERC20 Extension -", func() { Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") Expect(ethRes).To(BeNil(), "expected empty result") + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") + // Check that the allowance was not changed is.ExpectSendAuthzForContract(callType, contractsData, grantee.Addr, granterAddr, authzCoins) }, @@ -2418,9 +2774,8 @@ var _ = Describe("ERC20 Extension migration Flows -", func() { Expect(err).ToNot(HaveOccurred(), "failed to commit block") // Register the deployed erc20 contract as a token pair - _, err = utils.RegisterERC20(is.factory, is.network, utils.ERC20RegistrationData{ - Address: erc20Addr, - Denom: tokenDenom, + _, err = integrationutils.RegisterERC20(is.factory, is.network, integrationutils.ERC20RegistrationData{ + Addresses: []string{erc20Addr.Hex()}, ProposerPriv: contractOwner.Priv, }) Expect(err).ToNot(HaveOccurred(), "failed to register ERC20 token") @@ -2432,9 +2787,6 @@ var _ = Describe("ERC20 Extension migration Flows -", func() { err = is.MintERC20(erc20V5Call, contractData, contractOwner.Addr, supply.Amount.BigInt()) Expect(err).ToNot(HaveOccurred(), "failed to mint tokens") - err = is.network.NextBlock() - Expect(err).ToNot(HaveOccurred(), "failed to commit block") - // Check that the supply was minted is.ExpectBalancesForERC20(erc20V5Call, contractData, []ExpectedBalance{{ address: contractOwner.AccAddr, diff --git a/precompiles/erc20/query_test.go b/precompiles/erc20/query_test.go index 06e6d285..a8addbc1 100644 --- a/precompiles/erc20/query_test.go +++ b/precompiles/erc20/query_test.go @@ -7,14 +7,15 @@ import ( "math" "math/big" + chainutil "github.com/evmos/os/example_chain/testutil" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" "github.com/ethereum/go-ethereum/common" - exampleapp "github.com/evmos/os/example_chain" - chainutil "github.com/evmos/os/example_chain/testutil" + app "github.com/evmos/os/example_chain" auth "github.com/evmos/os/precompiles/authorization" "github.com/evmos/os/precompiles/erc20" "github.com/evmos/os/x/evm/core/vm" @@ -112,7 +113,7 @@ func (s *PrecompileTestSuite) TestNameSymbol() { testcases := []struct { name string denom string - malleate func(sdk.Context, *exampleapp.ExampleChain) + malleate func(sdk.Context, *app.ExampleChain) expPass bool errContains string expName string @@ -136,7 +137,7 @@ func (s *PrecompileTestSuite) TestNameSymbol() { { name: "fail - invalid denom (too short < 3 chars)", denom: tooShortTrace.IBCDenom(), - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain) { + malleate: func(ctx sdk.Context, app *app.ExampleChain) { app.TransferKeeper.SetDenomTrace(ctx, tooShortTrace) }, errContains: vm.ErrExecutionReverted.Error(), @@ -149,7 +150,7 @@ func (s *PrecompileTestSuite) TestNameSymbol() { { name: "pass - valid ibc denom without metadata and neither atto nor micro prefix", denom: validTraceDenomNoMicroAtto.IBCDenom(), - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain) { + malleate: func(ctx sdk.Context, app *app.ExampleChain) { app.TransferKeeper.SetDenomTrace(ctx, validTraceDenomNoMicroAtto) }, expPass: true, @@ -159,7 +160,7 @@ func (s *PrecompileTestSuite) TestNameSymbol() { { name: "pass - valid denom with metadata", denom: validMetadataDenom, - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain) { + malleate: func(ctx sdk.Context, app *app.ExampleChain) { // NOTE: we mint some coins to the inflation module address to be able to set denom metadata err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.Coins{sdk.NewInt64Coin(validMetadata.Base, 1)}) s.Require().NoError(err) @@ -174,7 +175,7 @@ func (s *PrecompileTestSuite) TestNameSymbol() { { name: "pass - valid ibc denom without metadata", denom: validTraceDenom.IBCDenom(), - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain) { + malleate: func(ctx sdk.Context, app *app.ExampleChain) { app.TransferKeeper.SetDenomTrace(ctx, validTraceDenom) }, expPass: true, @@ -230,7 +231,7 @@ func (s *PrecompileTestSuite) TestDecimals() { testcases := []struct { name string denom string - malleate func(sdk.Context, *exampleapp.ExampleChain) + malleate func(sdk.Context, *app.ExampleChain) expPass bool errContains string expDecimals uint8 @@ -258,7 +259,7 @@ func (s *PrecompileTestSuite) TestDecimals() { { name: "fail - valid ibc denom without metadata and neither atto nor micro prefix", denom: validTraceDenomNoMicroAtto.IBCDenom(), - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain) { + malleate: func(ctx sdk.Context, app *app.ExampleChain) { app.TransferKeeper.SetDenomTrace(ctx, validTraceDenomNoMicroAtto) }, errContains: vm.ErrExecutionReverted.Error(), @@ -266,7 +267,7 @@ func (s *PrecompileTestSuite) TestDecimals() { { name: "pass - invalid denom (too short < 3 chars)", denom: tooShortTrace.IBCDenom(), - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain) { + malleate: func(ctx sdk.Context, app *app.ExampleChain) { app.TransferKeeper.SetDenomTrace(ctx, tooShortTrace) }, expPass: true, // TODO: do we want to check in decimals query for the above error? @@ -275,7 +276,7 @@ func (s *PrecompileTestSuite) TestDecimals() { { name: "pass - valid denom with metadata", denom: validMetadataDenom, - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain) { + malleate: func(ctx sdk.Context, app *app.ExampleChain) { // NOTE: we mint some coins to the inflation module address to be able to set denom metadata err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.Coins{sdk.NewInt64Coin(validMetadata.Base, 1)}) s.Require().NoError(err) @@ -289,7 +290,7 @@ func (s *PrecompileTestSuite) TestDecimals() { { name: "pass - valid ibc denom without metadata", denom: validTraceDenom.IBCDenom(), - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain) { + malleate: func(ctx sdk.Context, app *app.ExampleChain) { app.TransferKeeper.SetDenomTrace(ctx, validTraceDenom) }, expPass: true, @@ -298,7 +299,7 @@ func (s *PrecompileTestSuite) TestDecimals() { { name: "pass - valid ibc denom without metadata and 18 decimals", denom: validAttoTraceDenom.IBCDenom(), - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain) { + malleate: func(ctx sdk.Context, app *app.ExampleChain) { app.TransferKeeper.SetDenomTrace(ctx, validAttoTraceDenom) }, expPass: true, @@ -307,7 +308,7 @@ func (s *PrecompileTestSuite) TestDecimals() { { name: "pass - valid denom with metadata but decimals overflow", denom: validMetadataDenom, - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain) { + malleate: func(ctx sdk.Context, app *app.ExampleChain) { // NOTE: we mint some coins to the inflation module address to be able to set denom metadata err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.Coins{sdk.NewInt64Coin(validMetadata.Base, 1)}) s.Require().NoError(err) @@ -320,7 +321,7 @@ func (s *PrecompileTestSuite) TestDecimals() { { name: "pass - valid ibc denom with metadata but no display denom", denom: validMetadataDenom, - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain) { + malleate: func(ctx sdk.Context, app *app.ExampleChain) { // NOTE: we mint some coins to the inflation module address to be able to set denom metadata err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.Coins{sdk.NewInt64Coin(validMetadata.Base, 1)}) s.Require().NoError(err) @@ -363,7 +364,7 @@ func (s *PrecompileTestSuite) TestTotalSupply() { testcases := []struct { name string - malleate func(sdk.Context, *exampleapp.ExampleChain, *big.Int) + malleate func(sdk.Context, *app.ExampleChain, *big.Int) expPass bool errContains string expTotal *big.Int @@ -375,7 +376,7 @@ func (s *PrecompileTestSuite) TestTotalSupply() { }, { name: "pass - some coins", - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain, amount *big.Int) { + malleate: func(ctx sdk.Context, app *app.ExampleChain, amount *big.Int) { // NOTE: we mint some coins to the inflation module address to be able to set denom metadata err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.Coins{sdk.NewCoin(validMetadata.Base, sdkmath.NewIntFromBigInt(amount))}) s.Require().NoError(err) @@ -416,28 +417,28 @@ func (s *PrecompileTestSuite) TestBalanceOf() { testcases := []struct { name string - malleate func(sdk.Context, *exampleapp.ExampleChain, *big.Int) []interface{} + malleate func(sdk.Context, *app.ExampleChain, *big.Int) []interface{} expPass bool errContains string expBalance *big.Int }{ { name: "fail - invalid number of arguments", - malleate: func(_ sdk.Context, _ *exampleapp.ExampleChain, _ *big.Int) []interface{} { + malleate: func(_ sdk.Context, _ *app.ExampleChain, _ *big.Int) []interface{} { return []interface{}{} }, errContains: "invalid number of arguments; expected 1; got: 0", }, { name: "fail - invalid address", - malleate: func(_ sdk.Context, _ *exampleapp.ExampleChain, _ *big.Int) []interface{} { + malleate: func(_ sdk.Context, _ *app.ExampleChain, _ *big.Int) []interface{} { return []interface{}{"invalid address"} }, errContains: "invalid account address: invalid address", }, { name: "pass - no coins in token denomination of precompile token pair", - malleate: func(_ sdk.Context, _ *exampleapp.ExampleChain, _ *big.Int) []interface{} { + malleate: func(_ sdk.Context, _ *app.ExampleChain, _ *big.Int) []interface{} { // NOTE: we fund the account with some coins in a different denomination from what was used in the precompile. err := chainutil.FundAccount( s.network.GetContext(), s.network.App.BankKeeper, s.keyring.GetAccAddr(0), sdk.NewCoins(sdk.NewInt64Coin(s.bondDenom, 100)), @@ -451,7 +452,7 @@ func (s *PrecompileTestSuite) TestBalanceOf() { }, { name: "pass - some coins", - malleate: func(ctx sdk.Context, app *exampleapp.ExampleChain, amount *big.Int) []interface{} { + malleate: func(ctx sdk.Context, app *app.ExampleChain, amount *big.Int) []interface{} { // NOTE: we fund the account with some coins of the token denomination that was used for the precompile err := chainutil.FundAccount( ctx, app.BankKeeper, s.keyring.GetAccAddr(0), sdk.NewCoins(sdk.NewCoin(s.tokenDenom, sdkmath.NewIntFromBigInt(amount))), @@ -497,35 +498,35 @@ func (s *PrecompileTestSuite) TestAllowance() { testcases := []struct { name string - malleate func(sdk.Context, *exampleapp.ExampleChain, *big.Int) []interface{} + malleate func(sdk.Context, *app.ExampleChain, *big.Int) []interface{} expPass bool errContains string expAllow *big.Int }{ { name: "fail - invalid number of arguments", - malleate: func(_ sdk.Context, _ *exampleapp.ExampleChain, _ *big.Int) []interface{} { + malleate: func(_ sdk.Context, _ *app.ExampleChain, _ *big.Int) []interface{} { return []interface{}{1} }, errContains: "invalid number of arguments; expected 2; got: 1", }, { name: "fail - invalid owner address", - malleate: func(_ sdk.Context, _ *exampleapp.ExampleChain, _ *big.Int) []interface{} { + malleate: func(_ sdk.Context, _ *app.ExampleChain, _ *big.Int) []interface{} { return []interface{}{"invalid address", s.keyring.GetAddr(1)} }, errContains: "invalid owner address: invalid address", }, { name: "fail - invalid spender address", - malleate: func(_ sdk.Context, _ *exampleapp.ExampleChain, _ *big.Int) []interface{} { + malleate: func(_ sdk.Context, _ *app.ExampleChain, _ *big.Int) []interface{} { return []interface{}{s.keyring.GetAddr(0), "invalid address"} }, errContains: "invalid spender address: invalid address", }, { name: "pass - no allowance exists should return 0", - malleate: func(_ sdk.Context, _ *exampleapp.ExampleChain, _ *big.Int) []interface{} { + malleate: func(_ sdk.Context, _ *app.ExampleChain, _ *big.Int) []interface{} { return []interface{}{s.keyring.GetAddr(0), s.keyring.GetAddr(1)} }, expPass: true, @@ -533,7 +534,7 @@ func (s *PrecompileTestSuite) TestAllowance() { }, { name: "pass - allowance exists but not for precompile token pair denom", - malleate: func(_ sdk.Context, _ *exampleapp.ExampleChain, _ *big.Int) []interface{} { + malleate: func(_ sdk.Context, _ *app.ExampleChain, _ *big.Int) []interface{} { granterIdx := 0 granteeIdx := 1 @@ -550,7 +551,7 @@ func (s *PrecompileTestSuite) TestAllowance() { }, { name: "pass - allowance exists for precompile token pair denom", - malleate: func(_ sdk.Context, _ *exampleapp.ExampleChain, amount *big.Int) []interface{} { + malleate: func(_ sdk.Context, _ *app.ExampleChain, amount *big.Int) []interface{} { granterIdx := 0 granteeIdx := 1 diff --git a/precompiles/erc20/setup_test.go b/precompiles/erc20/setup_test.go index 7b5fb8c4..3ffff577 100644 --- a/precompiles/erc20/setup_test.go +++ b/precompiles/erc20/setup_test.go @@ -45,7 +45,8 @@ func (s *PrecompileTestSuite) SetupTest() { ctx := integrationNetwork.GetContext() sk := integrationNetwork.App.StakingKeeper - bondDenom := sk.BondDenom(ctx) + bondDenom, err := sk.BondDenom(ctx) + s.Require().NoError(err) s.Require().NotEmpty(bondDenom, "bond denom cannot be empty") s.bondDenom = bondDenom diff --git a/precompiles/erc20/testdata/ERC20AllowanceCaller.json b/precompiles/erc20/testdata/ERC20AllowanceCaller.json index ea8b233e..92c1a010 100644 --- a/precompiles/erc20/testdata/ERC20AllowanceCaller.json +++ b/precompiles/erc20/testdata/ERC20AllowanceCaller.json @@ -248,8 +248,8 @@ "type": "function" } ], - "bytecode": "0x60806040523480156200001157600080fd5b50604051620011a3380380620011a38339818101604052810190620000379190620000e8565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506200011a565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000b08262000083565b9050919050565b620000c281620000a3565b8114620000ce57600080fd5b50565b600081519050620000e281620000b7565b92915050565b6000602082840312156200010157620001006200007e565b5b60006200011184828501620000d1565b91505092915050565b611079806200012a6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a08231146101a357806395d89b41146101d3578063a457c2d7146101f1578063a9059cbb14610221578063dd62ed3e14610251578063fc0c546a14610281576100b4565b806306fdde03146100b9578063095ea7b3146100d757806318160ddd1461010757806323b872dd14610125578063313ce567146101555780633950935114610173575b600080fd5b6100c161029f565b6040516100ce9190610a52565b60405180910390f35b6100f160048036038101906100ec9190610b1c565b61033a565b6040516100fe9190610b77565b60405180910390f35b61010f6103e3565b60405161011c9190610ba1565b60405180910390f35b61013f600480360381019061013a9190610bbc565b61047a565b60405161014c9190610b77565b60405180910390f35b61015d610526565b60405161016a9190610c2b565b60405180910390f35b61018d60048036038101906101889190610b1c565b6105bd565b60405161019a9190610b77565b60405180910390f35b6101bd60048036038101906101b89190610c46565b610666565b6040516101ca9190610ba1565b60405180910390f35b6101db61070a565b6040516101e89190610a52565b60405180910390f35b61020b60048036038101906102069190610b1c565b6107a5565b6040516102189190610b77565b60405180910390f35b61023b60048036038101906102369190610b1c565b61084e565b6040516102489190610b77565b60405180910390f35b61026b60048036038101906102669190610c73565b6108f7565b6040516102789190610ba1565b60405180910390f35b61028961099e565b6040516102969190610d12565b60405180910390f35b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801561030c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906103359190610e53565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b384846040518363ffffffff1660e01b8152600401610398929190610eab565b6020604051808303816000875af11580156103b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103db9190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104759190610f42565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b81526004016104da93929190610f6f565b6020604051808303816000875af11580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051d9190610f00565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610594573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b89190610fd2565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633950935184846040518363ffffffff1660e01b815260040161061b929190610eab565b6020604051808303816000875af115801561063a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065e9190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b81526004016106c29190610fff565b602060405180830381865afa1580156106df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107039190610f42565b9050919050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610777573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906107a09190610e53565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a457c2d784846040518363ffffffff1660e01b8152600401610803929190610eab565b6020604051808303816000875af1158015610822573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108469190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b81526004016108ac929190610eab565b6020604051808303816000875af11580156108cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ef9190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff1660e01b815260040161095592919061101a565b602060405180830381865afa158015610972573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109969190610f42565b905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081519050919050565b600082825260208201905092915050565b60005b838110156109fc5780820151818401526020810190506109e1565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a24826109c2565b610a2e81856109cd565b9350610a3e8185602086016109de565b610a4781610a08565b840191505092915050565b60006020820190508181036000830152610a6c8184610a19565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610ab382610a88565b9050919050565b610ac381610aa8565b8114610ace57600080fd5b50565b600081359050610ae081610aba565b92915050565b6000819050919050565b610af981610ae6565b8114610b0457600080fd5b50565b600081359050610b1681610af0565b92915050565b60008060408385031215610b3357610b32610a7e565b5b6000610b4185828601610ad1565b9250506020610b5285828601610b07565b9150509250929050565b60008115159050919050565b610b7181610b5c565b82525050565b6000602082019050610b8c6000830184610b68565b92915050565b610b9b81610ae6565b82525050565b6000602082019050610bb66000830184610b92565b92915050565b600080600060608486031215610bd557610bd4610a7e565b5b6000610be386828701610ad1565b9350506020610bf486828701610ad1565b9250506040610c0586828701610b07565b9150509250925092565b600060ff82169050919050565b610c2581610c0f565b82525050565b6000602082019050610c406000830184610c1c565b92915050565b600060208284031215610c5c57610c5b610a7e565b5b6000610c6a84828501610ad1565b91505092915050565b60008060408385031215610c8a57610c89610a7e565b5b6000610c9885828601610ad1565b9250506020610ca985828601610ad1565b9150509250929050565b6000819050919050565b6000610cd8610cd3610cce84610a88565b610cb3565b610a88565b9050919050565b6000610cea82610cbd565b9050919050565b6000610cfc82610cdf565b9050919050565b610d0c81610cf1565b82525050565b6000602082019050610d276000830184610d03565b92915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610d6f82610a08565b810181811067ffffffffffffffff82111715610d8e57610d8d610d37565b5b80604052505050565b6000610da1610a74565b9050610dad8282610d66565b919050565b600067ffffffffffffffff821115610dcd57610dcc610d37565b5b610dd682610a08565b9050602081019050919050565b6000610df6610df184610db2565b610d97565b905082815260208101848484011115610e1257610e11610d32565b5b610e1d8482856109de565b509392505050565b600082601f830112610e3a57610e39610d2d565b5b8151610e4a848260208601610de3565b91505092915050565b600060208284031215610e6957610e68610a7e565b5b600082015167ffffffffffffffff811115610e8757610e86610a83565b5b610e9384828501610e25565b91505092915050565b610ea581610aa8565b82525050565b6000604082019050610ec06000830185610e9c565b610ecd6020830184610b92565b9392505050565b610edd81610b5c565b8114610ee857600080fd5b50565b600081519050610efa81610ed4565b92915050565b600060208284031215610f1657610f15610a7e565b5b6000610f2484828501610eeb565b91505092915050565b600081519050610f3c81610af0565b92915050565b600060208284031215610f5857610f57610a7e565b5b6000610f6684828501610f2d565b91505092915050565b6000606082019050610f846000830186610e9c565b610f916020830185610e9c565b610f9e6040830184610b92565b949350505050565b610faf81610c0f565b8114610fba57600080fd5b50565b600081519050610fcc81610fa6565b92915050565b600060208284031215610fe857610fe7610a7e565b5b6000610ff684828501610fbd565b91505092915050565b60006020820190506110146000830184610e9c565b92915050565b600060408201905061102f6000830185610e9c565b61103c6020830184610e9c565b939250505056fea2646970667358221220637880a86b5674a1029aca57cde1625d2301a03c9bb21329d064a801f8d8916664736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a08231146101a357806395d89b41146101d3578063a457c2d7146101f1578063a9059cbb14610221578063dd62ed3e14610251578063fc0c546a14610281576100b4565b806306fdde03146100b9578063095ea7b3146100d757806318160ddd1461010757806323b872dd14610125578063313ce567146101555780633950935114610173575b600080fd5b6100c161029f565b6040516100ce9190610a52565b60405180910390f35b6100f160048036038101906100ec9190610b1c565b61033a565b6040516100fe9190610b77565b60405180910390f35b61010f6103e3565b60405161011c9190610ba1565b60405180910390f35b61013f600480360381019061013a9190610bbc565b61047a565b60405161014c9190610b77565b60405180910390f35b61015d610526565b60405161016a9190610c2b565b60405180910390f35b61018d60048036038101906101889190610b1c565b6105bd565b60405161019a9190610b77565b60405180910390f35b6101bd60048036038101906101b89190610c46565b610666565b6040516101ca9190610ba1565b60405180910390f35b6101db61070a565b6040516101e89190610a52565b60405180910390f35b61020b60048036038101906102069190610b1c565b6107a5565b6040516102189190610b77565b60405180910390f35b61023b60048036038101906102369190610b1c565b61084e565b6040516102489190610b77565b60405180910390f35b61026b60048036038101906102669190610c73565b6108f7565b6040516102789190610ba1565b60405180910390f35b61028961099e565b6040516102969190610d12565b60405180910390f35b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801561030c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906103359190610e53565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b384846040518363ffffffff1660e01b8152600401610398929190610eab565b6020604051808303816000875af11580156103b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103db9190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104759190610f42565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b81526004016104da93929190610f6f565b6020604051808303816000875af11580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051d9190610f00565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610594573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b89190610fd2565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633950935184846040518363ffffffff1660e01b815260040161061b929190610eab565b6020604051808303816000875af115801561063a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065e9190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b81526004016106c29190610fff565b602060405180830381865afa1580156106df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107039190610f42565b9050919050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610777573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906107a09190610e53565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a457c2d784846040518363ffffffff1660e01b8152600401610803929190610eab565b6020604051808303816000875af1158015610822573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108469190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b81526004016108ac929190610eab565b6020604051808303816000875af11580156108cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ef9190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff1660e01b815260040161095592919061101a565b602060405180830381865afa158015610972573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109969190610f42565b905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081519050919050565b600082825260208201905092915050565b60005b838110156109fc5780820151818401526020810190506109e1565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a24826109c2565b610a2e81856109cd565b9350610a3e8185602086016109de565b610a4781610a08565b840191505092915050565b60006020820190508181036000830152610a6c8184610a19565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610ab382610a88565b9050919050565b610ac381610aa8565b8114610ace57600080fd5b50565b600081359050610ae081610aba565b92915050565b6000819050919050565b610af981610ae6565b8114610b0457600080fd5b50565b600081359050610b1681610af0565b92915050565b60008060408385031215610b3357610b32610a7e565b5b6000610b4185828601610ad1565b9250506020610b5285828601610b07565b9150509250929050565b60008115159050919050565b610b7181610b5c565b82525050565b6000602082019050610b8c6000830184610b68565b92915050565b610b9b81610ae6565b82525050565b6000602082019050610bb66000830184610b92565b92915050565b600080600060608486031215610bd557610bd4610a7e565b5b6000610be386828701610ad1565b9350506020610bf486828701610ad1565b9250506040610c0586828701610b07565b9150509250925092565b600060ff82169050919050565b610c2581610c0f565b82525050565b6000602082019050610c406000830184610c1c565b92915050565b600060208284031215610c5c57610c5b610a7e565b5b6000610c6a84828501610ad1565b91505092915050565b60008060408385031215610c8a57610c89610a7e565b5b6000610c9885828601610ad1565b9250506020610ca985828601610ad1565b9150509250929050565b6000819050919050565b6000610cd8610cd3610cce84610a88565b610cb3565b610a88565b9050919050565b6000610cea82610cbd565b9050919050565b6000610cfc82610cdf565b9050919050565b610d0c81610cf1565b82525050565b6000602082019050610d276000830184610d03565b92915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610d6f82610a08565b810181811067ffffffffffffffff82111715610d8e57610d8d610d37565b5b80604052505050565b6000610da1610a74565b9050610dad8282610d66565b919050565b600067ffffffffffffffff821115610dcd57610dcc610d37565b5b610dd682610a08565b9050602081019050919050565b6000610df6610df184610db2565b610d97565b905082815260208101848484011115610e1257610e11610d32565b5b610e1d8482856109de565b509392505050565b600082601f830112610e3a57610e39610d2d565b5b8151610e4a848260208601610de3565b91505092915050565b600060208284031215610e6957610e68610a7e565b5b600082015167ffffffffffffffff811115610e8757610e86610a83565b5b610e9384828501610e25565b91505092915050565b610ea581610aa8565b82525050565b6000604082019050610ec06000830185610e9c565b610ecd6020830184610b92565b9392505050565b610edd81610b5c565b8114610ee857600080fd5b50565b600081519050610efa81610ed4565b92915050565b600060208284031215610f1657610f15610a7e565b5b6000610f2484828501610eeb565b91505092915050565b600081519050610f3c81610af0565b92915050565b600060208284031215610f5857610f57610a7e565b5b6000610f6684828501610f2d565b91505092915050565b6000606082019050610f846000830186610e9c565b610f916020830185610e9c565b610f9e6040830184610b92565b949350505050565b610faf81610c0f565b8114610fba57600080fd5b50565b600081519050610fcc81610fa6565b92915050565b600060208284031215610fe857610fe7610a7e565b5b6000610ff684828501610fbd565b91505092915050565b60006020820190506110146000830184610e9c565b92915050565b600060408201905061102f6000830185610e9c565b61103c6020830184610e9c565b939250505056fea2646970667358221220637880a86b5674a1029aca57cde1625d2301a03c9bb21329d064a801f8d8916664736f6c63430008130033", + "bytecode": "0x60806040523480156200001157600080fd5b50604051620011a3380380620011a38339818101604052810190620000379190620000e8565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506200011a565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000b08262000083565b9050919050565b620000c281620000a3565b8114620000ce57600080fd5b50565b600081519050620000e281620000b7565b92915050565b6000602082840312156200010157620001006200007e565b5b60006200011184828501620000d1565b91505092915050565b611079806200012a6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a08231146101a357806395d89b41146101d3578063a457c2d7146101f1578063a9059cbb14610221578063dd62ed3e14610251578063fc0c546a14610281576100b4565b806306fdde03146100b9578063095ea7b3146100d757806318160ddd1461010757806323b872dd14610125578063313ce567146101555780633950935114610173575b600080fd5b6100c161029f565b6040516100ce9190610a52565b60405180910390f35b6100f160048036038101906100ec9190610b1c565b61033a565b6040516100fe9190610b77565b60405180910390f35b61010f6103e3565b60405161011c9190610ba1565b60405180910390f35b61013f600480360381019061013a9190610bbc565b61047a565b60405161014c9190610b77565b60405180910390f35b61015d610526565b60405161016a9190610c2b565b60405180910390f35b61018d60048036038101906101889190610b1c565b6105bd565b60405161019a9190610b77565b60405180910390f35b6101bd60048036038101906101b89190610c46565b610666565b6040516101ca9190610ba1565b60405180910390f35b6101db61070a565b6040516101e89190610a52565b60405180910390f35b61020b60048036038101906102069190610b1c565b6107a5565b6040516102189190610b77565b60405180910390f35b61023b60048036038101906102369190610b1c565b61084e565b6040516102489190610b77565b60405180910390f35b61026b60048036038101906102669190610c73565b6108f7565b6040516102789190610ba1565b60405180910390f35b61028961099e565b6040516102969190610d12565b60405180910390f35b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801561030c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906103359190610e53565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b384846040518363ffffffff1660e01b8152600401610398929190610eab565b6020604051808303816000875af11580156103b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103db9190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104759190610f42565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b81526004016104da93929190610f6f565b6020604051808303816000875af11580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051d9190610f00565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610594573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b89190610fd2565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633950935184846040518363ffffffff1660e01b815260040161061b929190610eab565b6020604051808303816000875af115801561063a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065e9190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b81526004016106c29190610fff565b602060405180830381865afa1580156106df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107039190610f42565b9050919050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610777573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906107a09190610e53565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a457c2d784846040518363ffffffff1660e01b8152600401610803929190610eab565b6020604051808303816000875af1158015610822573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108469190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b81526004016108ac929190610eab565b6020604051808303816000875af11580156108cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ef9190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff1660e01b815260040161095592919061101a565b602060405180830381865afa158015610972573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109969190610f42565b905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081519050919050565b600082825260208201905092915050565b60005b838110156109fc5780820151818401526020810190506109e1565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a24826109c2565b610a2e81856109cd565b9350610a3e8185602086016109de565b610a4781610a08565b840191505092915050565b60006020820190508181036000830152610a6c8184610a19565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610ab382610a88565b9050919050565b610ac381610aa8565b8114610ace57600080fd5b50565b600081359050610ae081610aba565b92915050565b6000819050919050565b610af981610ae6565b8114610b0457600080fd5b50565b600081359050610b1681610af0565b92915050565b60008060408385031215610b3357610b32610a7e565b5b6000610b4185828601610ad1565b9250506020610b5285828601610b07565b9150509250929050565b60008115159050919050565b610b7181610b5c565b82525050565b6000602082019050610b8c6000830184610b68565b92915050565b610b9b81610ae6565b82525050565b6000602082019050610bb66000830184610b92565b92915050565b600080600060608486031215610bd557610bd4610a7e565b5b6000610be386828701610ad1565b9350506020610bf486828701610ad1565b9250506040610c0586828701610b07565b9150509250925092565b600060ff82169050919050565b610c2581610c0f565b82525050565b6000602082019050610c406000830184610c1c565b92915050565b600060208284031215610c5c57610c5b610a7e565b5b6000610c6a84828501610ad1565b91505092915050565b60008060408385031215610c8a57610c89610a7e565b5b6000610c9885828601610ad1565b9250506020610ca985828601610ad1565b9150509250929050565b6000819050919050565b6000610cd8610cd3610cce84610a88565b610cb3565b610a88565b9050919050565b6000610cea82610cbd565b9050919050565b6000610cfc82610cdf565b9050919050565b610d0c81610cf1565b82525050565b6000602082019050610d276000830184610d03565b92915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610d6f82610a08565b810181811067ffffffffffffffff82111715610d8e57610d8d610d37565b5b80604052505050565b6000610da1610a74565b9050610dad8282610d66565b919050565b600067ffffffffffffffff821115610dcd57610dcc610d37565b5b610dd682610a08565b9050602081019050919050565b6000610df6610df184610db2565b610d97565b905082815260208101848484011115610e1257610e11610d32565b5b610e1d8482856109de565b509392505050565b600082601f830112610e3a57610e39610d2d565b5b8151610e4a848260208601610de3565b91505092915050565b600060208284031215610e6957610e68610a7e565b5b600082015167ffffffffffffffff811115610e8757610e86610a83565b5b610e9384828501610e25565b91505092915050565b610ea581610aa8565b82525050565b6000604082019050610ec06000830185610e9c565b610ecd6020830184610b92565b9392505050565b610edd81610b5c565b8114610ee857600080fd5b50565b600081519050610efa81610ed4565b92915050565b600060208284031215610f1657610f15610a7e565b5b6000610f2484828501610eeb565b91505092915050565b600081519050610f3c81610af0565b92915050565b600060208284031215610f5857610f57610a7e565b5b6000610f6684828501610f2d565b91505092915050565b6000606082019050610f846000830186610e9c565b610f916020830185610e9c565b610f9e6040830184610b92565b949350505050565b610faf81610c0f565b8114610fba57600080fd5b50565b600081519050610fcc81610fa6565b92915050565b600060208284031215610fe857610fe7610a7e565b5b6000610ff684828501610fbd565b91505092915050565b60006020820190506110146000830184610e9c565b92915050565b600060408201905061102f6000830185610e9c565b61103c6020830184610e9c565b939250505056fea2646970667358221220910c05e182c52ca7193a9029d8b5680a7bc74b32cce495c09977813cda1b2ab364736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a08231146101a357806395d89b41146101d3578063a457c2d7146101f1578063a9059cbb14610221578063dd62ed3e14610251578063fc0c546a14610281576100b4565b806306fdde03146100b9578063095ea7b3146100d757806318160ddd1461010757806323b872dd14610125578063313ce567146101555780633950935114610173575b600080fd5b6100c161029f565b6040516100ce9190610a52565b60405180910390f35b6100f160048036038101906100ec9190610b1c565b61033a565b6040516100fe9190610b77565b60405180910390f35b61010f6103e3565b60405161011c9190610ba1565b60405180910390f35b61013f600480360381019061013a9190610bbc565b61047a565b60405161014c9190610b77565b60405180910390f35b61015d610526565b60405161016a9190610c2b565b60405180910390f35b61018d60048036038101906101889190610b1c565b6105bd565b60405161019a9190610b77565b60405180910390f35b6101bd60048036038101906101b89190610c46565b610666565b6040516101ca9190610ba1565b60405180910390f35b6101db61070a565b6040516101e89190610a52565b60405180910390f35b61020b60048036038101906102069190610b1c565b6107a5565b6040516102189190610b77565b60405180910390f35b61023b60048036038101906102369190610b1c565b61084e565b6040516102489190610b77565b60405180910390f35b61026b60048036038101906102669190610c73565b6108f7565b6040516102789190610ba1565b60405180910390f35b61028961099e565b6040516102969190610d12565b60405180910390f35b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801561030c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906103359190610e53565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b384846040518363ffffffff1660e01b8152600401610398929190610eab565b6020604051808303816000875af11580156103b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103db9190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104759190610f42565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b81526004016104da93929190610f6f565b6020604051808303816000875af11580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051d9190610f00565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610594573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b89190610fd2565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633950935184846040518363ffffffff1660e01b815260040161061b929190610eab565b6020604051808303816000875af115801561063a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065e9190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b81526004016106c29190610fff565b602060405180830381865afa1580156106df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107039190610f42565b9050919050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610777573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906107a09190610e53565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a457c2d784846040518363ffffffff1660e01b8152600401610803929190610eab565b6020604051808303816000875af1158015610822573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108469190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b81526004016108ac929190610eab565b6020604051808303816000875af11580156108cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ef9190610f00565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff1660e01b815260040161095592919061101a565b602060405180830381865afa158015610972573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109969190610f42565b905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081519050919050565b600082825260208201905092915050565b60005b838110156109fc5780820151818401526020810190506109e1565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a24826109c2565b610a2e81856109cd565b9350610a3e8185602086016109de565b610a4781610a08565b840191505092915050565b60006020820190508181036000830152610a6c8184610a19565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610ab382610a88565b9050919050565b610ac381610aa8565b8114610ace57600080fd5b50565b600081359050610ae081610aba565b92915050565b6000819050919050565b610af981610ae6565b8114610b0457600080fd5b50565b600081359050610b1681610af0565b92915050565b60008060408385031215610b3357610b32610a7e565b5b6000610b4185828601610ad1565b9250506020610b5285828601610b07565b9150509250929050565b60008115159050919050565b610b7181610b5c565b82525050565b6000602082019050610b8c6000830184610b68565b92915050565b610b9b81610ae6565b82525050565b6000602082019050610bb66000830184610b92565b92915050565b600080600060608486031215610bd557610bd4610a7e565b5b6000610be386828701610ad1565b9350506020610bf486828701610ad1565b9250506040610c0586828701610b07565b9150509250925092565b600060ff82169050919050565b610c2581610c0f565b82525050565b6000602082019050610c406000830184610c1c565b92915050565b600060208284031215610c5c57610c5b610a7e565b5b6000610c6a84828501610ad1565b91505092915050565b60008060408385031215610c8a57610c89610a7e565b5b6000610c9885828601610ad1565b9250506020610ca985828601610ad1565b9150509250929050565b6000819050919050565b6000610cd8610cd3610cce84610a88565b610cb3565b610a88565b9050919050565b6000610cea82610cbd565b9050919050565b6000610cfc82610cdf565b9050919050565b610d0c81610cf1565b82525050565b6000602082019050610d276000830184610d03565b92915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610d6f82610a08565b810181811067ffffffffffffffff82111715610d8e57610d8d610d37565b5b80604052505050565b6000610da1610a74565b9050610dad8282610d66565b919050565b600067ffffffffffffffff821115610dcd57610dcc610d37565b5b610dd682610a08565b9050602081019050919050565b6000610df6610df184610db2565b610d97565b905082815260208101848484011115610e1257610e11610d32565b5b610e1d8482856109de565b509392505050565b600082601f830112610e3a57610e39610d2d565b5b8151610e4a848260208601610de3565b91505092915050565b600060208284031215610e6957610e68610a7e565b5b600082015167ffffffffffffffff811115610e8757610e86610a83565b5b610e9384828501610e25565b91505092915050565b610ea581610aa8565b82525050565b6000604082019050610ec06000830185610e9c565b610ecd6020830184610b92565b9392505050565b610edd81610b5c565b8114610ee857600080fd5b50565b600081519050610efa81610ed4565b92915050565b600060208284031215610f1657610f15610a7e565b5b6000610f2484828501610eeb565b91505092915050565b600081519050610f3c81610af0565b92915050565b600060208284031215610f5857610f57610a7e565b5b6000610f6684828501610f2d565b91505092915050565b6000606082019050610f846000830186610e9c565b610f916020830185610e9c565b610f9e6040830184610b92565b949350505050565b610faf81610c0f565b8114610fba57600080fd5b50565b600081519050610fcc81610fa6565b92915050565b600060208284031215610fe857610fe7610a7e565b5b6000610ff684828501610fbd565b91505092915050565b60006020820190506110146000830184610e9c565b92915050565b600060408201905061102f6000830185610e9c565b61103c6020830184610e9c565b939250505056fea2646970667358221220910c05e182c52ca7193a9029d8b5680a7bc74b32cce495c09977813cda1b2ab364736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/erc20/testdata/ERC20NoMetadata.json b/precompiles/erc20/testdata/ERC20NoMetadata.json index 47171170..61e7cfa7 100644 --- a/precompiles/erc20/testdata/ERC20NoMetadata.json +++ b/precompiles/erc20/testdata/ERC20NoMetadata.json @@ -240,8 +240,8 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b50610f4f806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a082311461013b578063a457c2d71461016b578063a9059cbb1461019b578063dd62ed3e146101cb57610088565b8063095ea7b31461008d57806318160ddd146100bd57806323b872dd146100db578063395093511461010b575b600080fd5b6100a760048036038101906100a2919061096d565b6101fb565b6040516100b491906109c8565b60405180910390f35b6100c561021e565b6040516100d291906109f2565b60405180910390f35b6100f560048036038101906100f09190610a0d565b610228565b60405161010291906109c8565b60405180910390f35b6101256004803603810190610120919061096d565b610257565b60405161013291906109c8565b60405180910390f35b61015560048036038101906101509190610a60565b61028e565b60405161016291906109f2565b60405180910390f35b6101856004803603810190610180919061096d565b6102d6565b60405161019291906109c8565b60405180910390f35b6101b560048036038101906101b0919061096d565b61034d565b6040516101c291906109c8565b60405180910390f35b6101e560048036038101906101e09190610a8d565b610370565b6040516101f291906109f2565b60405180910390f35b6000806102066103f7565b90506102138185856103ff565b600191505092915050565b6000600254905090565b6000806102336103f7565b90506102408582856105c8565b61024b858585610654565b60019150509392505050565b6000806102626103f7565b90506102838185856102748589610370565b61027e9190610afc565b6103ff565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806102e16103f7565b905060006102ef8286610370565b905083811015610334576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032b90610bb3565b60405180910390fd5b61034182868684036103ff565b60019250505092915050565b6000806103586103f7565b9050610365818585610654565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361046e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161046590610c45565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036104dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d490610cd7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105bb91906109f2565b60405180910390a3505050565b60006105d48484610370565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461064e5781811015610640576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063790610d43565b60405180910390fd5b61064d84848484036103ff565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90610dd5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072990610e67565b60405180910390fd5b61073d8383836108ca565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156107c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ba90610ef9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516108b191906109f2565b60405180910390a36108c48484846108cf565b50505050565b505050565b505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610904826108d9565b9050919050565b610914816108f9565b811461091f57600080fd5b50565b6000813590506109318161090b565b92915050565b6000819050919050565b61094a81610937565b811461095557600080fd5b50565b60008135905061096781610941565b92915050565b60008060408385031215610984576109836108d4565b5b600061099285828601610922565b92505060206109a385828601610958565b9150509250929050565b60008115159050919050565b6109c2816109ad565b82525050565b60006020820190506109dd60008301846109b9565b92915050565b6109ec81610937565b82525050565b6000602082019050610a0760008301846109e3565b92915050565b600080600060608486031215610a2657610a256108d4565b5b6000610a3486828701610922565b9350506020610a4586828701610922565b9250506040610a5686828701610958565b9150509250925092565b600060208284031215610a7657610a756108d4565b5b6000610a8484828501610922565b91505092915050565b60008060408385031215610aa457610aa36108d4565b5b6000610ab285828601610922565b9250506020610ac385828601610922565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610b0782610937565b9150610b1283610937565b9250828201905080821115610b2a57610b29610acd565b5b92915050565b600082825260208201905092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610b9d602583610b30565b9150610ba882610b41565b604082019050919050565b60006020820190508181036000830152610bcc81610b90565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610c2f602483610b30565b9150610c3a82610bd3565b604082019050919050565b60006020820190508181036000830152610c5e81610c22565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610cc1602283610b30565b9150610ccc82610c65565b604082019050919050565b60006020820190508181036000830152610cf081610cb4565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000610d2d601d83610b30565b9150610d3882610cf7565b602082019050919050565b60006020820190508181036000830152610d5c81610d20565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000610dbf602583610b30565b9150610dca82610d63565b604082019050919050565b60006020820190508181036000830152610dee81610db2565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000610e51602383610b30565b9150610e5c82610df5565b604082019050919050565b60006020820190508181036000830152610e8081610e44565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000610ee3602683610b30565b9150610eee82610e87565b604082019050919050565b60006020820190508181036000830152610f1281610ed6565b905091905056fea26469706673582212201af30586fb0c9726887634543373816a162692c9d54b10d1f17ff104d3a1df5964736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a082311461013b578063a457c2d71461016b578063a9059cbb1461019b578063dd62ed3e146101cb57610088565b8063095ea7b31461008d57806318160ddd146100bd57806323b872dd146100db578063395093511461010b575b600080fd5b6100a760048036038101906100a2919061096d565b6101fb565b6040516100b491906109c8565b60405180910390f35b6100c561021e565b6040516100d291906109f2565b60405180910390f35b6100f560048036038101906100f09190610a0d565b610228565b60405161010291906109c8565b60405180910390f35b6101256004803603810190610120919061096d565b610257565b60405161013291906109c8565b60405180910390f35b61015560048036038101906101509190610a60565b61028e565b60405161016291906109f2565b60405180910390f35b6101856004803603810190610180919061096d565b6102d6565b60405161019291906109c8565b60405180910390f35b6101b560048036038101906101b0919061096d565b61034d565b6040516101c291906109c8565b60405180910390f35b6101e560048036038101906101e09190610a8d565b610370565b6040516101f291906109f2565b60405180910390f35b6000806102066103f7565b90506102138185856103ff565b600191505092915050565b6000600254905090565b6000806102336103f7565b90506102408582856105c8565b61024b858585610654565b60019150509392505050565b6000806102626103f7565b90506102838185856102748589610370565b61027e9190610afc565b6103ff565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806102e16103f7565b905060006102ef8286610370565b905083811015610334576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032b90610bb3565b60405180910390fd5b61034182868684036103ff565b60019250505092915050565b6000806103586103f7565b9050610365818585610654565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361046e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161046590610c45565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036104dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d490610cd7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105bb91906109f2565b60405180910390a3505050565b60006105d48484610370565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461064e5781811015610640576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063790610d43565b60405180910390fd5b61064d84848484036103ff565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90610dd5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072990610e67565b60405180910390fd5b61073d8383836108ca565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156107c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ba90610ef9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516108b191906109f2565b60405180910390a36108c48484846108cf565b50505050565b505050565b505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610904826108d9565b9050919050565b610914816108f9565b811461091f57600080fd5b50565b6000813590506109318161090b565b92915050565b6000819050919050565b61094a81610937565b811461095557600080fd5b50565b60008135905061096781610941565b92915050565b60008060408385031215610984576109836108d4565b5b600061099285828601610922565b92505060206109a385828601610958565b9150509250929050565b60008115159050919050565b6109c2816109ad565b82525050565b60006020820190506109dd60008301846109b9565b92915050565b6109ec81610937565b82525050565b6000602082019050610a0760008301846109e3565b92915050565b600080600060608486031215610a2657610a256108d4565b5b6000610a3486828701610922565b9350506020610a4586828701610922565b9250506040610a5686828701610958565b9150509250925092565b600060208284031215610a7657610a756108d4565b5b6000610a8484828501610922565b91505092915050565b60008060408385031215610aa457610aa36108d4565b5b6000610ab285828601610922565b9250506020610ac385828601610922565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610b0782610937565b9150610b1283610937565b9250828201905080821115610b2a57610b29610acd565b5b92915050565b600082825260208201905092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610b9d602583610b30565b9150610ba882610b41565b604082019050919050565b60006020820190508181036000830152610bcc81610b90565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610c2f602483610b30565b9150610c3a82610bd3565b604082019050919050565b60006020820190508181036000830152610c5e81610c22565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610cc1602283610b30565b9150610ccc82610c65565b604082019050919050565b60006020820190508181036000830152610cf081610cb4565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000610d2d601d83610b30565b9150610d3882610cf7565b602082019050919050565b60006020820190508181036000830152610d5c81610d20565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000610dbf602583610b30565b9150610dca82610d63565b604082019050919050565b60006020820190508181036000830152610dee81610db2565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000610e51602383610b30565b9150610e5c82610df5565b604082019050919050565b60006020820190508181036000830152610e8081610e44565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000610ee3602683610b30565b9150610eee82610e87565b604082019050919050565b60006020820190508181036000830152610f1281610ed6565b905091905056fea26469706673582212201af30586fb0c9726887634543373816a162692c9d54b10d1f17ff104d3a1df5964736f6c63430008130033", + "bytecode": "0x608060405234801561001057600080fd5b50610f4f806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a082311461013b578063a457c2d71461016b578063a9059cbb1461019b578063dd62ed3e146101cb57610088565b8063095ea7b31461008d57806318160ddd146100bd57806323b872dd146100db578063395093511461010b575b600080fd5b6100a760048036038101906100a2919061096d565b6101fb565b6040516100b491906109c8565b60405180910390f35b6100c561021e565b6040516100d291906109f2565b60405180910390f35b6100f560048036038101906100f09190610a0d565b610228565b60405161010291906109c8565b60405180910390f35b6101256004803603810190610120919061096d565b610257565b60405161013291906109c8565b60405180910390f35b61015560048036038101906101509190610a60565b61028e565b60405161016291906109f2565b60405180910390f35b6101856004803603810190610180919061096d565b6102d6565b60405161019291906109c8565b60405180910390f35b6101b560048036038101906101b0919061096d565b61034d565b6040516101c291906109c8565b60405180910390f35b6101e560048036038101906101e09190610a8d565b610370565b6040516101f291906109f2565b60405180910390f35b6000806102066103f7565b90506102138185856103ff565b600191505092915050565b6000600254905090565b6000806102336103f7565b90506102408582856105c8565b61024b858585610654565b60019150509392505050565b6000806102626103f7565b90506102838185856102748589610370565b61027e9190610afc565b6103ff565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806102e16103f7565b905060006102ef8286610370565b905083811015610334576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032b90610bb3565b60405180910390fd5b61034182868684036103ff565b60019250505092915050565b6000806103586103f7565b9050610365818585610654565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361046e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161046590610c45565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036104dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d490610cd7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105bb91906109f2565b60405180910390a3505050565b60006105d48484610370565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461064e5781811015610640576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063790610d43565b60405180910390fd5b61064d84848484036103ff565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90610dd5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072990610e67565b60405180910390fd5b61073d8383836108ca565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156107c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ba90610ef9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516108b191906109f2565b60405180910390a36108c48484846108cf565b50505050565b505050565b505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610904826108d9565b9050919050565b610914816108f9565b811461091f57600080fd5b50565b6000813590506109318161090b565b92915050565b6000819050919050565b61094a81610937565b811461095557600080fd5b50565b60008135905061096781610941565b92915050565b60008060408385031215610984576109836108d4565b5b600061099285828601610922565b92505060206109a385828601610958565b9150509250929050565b60008115159050919050565b6109c2816109ad565b82525050565b60006020820190506109dd60008301846109b9565b92915050565b6109ec81610937565b82525050565b6000602082019050610a0760008301846109e3565b92915050565b600080600060608486031215610a2657610a256108d4565b5b6000610a3486828701610922565b9350506020610a4586828701610922565b9250506040610a5686828701610958565b9150509250925092565b600060208284031215610a7657610a756108d4565b5b6000610a8484828501610922565b91505092915050565b60008060408385031215610aa457610aa36108d4565b5b6000610ab285828601610922565b9250506020610ac385828601610922565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610b0782610937565b9150610b1283610937565b9250828201905080821115610b2a57610b29610acd565b5b92915050565b600082825260208201905092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610b9d602583610b30565b9150610ba882610b41565b604082019050919050565b60006020820190508181036000830152610bcc81610b90565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610c2f602483610b30565b9150610c3a82610bd3565b604082019050919050565b60006020820190508181036000830152610c5e81610c22565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610cc1602283610b30565b9150610ccc82610c65565b604082019050919050565b60006020820190508181036000830152610cf081610cb4565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000610d2d601d83610b30565b9150610d3882610cf7565b602082019050919050565b60006020820190508181036000830152610d5c81610d20565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000610dbf602583610b30565b9150610dca82610d63565b604082019050919050565b60006020820190508181036000830152610dee81610db2565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000610e51602383610b30565b9150610e5c82610df5565b604082019050919050565b60006020820190508181036000830152610e8081610e44565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000610ee3602683610b30565b9150610eee82610e87565b604082019050919050565b60006020820190508181036000830152610f1281610ed6565b905091905056fea2646970667358221220aae0a88d58f3c2d7e55cff5f86a81b379a6ac4de9798e49af61f856ea7e5b04664736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a082311461013b578063a457c2d71461016b578063a9059cbb1461019b578063dd62ed3e146101cb57610088565b8063095ea7b31461008d57806318160ddd146100bd57806323b872dd146100db578063395093511461010b575b600080fd5b6100a760048036038101906100a2919061096d565b6101fb565b6040516100b491906109c8565b60405180910390f35b6100c561021e565b6040516100d291906109f2565b60405180910390f35b6100f560048036038101906100f09190610a0d565b610228565b60405161010291906109c8565b60405180910390f35b6101256004803603810190610120919061096d565b610257565b60405161013291906109c8565b60405180910390f35b61015560048036038101906101509190610a60565b61028e565b60405161016291906109f2565b60405180910390f35b6101856004803603810190610180919061096d565b6102d6565b60405161019291906109c8565b60405180910390f35b6101b560048036038101906101b0919061096d565b61034d565b6040516101c291906109c8565b60405180910390f35b6101e560048036038101906101e09190610a8d565b610370565b6040516101f291906109f2565b60405180910390f35b6000806102066103f7565b90506102138185856103ff565b600191505092915050565b6000600254905090565b6000806102336103f7565b90506102408582856105c8565b61024b858585610654565b60019150509392505050565b6000806102626103f7565b90506102838185856102748589610370565b61027e9190610afc565b6103ff565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806102e16103f7565b905060006102ef8286610370565b905083811015610334576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032b90610bb3565b60405180910390fd5b61034182868684036103ff565b60019250505092915050565b6000806103586103f7565b9050610365818585610654565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361046e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161046590610c45565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036104dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d490610cd7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105bb91906109f2565b60405180910390a3505050565b60006105d48484610370565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461064e5781811015610640576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063790610d43565b60405180910390fd5b61064d84848484036103ff565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90610dd5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072990610e67565b60405180910390fd5b61073d8383836108ca565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156107c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ba90610ef9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516108b191906109f2565b60405180910390a36108c48484846108cf565b50505050565b505050565b505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610904826108d9565b9050919050565b610914816108f9565b811461091f57600080fd5b50565b6000813590506109318161090b565b92915050565b6000819050919050565b61094a81610937565b811461095557600080fd5b50565b60008135905061096781610941565b92915050565b60008060408385031215610984576109836108d4565b5b600061099285828601610922565b92505060206109a385828601610958565b9150509250929050565b60008115159050919050565b6109c2816109ad565b82525050565b60006020820190506109dd60008301846109b9565b92915050565b6109ec81610937565b82525050565b6000602082019050610a0760008301846109e3565b92915050565b600080600060608486031215610a2657610a256108d4565b5b6000610a3486828701610922565b9350506020610a4586828701610922565b9250506040610a5686828701610958565b9150509250925092565b600060208284031215610a7657610a756108d4565b5b6000610a8484828501610922565b91505092915050565b60008060408385031215610aa457610aa36108d4565b5b6000610ab285828601610922565b9250506020610ac385828601610922565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610b0782610937565b9150610b1283610937565b9250828201905080821115610b2a57610b29610acd565b5b92915050565b600082825260208201905092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610b9d602583610b30565b9150610ba882610b41565b604082019050919050565b60006020820190508181036000830152610bcc81610b90565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610c2f602483610b30565b9150610c3a82610bd3565b604082019050919050565b60006020820190508181036000830152610c5e81610c22565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610cc1602283610b30565b9150610ccc82610c65565b604082019050919050565b60006020820190508181036000830152610cf081610cb4565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000610d2d601d83610b30565b9150610d3882610cf7565b602082019050919050565b60006020820190508181036000830152610d5c81610d20565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000610dbf602583610b30565b9150610dca82610d63565b604082019050919050565b60006020820190508181036000830152610dee81610db2565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000610e51602383610b30565b9150610e5c82610df5565b604082019050919050565b60006020820190508181036000830152610e8081610e44565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000610ee3602683610b30565b9150610eee82610e87565b604082019050919050565b60006020820190508181036000830152610f1281610ed6565b905091905056fea2646970667358221220aae0a88d58f3c2d7e55cff5f86a81b379a6ac4de9798e49af61f856ea7e5b04664736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/erc20/testdata/ERC20TestCaller.json b/precompiles/erc20/testdata/ERC20TestCaller.json index 8d916470..114ed59f 100644 --- a/precompiles/erc20/testdata/ERC20TestCaller.json +++ b/precompiles/erc20/testdata/ERC20TestCaller.json @@ -122,7 +122,7 @@ "inputs": [ { "internalType": "address payable", - "name": "_source", + "name": "receiver", "type": "address" }, { @@ -142,8 +142,8 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b50604051610f46380380610f46833981810160405281019061003291906100e3565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600060018190555050610110565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100b082610085565b9050919050565b6100c0816100a5565b81146100cb57600080fd5b50565b6000815190506100dd816100b7565b92915050565b6000602082840312156100f9576100f8610080565b5b6000610107848285016100ce565b91505092915050565b610e278061011f6000396000f3fe60806040526004361061004a5760003560e01c8063268d070a1461004f57806361bc221a1461006b5780636bc7b7cd14610096578063d0fedf55146100c6578063fc0c546a146100f6575b600080fd5b610069600480360381019061006491906107fc565b610121565b005b34801561007757600080fd5b506100806102bd565b60405161008d919061085e565b60405180910390f35b6100b060048036038101906100ab91906108b1565b6102c3565b6040516100bd919061094d565b60405180910390f35b6100e060048036038101906100db91906109a6565b6105ce565b6040516100ed919061094d565b60405180910390f35b34801561010257600080fd5b5061010b61073f565b6040516101189190610a6c565b60405180910390f35b6001600081548092919061013490610ab6565b919050555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b8152600401610197929190610b1f565b6020604051808303816000875af11580156101b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101da9190610b5d565b90508061021c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161021390610be7565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff1663d0fedf5585846001806040518563ffffffff1660e01b815260040161025c9493929190610c07565b6020604051808303816000875af192505050801561029857506040513d601f19601f820116820180604052508101906102959190610b5d565b60015b1561029f57505b600160008154809291906102b290610ab6565b919050555050505050565b60015481565b6000808773ffffffffffffffffffffffffffffffffffffffff16866040516102ea90610c7d565b60006040518083038185875af1925050503d8060008114610327576040519150601f19603f3d011682016040523d82523d6000602084013e61032c565b606091505b5050905080610370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036790610d04565b60405180910390fd5b83156103d0576001600081548092919061038990610ab6565b919050555060006103cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c690610d70565b60405180910390fd5b5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8a8a6040518363ffffffff1660e01b815260040161042e929190610b1f565b6020604051808303816000875af115801561044d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104719190610b5d565b9050806104b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104aa90610d04565b60405180910390fd5b831561051357600160008154809291906104cc90610ab6565b91905055506000610512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050990610d70565b60405180910390fd5b5b8873ffffffffffffffffffffffffffffffffffffffff168660405161053790610c7d565b60006040518083038185875af1925050503d8060008114610574576040519150601f19603f3d011682016040523d82523d6000602084013e610579565b606091505b505080925050816105bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b690610d04565b60405180910390fd5b81925050509695505050505050565b6000600160008154809291906105e390610ab6565b919050555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb87876040518363ffffffff1660e01b8152600401610646929190610d9f565b6020604051808303816000875af1158015610665573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106899190610b5d565b905083156106d35760006106d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c990610d70565b60405180910390fd5b5b600160008154809291906106e690610dc8565b91905055508215610733576000610732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072990610d70565b60405180910390fd5b5b80915050949350505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061079382610768565b9050919050565b6107a381610788565b81146107ae57600080fd5b50565b6000813590506107c08161079a565b92915050565b6000819050919050565b6107d9816107c6565b81146107e457600080fd5b50565b6000813590506107f6816107d0565b92915050565b60008060006060848603121561081557610814610763565b5b6000610823868287016107b1565b9350506020610834868287016107e7565b9250506040610845868287016107e7565b9150509250925092565b610858816107c6565b82525050565b6000602082019050610873600083018461084f565b92915050565b60008115159050919050565b61088e81610879565b811461089957600080fd5b50565b6000813590506108ab81610885565b92915050565b60008060008060008060c087890312156108ce576108cd610763565b5b60006108dc89828a016107b1565b96505060206108ed89828a016107e7565b95505060406108fe89828a016107e7565b945050606061090f89828a016107e7565b935050608061092089828a0161089c565b92505060a061093189828a0161089c565b9150509295509295509295565b61094781610879565b82525050565b6000602082019050610962600083018461093e565b92915050565b600061097382610768565b9050919050565b61098381610968565b811461098e57600080fd5b50565b6000813590506109a08161097a565b92915050565b600080600080608085870312156109c0576109bf610763565b5b60006109ce87828801610991565b94505060206109df878288016107e7565b93505060406109f08782880161089c565b9250506060610a018782880161089c565b91505092959194509250565b6000819050919050565b6000610a32610a2d610a2884610768565b610a0d565b610768565b9050919050565b6000610a4482610a17565b9050919050565b6000610a5682610a39565b9050919050565b610a6681610a4b565b82525050565b6000602082019050610a816000830184610a5d565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610ac1826107c6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610af357610af2610a87565b5b600182019050919050565b6000610b0982610a39565b9050919050565b610b1981610afe565b82525050565b6000604082019050610b346000830185610b10565b610b41602083018461084f565b9392505050565b600081519050610b5781610885565b92915050565b600060208284031215610b7357610b72610763565b5b6000610b8184828501610b48565b91505092915050565b600082825260208201905092915050565b7f6661696c20746f207472616e7366657200000000000000000000000000000000600082015250565b6000610bd1601083610b8a565b9150610bdc82610b9b565b602082019050919050565b60006020820190508181036000830152610c0081610bc4565b9050919050565b6000608082019050610c1c6000830187610b10565b610c29602083018661084f565b610c36604083018561093e565b610c43606083018461093e565b95945050505050565b600081905092915050565b50565b6000610c67600083610c4c565b9150610c7282610c57565b600082019050919050565b6000610c8882610c5a565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000610cee602183610b8a565b9150610cf982610c92565b604082019050919050565b60006020820190508181036000830152610d1d81610ce1565b9050919050565b7f7265766572742068657265000000000000000000000000000000000000000000600082015250565b6000610d5a600b83610b8a565b9150610d6582610d24565b602082019050919050565b60006020820190508181036000830152610d8981610d4d565b9050919050565b610d9981610968565b82525050565b6000604082019050610db46000830185610d90565b610dc1602083018461084f565b9392505050565b6000610dd3826107c6565b915060008203610de657610de5610a87565b5b60018203905091905056fea2646970667358221220585fa7c4d4a54121bbfa7152809da68f2c4de484e09def8d1501a0fb7048e3f064736f6c63430008130033", - "deployedBytecode": "0x60806040526004361061004a5760003560e01c8063268d070a1461004f57806361bc221a1461006b5780636bc7b7cd14610096578063d0fedf55146100c6578063fc0c546a146100f6575b600080fd5b610069600480360381019061006491906107fc565b610121565b005b34801561007757600080fd5b506100806102bd565b60405161008d919061085e565b60405180910390f35b6100b060048036038101906100ab91906108b1565b6102c3565b6040516100bd919061094d565b60405180910390f35b6100e060048036038101906100db91906109a6565b6105ce565b6040516100ed919061094d565b60405180910390f35b34801561010257600080fd5b5061010b61073f565b6040516101189190610a6c565b60405180910390f35b6001600081548092919061013490610ab6565b919050555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b8152600401610197929190610b1f565b6020604051808303816000875af11580156101b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101da9190610b5d565b90508061021c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161021390610be7565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff1663d0fedf5585846001806040518563ffffffff1660e01b815260040161025c9493929190610c07565b6020604051808303816000875af192505050801561029857506040513d601f19601f820116820180604052508101906102959190610b5d565b60015b1561029f57505b600160008154809291906102b290610ab6565b919050555050505050565b60015481565b6000808773ffffffffffffffffffffffffffffffffffffffff16866040516102ea90610c7d565b60006040518083038185875af1925050503d8060008114610327576040519150601f19603f3d011682016040523d82523d6000602084013e61032c565b606091505b5050905080610370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036790610d04565b60405180910390fd5b83156103d0576001600081548092919061038990610ab6565b919050555060006103cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c690610d70565b60405180910390fd5b5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8a8a6040518363ffffffff1660e01b815260040161042e929190610b1f565b6020604051808303816000875af115801561044d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104719190610b5d565b9050806104b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104aa90610d04565b60405180910390fd5b831561051357600160008154809291906104cc90610ab6565b91905055506000610512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050990610d70565b60405180910390fd5b5b8873ffffffffffffffffffffffffffffffffffffffff168660405161053790610c7d565b60006040518083038185875af1925050503d8060008114610574576040519150601f19603f3d011682016040523d82523d6000602084013e610579565b606091505b505080925050816105bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b690610d04565b60405180910390fd5b81925050509695505050505050565b6000600160008154809291906105e390610ab6565b919050555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb87876040518363ffffffff1660e01b8152600401610646929190610d9f565b6020604051808303816000875af1158015610665573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106899190610b5d565b905083156106d35760006106d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c990610d70565b60405180910390fd5b5b600160008154809291906106e690610dc8565b91905055508215610733576000610732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072990610d70565b60405180910390fd5b5b80915050949350505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061079382610768565b9050919050565b6107a381610788565b81146107ae57600080fd5b50565b6000813590506107c08161079a565b92915050565b6000819050919050565b6107d9816107c6565b81146107e457600080fd5b50565b6000813590506107f6816107d0565b92915050565b60008060006060848603121561081557610814610763565b5b6000610823868287016107b1565b9350506020610834868287016107e7565b9250506040610845868287016107e7565b9150509250925092565b610858816107c6565b82525050565b6000602082019050610873600083018461084f565b92915050565b60008115159050919050565b61088e81610879565b811461089957600080fd5b50565b6000813590506108ab81610885565b92915050565b60008060008060008060c087890312156108ce576108cd610763565b5b60006108dc89828a016107b1565b96505060206108ed89828a016107e7565b95505060406108fe89828a016107e7565b945050606061090f89828a016107e7565b935050608061092089828a0161089c565b92505060a061093189828a0161089c565b9150509295509295509295565b61094781610879565b82525050565b6000602082019050610962600083018461093e565b92915050565b600061097382610768565b9050919050565b61098381610968565b811461098e57600080fd5b50565b6000813590506109a08161097a565b92915050565b600080600080608085870312156109c0576109bf610763565b5b60006109ce87828801610991565b94505060206109df878288016107e7565b93505060406109f08782880161089c565b9250506060610a018782880161089c565b91505092959194509250565b6000819050919050565b6000610a32610a2d610a2884610768565b610a0d565b610768565b9050919050565b6000610a4482610a17565b9050919050565b6000610a5682610a39565b9050919050565b610a6681610a4b565b82525050565b6000602082019050610a816000830184610a5d565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610ac1826107c6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610af357610af2610a87565b5b600182019050919050565b6000610b0982610a39565b9050919050565b610b1981610afe565b82525050565b6000604082019050610b346000830185610b10565b610b41602083018461084f565b9392505050565b600081519050610b5781610885565b92915050565b600060208284031215610b7357610b72610763565b5b6000610b8184828501610b48565b91505092915050565b600082825260208201905092915050565b7f6661696c20746f207472616e7366657200000000000000000000000000000000600082015250565b6000610bd1601083610b8a565b9150610bdc82610b9b565b602082019050919050565b60006020820190508181036000830152610c0081610bc4565b9050919050565b6000608082019050610c1c6000830187610b10565b610c29602083018661084f565b610c36604083018561093e565b610c43606083018461093e565b95945050505050565b600081905092915050565b50565b6000610c67600083610c4c565b9150610c7282610c57565b600082019050919050565b6000610c8882610c5a565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000610cee602183610b8a565b9150610cf982610c92565b604082019050919050565b60006020820190508181036000830152610d1d81610ce1565b9050919050565b7f7265766572742068657265000000000000000000000000000000000000000000600082015250565b6000610d5a600b83610b8a565b9150610d6582610d24565b602082019050919050565b60006020820190508181036000830152610d8981610d4d565b9050919050565b610d9981610968565b82525050565b6000604082019050610db46000830185610d90565b610dc1602083018461084f565b9392505050565b6000610dd3826107c6565b915060008203610de657610de5610a87565b5b60018203905091905056fea2646970667358221220585fa7c4d4a54121bbfa7152809da68f2c4de484e09def8d1501a0fb7048e3f064736f6c63430008130033", + "bytecode": "0x608060405234801561001057600080fd5b50604051610f46380380610f46833981810160405281019061003291906100e3565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600060018190555050610110565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100b082610085565b9050919050565b6100c0816100a5565b81146100cb57600080fd5b50565b6000815190506100dd816100b7565b92915050565b6000602082840312156100f9576100f8610080565b5b6000610107848285016100ce565b91505092915050565b610e278061011f6000396000f3fe60806040526004361061004a5760003560e01c8063268d070a1461004f57806361bc221a1461006b5780636bc7b7cd14610096578063d0fedf55146100c6578063fc0c546a146100f6575b600080fd5b610069600480360381019061006491906107fc565b610121565b005b34801561007757600080fd5b506100806102bd565b60405161008d919061085e565b60405180910390f35b6100b060048036038101906100ab91906108b1565b6102c3565b6040516100bd919061094d565b60405180910390f35b6100e060048036038101906100db91906109a6565b6105ce565b6040516100ed919061094d565b60405180910390f35b34801561010257600080fd5b5061010b61073f565b6040516101189190610a6c565b60405180910390f35b6001600081548092919061013490610ab6565b919050555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b8152600401610197929190610b1f565b6020604051808303816000875af11580156101b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101da9190610b5d565b90508061021c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161021390610be7565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff1663d0fedf5585846001806040518563ffffffff1660e01b815260040161025c9493929190610c07565b6020604051808303816000875af192505050801561029857506040513d601f19601f820116820180604052508101906102959190610b5d565b60015b1561029f57505b600160008154809291906102b290610ab6565b919050555050505050565b60015481565b6000808773ffffffffffffffffffffffffffffffffffffffff16866040516102ea90610c7d565b60006040518083038185875af1925050503d8060008114610327576040519150601f19603f3d011682016040523d82523d6000602084013e61032c565b606091505b5050905080610370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036790610d04565b60405180910390fd5b83156103d0576001600081548092919061038990610ab6565b919050555060006103cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c690610d70565b60405180910390fd5b5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8a8a6040518363ffffffff1660e01b815260040161042e929190610b1f565b6020604051808303816000875af115801561044d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104719190610b5d565b9050806104b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104aa90610d04565b60405180910390fd5b831561051357600160008154809291906104cc90610ab6565b91905055506000610512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050990610d70565b60405180910390fd5b5b8873ffffffffffffffffffffffffffffffffffffffff168660405161053790610c7d565b60006040518083038185875af1925050503d8060008114610574576040519150601f19603f3d011682016040523d82523d6000602084013e610579565b606091505b505080925050816105bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b690610d04565b60405180910390fd5b81925050509695505050505050565b6000600160008154809291906105e390610ab6565b919050555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb87876040518363ffffffff1660e01b8152600401610646929190610d9f565b6020604051808303816000875af1158015610665573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106899190610b5d565b905083156106d35760006106d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c990610d70565b60405180910390fd5b5b600160008154809291906106e690610dc8565b91905055508215610733576000610732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072990610d70565b60405180910390fd5b5b80915050949350505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061079382610768565b9050919050565b6107a381610788565b81146107ae57600080fd5b50565b6000813590506107c08161079a565b92915050565b6000819050919050565b6107d9816107c6565b81146107e457600080fd5b50565b6000813590506107f6816107d0565b92915050565b60008060006060848603121561081557610814610763565b5b6000610823868287016107b1565b9350506020610834868287016107e7565b9250506040610845868287016107e7565b9150509250925092565b610858816107c6565b82525050565b6000602082019050610873600083018461084f565b92915050565b60008115159050919050565b61088e81610879565b811461089957600080fd5b50565b6000813590506108ab81610885565b92915050565b60008060008060008060c087890312156108ce576108cd610763565b5b60006108dc89828a016107b1565b96505060206108ed89828a016107e7565b95505060406108fe89828a016107e7565b945050606061090f89828a016107e7565b935050608061092089828a0161089c565b92505060a061093189828a0161089c565b9150509295509295509295565b61094781610879565b82525050565b6000602082019050610962600083018461093e565b92915050565b600061097382610768565b9050919050565b61098381610968565b811461098e57600080fd5b50565b6000813590506109a08161097a565b92915050565b600080600080608085870312156109c0576109bf610763565b5b60006109ce87828801610991565b94505060206109df878288016107e7565b93505060406109f08782880161089c565b9250506060610a018782880161089c565b91505092959194509250565b6000819050919050565b6000610a32610a2d610a2884610768565b610a0d565b610768565b9050919050565b6000610a4482610a17565b9050919050565b6000610a5682610a39565b9050919050565b610a6681610a4b565b82525050565b6000602082019050610a816000830184610a5d565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610ac1826107c6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610af357610af2610a87565b5b600182019050919050565b6000610b0982610a39565b9050919050565b610b1981610afe565b82525050565b6000604082019050610b346000830185610b10565b610b41602083018461084f565b9392505050565b600081519050610b5781610885565b92915050565b600060208284031215610b7357610b72610763565b5b6000610b8184828501610b48565b91505092915050565b600082825260208201905092915050565b7f6661696c20746f207472616e7366657200000000000000000000000000000000600082015250565b6000610bd1601083610b8a565b9150610bdc82610b9b565b602082019050919050565b60006020820190508181036000830152610c0081610bc4565b9050919050565b6000608082019050610c1c6000830187610b10565b610c29602083018661084f565b610c36604083018561093e565b610c43606083018461093e565b95945050505050565b600081905092915050565b50565b6000610c67600083610c4c565b9150610c7282610c57565b600082019050919050565b6000610c8882610c5a565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000610cee602183610b8a565b9150610cf982610c92565b604082019050919050565b60006020820190508181036000830152610d1d81610ce1565b9050919050565b7f7265766572742068657265000000000000000000000000000000000000000000600082015250565b6000610d5a600b83610b8a565b9150610d6582610d24565b602082019050919050565b60006020820190508181036000830152610d8981610d4d565b9050919050565b610d9981610968565b82525050565b6000604082019050610db46000830185610d90565b610dc1602083018461084f565b9392505050565b6000610dd3826107c6565b915060008203610de657610de5610a87565b5b60018203905091905056fea2646970667358221220717498b1523771461ba761fe74a71d2d7a1cf8d21d4ce4049f6cb9fe6f3e88b064736f6c63430008140033", + "deployedBytecode": "0x60806040526004361061004a5760003560e01c8063268d070a1461004f57806361bc221a1461006b5780636bc7b7cd14610096578063d0fedf55146100c6578063fc0c546a146100f6575b600080fd5b610069600480360381019061006491906107fc565b610121565b005b34801561007757600080fd5b506100806102bd565b60405161008d919061085e565b60405180910390f35b6100b060048036038101906100ab91906108b1565b6102c3565b6040516100bd919061094d565b60405180910390f35b6100e060048036038101906100db91906109a6565b6105ce565b6040516100ed919061094d565b60405180910390f35b34801561010257600080fd5b5061010b61073f565b6040516101189190610a6c565b60405180910390f35b6001600081548092919061013490610ab6565b919050555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b8152600401610197929190610b1f565b6020604051808303816000875af11580156101b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101da9190610b5d565b90508061021c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161021390610be7565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff1663d0fedf5585846001806040518563ffffffff1660e01b815260040161025c9493929190610c07565b6020604051808303816000875af192505050801561029857506040513d601f19601f820116820180604052508101906102959190610b5d565b60015b1561029f57505b600160008154809291906102b290610ab6565b919050555050505050565b60015481565b6000808773ffffffffffffffffffffffffffffffffffffffff16866040516102ea90610c7d565b60006040518083038185875af1925050503d8060008114610327576040519150601f19603f3d011682016040523d82523d6000602084013e61032c565b606091505b5050905080610370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036790610d04565b60405180910390fd5b83156103d0576001600081548092919061038990610ab6565b919050555060006103cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c690610d70565b60405180910390fd5b5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8a8a6040518363ffffffff1660e01b815260040161042e929190610b1f565b6020604051808303816000875af115801561044d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104719190610b5d565b9050806104b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104aa90610d04565b60405180910390fd5b831561051357600160008154809291906104cc90610ab6565b91905055506000610512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050990610d70565b60405180910390fd5b5b8873ffffffffffffffffffffffffffffffffffffffff168660405161053790610c7d565b60006040518083038185875af1925050503d8060008114610574576040519150601f19603f3d011682016040523d82523d6000602084013e610579565b606091505b505080925050816105bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b690610d04565b60405180910390fd5b81925050509695505050505050565b6000600160008154809291906105e390610ab6565b919050555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb87876040518363ffffffff1660e01b8152600401610646929190610d9f565b6020604051808303816000875af1158015610665573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106899190610b5d565b905083156106d35760006106d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c990610d70565b60405180910390fd5b5b600160008154809291906106e690610dc8565b91905055508215610733576000610732576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072990610d70565b60405180910390fd5b5b80915050949350505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061079382610768565b9050919050565b6107a381610788565b81146107ae57600080fd5b50565b6000813590506107c08161079a565b92915050565b6000819050919050565b6107d9816107c6565b81146107e457600080fd5b50565b6000813590506107f6816107d0565b92915050565b60008060006060848603121561081557610814610763565b5b6000610823868287016107b1565b9350506020610834868287016107e7565b9250506040610845868287016107e7565b9150509250925092565b610858816107c6565b82525050565b6000602082019050610873600083018461084f565b92915050565b60008115159050919050565b61088e81610879565b811461089957600080fd5b50565b6000813590506108ab81610885565b92915050565b60008060008060008060c087890312156108ce576108cd610763565b5b60006108dc89828a016107b1565b96505060206108ed89828a016107e7565b95505060406108fe89828a016107e7565b945050606061090f89828a016107e7565b935050608061092089828a0161089c565b92505060a061093189828a0161089c565b9150509295509295509295565b61094781610879565b82525050565b6000602082019050610962600083018461093e565b92915050565b600061097382610768565b9050919050565b61098381610968565b811461098e57600080fd5b50565b6000813590506109a08161097a565b92915050565b600080600080608085870312156109c0576109bf610763565b5b60006109ce87828801610991565b94505060206109df878288016107e7565b93505060406109f08782880161089c565b9250506060610a018782880161089c565b91505092959194509250565b6000819050919050565b6000610a32610a2d610a2884610768565b610a0d565b610768565b9050919050565b6000610a4482610a17565b9050919050565b6000610a5682610a39565b9050919050565b610a6681610a4b565b82525050565b6000602082019050610a816000830184610a5d565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610ac1826107c6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610af357610af2610a87565b5b600182019050919050565b6000610b0982610a39565b9050919050565b610b1981610afe565b82525050565b6000604082019050610b346000830185610b10565b610b41602083018461084f565b9392505050565b600081519050610b5781610885565b92915050565b600060208284031215610b7357610b72610763565b5b6000610b8184828501610b48565b91505092915050565b600082825260208201905092915050565b7f6661696c20746f207472616e7366657200000000000000000000000000000000600082015250565b6000610bd1601083610b8a565b9150610bdc82610b9b565b602082019050919050565b60006020820190508181036000830152610c0081610bc4565b9050919050565b6000608082019050610c1c6000830187610b10565b610c29602083018661084f565b610c36604083018561093e565b610c43606083018461093e565b95945050505050565b600081905092915050565b50565b6000610c67600083610c4c565b9150610c7282610c57565b600082019050919050565b6000610c8882610c5a565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000610cee602183610b8a565b9150610cf982610c92565b604082019050919050565b60006020820190508181036000830152610d1d81610ce1565b9050919050565b7f7265766572742068657265000000000000000000000000000000000000000000600082015250565b6000610d5a600b83610b8a565b9150610d6582610d24565b602082019050919050565b60006020820190508181036000830152610d8981610d4d565b9050919050565b610d9981610968565b82525050565b6000604082019050610db46000830185610d90565b610dc1602083018461084f565b9392505050565b6000610dd3826107c6565b915060008203610de657610de5610a87565b5b60018203905091905056fea2646970667358221220717498b1523771461ba761fe74a71d2d7a1cf8d21d4ce4049f6cb9fe6f3e88b064736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/erc20/tx.go b/precompiles/erc20/tx.go index b639d447..893e2857 100644 --- a/precompiles/erc20/tx.go +++ b/precompiles/erc20/tx.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package erc20 import ( @@ -80,7 +81,7 @@ func (p *Precompile) transfer( msg := banktypes.NewMsgSend(from.Bytes(), to.Bytes(), coins) - if err = msg.ValidateBasic(); err != nil { + if err = msg.Amount.Validate(); err != nil { return nil, err } @@ -93,7 +94,7 @@ func (p *Precompile) transfer( var prevAllowance *big.Int if ownerIsSpender { msgSrv := bankkeeper.NewMsgServerImpl(p.bankKeeper) - _, err = msgSrv.Send(sdk.WrapSDKContext(ctx), msg) + _, err = msgSrv.Send(ctx, msg) } else { _, _, prevAllowance, err = GetAuthzExpirationAndAllowance(p.AuthzKeeper, ctx, spenderAddr, from, p.tokenPair.Denom) if err != nil { @@ -109,7 +110,7 @@ func (p *Precompile) transfer( return nil, err } - // TODO: is this the correct denom? It was hardcoded to utils.BaseDenom before.. + // TODO: is this the correct denom? It was hardcoded to testconstants.ExampleAttoDenom before.. // evmDenom := p.evmKeeper.GetParams(ctx).EvmDenom // TODO: when using the Evm denomiation here there is an import cycle - how to handle this, we should get the EVM denom here evmDenom := chainconfig.BaseDenom diff --git a/precompiles/erc20/tx_test.go b/precompiles/erc20/tx_test.go index 74960319..afeea19f 100644 --- a/precompiles/erc20/tx_test.go +++ b/precompiles/erc20/tx_test.go @@ -12,6 +12,7 @@ import ( utiltx "github.com/evmos/os/testutil/tx" erc20types "github.com/evmos/os/x/erc20/types" "github.com/evmos/os/x/evm/core/vm" + "github.com/evmos/os/x/evm/statedb" ) var ( @@ -40,7 +41,7 @@ func (s *PrecompileTestSuite) TestTransfer() { }, func() {}, true, - "-1xmpl: invalid coins", + "coin -1xmpl amount is not positive", }, { "fail - invalid to address", @@ -111,6 +112,10 @@ func (s *PrecompileTestSuite) TestTransfer() { } func (s *PrecompileTestSuite) TestTransferFrom() { + var ( + ctx sdk.Context + stDB *statedb.StateDB + ) method := s.precompile.Methods[erc20.TransferFromMethod] // owner of the tokens owner := s.keyring.GetKey(0) @@ -131,7 +136,7 @@ func (s *PrecompileTestSuite) TestTransferFrom() { }, func() {}, true, - "-1xmpl: invalid coins", + "coin -1xmpl amount is not positive", }, { "fail - invalid from address", @@ -174,7 +179,7 @@ func (s *PrecompileTestSuite) TestTransferFrom() { func() []interface{} { expiration := time.Now().Add(time.Hour) err := s.network.App.AuthzKeeper.SaveGrant( - s.network.GetContext(), + ctx, spender.AccAddr, owner.AccAddr, &banktypes.SendAuthorization{SpendLimit: sdk.Coins{sdk.Coin{Denom: s.tokenDenom, Amount: math.NewInt(5e18)}}}, @@ -193,7 +198,7 @@ func (s *PrecompileTestSuite) TestTransferFrom() { func() []interface{} { expiration := time.Now().Add(time.Hour) err := s.network.App.AuthzKeeper.SaveGrant( - s.network.GetContext(), + ctx, spender.AccAddr, owner.AccAddr, &banktypes.SendAuthorization{SpendLimit: sdk.Coins{sdk.Coin{Denom: tokenDenom, Amount: math.NewInt(300)}}}, @@ -204,7 +209,7 @@ func (s *PrecompileTestSuite) TestTransferFrom() { return []interface{}{owner.Addr, toAddr, big.NewInt(100)} }, func() { - toAddrBalance := s.network.App.BankKeeper.GetBalance(s.network.GetContext(), toAddr.Bytes(), tokenDenom) + toAddrBalance := s.network.App.BankKeeper.GetBalance(ctx, toAddr.Bytes(), tokenDenom) s.Require().Equal(big.NewInt(100), toAddrBalance.Amount.BigInt(), "expected toAddr to have 100 XMPL") }, false, @@ -214,16 +219,16 @@ func (s *PrecompileTestSuite) TestTransferFrom() { "pass - spend on behalf of own account", func() []interface{} { // Mint some coins to the module account and then send to the spender address - err := s.network.App.BankKeeper.MintCoins(s.network.GetContext(), erc20types.ModuleName, XMPLCoin) + err := s.network.App.BankKeeper.MintCoins(ctx, erc20types.ModuleName, XMPLCoin) s.Require().NoError(err, "failed to mint coins") - err = s.network.App.BankKeeper.SendCoinsFromModuleToAccount(s.network.GetContext(), erc20types.ModuleName, spender.AccAddr, XMPLCoin) + err = s.network.App.BankKeeper.SendCoinsFromModuleToAccount(ctx, erc20types.ModuleName, spender.AccAddr, XMPLCoin) s.Require().NoError(err, "failed to send coins from module to account") // NOTE: no authorization is necessary to spend on behalf of the same account return []interface{}{spender.Addr, toAddr, big.NewInt(100)} }, func() { - toAddrBalance := s.network.App.BankKeeper.GetBalance(s.network.GetContext(), toAddr.Bytes(), tokenDenom) + toAddrBalance := s.network.App.BankKeeper.GetBalance(ctx, toAddr.Bytes(), tokenDenom) s.Require().Equal(big.NewInt(100), toAddrBalance.Amount.BigInt(), "expected toAddr to have 100 XMPL") }, false, @@ -235,18 +240,19 @@ func (s *PrecompileTestSuite) TestTransferFrom() { tc := tc s.Run(tc.name, func() { s.SetupTest() - stateDB := s.network.GetStateDB() + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() var contract *vm.Contract - contract, ctx := testutil.NewPrecompileContract(s.T(), s.network.GetContext(), spender.Addr, s.precompile, 0) + contract, ctx = testutil.NewPrecompileContract(s.T(), ctx, spender.Addr, s.precompile, 0) // Mint some coins to the module account and then send to the from address - err := s.network.App.BankKeeper.MintCoins(s.network.GetContext(), erc20types.ModuleName, XMPLCoin) + err := s.network.App.BankKeeper.MintCoins(ctx, erc20types.ModuleName, XMPLCoin) s.Require().NoError(err, "failed to mint coins") - err = s.network.App.BankKeeper.SendCoinsFromModuleToAccount(s.network.GetContext(), erc20types.ModuleName, owner.AccAddr, XMPLCoin) + err = s.network.App.BankKeeper.SendCoinsFromModuleToAccount(ctx, erc20types.ModuleName, owner.AccAddr, XMPLCoin) s.Require().NoError(err, "failed to send coins from module to account") - _, err = s.precompile.TransferFrom(ctx, contract, stateDB, &method, tc.malleate()) + _, err = s.precompile.TransferFrom(ctx, contract, stDB, &method, tc.malleate()) if tc.expErr { s.Require().Error(err, "expected transfer transaction to fail") s.Require().Contains(err.Error(), tc.errContains, "expected transfer transaction to fail with specific error") diff --git a/precompiles/erc20/utils_test.go b/precompiles/erc20/utils_test.go index 4413c2bc..0d673072 100644 --- a/precompiles/erc20/utils_test.go +++ b/precompiles/erc20/utils_test.go @@ -7,6 +7,7 @@ import ( "time" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" @@ -20,6 +21,7 @@ import ( commonnetwork "github.com/evmos/os/testutil/integration/common/network" "github.com/evmos/os/testutil/integration/os/factory" network "github.com/evmos/os/testutil/integration/os/network" + testutils "github.com/evmos/os/testutil/integration/os/utils" utiltx "github.com/evmos/os/testutil/tx" erc20types "github.com/evmos/os/x/erc20/types" evmtypes "github.com/evmos/os/x/evm/types" @@ -56,11 +58,15 @@ func (is *IntegrationTestSuite) setupSendAuthz( amount, ) Expect(err).ToNot(HaveOccurred(), "failed to set up send authorization") + + // commit changes to chain state + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") } func setupSendAuthz( network commonnetwork.Network, - factory commonfactory.TxFactory, + factory commonfactory.BaseTxFactory, grantee sdk.AccAddress, granterPriv cryptotypes.PrivKey, amount sdk.Coins, @@ -114,6 +120,10 @@ func (is *IntegrationTestSuite) setupSendAuthzForContract( default: panic("unknown contract call type") } + + // commit changes to the chain state + err := is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error while calling NextBlock") } // setupSendAuthzForERC20 is a helper function to set up a SendAuthorization for @@ -221,13 +231,22 @@ func (s *PrecompileTestSuite) setupERC20Precompile(denom string) *erc20.Precompi // setupERC20Precompile is a helper function to set up an instance of the ERC20 precompile for // a given token denomination, set the token pair in the ERC20 keeper and adds the precompile // to the available and active precompiles. -// -// TODO: refactor -func (is *IntegrationTestSuite) setupERC20Precompile(denom string) *erc20.Precompile { - tokenPair := erc20types.NewTokenPair(utiltx.GenerateAddress(), denom, erc20types.OWNER_MODULE) - is.network.App.Erc20Keeper.SetToken(is.network.GetContext(), tokenPair) +func (is *IntegrationTestSuite) setupERC20Precompile(denom string, tokenPairs []erc20types.TokenPair) *erc20.Precompile { + var tokenPair erc20types.TokenPair + for _, tp := range tokenPairs { + if tp.Denom != denom { + continue + } + tokenPair = tp + } - precompile, err := setupERC20PrecompileForTokenPair(*is.network, tokenPair) + precompile, err := erc20.NewPrecompile( + tokenPair, + is.network.App.BankKeeper, + is.network.App.AuthzKeeper, + is.network.App.TransferKeeper, + is.network.App.EVMKeeper, + ) Expect(err).ToNot(HaveOccurred(), "failed to set up %q erc20 precompile", tokenPair.Denom) return precompile @@ -235,6 +254,7 @@ func (is *IntegrationTestSuite) setupERC20Precompile(denom string) *erc20.Precom // setupERC20PrecompileForTokenPair is a helper function to set up an instance of the ERC20 precompile for // a given token pair and adds the precompile to the available and active precompiles. +// Do not use this function for integration tests. func setupERC20PrecompileForTokenPair( unitNetwork network.UnitTestNetwork, tokenPair erc20types.TokenPair, ) (*erc20.Precompile, error) { @@ -243,7 +263,7 @@ func setupERC20PrecompileForTokenPair( unitNetwork.App.BankKeeper, unitNetwork.App.AuthzKeeper, unitNetwork.App.TransferKeeper, - unitNetwork.App.EVMKeeper, + is.network.App.EVMKeeper, ) if err != nil { return nil, errorsmod.Wrapf(err, "failed to create %q erc20 precompile", tokenPair.Denom) @@ -260,13 +280,55 @@ func setupERC20PrecompileForTokenPair( return precompile, nil } +// setupNewERC20PrecompileForTokenPair is a helper function to set up an instance of the ERC20 precompile for +// a given token pair and adds the precompile to the available and active precompiles. +// This function should be used for integration tests +func setupNewERC20PrecompileForTokenPair( + privKey cryptotypes.PrivKey, + unitNetwork *network.UnitTestNetwork, + tf factory.TxFactory, tokenPair erc20types.TokenPair, +) (*erc20.Precompile, error) { + precompile, err := erc20.NewPrecompile( + tokenPair, + unitNetwork.App.BankKeeper, + unitNetwork.App.AuthzKeeper, + unitNetwork.App.TransferKeeper, + is.network.App.EVMKeeper, + ) + if err != nil { + return nil, errorsmod.Wrapf(err, "failed to create %q erc20 precompile", tokenPair.Denom) + } + + // Update the params via gov proposal + params := unitNetwork.App.Erc20Keeper.GetParams(unitNetwork.GetContext()) + params.DynamicPrecompiles = append(params.DynamicPrecompiles, precompile.Address().Hex()) + slices.Sort(params.DynamicPrecompiles) + + if err := params.Validate(); err != nil { + return nil, err + } + + if err := testutils.UpdateERC20Params(testutils.UpdateParamsInput{ + Pk: privKey, + Tf: tf, + Network: unitNetwork, + Params: params, + }); err != nil { + return nil, errorsmod.Wrapf(err, "failed to add %q erc20 precompile to EVM extensions", tokenPair.Denom) + } + + return precompile, nil +} + // CallType indicates which type of contract call is made during the integration tests. type CallType int // callType constants to differentiate between direct calls and calls through a contract. const ( directCall CallType = iota + 1 + directCallToken2 contractCall + contractCallToken2 erc20Call erc20CallerCall erc20V5Call @@ -274,7 +336,7 @@ const ( ) var ( - nativeCallTypes = []CallType{directCall, contractCall} + nativeCallTypes = []CallType{directCall, directCallToken2, contractCall, contractCallToken2} erc20CallTypes = []CallType{erc20Call, erc20CallerCall, erc20V5Call, erc20V5CallerCall} ) @@ -291,7 +353,8 @@ func (is *IntegrationTestSuite) getTxAndCallArgs( cd := contractData.GetContractData(callType) txArgs := evmtypes.EvmTxArgs{ - To: &cd.Address, + To: &cd.Address, + GasPrice: gasPrice, } callArgs := factory.CallArgs{ @@ -315,7 +378,7 @@ func (is *IntegrationTestSuite) ExpectBalances(expBalances []ExpectedBalance) { for _, expCoin := range expBalance.expCoins { coinBalance, err := is.handler.GetBalance(expBalance.address, expCoin.Denom) Expect(err).ToNot(HaveOccurred(), "expected no error getting balance") - Expect(coinBalance.Balance.Amount.Int64()).To(Equal(expCoin.Amount.Int64()), "expected different balance") + Expect(coinBalance.Balance.Amount).To(Equal(expCoin.Amount), "expected different balance") } } } @@ -347,10 +410,13 @@ func (is *IntegrationTestSuite) ExpectBalancesForERC20(callType CallType, contra _, ethRes, err := is.factory.CallContractAndCheckLogs(contractData.ownerPriv, txArgs, callArgs, passCheck) Expect(err).ToNot(HaveOccurred(), "expected no error getting balance") + err = is.network.NextBlock() + Expect(err).ToNot(HaveOccurred(), "error on NextBlock call") + var balance *big.Int err = contractABI.UnpackIntoInterface(&balance, "balanceOf", ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "expected no error unpacking balance") - Expect(balance.Int64()).To(Equal(expBalance.expCoins.AmountOf(is.tokenDenom).Int64()), "expected different balance") + Expect(math.NewIntFromBigInt(balance)).To(Equal(expBalance.expCoins.AmountOf(is.tokenDenom)), "expected different balance") } } @@ -382,11 +448,13 @@ func (is *IntegrationTestSuite) expectSendAuthzForERC20(callType CallType, contr _, ethRes, err := is.factory.CallContractAndCheckLogs(contractData.ownerPriv, txArgs, callArgs, passCheck) Expect(err).ToNot(HaveOccurred(), "expected no error getting allowance") + // Increase block to update nonce + Expect(is.network.NextBlock()).To(BeNil()) var allowance *big.Int err = contractABI.UnpackIntoInterface(&allowance, "allowance", ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "expected no error unpacking allowance") - Expect(allowance.Int64()).To(Equal(expAmount.AmountOf(is.tokenDenom).Int64()), "expected different allowance") + Expect(math.NewIntFromBigInt(allowance)).To(Equal(expAmount.AmountOf(is.tokenDenom)), "expected different allowance") } // ExpectSendAuthzForContract is a helper function to check that a SendAuthorization @@ -469,22 +537,25 @@ func (cd ContractsData) GetContractData(callType CallType) ContractData { // fundWithTokens is a helper function for the scope of the ERC20 integration tests. // Depending on the passed call type, it funds the given address with tokens either // using the Bank module or by minting straight on the ERC20 contract. +// Returns the updated balance amount of the receiver address func (is *IntegrationTestSuite) fundWithTokens( callType CallType, contractData ContractsData, receiver common.Address, fundCoins sdk.Coins, -) { +) math.Int { Expect(fundCoins).To(HaveLen(1), "expected only one coin") Expect(fundCoins[0].Denom).To(Equal(is.tokenDenom), "this helper function only supports funding with the token denom in the context of these integration tests", ) var err error + receiverBalance := fundCoins.AmountOf(is.tokenDenom) + balanceInBankMod := slices.Contains(nativeCallTypes, callType) switch { - case slices.Contains(nativeCallTypes, callType): - err = is.network.FundAccount(receiver.Bytes(), fundCoins) + case balanceInBankMod: + err = is.factory.FundAccount(is.keyring.GetKey(0), receiver.Bytes(), fundCoins) case slices.Contains(erc20CallTypes, callType): err = is.MintERC20(callType, contractData, receiver, fundCoins.AmountOf(is.tokenDenom).BigInt()) default: @@ -492,6 +563,15 @@ func (is *IntegrationTestSuite) fundWithTokens( } Expect(err).ToNot(HaveOccurred(), "failed to fund account") + Expect(is.network.NextBlock()).To(BeNil()) + + if balanceInBankMod { + balRes, err := is.handler.GetBalance(receiver.Bytes(), fundCoins.Denoms()[0]) + Expect(err).To(BeNil()) + receiverBalance = balRes.Balance.Amount + } + + return receiverBalance } // MintERC20 is a helper function to mint tokens on the ERC20 contract. @@ -512,7 +592,10 @@ func (is *IntegrationTestSuite) MintERC20(callType CallType, contractData Contra ExpPass: true, } - _, _, err := is.factory.CallContractAndCheckLogs(contractData.ownerPriv, txArgs, callArgs, mintCheck) + if _, _, err := is.factory.CallContractAndCheckLogs(contractData.ownerPriv, txArgs, callArgs, mintCheck); err != nil { + return err + } - return err + // commit changes to chain state + return is.network.NextBlock() } diff --git a/precompiles/ics20/approve_common.go b/precompiles/ics20/approve_common.go index c7a47883..778f4759 100644 --- a/precompiles/ics20/approve_common.go +++ b/precompiles/ics20/approve_common.go @@ -17,9 +17,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channelkeeper "github.com/cosmos/ibc-go/v7/modules/core/04-channel/keeper" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channelkeeper "github.com/cosmos/ibc-go/v8/modules/core/04-channel/keeper" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" cmn "github.com/evmos/os/precompiles/common" diff --git a/precompiles/ics20/approve_test.go b/precompiles/ics20/approve_test.go deleted file mode 100644 index 7b19ad87..00000000 --- a/precompiles/ics20/approve_test.go +++ /dev/null @@ -1,611 +0,0 @@ -// Copyright Tharsis Labs Ltd.(Evmos) -// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) -package ics20_test - -import ( - "fmt" - "math/big" - - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/evmos/os/precompiles/authorization" - cmn "github.com/evmos/os/precompiles/common" - "github.com/evmos/os/precompiles/ics20" - "github.com/evmos/os/testutil" -) - -type allowanceTestCase struct { - name string - malleate func() []interface{} - postCheck func(data []byte, inputArgs []interface{}) - gas uint64 - expError bool - errContains string -} - -var defaultAllowanceCases = []allowanceTestCase{ - { - "fail - empty input args", - func() []interface{} { - return []interface{}{} - }, - func([]byte, []interface{}) {}, - 200000, - true, - fmt.Sprintf(cmn.ErrInvalidNumberOfArgs, 5, 0), - }, - // { // TODO uncomment when corresponding logic included - // "fail - origin same as spender", - // func() []interface{} { - // return []interface{}{ - // common.BytesToAddress(s.chainA.SenderAccount.GetAddress().Bytes()), - // "port-1", - // "channel-1", - // testutil.ExampleAttoDenom, - // big.NewInt(1e18), - // } - // }, - // func(data []byte, inputArgs []interface{}) {}, - // 200000, - // true, - // "origin is the same as spender", - // }, - { - "fail - authorization does not exist", - func() []interface{} { - return []interface{}{ - s.address, - "port-1", - "channel-1", - testutil.ExampleAttoDenom, - big.NewInt(1e18), - } - }, - func([]byte, []interface{}) {}, - 200000, - true, - "does not exist", - }, - { - "fail - allocation for specified denom does not exist", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, s.address, s.address, path, maxUint256Coins, nil, nil) - s.Require().NoError(err) - return []interface{}{ - s.address, - path.EndpointA.ChannelConfig.PortID, - path.EndpointB.ChannelID, - "atom", - big.NewInt(1e18), - } - }, - func([]byte, []interface{}) { - }, - 200000, - true, - "no matching allocation found", - }, - { - "fail - allocation for specified channel and port id does not exist", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, s.address, s.address, path, maxUint256Coins, nil, nil) - s.Require().NoError(err) - return []interface{}{ - s.address, - "port-1", - "channel-1", - testutil.ExampleAttoDenom, - big.NewInt(1e18), - } - }, - func([]byte, []interface{}) { - }, - 200000, - true, - "no matching allocation found", - }, -} - -func (s *PrecompileTestSuite) TestApprove() { - method := s.precompile.Methods[authorization.ApproveMethod] - - testCases := []struct { - name string - malleate func() []interface{} - postCheck func(data []byte, inputArgs []interface{}) - gas uint64 - expError bool - errContains string - }{ - { - "fail - empty input args", - func() []interface{} { - return []interface{}{} - }, - func([]byte, []interface{}) {}, - 200000, - true, - fmt.Sprintf(cmn.ErrInvalidNumberOfArgs, 2, 0), - }, - { - "fail - channel does not exist", - func() []interface{} { - return []interface{}{ - s.address, - []cmn.ICS20Allocation{ - { - SourcePort: "port-1", - SourceChannel: "channel-1", - SpendLimit: defaultCmnCoins, - AllowList: nil, - }, - }, - } - }, - func([]byte, []interface{}) {}, - 200000, - true, - channeltypes.ErrChannelNotFound.Error(), - }, - { - "pass - MaxInt256 allocation", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - return []interface{}{ - s.address, - []cmn.ICS20Allocation{ - { - SourcePort: path.EndpointA.ChannelConfig.PortID, - SourceChannel: path.EndpointA.ChannelID, - SpendLimit: maxUint256CmnCoins, - AllowList: nil, - }, - }, - } - }, - func(_ []byte, _ []interface{}) { - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, s.address.Bytes(), s.address.Bytes(), ics20.TransferMsgURL) - transferAuthz := authz.(*transfertypes.TransferAuthorization) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, maxUint256Coins) - }, - 200000, - false, - "", - }, - { - "pass - create authorization with specific spend limit", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - return []interface{}{ - differentAddress, - []cmn.ICS20Allocation{ - { - SourcePort: path.EndpointA.ChannelConfig.PortID, - SourceChannel: path.EndpointA.ChannelID, - SpendLimit: defaultCmnCoins, - AllowList: nil, - }, - }, - } - }, - func(_ []byte, _ []interface{}) { - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, differentAddress.Bytes(), s.address.Bytes(), ics20.TransferMsgURL) - transferAuthz := authz.(*transfertypes.TransferAuthorization) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, defaultCoins) - }, - 200000, - false, - "", - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() - - args := tc.malleate() - bz, err := s.precompile.Approve(s.ctx, s.address, s.stateDB, &method, args) - - if tc.expError { - s.Require().ErrorContains(err, tc.errContains) - s.Require().Empty(bz) - } else { - s.Require().NoError(err) - s.Require().Equal(bz, cmn.TrueValue) - tc.postCheck(bz, args) - } - }) - } -} - -func (s *PrecompileTestSuite) TestRevoke() { - method := s.precompile.Methods[authorization.RevokeMethod] - - testCases := []struct { - name string - malleate func() []interface{} - postCheck func() - gas uint64 - expError bool - errContains string - }{ - { - "fail - empty input args", - func() []interface{} { - return []interface{}{} - }, - func() {}, - 200000, - true, - fmt.Sprintf(cmn.ErrInvalidNumberOfArgs, 1, 0), - }, - { - "fail - not a correct grantee address", - func() []interface{} { - return []interface{}{ - "test string", - } - }, - func() {}, - 200000, - true, - fmt.Sprintf(authorization.ErrInvalidGrantee, "test string"), - }, - { - "fail - authorization does not exist", - func() []interface{} { - return []interface{}{ - s.address, - } - }, - func() {}, - 200000, - true, - "does not exist", - }, - { - "pass - deletes authorization grant", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, differentAddress, s.address, path, defaultCoins, nil, nil) - s.Require().NoError(err) - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, differentAddress.Bytes(), s.address.Bytes(), ics20.TransferMsgURL) - s.Require().NotNil(authz) - return []interface{}{ - differentAddress, - } - }, - func() { - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, differentAddress.Bytes(), s.address.Bytes(), ics20.TransferMsgURL) - s.Require().Nil(authz) - }, - 200000, - false, - "", - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() - - args := tc.malleate() - bz, err := s.precompile.Revoke(s.ctx, s.address, s.stateDB, &method, args) - - if tc.expError { - s.Require().ErrorContains(err, tc.errContains) - s.Require().Empty(bz) - } else { - s.Require().NoError(err) - s.Require().Equal(bz, cmn.TrueValue) - tc.postCheck() - } - }) - } -} - -func (s *PrecompileTestSuite) TestIncreaseAllowance() { - method := s.precompile.Methods[authorization.IncreaseAllowanceMethod] - - testCases := []allowanceTestCase{ - { - "fail - the new spend limit overflows the maxUint256", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - overflowTestCoins := maxUint256Coins.Sub(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 1)) - err := s.NewTransferAuthorization(s.ctx, s.app, differentAddress, s.address, path, overflowTestCoins, nil, nil) - s.Require().NoError(err) - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, overflowTestCoins) - return []interface{}{ - differentAddress, - path.EndpointA.ChannelConfig.PortID, - path.EndpointB.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(2e18), - } - }, - func([]byte, []interface{}) {}, - 200000, - true, - cmn.ErrIntegerOverflow, - }, - { - "pass - increase allowance by 1 EVMOS for a single allocation with a single coin denomination", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, differentAddress, s.address, path, defaultCoins, nil, nil) - s.Require().NoError(err) - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, defaultCoins) - return []interface{}{ - differentAddress, - path.EndpointA.ChannelConfig.PortID, - path.EndpointB.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(1e18), - } - }, - func([]byte, []interface{}) { - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit[0].Amount, math.NewInt(2e18)) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit[0].Denom, testutil.ExampleAttoDenom) - }, - 200000, - false, - "", - }, - { - "pass - increase allowance by 1 Atom for single allocation with a multiple coin denomination", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, differentAddress, s.address, path, mutliSpendLimit, nil, nil) - s.Require().NoError(err) - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, mutliSpendLimit) - return []interface{}{ - differentAddress, - path.EndpointA.ChannelConfig.PortID, - path.EndpointB.ChannelID, - "uatom", - big.NewInt(1e18), - } - }, - func([]byte, []interface{}) { - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit[1].Amount, math.NewInt(2e18)) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit[1].Denom, "uatom") - }, - 200000, - false, - "", - }, - { - "pass - increase allowance by 1 Evmos for multiple allocations with a single coin denomination", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - allocations := []transfertypes.Allocation{ - { - SourcePort: "port-01", - SourceChannel: "channel-03", - SpendLimit: atomCoins, - AllowList: nil, - }, - { - SourcePort: path.EndpointA.ChannelConfig.PortID, - SourceChannel: path.EndpointA.ChannelID, - SpendLimit: defaultCoins, - AllowList: nil, - }, - } - err := s.NewTransferAuthorizationWithAllocations(s.ctx, s.app, differentAddress, s.address, allocations) - s.Require().NoError(err) - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, atomCoins) - s.Require().Equal(transferAuthz.Allocations[1].SpendLimit, defaultCoins) - return []interface{}{ - differentAddress, - path.EndpointA.ChannelConfig.PortID, - path.EndpointB.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(1e18), - } - }, - func([]byte, []interface{}) { - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, atomCoins) - s.Require().Equal(transferAuthz.Allocations[1].SpendLimit[0].Amount, math.NewInt(2e18)) - s.Require().Equal(transferAuthz.Allocations[1].SpendLimit[0].Denom, testutil.ExampleAttoDenom) - }, - 200000, - false, - "", - }, - } - testCases = append(testCases, defaultAllowanceCases...) - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() - - args := tc.malleate() - bz, err := s.precompile.IncreaseAllowance(s.ctx, s.address, s.stateDB, &method, args) - - if tc.expError { - s.Require().ErrorContains(err, tc.errContains) - s.Require().Empty(bz) - } else { - s.Require().NoError(err) - s.Require().Equal(bz, cmn.TrueValue) - tc.postCheck(bz, args) - } - }) - } -} - -func (s *PrecompileTestSuite) TestDecreaseAllowance() { - method := s.precompile.Methods[authorization.DecreaseAllowanceMethod] - - testCases := []allowanceTestCase{ - { - "fail - the new spend limit is negative", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, differentAddress, s.address, path, defaultCoins, nil, nil) - s.Require().NoError(err) - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().NotNil(transferAuthz) - s.Require().Len(transferAuthz.Allocations, 1) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, defaultCoins) - return []interface{}{ - differentAddress, - path.EndpointA.ChannelConfig.PortID, - path.EndpointB.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(2e18), - } - }, - func([]byte, []interface{}) {}, - 200000, - true, - cmn.ErrNegativeAmount, - }, - { - "pass - decrease allowance by 1 EVMOS for a single allocation with a single coin denomination", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, differentAddress, s.address, path, defaultCoins, nil, nil) - s.Require().NoError(err) - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().NotNil(transferAuthz) - s.Require().Len(transferAuthz.Allocations, 1) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, defaultCoins) - return []interface{}{ - differentAddress, - path.EndpointA.ChannelConfig.PortID, - path.EndpointB.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(500000000000000000), - } - }, - func(_ []byte, _ []interface{}) { - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().NotNil(transferAuthz) - s.Require().Len(transferAuthz.Allocations, 1, "should have at least one allocation", transferAuthz) - s.Require().Len(transferAuthz.Allocations[0].SpendLimit, 1, "should have at least one coin; allocation %s", transferAuthz.Allocations[0]) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit[0].Denom, testutil.ExampleAttoDenom) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit[0].Amount, math.NewInt(500000000000000000)) - }, - 200000, - false, - "", - }, - { - "pass - decrease allowance by 1 Atom for single allocation with a multiple coin denomination", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, differentAddress, s.address, path, mutliSpendLimit, nil, nil) - s.Require().NoError(err) - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, mutliSpendLimit) - return []interface{}{ - differentAddress, - path.EndpointA.ChannelConfig.PortID, - path.EndpointB.ChannelID, - "uatom", - big.NewInt(500000000000000000), - } - }, - func(_ []byte, _ []interface{}) { - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().NotNil(transferAuthz) - s.Require().Len(transferAuthz.Allocations, 1, "should have at least one allocation") - s.Require().Len(transferAuthz.Allocations[0].SpendLimit, len(mutliSpendLimit), "should have two coins; allocation %s", transferAuthz.Allocations[0]) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit[1].Amount, math.NewInt(500000000000000000)) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit[1].Denom, "uatom") - // other denom should remain unchanged - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit[0], defaultCoins[0]) - }, - 200000, - false, - "", - }, - { - "pass - decrease allowance by 0.5 Evmos for multiple allocations with a single coin denomination", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - allocations := []transfertypes.Allocation{ - { - SourcePort: "port-01", - SourceChannel: "channel-03", - SpendLimit: atomCoins, - AllowList: nil, - }, - { - SourcePort: path.EndpointA.ChannelConfig.PortID, - SourceChannel: path.EndpointA.ChannelID, - SpendLimit: defaultCoins, - AllowList: nil, - }, - } - err := s.NewTransferAuthorizationWithAllocations(s.ctx, s.app, differentAddress, s.address, allocations) - s.Require().NoError(err) - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, atomCoins) - s.Require().Equal(transferAuthz.Allocations[1].SpendLimit, defaultCoins) - return []interface{}{ - differentAddress, - path.EndpointA.ChannelConfig.PortID, - path.EndpointB.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(1e18 / 2), - } - }, - func(_ []byte, _ []interface{}) { - transferAuthz := s.GetTransferAuthorization(s.ctx, differentAddress, s.address) - s.Require().Equal(transferAuthz.Allocations[1].SpendLimit[0].Amount, math.NewInt(1e18/2)) - s.Require().Equal(transferAuthz.Allocations[1].SpendLimit[0].Denom, testutil.ExampleAttoDenom) - }, - 200000, - false, - "", - }, - } - - testCases = append(testCases, defaultAllowanceCases...) - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() - - args := tc.malleate() - bz, err := s.precompile.DecreaseAllowance(s.ctx, s.address, s.stateDB, &method, args) - - if tc.expError { - s.Require().ErrorContains(err, tc.errContains) - s.Require().Empty(bz) - } else { - s.Require().NoError(err) - s.Require().Equal(bz, cmn.TrueValue) - tc.postCheck(bz, args) - } - }) - } -} diff --git a/precompiles/ics20/events.go b/precompiles/ics20/events.go index dd0027c6..2b94e28a 100644 --- a/precompiles/ics20/events.go +++ b/precompiles/ics20/events.go @@ -56,7 +56,7 @@ func EmitIBCTransferEvent( Address: precompileAddr, Topics: topics, Data: packed, - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil diff --git a/precompiles/ics20/events_test.go b/precompiles/ics20/events_test.go deleted file mode 100644 index 340d1471..00000000 --- a/precompiles/ics20/events_test.go +++ /dev/null @@ -1,311 +0,0 @@ -package ics20_test - -import ( - "math/big" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/evmos/os/precompiles/authorization" - cmn "github.com/evmos/os/precompiles/common" - "github.com/evmos/os/precompiles/ics20" - "github.com/evmos/os/testutil" - "github.com/evmos/os/x/evm/core/vm" -) - -func (s *PrecompileTestSuite) TestTransferEvent() { - method := s.precompile.Methods[ics20.TransferMethod] - testCases := []struct { - name string - malleate func(sender, receiver sdk.AccAddress) []interface{} - expErr bool - errContains string - postCheck func(sender, receiver sdk.AccAddress) - }{ - { - "success - transfer event emitted", - func(sender, receiver sdk.AccAddress) []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, common.BytesToAddress(sender), common.BytesToAddress(sender), path, defaultCoins, nil, []string{"memo"}) - s.Require().NoError(err) - return []interface{}{ - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(1e18), - common.BytesToAddress(sender.Bytes()), - receiver.String(), - s.chainB.GetTimeoutHeight(), - uint64(0), - "memo", - } - }, - false, - "", - func(sender, receiver sdk.AccAddress) { - log := s.stateDB.Logs()[0] - s.Require().Equal(log.Address, s.precompile.Address()) - // Check event signature matches the one emitted - event := s.precompile.ABI.Events[ics20.EventTypeIBCTransfer] - s.Require().Equal(event.ID, common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) - - var ibcTransferEvent ics20.EventIBCTransfer - err := cmn.UnpackLog(s.precompile.ABI, &ibcTransferEvent, ics20.EventTypeIBCTransfer, *log) - s.Require().NoError(err) - s.Require().Equal(common.BytesToAddress(sender.Bytes()), ibcTransferEvent.Sender) - s.Require().Equal(crypto.Keccak256Hash([]byte(receiver.String())), ibcTransferEvent.Receiver) - s.Require().Equal("transfer", ibcTransferEvent.SourcePort) - s.Require().Equal("channel-0", ibcTransferEvent.SourceChannel) - s.Require().Equal(big.NewInt(1e18), ibcTransferEvent.Amount) - s.Require().Equal(testutil.ExampleAttoDenom, ibcTransferEvent.Denom) - s.Require().Equal("memo", ibcTransferEvent.Memo) - }, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() // reset - - sender := s.chainA.SenderAccount.GetAddress() - receiver := s.chainB.SenderAccount.GetAddress() - contract := vm.NewContract(vm.AccountRef(sender), s.precompile, big.NewInt(0), 20000) - _, err := s.precompile.Transfer(s.ctx, common.BytesToAddress(sender), contract, s.stateDB, &method, tc.malleate(sender, receiver)) - - if tc.expErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), tc.errContains) - } else { - s.Require().NoError(err) - tc.postCheck(sender, receiver) - } - }) - } -} - -func (s *PrecompileTestSuite) TestApproveTransferAuthorizationEvent() { - method := s.precompile.Methods[authorization.ApproveMethod] - testCases := []struct { - name string - malleate func() []interface{} - expErr bool - errContains string - postCheck func() - }{ - { - "success - transfer authorization event emitted with default coins ", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - return []interface{}{ - s.address, - []cmn.ICS20Allocation{ - { - SourcePort: path.EndpointA.ChannelConfig.PortID, - SourceChannel: path.EndpointA.ChannelID, - SpendLimit: defaultCmnCoins, - AllowList: nil, - }, - }, - } - }, - false, - "", - func() { - log := s.stateDB.Logs()[0] - s.Require().Equal(log.Address, s.precompile.Address()) - // Check event signature matches the one emitted - event := s.precompile.ABI.Events[authorization.EventTypeIBCTransferAuthorization] - s.Require().Equal(event.ID, common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) - - var transferAuthorizationEvent ics20.EventTransferAuthorization - err := cmn.UnpackLog(s.precompile.ABI, &transferAuthorizationEvent, authorization.EventTypeIBCTransferAuthorization, *log) - s.Require().NoError(err) - s.Require().Equal(s.address, transferAuthorizationEvent.Granter) - s.Require().Equal(s.address, transferAuthorizationEvent.Grantee) - s.Require().Equal("transfer", transferAuthorizationEvent.Allocations[0].SourcePort) - s.Require().Equal("channel-0", transferAuthorizationEvent.Allocations[0].SourceChannel) - abiCoins := cmn.NewCoinsResponse(defaultCoins) - s.Require().Equal(abiCoins, transferAuthorizationEvent.Allocations[0].SpendLimit) - }, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() // reset - - _, err := s.precompile.Approve(s.ctx, s.address, s.stateDB, &method, tc.malleate()) - - if tc.expErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), tc.errContains) - } else { - s.Require().NoError(err) - tc.postCheck() - } - }) - } -} - -func (s *PrecompileTestSuite) TestRevokeTransferAuthorizationEvent() { - method := s.precompile.Methods[authorization.ApproveMethod] - testCases := []struct { - name string - malleate func() []interface{} - expErr bool - errContains string - postCheck func() - }{ - { - "success - transfer revoke authorization event emitted", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, s.address, s.address, path, defaultCoins, nil, nil) - s.Require().NoError(err) - return []interface{}{ - s.address, - } - }, - false, - "", - func() { - log := s.stateDB.Logs()[0] - s.Require().Equal(log.Address, s.precompile.Address()) - // Check event signature matches the one emitted - event := s.precompile.ABI.Events[authorization.EventTypeIBCTransferAuthorization] - s.Require().Equal(event.ID, common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) - - var transferRevokeAuthorizationEvent ics20.EventTransferAuthorization - err := cmn.UnpackLog(s.precompile.ABI, &transferRevokeAuthorizationEvent, authorization.EventTypeIBCTransferAuthorization, *log) - s.Require().NoError(err) - s.Require().Equal(s.address, transferRevokeAuthorizationEvent.Grantee) - s.Require().Equal(s.address, transferRevokeAuthorizationEvent.Granter) - s.Require().Equal(0, len(transferRevokeAuthorizationEvent.Allocations)) - }, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() // reset - - _, err := s.precompile.Revoke(s.ctx, s.address, s.stateDB, &method, tc.malleate()) - - if tc.expErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), tc.errContains) - } else { - s.Require().NoError(err) - tc.postCheck() - } - }) - } -} - -func (s *PrecompileTestSuite) TestIncreaseAllowanceEvent() { - method := s.precompile.Methods[authorization.IncreaseAllowanceMethod] - testCases := []struct { - name string - malleate func() []interface{} - expErr bool - errContains string - postCheck func() - }{ - { - "success - increased allowance by 1 Evmos", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, s.address, s.address, path, defaultCoins, nil, nil) - s.Require().NoError(err) - return []interface{}{ - s.address, - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(1e18), - } - }, - false, - "", - func() { - log := s.stateDB.Logs()[0] - amount := big.NewInt(1e18) - s.CheckAllowanceChangeEvent(log, amount, true) - }, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() // reset - - _, err := s.precompile.IncreaseAllowance(s.ctx, s.address, s.stateDB, &method, tc.malleate()) - - if tc.expErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), tc.errContains) - } else { - s.Require().NoError(err) - tc.postCheck() - } - }) - } -} - -func (s *PrecompileTestSuite) TestDecreaseAllowanceEvent() { - method := s.precompile.Methods[authorization.DecreaseAllowanceMethod] - testCases := []struct { - name string - malleate func() []interface{} - expErr bool - errContains string - postCheck func() - }{ - { - "success - decrease allowance by 0.5 Evmos", - func() []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, s.address, s.address, path, defaultCoins, nil, nil) - s.Require().NoError(err) - return []interface{}{ - s.address, - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(1e18 / 2), - } - }, - false, - "", - func() { - log := s.stateDB.Logs()[0] - amount := big.NewInt(1e18 / 2) - s.CheckAllowanceChangeEvent(log, amount, false) - }, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() // reset - - _, err := s.precompile.DecreaseAllowance(s.ctx, s.address, s.stateDB, &method, tc.malleate()) - - if tc.expErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), tc.errContains) - } else { - s.Require().NoError(err) - tc.postCheck() - } - }) - } -} diff --git a/precompiles/ics20/ics20.go b/precompiles/ics20/ics20.go index 459a7e50..18afc082 100644 --- a/precompiles/ics20/ics20.go +++ b/precompiles/ics20/ics20.go @@ -7,10 +7,10 @@ import ( "embed" "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - channelkeeper "github.com/cosmos/ibc-go/v7/modules/core/04-channel/keeper" + channelkeeper "github.com/cosmos/ibc-go/v8/modules/core/04-channel/keeper" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/precompiles/authorization" cmn "github.com/evmos/os/precompiles/common" @@ -20,6 +20,9 @@ import ( transferkeeper "github.com/evmos/os/x/ibc/transfer/keeper" ) +// PrecompileAddress of the ICS-20 EVM extension in hex format. +const PrecompileAddress = "0x0000000000000000000000000000000000000802" + var _ vm.PrecompiledContract = &Precompile{} // Embed abi json file to the executable binary. Needed when importing as dependency. diff --git a/precompiles/ics20/integration_test.go b/precompiles/ics20/integration_test.go deleted file mode 100644 index 190e5738..00000000 --- a/precompiles/ics20/integration_test.go +++ /dev/null @@ -1,1725 +0,0 @@ -// Copyright Tharsis Labs Ltd.(Evmos) -// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) -package ics20_test - -import ( - "fmt" - "math/big" - - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - "github.com/ethereum/go-ethereum/common" - evmoscontracts "github.com/evmos/os/contracts" - chainutil "github.com/evmos/os/example_chain/testutil" - evmostesting "github.com/evmos/os/ibc/testing" - "github.com/evmos/os/precompiles/authorization" - cmn "github.com/evmos/os/precompiles/common" - "github.com/evmos/os/precompiles/erc20" - "github.com/evmos/os/precompiles/ics20" - "github.com/evmos/os/precompiles/testutil" - "github.com/evmos/os/precompiles/testutil/contracts" - evmosutil "github.com/evmos/os/testutil" - erc20types "github.com/evmos/os/x/erc20/types" - "github.com/evmos/os/x/evm/core/vm" - evmtypes "github.com/evmos/os/x/evm/types" - - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/ginkgo/v2" - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/gomega" -) - -// General variables used for integration tests -var ( - // defaultCallArgs and defaultApproveArgs are the default arguments for calling the smart contract and to - // call the approve method specifically. - // - // NOTE: this has to be populated in a BeforeEach block because the contractAddr would otherwise be a nil address. - defaultCallArgs, defaultApproveArgs contracts.CallArgs - - // defaultLogCheck instantiates a log check arguments struct with the precompile ABI events populated. - defaultLogCheck testutil.LogCheckArgs - // passCheck defines the arguments to check if the precompile returns no error - passCheck testutil.LogCheckArgs - // outOfGasCheck defines the arguments to check if the precompile returns out of gas error - outOfGasCheck testutil.LogCheckArgs - - // gasPrice defines a default gas price to be used in the testing suite - gasPrice = big.NewInt(200_000) - - // array of allocations with only one allocation for 'aevmos' coin - defaultSingleAlloc []cmn.ICS20Allocation - - // interchainSenderContract is the compiled contract calling the interchain functionality - interchainSenderContract evmtypes.CompiledContract -) - -var _ = Describe("IBCTransfer Precompile", func() { - BeforeEach(func() { - s.suiteIBCTesting = true - s.SetupTest() - s.setupAllocationsForTesting() - - var err error - Expect(err).To(BeNil(), "error while loading the interchain sender contract: %v", err) - - // set the default call arguments - defaultCallArgs = contracts.CallArgs{ - ContractAddr: s.precompile.Address(), - ContractABI: s.precompile.ABI, - PrivKey: s.privKey, - GasPrice: gasPrice, - } - defaultApproveArgs = defaultCallArgs.WithMethodName(authorization.ApproveMethod) - - defaultLogCheck = testutil.LogCheckArgs{ - ABIEvents: s.precompile.ABI.Events, - } - passCheck = defaultLogCheck.WithExpPass(true) - outOfGasCheck = defaultLogCheck.WithErrContains(vm.ErrOutOfGas.Error()) - }) - - Describe("Execute approve transaction", func() { - BeforeEach(func() { - // check no previous authorization exist - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), s.differentAddr.Bytes(), s.address.Bytes()) - Expect(err).To(BeNil(), "error while getting authorizations") - Expect(auths).To(HaveLen(0), "expected no authorizations before tests") - defaultSingleAlloc = []cmn.ICS20Allocation{ - { - SourcePort: ibctesting.TransferPort, - SourceChannel: s.transferPath.EndpointA.ChannelID, - SpendLimit: defaultCmnCoins, - AllowedPacketData: []string{"memo"}, - }, - } - }) - - // TODO uncomment when enforcing grantee != origin - // It("should return error if the origin is same as the spender", func() { - // approveArgs := defaultApproveArgs.WithArgs( - // s.address, - // defaultSingleAlloc, - // ) - - // _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, approveArgs, differentOriginCheck) - // Expect(err).To(BeNil(), "error while calling the precompile") - - // s.chainA.NextBlock() - - // // check no authorization exist - // auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), s.differentAddr.Bytes(), s.address.Bytes()) - // Expect(err).To(BeNil(), "error while getting authorizations") - // Expect(auths).To(HaveLen(0), "expected no authorization") - // }) - - It("should return error if the provided gasLimit is too low", func() { - approveArgs := defaultApproveArgs. - WithGasLimit(30000). - WithArgs( - s.differentAddr, - defaultSingleAlloc, - ) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, approveArgs, outOfGasCheck) - Expect(err).To(HaveOccurred(), "error while calling the precompile") - Expect(err.Error()).To(ContainSubstring(vm.ErrOutOfGas.Error())) - - s.chainA.NextBlock() - - // check no authorization exist - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), s.differentAddr.Bytes(), s.address.Bytes()) - Expect(err).To(BeNil()) - Expect(auths).To(HaveLen(0)) - }) - - It("should approve the corresponding allocation", func() { - approveArgs := defaultApproveArgs.WithArgs( - s.differentAddr, - defaultSingleAlloc, - ) - - approvalCheck := passCheck. - WithExpEvents(authorization.EventTypeIBCTransferAuthorization) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, approveArgs, approvalCheck) - Expect(err).To(BeNil(), "error while calling the precompile") - - s.chainA.NextBlock() - - // check GetAuthorizations is returning the record - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), s.differentAddr.Bytes(), s.address.Bytes()) - Expect(err).To(BeNil(), "error while getting authorizations") - Expect(auths).To(HaveLen(1), "expected one authorization") - Expect(auths[0].MsgTypeURL()).To(Equal(ics20.TransferMsgURL)) - transferAuthz := auths[0].(*transfertypes.TransferAuthorization) - Expect(transferAuthz.Allocations[0].SpendLimit).To(Equal(defaultCoins)) - }) - }) - - Describe("Execute revoke transaction", func() { - var defaultRevokeArgs contracts.CallArgs - BeforeEach(func() { - // create authorization - s.setTransferApproval(defaultCallArgs, s.differentAddr, defaultSingleAlloc) - defaultRevokeArgs = defaultCallArgs.WithMethodName(authorization.RevokeMethod) - }) - - It("should revoke authorization", func() { - revokeArgs := defaultRevokeArgs.WithArgs( - s.differentAddr, - ) - revokeCheck := passCheck. - WithExpEvents(authorization.EventTypeIBCTransferAuthorization) - - _, _, err := contracts.CallContractAndCheckLogs( - s.chainA.GetContext(), - s.app, - revokeArgs, - revokeCheck, - ) - Expect(err).To(BeNil(), "error while calling the precompile") - - s.chainA.NextBlock() - - // check no authorization exist - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), s.differentAddr.Bytes(), s.address.Bytes()) - Expect(err).To(BeNil(), "error while getting authorizations") - Expect(auths).To(HaveLen(0), "expected no authorization") - }) - }) - - Describe("Execute increase allowance transaction", func() { - BeforeEach(func() { - s.setTransferApproval(defaultCallArgs, s.differentAddr, defaultSingleAlloc) - }) - - // TODO uncomment when enforcing grantee != origin - // this is a copy of a different test but for a different method - // It("should return an error if the origin is same as the spender", func() { - // increaseAllowanceArgs := defaultCallArgs. - // WithMethodName(authorization.IncreaseAllowanceMethod). - // WithArgs( - // s.address, - // s.transferPath.EndpointA.ChannelConfig.PortID, - // s.transferPath.EndpointA.ChannelID, - // evmosutil.ExampleAttoDenom, - // big.NewInt(1e18), - // ) - - // differentOriginCheck := defaultLogCheck.WithErrContains(cmn.ErrDifferentOrigin, s.address, s.differentAddr) - - // _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, increaseAllowanceArgs, differentOriginCheck) - // Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - // // check no authorization exist - // auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), s.address.Bytes(), s.address.Bytes()) - // Expect(err).To(BeNil(), "error while getting authorizations") - // Expect(auths).To(BeNil()) - // }) - - It("should return an error if the allocation denom is not present", func() { //nolint:dupl - increaseAllowanceArgs := defaultCallArgs. - WithMethodName(authorization.IncreaseAllowanceMethod). - WithArgs( - s.differentAddr, - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - "urandom", - big.NewInt(1e18), - ) - - noMatchingAllocation := defaultLogCheck.WithErrContains( - ics20.ErrNoMatchingAllocation, - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - "urandom", - ) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, increaseAllowanceArgs, noMatchingAllocation) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring(ics20.ErrNoMatchingAllocation, "transfer", "channel-0", "urandom")) - - // check authorization didn't change - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), s.differentAddr.Bytes(), s.address.Bytes()) - Expect(err).To(BeNil(), "error while getting authorizations") - Expect(auths).To(HaveLen(1), "expected one authorization") - Expect(auths[0].MsgTypeURL()).To(Equal(ics20.TransferMsgURL)) - transferAuthz := auths[0].(*transfertypes.TransferAuthorization) - Expect(transferAuthz.Allocations[0].SpendLimit).To(Equal(defaultCoins)) - }) - - It("should increase allowance by 1 EVMOS", func() { - s.setTransferApproval(defaultCallArgs, s.differentAddr, defaultSingleAlloc) - - increaseAllowanceArgs := defaultCallArgs. - WithMethodName(authorization.IncreaseAllowanceMethod). - WithArgs( - s.differentAddr, - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - evmosutil.ExampleAttoDenom, - big.NewInt(1e18), - ) - - allowanceCheck := passCheck.WithExpEvents(authorization.EventTypeIBCTransferAuthorization) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, increaseAllowanceArgs, allowanceCheck) - Expect(err).To(BeNil(), "error while calling the precompile") - - s.chainA.NextBlock() - - // check auth was updated - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), s.differentAddr.Bytes(), s.address.Bytes()) - Expect(err).To(BeNil(), "error while getting authorizations") - Expect(auths).To(HaveLen(1), "expected one authorization") - Expect(auths[0].MsgTypeURL()).To(Equal(ics20.TransferMsgURL)) - transferAuthz := auths[0].(*transfertypes.TransferAuthorization) - Expect(transferAuthz.Allocations[0].SpendLimit).To(Equal(defaultCoins.Add(sdk.Coin{Denom: evmosutil.ExampleAttoDenom, Amount: math.NewInt(1e18)}))) - }) - }) - - Describe("Execute decrease allowance transaction", func() { - BeforeEach(func() { - s.setTransferApproval(defaultCallArgs, s.differentAddr, defaultSingleAlloc) - }) - - It("should fail if decreased amount is more than the total spend limit left", func() { - decreaseAllowance := defaultCallArgs. - WithMethodName(authorization.DecreaseAllowanceMethod). - WithArgs( - s.differentAddr, - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - evmosutil.ExampleAttoDenom, - big.NewInt(2e18), - ) - - allowanceCheck := defaultLogCheck.WithErrContains("negative amount") - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, decreaseAllowance, allowanceCheck) - Expect(err).To(HaveOccurred(), "error while calling the precompile") - Expect(err.Error()).To(ContainSubstring("negative amount")) - }) - - // TODO uncomment when enforcing grantee != origin - // //nolint:dupl // this is a copy of a different test but for a different method - // It("should return an error if the origin same the spender", func() { - // decreaseAllowance := defaultCallArgs. - // WithMethodName(authorization.DecreaseAllowanceMethod). - // WithArgs( - // s.address, - // s.transferPath.EndpointA.ChannelConfig.PortID, - // s.transferPath.EndpointA.ChannelID, - // evmosutil.ExampleAttoDenom, - // big.NewInt(1e18), - // ) - - // differentOriginCheck := defaultLogCheck.WithErrContains(cmn.ErrDifferentOrigin, s.address, s.differentAddr) - - // _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, decreaseAllowance, differentOriginCheck) - // Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - // // check authorization does not exist - // auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), s.address.Bytes(), s.address.Bytes()) - // Expect(err).To(BeNil(), "error while getting authorizations") - // Expect(auths).To(BeNil()) - // }) - - It("should return an error if the allocation denom is not present", func() { //nolint:dupl - decreaseAllowance := defaultCallArgs. - WithMethodName(authorization.DecreaseAllowanceMethod). - WithArgs( - s.differentAddr, - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - "urandom", - big.NewInt(1e18), - ) - - noMatchingAllocation := defaultLogCheck.WithErrContains( - ics20.ErrNoMatchingAllocation, - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - "urandom", - ) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, decreaseAllowance, noMatchingAllocation) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring(ics20.ErrNoMatchingAllocation, "transfer", "channel-0", "urandom")) - - // check authorization didn't change - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), s.differentAddr.Bytes(), s.address.Bytes()) - Expect(err).To(BeNil(), "error while getting authorizations") - Expect(auths).To(HaveLen(1), "expected one authorization") - Expect(auths[0].MsgTypeURL()).To(Equal(ics20.TransferMsgURL)) - transferAuthz := auths[0].(*transfertypes.TransferAuthorization) - Expect(transferAuthz.Allocations[0].SpendLimit).To(Equal(defaultCoins)) - }) - - It("should delete grant if allowance is decreased to 0", func() { - decreaseAllowance := defaultCallArgs. - WithMethodName(authorization.DecreaseAllowanceMethod). - WithArgs( - s.differentAddr, - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - evmosutil.ExampleAttoDenom, - big.NewInt(1e18), - ) - - allowanceCheck := passCheck.WithExpEvents(authorization.EventTypeIBCTransferAuthorization) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, decreaseAllowance, allowanceCheck) - Expect(err).To(BeNil(), "error while calling the precompile") - - s.chainA.NextBlock() - - // check auth record - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), s.differentAddr.Bytes(), s.address.Bytes()) - Expect(err).To(BeNil(), "error while getting authorizations") - Expect(auths).To(HaveLen(1), "expected one authorization") - Expect(auths[0].MsgTypeURL()).To(Equal(ics20.TransferMsgURL)) - transferAuthz := auths[0].(*transfertypes.TransferAuthorization) - Expect(transferAuthz.Allocations[0].SpendLimit).To(HaveLen(0)) - }) - }) - - Describe("Execute transfer transaction", func() { - var defaultTransferArgs contracts.CallArgs - - BeforeEach(func() { - // populate the default transfer args - defaultTransferArgs = defaultCallArgs. - WithMethodName(ics20.TransferMethod). - WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - s.bondDenom, - defaultCmnCoins[0].Amount, - s.address, - s.chainB.SenderAccount.GetAddress().String(), // receiver - s.chainB.GetTimeoutHeight(), - uint64(0), // disable timeout timestamp - "memo", - ) - }) - - Context("without authorization", func() { - It("owner should transfer without authorization", func() { - initialBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - logCheckArgs := passCheck.WithExpEvents(ics20.EventTypeIBCTransfer) - - res, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultTransferArgs, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - // check the sender balance was deducted - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Sub(fees).Sub(defaultCoins[0].Amount))) - }) - - It("should succeed in transfer transaction but should timeout and refund sender", func() { - initialBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - logCheckArgs := passCheck.WithExpEvents(ics20.EventTypeIBCTransfer) - timeoutHeight := clienttypes.NewHeight(clienttypes.ParseChainID(s.chainB.ChainID), uint64(s.chainB.GetContext().BlockHeight())+1) - - transferArgs := defaultTransferArgs.WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - s.bondDenom, - defaultCmnCoins[0].Amount, - s.address, - s.chainB.SenderAccount.GetAddress().String(), // receiver - timeoutHeight, - uint64(0), // disable timeout timestamp - "memo", - ) - - res, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, transferArgs, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - out, err := s.precompile.Unpack(ics20.TransferMethod, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking response: %v", err) - // check sequence in returned data - sequence, ok := out[0].(uint64) - Expect(ok).To(BeTrue()) - Expect(sequence).To(Equal(uint64(1))) - - // check the sender balance was deducted - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Sub(fees).Sub(defaultCoins[0].Amount))) - - // the transfer is reverted because the packet times out - // build the sent packet - // this is the packet sent - packet := s.makePacket( - sdk.AccAddress(s.address.Bytes()).String(), - s.chainB.SenderAccount.GetAddress().String(), - s.bondDenom, - "memo", - defaultCmnCoins[0].Amount, - sequence, - timeoutHeight, - ) - - // packet times out and the OnTimeoutPacket callback is executed - s.chainA.NextBlock() - // increment block height on chainB to make the packet timeout - s.chainB.NextBlock() - - // increment sequence for successful transaction execution - err = s.chainA.SenderAccount.SetSequence(s.chainA.SenderAccount.GetSequence() + 1) - s.Require().NoError(err) - - err = s.transferPath.EndpointA.UpdateClient() - Expect(err).To(BeNil()) - - // Receive timeout - err = s.transferPath.EndpointA.TimeoutPacket(packet) - Expect(err).To(BeNil()) - - // To submit a timeoutMsg, the TimeoutPacket function - // uses a default fee amount - timeoutMsgFee := math.NewInt(evmostesting.DefaultFeeAmt * 2) - fees = fees.Add(timeoutMsgFee) - - finalBalance = s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Sub(fees))) - }) - - It("should not transfer other account's balance", func() { - // initialBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - // fund senders account - err := chainutil.FundAccountWithBaseDenom(s.chainA.GetContext(), s.app.BankKeeper, s.differentAddr.Bytes(), amt) - Expect(err).To(BeNil()) - senderInitialBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.differentAddr.Bytes(), s.bondDenom) - Expect(senderInitialBalance.Amount).To(Equal(math.NewInt(amt))) - - transferArgs := defaultTransferArgs.WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - s.bondDenom, - defaultCmnCoins[0].Amount, - s.differentAddr, - s.chainB.SenderAccount.GetAddress().String(), // receiver - s.chainB.GetTimeoutHeight(), - uint64(0), // disable timeout timestamp - "memo", - ) - - logCheckArgs := defaultLogCheck.WithErrContains(ics20.ErrDifferentOriginFromSender, s.address, s.differentAddr) - - _, _, err = contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, transferArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring(ics20.ErrDifferentOriginFromSender, s.address, s.differentAddr)) - - // check the sender only paid for the fees - // and funds were not transferred - // TODO: fees are not calculated correctly with this logic - // fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - // finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - // Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Sub(fees))) - - senderFinalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.differentAddr.Bytes(), s.bondDenom) - Expect(senderFinalBalance.Amount).To(Equal(senderInitialBalance.Amount)) - }) - }) - - Context("with authorization", func() { - BeforeEach(func() { - expTime := s.chainA.GetContext().BlockTime().Add(s.precompile.ApprovalExpiration) - - allocations := []transfertypes.Allocation{ - { - SourcePort: s.transferPath.EndpointA.ChannelConfig.PortID, - SourceChannel: s.transferPath.EndpointA.ChannelID, - SpendLimit: defaultCoins, - }, - } - - // create grant to allow s.address to spend differentAddr funds - err := s.app.AuthzKeeper.SaveGrant( - s.chainA.GetContext(), - s.address.Bytes(), - s.differentAddr.Bytes(), - &transfertypes.TransferAuthorization{Allocations: allocations}, - &expTime, - ) - Expect(err).To(BeNil()) - - // fund the account from which funds will be sent - err = chainutil.FundAccountWithBaseDenom(s.chainA.GetContext(), s.app.BankKeeper, s.differentAddr.Bytes(), amt) - Expect(err).To(BeNil()) - senderInitialBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.differentAddr.Bytes(), s.bondDenom) - Expect(senderInitialBalance.Amount).To(Equal(math.NewInt(amt))) - }) - - It("should not transfer other account's balance", func() { - // ATM it is not allowed for another EOA to spend other EOA - // funds via EVM extensions. - // However, it is allowed for a contract to spend an EOA's account and - // an EOA account to spend a contract's balance - // if the required authorization exist - // initialBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - transferArgs := defaultTransferArgs.WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - s.bondDenom, - defaultCmnCoins[0].Amount, - s.differentAddr, - s.chainB.SenderAccount.GetAddress().String(), // receiver - s.chainB.GetTimeoutHeight(), - uint64(0), // disable timeout timestamp - "memo", - ) - - logCheckArgs := defaultLogCheck.WithErrContains(ics20.ErrDifferentOriginFromSender, s.address, s.differentAddr) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, transferArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring(ics20.ErrDifferentOriginFromSender, s.address, s.differentAddr)) - - // check the sender only paid for the fees - // and funds from the other account were not transferred - // TODO: fees are not calculated correctly with this logic - // fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - // finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - // Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Sub(fees))) - - senderFinalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.differentAddr.Bytes(), s.bondDenom) - Expect(senderFinalBalance.Amount).To(Equal(math.NewInt(amt))) - }) - }) - - Context("sending ERC20 coins", func() { - var ( - // erc20Addr is the address of the ERC20 contract - erc20Addr common.Address - // sentAmount is the amount of tokens to send for testing - sentAmount = big.NewInt(1000) - tokenPair *erc20types.TokenPair - defaultErc20TransferArgs contracts.CallArgs - err error - ) - - BeforeEach(func() { - erc20Addr = s.setupERC20ContractTests(sentAmount) - // register the token pair - tokenPair, err = s.app.Erc20Keeper.RegisterERC20(s.chainA.GetContext(), erc20Addr) - Expect(err).To(BeNil(), "error while registering the token pair: %v", err) - - defaultErc20TransferArgs = defaultTransferArgs.WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - tokenPair.Denom, - sentAmount, - s.address, - s.chainB.SenderAccount.GetAddress().String(), // receiver - s.chainB.GetTimeoutHeight(), - uint64(0), // disable timeout timestamp - "memo", - ) - }) - - Context("without authorization", func() { - It("should transfer registered ERC20s", func() { - preBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - logCheckArgs := passCheck.WithExpEvents(ics20.EventTypeIBCTransfer) - - res, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultErc20TransferArgs, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - out, err := s.precompile.Unpack(ics20.TransferMethod, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking response: %v", err) - // check sequence in returned data - Expect(out[0]).To(Equal(uint64(1))) - - s.chainA.NextBlock() - - // check only fees were deducted from sending account - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(preBalance.Amount.Sub(fees))) - - // check Erc20 balance was reduced by sent amount - balance := s.app.Erc20Keeper.BalanceOf( - s.chainA.GetContext(), - evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI, - erc20Addr, - s.address, - ) - Expect(balance.Int64()).To(BeZero(), "address does not have the expected amount of tokens") - }) - - It("should not transfer other account's balance", func() { - // mint some ERC20 to the sender's account - defaultERC20CallArgs := contracts.CallArgs{ - ContractAddr: erc20Addr, - ContractABI: evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI, - PrivKey: s.privKey, - GasPrice: gasPrice, - } - - // mint coins to the address - mintCoinsArgs := defaultERC20CallArgs. - WithMethodName("mint"). - WithArgs(s.differentAddr, defaultCmnCoins[0].Amount) - - mintCheck := testutil.LogCheckArgs{ - ABIEvents: evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI.Events, - ExpEvents: []string{erc20.EventTypeTransfer}, // upon minting the tokens are sent to the receiving address - ExpPass: true, - } - - _, _, err = contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, mintCoinsArgs, mintCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - // try to transfer other account's erc20 tokens - transferArgs := defaultTransferArgs.WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - tokenPair.Denom, - defaultCmnCoins[0].Amount, - s.differentAddr, - s.chainB.SenderAccount.GetAddress().String(), // receiver - s.chainB.GetTimeoutHeight(), - uint64(0), // disable timeout timestamp - "memo", - ) - - logCheckArgs := defaultLogCheck.WithErrContains(ics20.ErrDifferentOriginFromSender, s.address, s.differentAddr) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, transferArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring(ics20.ErrDifferentOriginFromSender, s.address, s.differentAddr)) - - // check funds were not transferred - balance := s.app.Erc20Keeper.BalanceOf( - s.chainA.GetContext(), - evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI, - erc20Addr, - s.differentAddr, - ) - Expect(balance).To(Equal(defaultCmnCoins[0].Amount), "address does not have the expected amount of tokens") - }) - - It("should succeed in transfer transaction but should error on packet destination if the receiver address is wrong", func() { - preBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - invalidReceiverAddr := "invalid_address" - transferArgs := defaultTransferArgs.WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - tokenPair.Denom, - sentAmount, - s.address, - invalidReceiverAddr, // invalid receiver - s.chainB.GetTimeoutHeight(), - uint64(0), // disable timeout timestamp - "memo", - ) - - logCheckArgs := passCheck.WithExpEvents(ics20.EventTypeIBCTransfer) - - res, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, transferArgs, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - out, err := s.precompile.Unpack(ics20.TransferMethod, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking response: %v", err) - // check sequence in returned data - sequence, ok := out[0].(uint64) - Expect(ok).To(BeTrue()) - Expect(sequence).To(Equal(uint64(1))) - - s.chainA.NextBlock() - - // check only fees were deducted from sending account - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(preBalance.Amount.Sub(fees))) - - // check Erc20 balance was reduced by sent amount (escrowed on ibc escrow account) - balance := s.app.Erc20Keeper.BalanceOf( - s.chainA.GetContext(), - evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI, - erc20Addr, - s.address, - ) - Expect(balance.Int64()).To(BeZero(), "address does not have the expected amount of tokens") - - // the transfer is reverted because fails checks on the receiving chain - // this is the packet sent - packet := s.makePacket( - sdk.AccAddress(s.address.Bytes()).String(), - invalidReceiverAddr, - tokenPair.Denom, - "memo", - sentAmount, - sequence, - s.chainB.GetTimeoutHeight(), - ) - - // increment sequence for successful transaction execution - err = s.chainA.SenderAccount.SetSequence(s.chainA.SenderAccount.GetSequence() + 3) - s.Require().NoError(err) - - err = s.transferPath.EndpointA.UpdateClient() - Expect(err).To(BeNil()) - - // Relay packet - err = s.transferPath.RelayPacket(packet) - Expect(err).To(BeNil()) - - // check escrowed funds are refunded to sender - finalERC20balance := s.app.Erc20Keeper.BalanceOf( - s.chainA.GetContext(), - evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI, - erc20Addr, - s.address, - ) - Expect(finalERC20balance).To(Equal(sentAmount), "address does not have the expected amount of tokens") - }) - - It("should succeed in transfer transaction but should timeout", func() { - preBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - logCheckArgs := passCheck.WithExpEvents(ics20.EventTypeIBCTransfer) - - timeoutHeight := clienttypes.NewHeight(clienttypes.ParseChainID(s.chainB.ChainID), uint64(s.chainB.GetContext().BlockHeight())+1) - - transferArgs := defaultTransferArgs.WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - tokenPair.Denom, - sentAmount, - s.address, - s.chainB.SenderAccount.GetAddress().String(), // receiver - timeoutHeight, - uint64(0), // disable timeout timestamp - "memo", - ) - - res, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, transferArgs, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - out, err := s.precompile.Unpack(ics20.TransferMethod, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking response: %v", err) - // check sequence in returned data - sequence, ok := out[0].(uint64) - Expect(ok).To(BeTrue()) - Expect(sequence).To(Equal(uint64(1))) - - s.chainA.NextBlock() - - // check only fees were deducted from sending account - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(preBalance.Amount.Sub(fees))) - - // check Erc20 balance was reduced by sent amount - balance := s.app.Erc20Keeper.BalanceOf( - s.chainA.GetContext(), - evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI, - erc20Addr, - s.address, - ) - Expect(balance.Int64()).To(BeZero(), "address does not have the expected amount of tokens") - - // the transfer is reverted because the packet times out - // this is the packet sent - packet := s.makePacket( - sdk.AccAddress(s.address.Bytes()).String(), - s.chainB.SenderAccount.GetAddress().String(), - tokenPair.Denom, - "memo", - sentAmount, - sequence, - timeoutHeight, - ) - - // packet times out and the OnTimeoutPacket callback is executed - s.chainA.NextBlock() - // increment block height on chainB to make the packet timeout - s.chainB.NextBlock() - - // increment sequence for successful transaction execution - err = s.chainA.SenderAccount.SetSequence(s.chainA.SenderAccount.GetSequence() + 3) - s.Require().NoError(err) - - err = s.transferPath.EndpointA.UpdateClient() - Expect(err).To(BeNil()) - - // Receive timeout - err = s.transferPath.EndpointA.TimeoutPacket(packet) - Expect(err).To(BeNil()) - - // check escrowed funds are refunded to sender - finalERC20balance := s.app.Erc20Keeper.BalanceOf( - s.chainA.GetContext(), - evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI, - erc20Addr, - s.address, - ) - Expect(finalERC20balance).To(Equal(sentAmount), "address does not have the expected amount of tokens") - }) - }) - }) - }) - - Context("Queries", func() { - var ( - path string - expTrace transfertypes.DenomTrace - ) - - BeforeEach(func() { - path = fmt.Sprintf( - "%s/%s/%s/%s", - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - s.transferPath.EndpointB.ChannelConfig.PortID, - s.transferPath.EndpointB.ChannelID, - ) - expTrace = transfertypes.DenomTrace{ - Path: path, - BaseDenom: evmosutil.ExampleAttoDenom, - } - }) - - It("should query denom trace", func() { - // setup - create a denom trace to get it on the query result - method := ics20.DenomTraceMethod - s.app.TransferKeeper.SetDenomTrace(s.chainA.GetContext(), expTrace) - - args := defaultCallArgs. - WithMethodName(method). - WithArgs(expTrace.IBCDenom()) - - _, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, args, passCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - var out ics20.DenomTraceResponse - err = s.precompile.UnpackIntoInterface(&out, method, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking the output: %v", err) - Expect(out.DenomTrace.Path).To(Equal(expTrace.Path)) - Expect(out.DenomTrace.BaseDenom).To(Equal(expTrace.BaseDenom)) - }) - - Context("denom traces query", func() { - var ( - method string - expTraces []transfertypes.DenomTrace - ) - BeforeEach(func() { - method = ics20.DenomTracesMethod - // setup - create some denom traces to get on the query result - expTraces = []transfertypes.DenomTrace{ - {Path: "", BaseDenom: evmosutil.ExampleAttoDenom}, - {Path: fmt.Sprintf("%s/%s", s.transferPath.EndpointA.ChannelConfig.PortID, s.transferPath.EndpointA.ChannelID), BaseDenom: evmosutil.ExampleAttoDenom}, - expTrace, - } - - for _, trace := range expTraces { - s.app.TransferKeeper.SetDenomTrace(s.chainA.GetContext(), trace) - } - }) - It("should query denom traces - w/all results on page", func() { - args := defaultCallArgs. - WithMethodName(method). - WithArgs( - query.PageRequest{ - Limit: 3, - CountTotal: true, - }) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, args, passCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - var out ics20.DenomTracesResponse - err = s.precompile.UnpackIntoInterface(&out, method, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking the output: %v", err) - Expect(out.DenomTraces).To(HaveLen(3), "expected 3 denom traces to be returned") - Expect(out.PageResponse.Total).To(Equal(uint64(3))) - Expect(out.PageResponse.NextKey).To(BeEmpty()) - - for i, dt := range out.DenomTraces { - // order can change - Expect(dt.Path).To(Equal(expTraces[i].Path)) - Expect(dt.BaseDenom).To(Equal(expTraces[i].BaseDenom)) - } - }) - - It("should query denom traces - w/pagination", func() { - args := defaultCallArgs. - WithMethodName(method). - WithArgs( - query.PageRequest{ - Limit: 1, - CountTotal: true, - }) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, args, passCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - var out ics20.DenomTracesResponse - err = s.precompile.UnpackIntoInterface(&out, method, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking the output: %v", err) - Expect(out.DenomTraces).To(HaveLen(1), "expected 1 denom traces to be returned") - Expect(out.PageResponse.Total).To(Equal(uint64(3))) - Expect(out.PageResponse.NextKey).NotTo(BeEmpty()) - }) - }) - - It("should query denom hash", func() { - method := ics20.DenomHashMethod - // setup - create a denom expTrace - s.app.TransferKeeper.SetDenomTrace(s.chainA.GetContext(), expTrace) - - args := defaultCallArgs. - WithMethodName(method). - WithArgs(expTrace.GetFullDenomPath()) - - _, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, args, passCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - out, err := s.precompile.Unpack(method, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking the output: %v", err) - Expect(out).To(HaveLen(1)) - Expect(out[0]).To(Equal(expTrace.Hash().String())) - }) - }) - - Context("query allowance", func() { - Context("No authorization", func() { - It("should return empty array", func() { - method := authorization.AllowanceMethod - - args := defaultCallArgs. - WithMethodName(method). - WithArgs(s.address, s.differentAddr) - - _, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, args, passCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - var out []cmn.ICS20Allocation - err = s.precompile.UnpackIntoInterface(&out, method, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking the output: %v", err) - Expect(out).To(HaveLen(0)) - }) - }) - - Context("with authorization", func() { - BeforeEach(func() { - s.setTransferApproval(defaultCallArgs, s.differentAddr, defaultSingleAlloc) - }) - - It("should return the allowance", func() { - method := authorization.AllowanceMethod - - args := defaultCallArgs. - WithMethodName(method). - WithArgs(s.differentAddr, s.address) - - _, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, args, passCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - var out []cmn.ICS20Allocation - err = s.precompile.UnpackIntoInterface(&out, method, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking the output: %v", err) - Expect(out).To(HaveLen(1)) - Expect(len(out)).To(Equal(len(defaultSingleAlloc))) - Expect(out[0].SourcePort).To(Equal(defaultSingleAlloc[0].SourcePort)) - Expect(out[0].SourceChannel).To(Equal(defaultSingleAlloc[0].SourceChannel)) - Expect(out[0].SpendLimit).To(Equal(defaultSingleAlloc[0].SpendLimit)) - Expect(out[0].AllowList).To(HaveLen(0)) - Expect(out[0].AllowedPacketData).To(HaveLen(1)) - Expect(out[0].AllowedPacketData[0]).To(Equal("memo")) - }) - }) - }) -}) - -var _ = Describe("Calling ICS20 precompile from another contract", func() { - var ( - - // interchainSenderCallerContract is the compiled contract calling the interchain functionality - interchainSenderCallerContract evmtypes.CompiledContract - // contractAddr is the address of the smart contract that will be deployed - contractAddr common.Address - // senderCallerContractAddr is the address of the InterchainSenderCaller smart contract that will be deployed - senderCallerContractAddr common.Address - // execRevertedCheck defines the default log checking arguments which includes the - // standard revert message. - execRevertedCheck testutil.LogCheckArgs - // err is a basic error type - err error - ) - - BeforeEach(func() { - s.suiteIBCTesting = true - s.SetupTest() - s.setupAllocationsForTesting() - - // Deploy InterchainSender contract - interchainSenderContract, err = contracts.LoadInterchainSenderContract() - Expect(err).To(BeNil(), "error while loading the interchain sender contract: %v", err) - - contractAddr, err = DeployContract( - s.chainA.GetContext(), - s.app, - s.privKey, - gasPrice, - s.queryClientEVM, - interchainSenderContract, - ) - Expect(err).To(BeNil(), "error while deploying the smart contract: %v", err) - - // NextBlock the smart contract - s.chainA.NextBlock() - - // Deploy InterchainSenderCaller contract - interchainSenderCallerContract, err = contracts.LoadInterchainSenderCallerContract() - Expect(err).To(BeNil(), "error while loading the interchain sender contract: %v", err) - - senderCallerContractAddr, err = DeployContract( - s.chainA.GetContext(), - s.app, - s.privKey, - gasPrice, - s.queryClientEVM, - interchainSenderCallerContract, - contractAddr, - ) - Expect(err).To(BeNil(), "error while deploying the smart contract: %v", err) - - // NextBlock the smart contract - s.chainA.NextBlock() - - // check contracts were correctly deployed - cAcc := s.app.EVMKeeper.GetAccount(s.chainA.GetContext(), contractAddr) - Expect(cAcc).ToNot(BeNil(), "contract account should exist") - Expect(cAcc.IsContract()).To(BeTrue(), "account should be a contract") - - cAcc = s.app.EVMKeeper.GetAccount(s.chainA.GetContext(), senderCallerContractAddr) - Expect(cAcc).ToNot(BeNil(), "contract account should exist") - Expect(cAcc.IsContract()).To(BeTrue(), "account should be a contract") - - // populate default call args - defaultCallArgs = contracts.CallArgs{ - ContractAddr: contractAddr, - ContractABI: interchainSenderContract.ABI, - PrivKey: s.privKey, - GasPrice: gasPrice, - } - defaultApproveArgs = defaultCallArgs. - WithMethodName("testApprove"). - WithArgs(defaultSingleAlloc) - - // default log check arguments - defaultLogCheck = testutil.LogCheckArgs{ABIEvents: s.precompile.Events} - execRevertedCheck = defaultLogCheck.WithErrContains("execution reverted") - passCheck = defaultLogCheck.WithExpPass(true) - }) - - Context("approving methods", func() { - Context("with valid input", func() { - It("should approve one allocation", func() { - approvalCheck := passCheck. - WithExpEvents(authorization.EventTypeIBCTransferAuthorization) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultApproveArgs, approvalCheck) - Expect(err).To(BeNil(), "error while calling the precompile") - - s.chainA.NextBlock() - - // check GetAuthorizations is returning the record - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), contractAddr.Bytes(), s.address.Bytes()) - Expect(err).To(BeNil(), "error while getting authorizations") - Expect(auths).To(HaveLen(1), "expected one authorization") - Expect(auths[0].MsgTypeURL()).To(Equal(ics20.TransferMsgURL)) - transferAuthz := auths[0].(*transfertypes.TransferAuthorization) - Expect(transferAuthz.Allocations[0].SpendLimit).To(Equal(defaultCoins)) - }) - }) - }) - - Context("revoke method", func() { - var defaultRevokeArgs contracts.CallArgs - BeforeEach(func() { - s.setTransferApprovalForContract(defaultApproveArgs) - defaultRevokeArgs = defaultCallArgs.WithMethodName( - "testRevoke", - ) - }) - - It("should revoke authorization", func() { - // used to check if the corresponding event is emitted - revokeCheck := passCheck. - WithExpEvents(authorization.EventTypeIBCTransferAuthorization) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultRevokeArgs, revokeCheck) - Expect(err).To(BeNil(), "error while calling the precompile") - - s.chainA.NextBlock() - - // check authorization was removed - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), contractAddr.Bytes(), s.address.Bytes()) - Expect(err).To(BeNil(), "error while getting authorizations") - Expect(auths).To(BeNil()) - }) - }) - - Context("update allowance methods", func() { - var ( - amt *big.Int - allowanceChangeCheck testutil.LogCheckArgs - defaultChangeAllowanceArg contracts.CallArgs - ) - - BeforeEach(func() { - amt = big.NewInt(1e10) - allowanceChangeCheck = passCheck. - WithExpEvents(authorization.EventTypeIBCTransferAuthorization) - s.setTransferApprovalForContract(defaultApproveArgs) - defaultChangeAllowanceArg = defaultCallArgs. - WithMethodName("testIncreaseAllowance"). - WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - evmosutil.ExampleAttoDenom, - amt, - ) - }) - - Context("Increase allowance", func() { - It("should increase allowance", func() { //nolint:dupl - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultChangeAllowanceArg, allowanceChangeCheck) - Expect(err).To(BeNil(), "error while calling the precompile") - - s.chainA.NextBlock() - - // check authorization spend limit increased - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), contractAddr.Bytes(), s.address.Bytes()) - Expect(err).To(BeNil(), "error while getting authorizations") - Expect(auths).To(HaveLen(1), "expected one authorization") - Expect(auths[0].MsgTypeURL()).To(Equal(ics20.TransferMsgURL)) - transferAuthz := auths[0].(*transfertypes.TransferAuthorization) - Expect(transferAuthz.Allocations[0].SpendLimit.AmountOf(evmosutil.ExampleAttoDenom)).To(Equal(defaultCoins.AmountOf(evmosutil.ExampleAttoDenom).Add(math.NewIntFromBigInt(amt)))) - }) - }) - - Context("Decrease allowance", func() { - var defaultDecreaseAllowanceArg contracts.CallArgs - - BeforeEach(func() { - defaultDecreaseAllowanceArg = defaultChangeAllowanceArg. - WithMethodName("testDecreaseAllowance") - }) - - It("should decrease allowance", func() { //nolint:dupl - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultDecreaseAllowanceArg, allowanceChangeCheck) - Expect(err).To(BeNil(), "error while calling the precompile") - - s.chainA.NextBlock() - - // check authorization spend limit decreased - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.chainA.GetContext(), contractAddr.Bytes(), s.address.Bytes()) - Expect(err).To(BeNil(), "error while getting authorizations") - Expect(auths).To(HaveLen(1), "expected one authorization") - Expect(auths[0].MsgTypeURL()).To(Equal(ics20.TransferMsgURL)) - transferAuthz := auths[0].(*transfertypes.TransferAuthorization) - Expect(transferAuthz.Allocations[0].SpendLimit.AmountOf(evmosutil.ExampleAttoDenom)).To(Equal(defaultCoins.AmountOf(evmosutil.ExampleAttoDenom).Sub(math.NewIntFromBigInt(amt)))) - }) - }) - }) - - Context("transfer method", func() { - var defaultTransferArgs contracts.CallArgs - BeforeEach(func() { - defaultTransferArgs = defaultCallArgs.WithMethodName( - "testTransferUserFunds", - ) - }) - - Context("'aevmos' coin", func() { - Context("with authorization", func() { - BeforeEach(func() { - // set approval to transfer 'aevmos' - s.setTransferApprovalForContract(defaultApproveArgs) - }) - - It("should transfer funds", func() { - initialBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - transferArgs := defaultTransferArgs.WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - s.bondDenom, - defaultCmnCoins[0].Amount, - s.chainB.SenderAccount.GetAddress().String(), // receiver - s.chainB.GetTimeoutHeight(), - uint64(0), // disable timeout timestamp - "memo", - ) - - logCheckArgs := passCheck.WithExpEvents(ics20.EventTypeIBCTransfer) - - res, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, transferArgs, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - out, err := s.precompile.Unpack(ics20.TransferMethod, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking response: %v", err) - // check sequence in returned data - Expect(out[0]).To(Equal(uint64(1))) - - s.chainA.NextBlock() - - // The allowance is spent after the transfer thus the authorization is deleted - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.chainA.GetContext(), contractAddr.Bytes(), s.address.Bytes(), ics20.TransferMsgURL) - Expect(authz).To(BeNil()) - - // check sent tokens were deducted from sending account - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Sub(defaultCoins.AmountOf(s.bondDenom)).Sub(fees))) - }) - - Context("Calling the InterchainSender caller contract", func() { - It("should perform 2 transfers and revert 2 transfers", func() { - // setup approval to send transfer without memo - alloc := defaultSingleAlloc - alloc[0].AllowedPacketData = []string{""} - appArgs := defaultApproveArgs.WithArgs(alloc) - s.setTransferApprovalForContract(appArgs) - // Send some funds to the InterchainSender - // to perform internal transfers - initialContractBal := math.NewInt(1e18) - err := chainutil.FundAccountWithBaseDenom(s.chainA.GetContext(), s.app.BankKeeper, contractAddr.Bytes(), initialContractBal.Int64()) - Expect(err).To(BeNil(), "error while funding account") - - // get initial balances - initialBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - // use half of the allowance when calling the fn - // because in total we'll try to send (2 * amt) - // with 4 IBC transfers (2 will succeed & 2 will revert) - amt := defaultCmnCoins[0].ToSDKType().Amount.QuoRaw(2) - args := contracts.CallArgs{ - PrivKey: s.privKey, - ContractAddr: senderCallerContractAddr, - ContractABI: interchainSenderCallerContract.ABI, - MethodName: "transfersWithRevert", - GasPrice: gasPrice, - Args: []interface{}{ - s.address, - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - s.bondDenom, - amt.BigInt(), - s.chainB.SenderAccount.GetAddress().String(), // receiver - }, - } - - logCheckArgs := passCheck.WithExpEvents([]string{ics20.EventTypeIBCTransfer, ics20.EventTypeIBCTransfer}...) - - res, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, args, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - Expect(res.IsOK()).To(BeTrue()) - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - - // the response should have two IBC transfer cosmos events (required for the relayer) - expIBCPackets := 2 - ibcTransferCount := 0 - sendPacketCount := 0 - for _, event := range res.Events { - if event.Type == transfertypes.EventTypeTransfer { - ibcTransferCount++ - } - if event.Type == channeltypes.EventTypeSendPacket { - sendPacketCount++ - } - } - Expect(ibcTransferCount).To(Equal(expIBCPackets)) - Expect(sendPacketCount).To(Equal(expIBCPackets)) - - // Check that 2 packages were created - pkgs := s.app.IBCKeeper.ChannelKeeper.GetAllPacketCommitments(s.chainA.GetContext()) - Expect(pkgs).To(HaveLen(expIBCPackets)) - - // check that the escrow amount corresponds to the 2 transfers - coinsEscrowed := s.app.TransferKeeper.GetTotalEscrowForDenom(s.chainA.GetContext(), s.bondDenom) - Expect(coinsEscrowed.Amount).To(Equal(amt)) - - amtTransferredFromContract := math.NewInt(45) - finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Sub(amt).Sub(fees).Add(amtTransferredFromContract))) - - contractFinalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), contractAddr.Bytes(), s.bondDenom) - Expect(contractFinalBalance.Amount).To(Equal(initialContractBal.Sub(amtTransferredFromContract))) - }) - }) - }) - }) - - Context("IBC coin", func() { - var ( - ibcDenom = testutil.UosmoIbcdenom - amt, _ = math.NewIntFromString("1000000000000000000000") - sentAmt, _ = math.NewIntFromString("100000000000000000000") - coinOsmo = sdk.NewCoin(ibcDenom, amt) - coins = sdk.NewCoins(coinOsmo) - initialOsmoBalance sdk.Coin - defaultTransferIbcCoinArgs contracts.CallArgs - ) - BeforeEach(func() { - // set IBC denom trace - s.app.TransferKeeper.SetDenomTrace( - s.chainA.GetContext(), - transfertypes.DenomTrace{ - Path: testutil.UosmoDenomtrace.Path, - BaseDenom: testutil.UosmoDenomtrace.BaseDenom, - }, - ) - - // Mint IBC coins and add them to sender balance - err = s.app.BankKeeper.MintCoins(s.chainA.GetContext(), minttypes.ModuleName, coins) - s.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToAccount(s.chainA.GetContext(), minttypes.ModuleName, s.chainA.SenderAccount.GetAddress(), coins) - s.Require().NoError(err) - - initialOsmoBalance = s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), ibcDenom) - Expect(initialOsmoBalance.Amount).To(Equal(amt)) - - defaultTransferIbcCoinArgs = defaultTransferArgs.WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - ibcDenom, - sentAmt.BigInt(), - s.chainB.SenderAccount.GetAddress().String(), // receiver - s.chainB.GetTimeoutHeight(), - uint64(0), // disable timeout timestamp - "memo", - ) - }) - - Context("without authorization", func() { - It("should not transfer IBC coin", func() { - // initialEvmosBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultTransferIbcCoinArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - - // check only fees were deducted from sending account - // TODO: fees are not calculated correctly with this logic - // fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - // finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - // Expect(finalBalance.Amount).To(Equal(initialEvmosBalance.Amount.Sub(fees))) - - // check IBC coins balance remains unchanged - finalOsmoBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), ibcDenom) - Expect(finalOsmoBalance.Amount).To(Equal(initialOsmoBalance.Amount)) - }) - }) - - Context("with authorization", func() { - BeforeEach(func() { - // create grant to allow spending the ibc coins - args := defaultApproveArgs.WithArgs([]cmn.ICS20Allocation{ - { - SourcePort: ibctesting.TransferPort, - SourceChannel: s.transferPath.EndpointA.ChannelID, - SpendLimit: []cmn.Coin{{Denom: ibcDenom, Amount: amt.BigInt()}}, - AllowList: []string{}, - AllowedPacketData: []string{"memo"}, - }, - }) - s.setTransferApprovalForContract(args) - }) - - It("should transfer IBC coin", func() { - initialEvmosBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - logCheckArgs := passCheck.WithExpEvents(ics20.EventTypeIBCTransfer) - - res, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultTransferIbcCoinArgs, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - out, err := s.precompile.Unpack(ics20.TransferMethod, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking response: %v", err) - // check sequence in returned data - Expect(out[0]).To(Equal(uint64(1))) - - s.chainA.NextBlock() - - // Check the allowance spend limit is updated - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.chainA.GetContext(), contractAddr.Bytes(), s.address.Bytes(), ics20.TransferMsgURL) - Expect(authz).NotTo(BeNil(), "expected one authorization") - Expect(authz.MsgTypeURL()).To(Equal(ics20.TransferMsgURL)) - transferAuthz := authz.(*transfertypes.TransferAuthorization) - Expect(transferAuthz.Allocations[0].SpendLimit.AmountOf(ibcDenom)).To(Equal(amt.Sub(sentAmt))) - - // check only fees were deducted from sending account - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(initialEvmosBalance.Amount.Sub(fees))) - - // check sent tokens were deducted from sending account - finalOsmoBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), ibcDenom) - Expect(finalOsmoBalance.Amount).To(Equal(initialOsmoBalance.Amount.Sub(sentAmt))) - }) - }) - }) - - Context("transfer ERC20", func() { - var ( - // denom is the registered token pair denomination - denom string - // erc20Addr is the address of the ERC20 contract - erc20Addr common.Address - defaultTransferERC20Args contracts.CallArgs - // sentAmount is the amount of tokens to send for testing - sentAmount = big.NewInt(1000) - ) - - BeforeEach(func() { - erc20Addr = s.setupERC20ContractTests(sentAmount) - - // Register ERC20 token pair to send via IBC - _, err := s.app.Erc20Keeper.RegisterERC20(s.chainA.GetContext(), erc20Addr) - Expect(err).To(BeNil(), "error while registering the token pair: %v", err) - - denom = fmt.Sprintf("erc20/%s", erc20Addr.String()) - - defaultTransferERC20Args = defaultTransferArgs.WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - denom, - sentAmount, - s.chainB.SenderAccount.GetAddress().String(), // receiver - s.chainB.GetTimeoutHeight(), - uint64(0), // disable timeout timestamp - "memo", - ) - }) - - Context("without authorization", func() { - tryERC20Transfer := func() { - // initialBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultTransferERC20Args, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - - // check only fees were deducted from sending account - // TODO: fees are not calculated correctly with this logic - // fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - // finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - // Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Sub(fees))) - - // check Erc20 balance remained unchanged by sent amount - balance := s.app.Erc20Keeper.BalanceOf( - s.chainA.GetContext(), - evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI, - erc20Addr, - s.address, - ) - Expect(balance).To(Equal(sentAmount), "address does not have the expected amount of tokens") - } - - It("should not transfer registered ERC-20 token", func() { - tryERC20Transfer() - }) - - Context("with authorization, but not for ERC20 token", func() { - BeforeEach(func() { - // create grant to allow spending the ibc coins - args := defaultApproveArgs.WithArgs([]cmn.ICS20Allocation{ - { - SourcePort: ibctesting.TransferPort, - SourceChannel: s.transferPath.EndpointA.ChannelID, - SpendLimit: []cmn.Coin{{Denom: testutil.UosmoIbcdenom, Amount: big.NewInt(10000)}}, - AllowList: []string{}, - }, - }) - s.setTransferApprovalForContract(args) - }) - - It("should not transfer registered ERC-20 token", func() { - tryERC20Transfer() - }) - }) - }) - - Context("with authorization", func() { - BeforeEach(func() { - // create grant to allow spending the erc20 tokens - args := defaultApproveArgs.WithArgs([]cmn.ICS20Allocation{ - { - SourcePort: ibctesting.TransferPort, - SourceChannel: s.transferPath.EndpointA.ChannelID, - SpendLimit: []cmn.Coin{{Denom: denom, Amount: sentAmount}}, - AllowList: []string{}, - AllowedPacketData: []string{"memo"}, - }, - }) - s.setTransferApprovalForContract(args) - }) - - It("should transfer registered ERC-20 token", func() { - initialBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - logCheckArgs := passCheck.WithExpEvents(ics20.EventTypeIBCTransfer) - - res, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultTransferERC20Args, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - out, err := s.precompile.Unpack(ics20.TransferMethod, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking response: %v", err) - // check sequence in returned data - Expect(out[0]).To(Equal(uint64(1))) - - s.chainA.NextBlock() - - // The allowance is spent after the transfer thus the authorization is deleted - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.chainA.GetContext(), contractAddr.Bytes(), s.address.Bytes(), ics20.TransferMsgURL) - Expect(authz).To(BeNil()) - - // check only fees were deducted from sending account - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(initialBalance.Amount.Sub(fees))) - - // check Erc20 balance was reduced by sent amount - balance := s.app.Erc20Keeper.BalanceOf( - s.chainA.GetContext(), - evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI, - erc20Addr, - s.address, - ) - Expect(balance.Int64()).To(BeZero(), "address does not have the expected amount of tokens") - }) - }) - }) - }) - - Context("transfer a contract's funds", func() { - var defaultTransferArgs contracts.CallArgs - - BeforeEach(func() { - defaultTransferArgs = defaultCallArgs.WithMethodName( - "testTransferContractFunds", - ) - }) - - Context("transfer 'aevmos", func() { - var defaultTransferEvmosArgs contracts.CallArgs - BeforeEach(func() { - // send some funds to the contract from which the funds will be sent - err = chainutil.FundAccountWithBaseDenom(s.chainA.GetContext(), s.app.BankKeeper, contractAddr.Bytes(), amt) - Expect(err).To(BeNil()) - senderInitialBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), contractAddr.Bytes(), s.bondDenom) - Expect(senderInitialBalance.Amount).To(Equal(math.NewInt(amt))) - - defaultTransferEvmosArgs = defaultTransferArgs.WithArgs( - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - s.bondDenom, - defaultCmnCoins[0].Amount, - s.chainB.SenderAccount.GetAddress().String(), // receiver - s.chainB.GetTimeoutHeight(), - uint64(0), // disable timeout timestamp - "memo", - ) - }) - - Context("without authorization", func() { - It("should not transfer funds", func() { - initialBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), contractAddr.Bytes(), s.bondDenom) - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultTransferEvmosArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - - // check sent tokens remained unchanged from sending account (contract) - finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), contractAddr.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(initialBalance.Amount)) - }) - }) - - Context("with authorization", func() { - BeforeEach(func() { - // set approval to transfer 'aevmos' - s.setTransferApprovalForContract(defaultApproveArgs) - }) - - It("should transfer funds", func() { - initialSignerBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - - logCheckArgs := passCheck.WithExpEvents(ics20.EventTypeIBCTransfer) - - res, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultTransferEvmosArgs, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - out, err := s.precompile.Unpack(ics20.TransferMethod, ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking response: %v", err) - // check sequence in returned data - Expect(out[0]).To(Equal(uint64(1))) - - s.chainA.NextBlock() - - // The allowance is spent after the transfer thus the authorization is deleted - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.chainA.GetContext(), contractAddr.Bytes(), s.address.Bytes(), ics20.TransferMsgURL) - Expect(authz).To(BeNil()) - - // check sent tokens were deducted from sending account - finalBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), contractAddr.Bytes(), s.bondDenom) - Expect(finalBalance.Amount).To(Equal(math.ZeroInt())) - - // tx fees are paid by the tx signer - fees := math.NewIntFromBigInt(gasPrice).MulRaw(res.GasUsed) - finalSignerBalance := s.app.BankKeeper.GetBalance(s.chainA.GetContext(), s.address.Bytes(), s.bondDenom) - Expect(finalSignerBalance.Amount).To(Equal(initialSignerBalance.Amount.Sub(fees))) - }) - }) - }) - }) - - // =============================================== - // QUERIES - // =============================================== - - Context("allowance query method", func() { - var defaultAllowanceArgs contracts.CallArgs - BeforeEach(func() { - s.setTransferApprovalForContract(defaultApproveArgs) - defaultAllowanceArgs = defaultCallArgs. - WithMethodName("testAllowance"). - WithArgs(contractAddr, s.address) - }) - - It("should return allocations", func() { - _, ethRes, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, defaultAllowanceArgs, passCheck) - Expect(err).To(BeNil(), "error while calling the precompile") - - var out []cmn.ICS20Allocation - err = interchainSenderContract.ABI.UnpackIntoInterface(&out, "testAllowance", ethRes.Ret) - Expect(err).To(BeNil(), "error while unpacking the output: %v", err) - Expect(out).To(HaveLen(1)) - Expect(len(out)).To(Equal(len(defaultSingleAlloc))) - Expect(out[0].SourcePort).To(Equal(defaultSingleAlloc[0].SourcePort)) - Expect(out[0].SourceChannel).To(Equal(defaultSingleAlloc[0].SourceChannel)) - Expect(out[0].SpendLimit).To(Equal(defaultSingleAlloc[0].SpendLimit)) - Expect(out[0].AllowList).To(HaveLen(0)) - Expect(out[0].AllowedPacketData).To(HaveLen(1)) - Expect(out[0].AllowedPacketData[0]).To(Equal("memo")) - }) - }) -}) diff --git a/precompiles/ics20/query.go b/precompiles/ics20/query.go index c14ccca4..a64c2ff1 100644 --- a/precompiles/ics20/query.go +++ b/precompiles/ics20/query.go @@ -8,7 +8,7 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/evmos/os/precompiles/authorization" cmn "github.com/evmos/os/precompiles/common" @@ -39,7 +39,7 @@ func (p Precompile) DenomTrace( return nil, err } - res, err := p.transferKeeper.DenomTrace(sdk.WrapSDKContext(ctx), req) + res, err := p.transferKeeper.DenomTrace(ctx, req) if err != nil { // if the trace does not exist, return empty array if strings.Contains(err.Error(), ErrTraceNotFound) { @@ -63,7 +63,7 @@ func (p Precompile) DenomTraces( return nil, err } - res, err := p.transferKeeper.DenomTraces(sdk.WrapSDKContext(ctx), req) + res, err := p.transferKeeper.DenomTraces(ctx, req) if err != nil { return nil, err } @@ -83,7 +83,7 @@ func (p Precompile) DenomHash( return nil, err } - res, err := p.transferKeeper.DenomHash(sdk.WrapSDKContext(ctx), req) + res, err := p.transferKeeper.DenomHash(ctx, req) if err != nil { // if the denom hash does not exist, return empty string if strings.Contains(err.Error(), ErrTraceNotFound) { diff --git a/precompiles/ics20/query_test.go b/precompiles/ics20/query_test.go deleted file mode 100644 index 2056db66..00000000 --- a/precompiles/ics20/query_test.go +++ /dev/null @@ -1,398 +0,0 @@ -package ics20_test - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - "github.com/evmos/os/precompiles/authorization" - cmn "github.com/evmos/os/precompiles/common" - "github.com/evmos/os/precompiles/ics20" - "github.com/evmos/os/testutil" -) - -func (s *PrecompileTestSuite) TestDenomTrace() { - var expTrace types.DenomTrace - method := s.precompile.Methods[ics20.DenomTraceMethod] - testCases := []struct { - name string - malleate func() []interface{} - postCheck func(data []byte, inputArgs []interface{}) - gas uint64 - expError bool - errContains string - }{ - { - "fail - empty args", - func() []interface{} { return []interface{}{} }, - func([]byte, []interface{}) {}, - 200000, - true, - "invalid input arguments", - }, - { - "fail - invalid denom trace", - func() []interface{} { - return []interface{}{"invalid denom trace"} - }, - func([]byte, []interface{}) {}, - 200000, - true, - "invalid denom trace", - }, - { - "success - denom trace not found, return empty struct", - func() []interface{} { - expTrace.Path = "transfer/channelToA/transfer/channelToB" - expTrace.BaseDenom = testutil.ExampleAttoDenom - return []interface{}{ - expTrace.IBCDenom(), - } - }, - func(data []byte, _ []interface{}) { - var out ics20.DenomTraceResponse - err := s.precompile.UnpackIntoInterface(&out, ics20.DenomTraceMethod, data) - s.Require().NoError(err, "failed to unpack output", err) - s.Require().Equal("", out.DenomTrace.BaseDenom) - s.Require().Equal("", out.DenomTrace.Path) - }, - 200000, - false, - "", - }, - { - "success - denom trace", - func() []interface{} { - expTrace.Path = "transfer/channelToA/transfer/channelToB" - expTrace.BaseDenom = testutil.ExampleAttoDenom - s.app.TransferKeeper.SetDenomTrace(s.ctx, expTrace) - return []interface{}{ - expTrace.IBCDenom(), - } - }, - func(data []byte, _ []interface{}) { - var out ics20.DenomTraceResponse - err := s.precompile.UnpackIntoInterface(&out, ics20.DenomTraceMethod, data) - s.Require().NoError(err, "failed to unpack output", err) - s.Require().Equal(expTrace.Path, out.DenomTrace.Path) - s.Require().Equal(expTrace.BaseDenom, out.DenomTrace.BaseDenom) - }, - 200000, - false, - "", - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() - contract := s.NewPrecompileContract(tc.gas) - args := tc.malleate() - bz, err := s.precompile.DenomTrace(s.ctx, contract, &method, args) - - if tc.expError { - s.Require().ErrorContains(err, tc.errContains) - s.Require().Empty(bz) - } else { - s.Require().NoError(err) - tc.postCheck(bz, args) - } - }) - } -} - -func (s *PrecompileTestSuite) TestDenomTraces() { - expTraces := types.Traces(nil) - method := s.precompile.Methods[ics20.DenomTracesMethod] - testCases := []struct { - name string - malleate func() []interface{} - postCheck func(data []byte, inputArgs []interface{}) - gas uint64 - expError bool - errContains string - }{ - { - "fail - empty args", - func() []interface{} { return []interface{}{} }, - func([]byte, []interface{}) {}, - 200000, - true, - "invalid number of arguments", - }, - { - "success - gets denom traces", - func() []interface{} { - expTraces = append(expTraces, types.DenomTrace{Path: "", BaseDenom: testutil.ExampleAttoDenom}) - expTraces = append(expTraces, types.DenomTrace{Path: "transfer/channelToA/transfer/channelToB", BaseDenom: testutil.ExampleAttoDenom}) - expTraces = append(expTraces, types.DenomTrace{Path: "transfer/channelToB", BaseDenom: testutil.ExampleAttoDenom}) - - for _, trace := range expTraces { - s.app.TransferKeeper.SetDenomTrace(s.ctx, trace) - } - return []interface{}{ - query.PageRequest{ - Limit: 3, - CountTotal: true, - }, - } - }, - func(data []byte, _ []interface{}) { - var denomTraces ics20.DenomTracesResponse - err := s.precompile.UnpackIntoInterface(&denomTraces, ics20.DenomTracesMethod, data) - s.Require().Equal(denomTraces.PageResponse.Total, uint64(3)) - s.Require().NoError(err, "failed to unpack output", err) - s.Require().Equal(3, len(denomTraces.DenomTraces)) - for i, trace := range denomTraces.DenomTraces { - s.Require().Equal(expTraces[i].Path, trace.Path) - } - }, - 200000, - false, - "", - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() - contract := s.NewPrecompileContract(tc.gas) - args := tc.malleate() - bz, err := s.precompile.DenomTraces(s.ctx, contract, &method, args) - - if tc.expError { - s.Require().ErrorContains(err, tc.errContains) - s.Require().Empty(bz) - } else { - s.Require().NoError(err) - tc.postCheck(bz, args) - } - }) - } -} - -func (s *PrecompileTestSuite) TestDenomHash() { - reqTrace := types.DenomTrace{ - Path: "transfer/channelToA/transfer/channelToB", - BaseDenom: testutil.ExampleAttoDenom, - } - method := s.precompile.Methods[ics20.DenomHashMethod] - testCases := []struct { - name string - malleate func() []interface{} - postCheck func(data []byte, inputArgs []interface{}) - gas uint64 - expError bool - errContains string - }{ - { - "success - trace not found, returns empty string", - func() []interface{} { return []interface{}{"transfer/channelToB/transfer/channelToA"} }, - func(data []byte, _ []interface{}) { - var hash string - err := s.precompile.UnpackIntoInterface(&hash, ics20.DenomHashMethod, data) - s.Require().NoError(err, "failed to unpack output", err) - s.Require().Equal("", hash) - }, - 200000, - false, - "", - }, - { - "success - get the hash of a denom trace", - func() []interface{} { - s.app.TransferKeeper.SetDenomTrace(s.ctx, reqTrace) - return []interface{}{ - reqTrace.GetFullDenomPath(), - } - }, - func(data []byte, _ []interface{}) { - var hash string - err := s.precompile.UnpackIntoInterface(&hash, ics20.DenomHashMethod, data) - s.Require().NoError(err, "failed to unpack output", err) - s.Require().Equal(reqTrace.Hash().String(), hash) - }, - 200000, - false, - "", - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() - contract := s.NewPrecompileContract(tc.gas) - args := tc.malleate() - - bz, err := s.precompile.DenomHash(s.ctx, contract, &method, args) - - if tc.expError { - s.Require().ErrorContains(err, tc.errContains) - s.Require().Empty(bz) - } else { - s.Require().NoError(err) - tc.postCheck(bz, args) - } - }) - } -} - -func (s *PrecompileTestSuite) TestAllowance() { - var ( - path = NewTransferPath(s.chainA, s.chainB) - path2 = NewTransferPath(s.chainA, s.chainB) - paths = []*ibctesting.Path{path, path2} - method = s.precompile.Methods[authorization.AllowanceMethod] - ) - // set channel, otherwise is "" and throws error - path.EndpointA.ChannelID = "channel-0" - path2.EndpointA.ChannelID = "channel-1" - - testCases := []struct { - name string - malleate func() []interface{} - postCheck func(bz []byte) - gas uint64 - expErr bool - errContains string - }{ - { - "fail - empty input args", - func() []interface{} { - return []interface{}{} - }, - func([]byte) {}, - 100000, - true, - fmt.Sprintf(cmn.ErrInvalidNumberOfArgs, 3, 1), - }, - { - "success - no allowance == empty array", - func() []interface{} { - return []interface{}{ - s.address, - s.differentAddr, - } - }, - func(bz []byte) { - var allocations []cmn.ICS20Allocation - err := s.precompile.UnpackIntoInterface(&allocations, authorization.AllowanceMethod, bz) - s.Require().NoError(err, "failed to unpack output") - s.Require().Len(allocations, 0) - }, - 100000, - false, - "", - }, - { - "success - auth with one allocation", - func() []interface{} { - err := s.NewTransferAuthorization( - s.ctx, - s.app, - s.differentAddr, - s.address, - path, - defaultCoins, - []string{s.chainB.SenderAccount.GetAddress().String()}, - []string{"memo"}, - ) - s.Require().NoError(err) - - return []interface{}{ - s.differentAddr, - s.address, - } - }, - func(bz []byte) { - expAllocs := []cmn.ICS20Allocation{ - { - SourcePort: path.EndpointA.ChannelConfig.PortID, - SourceChannel: path.EndpointA.ChannelID, - SpendLimit: defaultCmnCoins, - AllowList: []string{s.chainB.SenderAccount.GetAddress().String()}, - AllowedPacketData: []string{"memo"}, - }, - } - - var allocations []cmn.ICS20Allocation - err := s.precompile.UnpackIntoInterface(&allocations, authorization.AllowanceMethod, bz) - s.Require().NoError(err, "failed to unpack output") - - s.Require().Equal(expAllocs, allocations) - }, - 100000, - false, - "", - }, - { - "success - auth with multiple allocations", - func() []interface{} { - allocs := make([]types.Allocation, len(paths)) - for i, p := range paths { - allocs[i] = types.Allocation{ - SourcePort: p.EndpointA.ChannelConfig.PortID, - SourceChannel: p.EndpointA.ChannelID, - SpendLimit: mutliSpendLimit, - AllowList: []string{s.chainB.SenderAccount.GetAddress().String()}, - AllowedPacketData: []string{"memo"}, - } - } - - err := s.NewTransferAuthorizationWithAllocations( - s.ctx, - s.app, - s.differentAddr, - s.address, - allocs, - ) - s.Require().NoError(err) - - return []interface{}{ - s.differentAddr, - s.address, - } - }, - func(bz []byte) { - expAllocs := make([]cmn.ICS20Allocation, len(paths)) - for i, p := range paths { - expAllocs[i] = cmn.ICS20Allocation{ - SourcePort: p.EndpointA.ChannelConfig.PortID, - SourceChannel: p.EndpointA.ChannelID, - SpendLimit: mutliCmnCoins, - AllowList: []string{s.chainB.SenderAccount.GetAddress().String()}, - AllowedPacketData: []string{"memo"}, - } - } - - var allocations []cmn.ICS20Allocation - err := s.precompile.UnpackIntoInterface(&allocations, authorization.AllowanceMethod, bz) - s.Require().NoError(err, "failed to unpack output") - - s.Require().Equal(expAllocs, allocations) - }, - 100000, - false, - "", - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() // reset - - args := tc.malleate() - bz, err := s.precompile.Allowance(s.ctx, &method, args) - - if tc.expErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), tc.errContains) - } else { - s.Require().NoError(err) - s.Require().NotNil(bz) - tc.postCheck(bz) - } - }) - } -} diff --git a/precompiles/ics20/setup_test.go b/precompiles/ics20/setup_test.go deleted file mode 100644 index 6b4f9f03..00000000 --- a/precompiles/ics20/setup_test.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright Tharsis Labs Ltd.(Evmos) -// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) -package ics20_test - -import ( - "testing" - "time" - - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - exampleapp "github.com/evmos/os/example_chain" - evmosibc "github.com/evmos/os/ibc/testing" - "github.com/evmos/os/precompiles/ics20" - "github.com/evmos/os/x/evm/statedb" - evmtypes "github.com/evmos/os/x/evm/types" - - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/ginkgo/v2" - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/gomega" - - "github.com/stretchr/testify/suite" -) - -var s *PrecompileTestSuite - -type PrecompileTestSuite struct { - suite.Suite - - ctx sdk.Context - app *exampleapp.ExampleChain - address common.Address - differentAddr common.Address - validators []stakingtypes.Validator - valSet *tmtypes.ValidatorSet - ethSigner ethtypes.Signer - privKey cryptotypes.PrivKey - signer keyring.Signer - bondDenom string - - precompile *ics20.Precompile - stateDB *statedb.StateDB - - coordinator *ibctesting.Coordinator - chainA *ibctesting.TestChain - chainB *ibctesting.TestChain - transferPath *evmosibc.Path - queryClientEVM evmtypes.QueryClient - - defaultExpirationDuration time.Time - - suiteIBCTesting bool -} - -func TestPrecompileTestSuite(t *testing.T) { - s = new(PrecompileTestSuite) - suite.Run(t, s) - - // Run Ginkgo integration tests - RegisterFailHandler(Fail) - RunSpecs(t, "ICS20 Precompile Suite") -} - -func (s *PrecompileTestSuite) SetupTest() { - s.DoSetupTest() -} diff --git a/precompiles/ics20/tx.go b/precompiles/ics20/tx.go index 86653d03..9d25eb4a 100644 --- a/precompiles/ics20/tx.go +++ b/precompiles/ics20/tx.go @@ -9,8 +9,8 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" @@ -59,7 +59,7 @@ func (p *Precompile) Transfer( return nil, err } - res, err := p.transferKeeper.Transfer(sdk.WrapSDKContext(ctx), msg) + res, err := p.transferKeeper.Transfer(ctx, msg) if err != nil { return nil, err } diff --git a/precompiles/ics20/tx_test.go b/precompiles/ics20/tx_test.go deleted file mode 100644 index ccf76d6c..00000000 --- a/precompiles/ics20/tx_test.go +++ /dev/null @@ -1,392 +0,0 @@ -package ics20_test - -import ( - "fmt" - "math/big" - - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/ethereum/go-ethereum/common" - chainutil "github.com/evmos/os/example_chain/testutil" - cmn "github.com/evmos/os/precompiles/common" - "github.com/evmos/os/precompiles/ics20" - "github.com/evmos/os/testutil" - testutiltx "github.com/evmos/os/testutil/tx" - "github.com/evmos/os/x/evm/core/vm" -) - -var ( - differentAddress = testutiltx.GenerateAddress() - amt int64 = 1000000000000000000 -) - -func (s *PrecompileTestSuite) TestTransfer() { - callingContractAddr := differentAddress - method := s.precompile.Methods[ics20.TransferMethod] - testCases := []struct { - name string - malleate func(sender, receiver sdk.AccAddress) []interface{} - postCheck func(sender, receiver sdk.AccAddress, data []byte, inputArgs []interface{}) - gas uint64 - expError bool - errContains string - }{ - { - "fail - empty args", - func(sdk.AccAddress, sdk.AccAddress) []interface{} { - return []interface{}{} - }, - func(sdk.AccAddress, sdk.AccAddress, []byte, []interface{}) { - }, - 200000, - true, - fmt.Sprintf(cmn.ErrInvalidNumberOfArgs, 9, 0), - }, - { - "fail - no transfer authorization", - func(sdk.AccAddress, sdk.AccAddress) []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - return []interface{}{ - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(1e18), - common.BytesToAddress(s.chainA.SenderAccount.GetAddress().Bytes()), - s.chainB.SenderAccount.GetAddress().String(), - s.chainB.GetTimeoutHeight(), - uint64(0), - "memo", - } - }, - func(sdk.AccAddress, sdk.AccAddress, []byte, []interface{}) { - }, - 200000, - true, - "does not exist", - }, - { - "fail - channel does not exist", - func(sdk.AccAddress, sdk.AccAddress) []interface{} { - return []interface{}{ - "port", - "channel-01", - testutil.ExampleAttoDenom, - big.NewInt(1e18), - common.BytesToAddress(s.chainA.SenderAccount.GetAddress().Bytes()), - s.chainB.SenderAccount.GetAddress().String(), - s.chainB.GetTimeoutHeight(), - uint64(0), - "memo", - } - }, - func(sdk.AccAddress, sdk.AccAddress, []byte, []interface{}) { - }, - 200000, - true, - channeltypes.ErrChannelNotFound.Error(), - }, - { - "fail - non authorized denom", - func(sender, _ sdk.AccAddress) []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, callingContractAddr, common.BytesToAddress(sender), path, defaultCoins, nil, []string{"memo"}) - s.Require().NoError(err) - return []interface{}{ - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - "uatom", - big.NewInt(1e18), - common.BytesToAddress(s.chainA.SenderAccount.GetAddress().Bytes()), - s.chainB.SenderAccount.GetAddress().String(), - s.chainB.GetTimeoutHeight(), - uint64(0), - "memo", - } - }, - func(sdk.AccAddress, sdk.AccAddress, []byte, []interface{}) { - }, - 200000, - true, - "requested amount is more than spend limit", - }, - { - "fail - allowance is less than transfer amount", - func(sender, _ sdk.AccAddress) []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, callingContractAddr, common.BytesToAddress(sender), path, defaultCoins, nil, []string{"memo"}) - s.Require().NoError(err) - return []interface{}{ - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(2e18), - common.BytesToAddress(s.chainA.SenderAccount.GetAddress().Bytes()), - s.chainB.SenderAccount.GetAddress().String(), - s.chainB.GetTimeoutHeight(), - uint64(0), - "memo", - } - }, - func(sdk.AccAddress, sdk.AccAddress, []byte, []interface{}) { - }, - 200000, - true, - "requested amount is more than spend limit", - }, - { - "fail - transfer 1 Evmos from chainA to chainB from somebody else's account", - func(sender, receiver sdk.AccAddress) []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, common.BytesToAddress(sender), common.BytesToAddress(sender), path, defaultCoins, nil, []string{"memo"}) - s.Require().NoError(err) - // fund another user's account - err = chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, differentAddress.Bytes(), amt) - s.Require().NoError(err) - - return []interface{}{ - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(amt), - common.BytesToAddress(differentAddress.Bytes()), - receiver.String(), - s.chainB.GetTimeoutHeight(), - uint64(0), - "memo", - } - }, - func(sender, _ sdk.AccAddress, _ []byte, _ []interface{}) { - // The allowance is spent after the transfer thus the authorization is deleted - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, sender, sender, ics20.TransferMsgURL) - transferAuthz := authz.(*transfertypes.TransferAuthorization) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, defaultCoins) - - // the balance on other user's account should remain unchanged - balance := s.app.BankKeeper.GetBalance(s.ctx, differentAddress.Bytes(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount, math.NewInt(amt)) - s.Require().Equal(balance.Denom, testutil.ExampleAttoDenom) - }, - 200000, - true, - "does not exist", - }, - { - "fail - transfer with memo string, but authorization does not allows it", - func(sender, receiver sdk.AccAddress) []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, callingContractAddr, common.BytesToAddress(sender), path, defaultCoins, nil, nil) - s.Require().NoError(err) - return []interface{}{ - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(1e18), - common.BytesToAddress(sender.Bytes()), - receiver.String(), - s.chainB.GetTimeoutHeight(), - uint64(0), - "memo", - } - }, - func(sender, _ sdk.AccAddress, _ []byte, _ []interface{}) { - // Check allowance remains unchanged - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, callingContractAddr.Bytes(), sender, ics20.TransferMsgURL) - transferAuthz := authz.(*transfertypes.TransferAuthorization) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, defaultCoins) - }, - 200000, - true, - "memo must be empty because allowed packet data in allocation is empty", - }, - { - "pass - transfer 1 Evmos from chainA to chainB and spend the entire allowance", - func(sender, receiver sdk.AccAddress) []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, callingContractAddr, common.BytesToAddress(sender), path, defaultCoins, nil, []string{"memo"}) - s.Require().NoError(err) - return []interface{}{ - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(1e18), - common.BytesToAddress(sender.Bytes()), - receiver.String(), - s.chainB.GetTimeoutHeight(), - uint64(0), - "memo", - } - }, - func(sender, _ sdk.AccAddress, _ []byte, _ []interface{}) { - // Check allowance was deleted - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, callingContractAddr.Bytes(), sender, ics20.TransferMsgURL) - s.Require().Nil(authz) - - balance := s.app.BankKeeper.GetBalance(s.ctx, s.chainA.SenderAccount.GetAddress(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount, math.NewInt(4e18)) - s.Require().Equal(balance.Denom, testutil.ExampleAttoDenom) - }, - 200000, - false, - "", - }, - //nolint:dupl - { - "pass - transfer 1 Evmos from chainA to chainB and don't change the unlimited spending limit", - func(sender, receiver sdk.AccAddress) []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, callingContractAddr, common.BytesToAddress(sender), path, maxUint256Coins, nil, []string{"memo"}) - s.Require().NoError(err) - return []interface{}{ - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(1e18), - common.BytesToAddress(sender.Bytes()), - receiver.String(), - s.chainB.GetTimeoutHeight(), - uint64(0), - "memo", - } - }, - func(sender, _ sdk.AccAddress, _ []byte, _ []interface{}) { - // The allowance is spent after the transfer thus the authorization is deleted - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, callingContractAddr.Bytes(), sender, ics20.TransferMsgURL) - transferAuthz := authz.(*transfertypes.TransferAuthorization) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, maxUint256Coins) - - balance := s.app.BankKeeper.GetBalance(s.ctx, s.chainA.SenderAccount.GetAddress(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount, math.NewInt(4e18)) - s.Require().Equal(balance.Denom, testutil.ExampleAttoDenom) - }, - 200000, - false, - "", - }, - //nolint:dupl - { - "pass - transfer 1 Evmos from chainA to chainB and only change 1 spend limit", - func(sender, receiver sdk.AccAddress) []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - err := s.NewTransferAuthorization(s.ctx, s.app, callingContractAddr, common.BytesToAddress(sender), path, mutliSpendLimit, nil, []string{"memo"}) - s.Require().NoError(err) - return []interface{}{ - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(1e18), - common.BytesToAddress(sender.Bytes()), - receiver.String(), - s.chainB.GetTimeoutHeight(), - uint64(0), - "memo", - } - }, - func(sender, _ sdk.AccAddress, _ []byte, _ []interface{}) { - // The allowance is spent after the transfer thus the authorization is deleted - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, callingContractAddr.Bytes(), sender, ics20.TransferMsgURL) - transferAuthz := authz.(*transfertypes.TransferAuthorization) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, atomCoins) - - balance := s.app.BankKeeper.GetBalance(s.ctx, s.chainA.SenderAccount.GetAddress(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount, math.NewInt(4e18)) - s.Require().Equal(balance.Denom, testutil.ExampleAttoDenom) - }, - 200000, - false, - "", - }, - { - "pass - transfer 1 Evmos from chainA to chainB and only change 1 spend limit for the associated allocation", - func(sender, receiver sdk.AccAddress) []interface{} { - path := NewTransferPath(s.chainA, s.chainB) - s.coordinator.Setup(path) - allocations := []transfertypes.Allocation{ - { - SourcePort: "port-01", - SourceChannel: "channel-03", - SpendLimit: atomCoins, - AllowList: nil, - AllowedPacketData: []string{"*"}, // allow any memo string - - }, - { - SourcePort: path.EndpointA.ChannelConfig.PortID, - SourceChannel: path.EndpointA.ChannelID, - SpendLimit: defaultCoins, - AllowList: nil, - AllowedPacketData: []string{"*"}, // allow any memo string - }, - } - err := s.NewTransferAuthorizationWithAllocations(s.ctx, s.app, callingContractAddr, common.BytesToAddress(sender), allocations) - s.Require().NoError(err) - return []interface{}{ - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - testutil.ExampleAttoDenom, - big.NewInt(1e18), - common.BytesToAddress(sender.Bytes()), - receiver.String(), - s.chainB.GetTimeoutHeight(), - uint64(0), - "memo", - } - }, - func(sender, _ sdk.AccAddress, _ []byte, _ []interface{}) { - // The allowance is spent after the transfer thus the authorization is deleted - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, callingContractAddr.Bytes(), sender, ics20.TransferMsgURL) - transferAuthz := authz.(*transfertypes.TransferAuthorization) - s.Require().Equal(transferAuthz.Allocations[0].SpendLimit, atomCoins) - - balance := s.app.BankKeeper.GetBalance(s.ctx, s.chainA.SenderAccount.GetAddress(), testutil.ExampleAttoDenom) - s.Require().Equal(balance.Amount, math.NewInt(4e18)) - s.Require().Equal(balance.Denom, testutil.ExampleAttoDenom) - }, - 200000, - false, - "", - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTest() - - sender := s.chainA.SenderAccount.GetAddress() - receiver := s.chainB.SenderAccount.GetAddress() - - contract := vm.NewContract(vm.AccountRef(common.BytesToAddress(sender)), s.precompile, big.NewInt(0), tc.gas) - - s.ctx = s.ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) - initialGas := s.ctx.GasMeter().GasConsumed() - s.Require().Zero(initialGas) - - args := tc.malleate(sender, receiver) - - // set the caller address to be another address (so we can test the authorization logic) - contract.CallerAddress = callingContractAddr - bz, err := s.precompile.Transfer(s.ctx, common.BytesToAddress(sender), contract, s.stateDB, &method, args) - - if tc.expError { - s.Require().ErrorContains(err, tc.errContains) - s.Require().Empty(bz) - if tc.postCheck != nil { - tc.postCheck(sender, receiver, bz, args) - } - } else { - s.Require().NoError(err) - s.Require().Equal(bz, cmn.TrueValue) - tc.postCheck(sender, receiver, bz, args) - } - }) - } -} diff --git a/precompiles/ics20/types.go b/precompiles/ics20/types.go index 37bdf732..a6e41479 100644 --- a/precompiles/ics20/types.go +++ b/precompiles/ics20/types.go @@ -9,20 +9,19 @@ import ( "math/big" "time" - "github.com/cosmos/cosmos-sdk/x/authz" - authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - "github.com/evmos/os/x/evm/core/vm" - errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/cosmos/cosmos-sdk/x/authz" + authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/precompiles/authorization" cmn "github.com/evmos/os/precompiles/common" + "github.com/evmos/os/x/evm/core/vm" ) const ( diff --git a/precompiles/ics20/utils_test.go b/precompiles/ics20/utils_test.go deleted file mode 100644 index d37e7b45..00000000 --- a/precompiles/ics20/utils_test.go +++ /dev/null @@ -1,641 +0,0 @@ -// Copyright Tharsis Labs Ltd.(Evmos) -// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) -package ics20_test - -import ( - "encoding/json" - "math/big" - "time" - - "cosmossdk.io/math" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/crypto/tmhash" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/baseapp" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/testutil/mock" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - evmoscontracts "github.com/evmos/os/contracts" - exampleapp "github.com/evmos/os/example_chain" - chainutil "github.com/evmos/os/example_chain/testutil" - evmosibc "github.com/evmos/os/ibc/testing" - "github.com/evmos/os/precompiles/authorization" - cmn "github.com/evmos/os/precompiles/common" - "github.com/evmos/os/precompiles/erc20" - "github.com/evmos/os/precompiles/ics20" - "github.com/evmos/os/precompiles/testutil" - "github.com/evmos/os/precompiles/testutil/contracts" - evmosutil "github.com/evmos/os/testutil" - evmosutiltx "github.com/evmos/os/testutil/tx" - evmostypes "github.com/evmos/os/types" - "github.com/evmos/os/x/evm/core/vm" - "github.com/evmos/os/x/evm/statedb" - evmtypes "github.com/evmos/os/x/evm/types" - feemarkettypes "github.com/evmos/os/x/feemarket/types" - - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/gomega" -) - -type erc20Meta struct { - Name string - Symbol string - Decimals uint8 -} - -var ( - maxUint256Coins = sdk.Coins{sdk.Coin{Denom: evmosutil.ExampleAttoDenom, Amount: math.NewIntFromBigInt(abi.MaxUint256)}} - maxUint256CmnCoins = []cmn.Coin{{Denom: evmosutil.ExampleAttoDenom, Amount: abi.MaxUint256}} - defaultCoins = sdk.Coins{sdk.Coin{Denom: evmosutil.ExampleAttoDenom, Amount: math.NewInt(1e18)}} - baseDenomCmnCoin = cmn.Coin{Denom: evmosutil.ExampleAttoDenom, Amount: big.NewInt(1e18)} - defaultCmnCoins = []cmn.Coin{baseDenomCmnCoin} - atomCoins = sdk.Coins{sdk.Coin{Denom: "uatom", Amount: math.NewInt(1e18)}} - atomCmnCoin = cmn.Coin{Denom: "uatom", Amount: big.NewInt(1e18)} - mutliSpendLimit = sdk.Coins{sdk.Coin{Denom: evmosutil.ExampleAttoDenom, Amount: math.NewInt(1e18)}, sdk.Coin{Denom: "uatom", Amount: math.NewInt(1e18)}} - mutliCmnCoins = []cmn.Coin{baseDenomCmnCoin, atomCmnCoin} - testERC20 = erc20Meta{ - Name: "TestCoin", - Symbol: "TC", - Decimals: 18, - } -) - -// SetupWithGenesisValSet initializes a new evmOS app with a validator set and genesis accounts -// that also act as delegators. For simplicity, each validator is bonded with a delegation -// of one consensus engine unit (10^6) in the default token of the simapp from first genesis -// account. A Nop logger is set in SimApp. -func (s *PrecompileTestSuite) SetupWithGenesisValSet(valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) { - appI, genesisState := exampleapp.SetupTestingApp(evmosutil.ExampleChainID)() - app, ok := appI.(*exampleapp.ExampleChain) - s.Require().True(ok) - - // set genesis accounts - authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) - genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis) - - validators := make([]stakingtypes.Validator, 0, len(valSet.Validators)) - delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators)) - - bondAmt := sdk.TokensFromConsensusPower(1, evmostypes.AttoPowerReduction) - - for _, val := range valSet.Validators { - pk, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) - s.Require().NoError(err) - pkAny, err := codectypes.NewAnyWithValue(pk) - s.Require().NoError(err) - validator := stakingtypes.Validator{ - OperatorAddress: sdk.ValAddress(val.Address).String(), - ConsensusPubkey: pkAny, - Jailed: false, - Status: stakingtypes.Bonded, - Tokens: bondAmt, - DelegatorShares: math.LegacyOneDec(), - Description: stakingtypes.Description{}, - UnbondingHeight: int64(0), - UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()), - MinSelfDelegation: math.ZeroInt(), - } - validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), math.LegacyOneDec())) - } - s.validators = validators - - // set validators and delegations - stakingParams := stakingtypes.DefaultParams() - // set bond demon to be aevmos - stakingParams.BondDenom = evmosutil.ExampleAttoDenom - stakingGenesis := stakingtypes.NewGenesisState(stakingParams, validators, delegations) - genesisState[stakingtypes.ModuleName] = app.AppCodec().MustMarshalJSON(stakingGenesis) - - totalBondAmt := bondAmt.Mul(math.NewInt(int64(len(validators)))) - totalSupply := sdk.NewCoins() - for _, b := range balances { - // add genesis acc tokens and delegated tokens to total supply - totalSupply = totalSupply.Add(b.Coins.Add(sdk.NewCoin(evmosutil.ExampleAttoDenom, totalBondAmt))...) - } - - // add bonded amount to bonded pool module account - balances = append(balances, banktypes.Balance{ - Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), - Coins: sdk.Coins{sdk.NewCoin(evmosutil.ExampleAttoDenom, totalBondAmt)}, - }) - - // update total supply - bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{}, []banktypes.SendEnabled{}) - genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) - - stateBytes, err := json.MarshalIndent(genesisState, "", " ") - s.Require().NoError(err) - - feeGenesis := feemarkettypes.NewGenesisState(feemarkettypes.DefaultGenesisState().Params, 0) - genesisState[feemarkettypes.ModuleName] = app.AppCodec().MustMarshalJSON(feeGenesis) - - // init chain will set the validator set and initialize the genesis accounts - app.InitChain( - abci.RequestInitChain{ - ChainId: evmosutil.ExampleChainID, - Validators: []abci.ValidatorUpdate{}, - ConsensusParams: chainutil.DefaultConsensusParams, - AppStateBytes: stateBytes, - }, - ) - - // commit genesis changes - app.Commit() - - // instantiate new header - header := evmosutil.NewHeader( - 2, - time.Now().UTC(), - evmosutil.ExampleChainID, - sdk.ConsAddress(validators[0].GetOperator()), - tmhash.Sum([]byte("app")), - tmhash.Sum([]byte("validators")), - ) - - app.BeginBlock(abci.RequestBeginBlock{Header: header}) - - // create Contexts - s.ctx = app.BaseApp.NewContext(false, header) - s.app = app -} - -func (s *PrecompileTestSuite) DoSetupTest() { - s.defaultExpirationDuration = s.ctx.BlockTime().Add(cmn.DefaultExpirationDuration).UTC() - - // generate validators private/public key - var ( - validatorsPerChain = 2 - validators []*tmtypes.Validator - signersByAddress = make(map[string]tmtypes.PrivValidator, validatorsPerChain) - ) - - for i := 0; i < validatorsPerChain; i++ { - privVal := mock.NewPV() - pubKey, err := privVal.GetPubKey() - s.Require().NoError(err) - validators = append(validators, tmtypes.NewValidator(pubKey, 1)) - signersByAddress[pubKey.Address().String()] = privVal - } - - // construct validator set; - // Note that the validators are sorted by voting power - // or, if equal, by address lexical order - s.valSet = tmtypes.NewValidatorSet(validators) - - // Create a coordinator and 2 test chains that will be used in the testing suite - chains := make(map[string]*ibctesting.TestChain) - s.coordinator = &ibctesting.Coordinator{ - T: s.T(), - // NOTE: This year has to be updated otherwise the client will be shown as expired - CurrentTime: time.Date(time.Now().Year()+1, 1, 2, 0, 0, 0, 0, time.UTC), - } - // Create 2 Evmos chains - chains[evmosutil.ExampleChainID] = s.NewTestChainWithValSet(s.coordinator, s.valSet, signersByAddress) - // TODO: Figure out if we want to make the second chain keepers accessible to the tests to check the state - chainID2 := evmosutil.ExampleChainID + "2" - chains[chainID2] = ibctesting.NewTestChain(s.T(), s.coordinator, chainID2) - s.coordinator.Chains = chains - - // Setup Chains in the testing suite - s.chainA = s.coordinator.GetChain(evmosutil.ExampleChainID) - s.chainB = s.coordinator.GetChain(chainID2) - - if s.suiteIBCTesting { - s.setupIBCTest() - } -} - -func (s *PrecompileTestSuite) NewTestChainWithValSet(coord *ibctesting.Coordinator, valSet *tmtypes.ValidatorSet, signers map[string]tmtypes.PrivValidator) *ibctesting.TestChain { - // generate genesis account - addr, priv := evmosutiltx.NewAddrKey() - s.privKey = priv - s.address = addr - // differentAddr is an address generated for testing purposes that e.g. raises the different origin error - s.differentAddr = evmosutiltx.GenerateAddress() - s.signer = evmosutiltx.NewSigner(priv) - - baseAcc := authtypes.NewBaseAccount(priv.PubKey().Address().Bytes(), priv.PubKey(), 0, 0) - amount := sdk.TokensFromConsensusPower(5, evmostypes.AttoPowerReduction) - - balance := banktypes.Balance{ - Address: baseAcc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, amount)), - } - - s.SetupWithGenesisValSet(valSet, []authtypes.GenesisAccount{baseAcc}, balance) - - // create current header and call begin block - header := tmproto.Header{ - ChainID: evmosutil.ExampleChainID, - Height: 1, - Time: coord.CurrentTime.UTC(), - } - - txConfig := s.app.GetTxConfig() - - // Create StateDB - s.stateDB = statedb.New(s.ctx, s.app.EVMKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(s.ctx.HeaderHash().Bytes()))) - - // bond denom - stakingParams := s.app.StakingKeeper.GetParams(s.ctx) - stakingParams.BondDenom = evmosutil.ExampleAttoDenom - s.bondDenom = stakingParams.BondDenom - err := s.app.StakingKeeper.SetParams(s.ctx, stakingParams) - s.Require().NoError(err) - - s.ethSigner = ethtypes.LatestSignerForChainID(s.app.EVMKeeper.ChainID()) - - // Setting up the fee market to 0 so the transactions don't fail in IBC testing - s.app.FeeMarketKeeper.SetBaseFee(s.ctx, big.NewInt(0)) - s.app.FeeMarketKeeper.SetBlockGasWanted(s.ctx, 0) - s.app.FeeMarketKeeper.SetTransientBlockGasWanted(s.ctx, 0) - - precompile, err := ics20.NewPrecompile(*s.app.StakingKeeper, s.app.TransferKeeper, s.app.IBCKeeper.ChannelKeeper, s.app.AuthzKeeper, s.app.EVMKeeper) - s.Require().NoError(err) - s.precompile = precompile - - queryHelperEvm := baseapp.NewQueryServerTestHelper(s.ctx, s.app.InterfaceRegistry()) - evmtypes.RegisterQueryServer(queryHelperEvm, s.app.EVMKeeper) - s.queryClientEVM = evmtypes.NewQueryClient(queryHelperEvm) - - // create an account to send transactions from - chain := &ibctesting.TestChain{ - T: s.T(), - Coordinator: coord, - ChainID: evmosutil.ExampleChainID, - App: s.app, - CurrentHeader: header, - QueryServer: s.app.GetIBCKeeper(), - TxConfig: txConfig, - Codec: s.app.AppCodec(), - Vals: valSet, - NextVals: valSet, - Signers: signers, - SenderPrivKey: priv, - SenderAccount: baseAcc, - SenderAccounts: []ibctesting.SenderAccount{{SenderPrivKey: priv, SenderAccount: baseAcc}}, - } - - coord.CommitBlock(chain) - - return chain -} - -// NewPrecompileContract creates a new precompile contract and sets the gas meter -func (s *PrecompileTestSuite) NewPrecompileContract(gas uint64) *vm.Contract { - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), gas) - - s.ctx = s.ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) - initialGas := s.ctx.GasMeter().GasConsumed() - s.Require().Zero(initialGas) - - return contract -} - -// NewTransferAuthorizationWithAllocations creates a new allocation for the given grantee and granter and the given coins -func (s *PrecompileTestSuite) NewTransferAuthorizationWithAllocations(ctx sdk.Context, app *exampleapp.ExampleChain, grantee, granter common.Address, allocations []transfertypes.Allocation) error { - transferAuthz := &transfertypes.TransferAuthorization{Allocations: allocations} - if err := transferAuthz.ValidateBasic(); err != nil { - return err - } - - // create the authorization - return app.AuthzKeeper.SaveGrant(ctx, grantee.Bytes(), granter.Bytes(), transferAuthz, &s.defaultExpirationDuration) -} - -// NewTransferAuthorization creates a new transfer authorization for the given grantee and granter and the given coins -func (s *PrecompileTestSuite) NewTransferAuthorization(ctx sdk.Context, app *exampleapp.ExampleChain, grantee, granter common.Address, path *ibctesting.Path, coins sdk.Coins, allowList []string, allowedPacketData []string) error { - allocations := []transfertypes.Allocation{ - { - SourcePort: path.EndpointA.ChannelConfig.PortID, - SourceChannel: path.EndpointA.ChannelID, - SpendLimit: coins, - AllowList: allowList, - AllowedPacketData: allowedPacketData, - }, - } - - transferAuthz := &transfertypes.TransferAuthorization{Allocations: allocations} - if err := transferAuthz.ValidateBasic(); err != nil { - return err - } - - // create the authorization - return app.AuthzKeeper.SaveGrant(ctx, grantee.Bytes(), granter.Bytes(), transferAuthz, &s.defaultExpirationDuration) -} - -// GetTransferAuthorization returns the transfer authorization for the given grantee and granter -func (s *PrecompileTestSuite) GetTransferAuthorization(ctx sdk.Context, grantee, granter common.Address) *transfertypes.TransferAuthorization { - grant, _ := s.app.AuthzKeeper.GetAuthorization(ctx, grantee.Bytes(), granter.Bytes(), ics20.TransferMsgURL) - s.Require().NotNil(grant) - transferAuthz, ok := grant.(*transfertypes.TransferAuthorization) - s.Require().True(ok) - s.Require().NotNil(transferAuthz) - return transferAuthz -} - -// CheckAllowanceChangeEvent is a helper function used to check the allowance change event arguments. -func (s *PrecompileTestSuite) CheckAllowanceChangeEvent(log *ethtypes.Log, amount *big.Int, isIncrease bool) { - // Check event signature matches the one emitted - event := s.precompile.ABI.Events[authorization.EventTypeIBCTransferAuthorization] - s.Require().Equal(event.ID, common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) - - var approvalEvent ics20.EventTransferAuthorization - err := cmn.UnpackLog(s.precompile.ABI, &approvalEvent, authorization.EventTypeIBCTransferAuthorization, *log) - s.Require().NoError(err) - s.Require().Equal(s.address, approvalEvent.Grantee) - s.Require().Equal(s.address, approvalEvent.Granter) - s.Require().Equal("transfer", approvalEvent.Allocations[0].SourcePort) - s.Require().Equal("channel-0", approvalEvent.Allocations[0].SourceChannel) - - allocationAmount := approvalEvent.Allocations[0].SpendLimit[0].Amount - if isIncrease { - newTotal := amount.Add(allocationAmount, amount) - s.Require().Equal(amount, newTotal) - } else { - newTotal := amount.Sub(allocationAmount, amount) - s.Require().Equal(amount, newTotal) - } -} - -// NewTransferPath creates a new path between two chains with the specified portIds and version. -func NewTransferPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { - path := ibctesting.NewPath(chainA, chainB) - path.EndpointA.ChannelConfig.PortID = transfertypes.PortID - path.EndpointB.ChannelConfig.PortID = transfertypes.PortID - path.EndpointA.ChannelConfig.Version = transfertypes.Version - path.EndpointB.ChannelConfig.Version = transfertypes.Version - - return path -} - -// setupIBCTest makes the necessary setup of chains A & B -// for integration tests -func (s *PrecompileTestSuite) setupIBCTest() { - s.coordinator.CommitNBlocks(s.chainA, 2) - s.coordinator.CommitNBlocks(s.chainB, 2) - - s.app = s.chainA.App.(*exampleapp.ExampleChain) - evmParams := s.app.EVMKeeper.GetParams(s.chainA.GetContext()) - evmParams.EvmDenom = evmosutil.ExampleAttoDenom - err := s.app.EVMKeeper.SetParams(s.chainA.GetContext(), evmParams) - s.Require().NoError(err) - - // Set block proposer once, so its carried over on the ibc-go-testing suite - validators := s.app.StakingKeeper.GetValidators(s.chainA.GetContext(), 2) - cons, err := validators[0].GetConsAddr() - s.Require().NoError(err) - s.chainA.CurrentHeader.ProposerAddress = cons.Bytes() - - err = s.app.StakingKeeper.SetValidatorByConsAddr(s.chainA.GetContext(), validators[0]) - s.Require().NoError(err) - - _, err = s.app.EVMKeeper.GetCoinbaseAddress(s.chainA.GetContext(), sdk.ConsAddress(s.chainA.CurrentHeader.ProposerAddress)) - s.Require().NoError(err) - - // Mint coins locked on the evmos account generated with secp. - amt, ok := math.NewIntFromString("1000000000000000000000") - s.Require().True(ok) - coinEvmos := sdk.NewCoin(evmosutil.ExampleAttoDenom, amt) - coins := sdk.NewCoins(coinEvmos) - err = s.app.BankKeeper.MintCoins(s.chainA.GetContext(), minttypes.ModuleName, coins) - s.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToAccount(s.chainA.GetContext(), minttypes.ModuleName, s.chainA.SenderAccount.GetAddress(), coins) - s.Require().NoError(err) - - s.transferPath = evmosibc.NewTransferPath(s.chainA, s.chainB) // clientID, connectionID, channelID empty - evmosibc.SetupPath(s.coordinator, s.transferPath) // clientID, connectionID, channelID filled - s.Require().Equal("07-tendermint-0", s.transferPath.EndpointA.ClientID) - s.Require().Equal("connection-0", s.transferPath.EndpointA.ConnectionID) - s.Require().Equal("channel-0", s.transferPath.EndpointA.ChannelID) -} - -// setTransferApproval sets the transfer approval for the given grantee and allocations -func (s *PrecompileTestSuite) setTransferApproval( - args contracts.CallArgs, - grantee common.Address, - allocations []cmn.ICS20Allocation, -) { - args.MethodName = authorization.ApproveMethod - args.Args = []interface{}{ - grantee, - allocations, - } - - logCheckArgs := testutil.LogCheckArgs{ - ABIEvents: s.precompile.Events, - ExpEvents: []string{authorization.EventTypeIBCTransferAuthorization}, - ExpPass: true, - } - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, args, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the contract to approve") - - s.chainA.NextBlock() - - // check auth created successfully - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.chainA.GetContext(), grantee.Bytes(), args.PrivKey.PubKey().Address().Bytes(), ics20.TransferMsgURL) - Expect(authz).NotTo(BeNil()) - transferAuthz, ok := authz.(*transfertypes.TransferAuthorization) - Expect(ok).To(BeTrue()) - Expect(len(transferAuthz.Allocations[0].SpendLimit)).To(Equal(len(allocations[0].SpendLimit))) - for i, sl := range transferAuthz.Allocations[0].SpendLimit { - // NOTE order may change if there're more than one coin - Expect(sl.Denom).To(Equal(allocations[0].SpendLimit[i].Denom)) - Expect(sl.Amount.BigInt()).To(Equal(allocations[0].SpendLimit[i].Amount)) - } -} - -// setTransferApprovalForContract sets the transfer approval for the given contract -func (s *PrecompileTestSuite) setTransferApprovalForContract(args contracts.CallArgs) { - logCheckArgs := testutil.LogCheckArgs{ - ABIEvents: s.precompile.Events, - ExpEvents: []string{authorization.EventTypeIBCTransferAuthorization}, - ExpPass: true, - } - - _, _, err := contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, args, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the contract to approve") - - s.chainA.NextBlock() - - // check auth created successfully - authz, _ := s.app.AuthzKeeper.GetAuthorization(s.chainA.GetContext(), args.ContractAddr.Bytes(), args.PrivKey.PubKey().Address().Bytes(), ics20.TransferMsgURL) - Expect(authz).NotTo(BeNil()) - transferAuthz, ok := authz.(*transfertypes.TransferAuthorization) - Expect(ok).To(BeTrue()) - Expect(len(transferAuthz.Allocations) > 0).To(BeTrue()) -} - -// setupAllocationsForTesting sets the allocations for testing -func (s *PrecompileTestSuite) setupAllocationsForTesting() { - defaultSingleAlloc = []cmn.ICS20Allocation{ - { - SourcePort: ibctesting.TransferPort, - SourceChannel: s.transferPath.EndpointA.ChannelID, - SpendLimit: defaultCmnCoins, - AllowedPacketData: []string{"memo"}, - }, - } -} - -// DeployContract deploys a contract with the provided private key, -// compiled contract data and constructor arguments -func DeployContract( - ctx sdk.Context, - exampleApp *exampleapp.ExampleChain, - priv cryptotypes.PrivKey, - gasPrice *big.Int, - queryClientEvm evmtypes.QueryClient, - contract evmtypes.CompiledContract, - constructorArgs ...interface{}, -) (common.Address, error) { - chainID := exampleApp.EVMKeeper.ChainID() - from := common.BytesToAddress(priv.PubKey().Address().Bytes()) - nonce := exampleApp.EVMKeeper.GetNonce(ctx, from) - - ctorArgs, err := contract.ABI.Pack("", constructorArgs...) - if err != nil { - return common.Address{}, err - } - - data := append(contract.Bin, ctorArgs...) //nolint:gocritic - gas, err := evmosutiltx.GasLimit(ctx, from, data, queryClientEvm) - if err != nil { - return common.Address{}, err - } - - msgEthereumTx := evmtypes.NewTx(&evmtypes.EvmTxArgs{ - ChainID: chainID, - Nonce: nonce, - GasLimit: gas, - GasFeeCap: exampleApp.FeeMarketKeeper.GetBaseFee(ctx), - GasTipCap: big.NewInt(1), - GasPrice: gasPrice, - Input: data, - Accesses: ðtypes.AccessList{}, - }) - msgEthereumTx.From = from.String() - - res, err := chainutil.DeliverEthTx(exampleApp, priv, msgEthereumTx) - if err != nil { - return common.Address{}, err - } - - if _, err := chainutil.CheckEthTxResponse(res, exampleApp.AppCodec()); err != nil { - return common.Address{}, err - } - - return crypto.CreateAddress(from, nonce), nil -} - -// DeployERC20Contract deploys a ERC20 token with the provided name, symbol and decimals -func (s *PrecompileTestSuite) DeployERC20Contract(chain *ibctesting.TestChain, name, symbol string, decimals uint8) (common.Address, error) { - addr, err := DeployContract( - chain.GetContext(), - s.app, - s.privKey, - gasPrice, - s.queryClientEVM, - evmoscontracts.ERC20MinterBurnerDecimalsContract, - name, - symbol, - decimals, - ) - chain.NextBlock() - return addr, err -} - -// setupERC20ContractTests deploys a ERC20 token -// and mint some tokens to the deployer address (s.address). -// The amount of tokens sent to the deployer address is defined in -// the 'amount' input argument -func (s *PrecompileTestSuite) setupERC20ContractTests(amount *big.Int) common.Address { - erc20Addr, err := s.DeployERC20Contract(s.chainA, testERC20.Name, testERC20.Symbol, testERC20.Decimals) - Expect(err).To(BeNil(), "error while deploying ERC20 contract: %v", err) - - defaultERC20CallArgs := contracts.CallArgs{ - ContractAddr: erc20Addr, - ContractABI: evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI, - PrivKey: s.privKey, - GasPrice: gasPrice, - } - - // mint coins to the address - mintCoinsArgs := defaultERC20CallArgs. - WithMethodName("mint"). - WithArgs(s.address, amount) - - mintCheck := testutil.LogCheckArgs{ - ABIEvents: evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI.Events, - ExpEvents: []string{erc20.EventTypeTransfer}, // upon minting the tokens are sent to the receiving address - ExpPass: true, - } - - _, _, err = contracts.CallContractAndCheckLogs(s.chainA.GetContext(), s.app, mintCoinsArgs, mintCheck) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - s.chainA.NextBlock() - - // check that the address has the tokens -- this has to be done using the stateDB because - // unregistered token pairs do not show up in the bank keeper - balance := s.app.Erc20Keeper.BalanceOf( - s.chainA.GetContext(), - evmoscontracts.ERC20MinterBurnerDecimalsContract.ABI, - erc20Addr, - s.address, - ) - Expect(balance).To(Equal(amount), "address does not have the expected amount of tokens") - - return erc20Addr -} - -// makePacket is a helper function to build the sent IBC packet -// to perform an ICS20 transfer. -// This packet is then used to test the IBC callbacks (Timeout, Ack) -func (s *PrecompileTestSuite) makePacket( - senderAddr, - receiverAddr, - denom, - memo string, - amt *big.Int, - seq uint64, - timeoutHeight clienttypes.Height, -) channeltypes.Packet { - packetData := transfertypes.NewFungibleTokenPacketData( - denom, - amt.String(), - senderAddr, - receiverAddr, - memo, - ) - - return channeltypes.NewPacket( - packetData.GetBytes(), - seq, - s.transferPath.EndpointA.ChannelConfig.PortID, - s.transferPath.EndpointA.ChannelID, - s.transferPath.EndpointB.ChannelConfig.PortID, - s.transferPath.EndpointB.ChannelID, - timeoutHeight, - 0, - ) -} diff --git a/precompiles/p256/integration_test.go b/precompiles/p256/integration_test.go index 398e2fdc..9bf099e9 100644 --- a/precompiles/p256/integration_test.go +++ b/precompiles/p256/integration_test.go @@ -7,6 +7,8 @@ import ( "crypto/elliptic" "crypto/rand" + exampleapp "github.com/evmos/os/example_chain" + "github.com/cometbft/cometbft/crypto" "github.com/ethereum/go-ethereum/common" @@ -61,6 +63,10 @@ var _ = Describe("Calling p256 precompile directly", Label("P256 Precompile"), O }) When("the precompile is enabled in the EVM params", func() { + BeforeAll(func() { + s = setupIntegrationTestSuite(nil) + }) + DescribeTable("execute contract call", func(inputFn func() (input, expOutput []byte, expErr string)) { senderKey := s.keyring.GetKey(0) @@ -70,11 +76,11 @@ var _ = Describe("Calling p256 precompile directly", Label("P256 Precompile"), O Input: input, } - resDeliverTx, err := s.factory.ExecuteEthTx(senderKey.Priv, args) + txResult, err := s.factory.ExecuteEthTx(senderKey.Priv, args) Expect(err).To(BeNil()) - Expect(resDeliverTx.IsOK()).To(Equal(true), "transaction should have succeeded", resDeliverTx.GetLog()) + Expect(txResult.IsOK()).To(Equal(true), "transaction should have succeeded", txResult.GetLog()) - res, err := utils.DecodeResponseDeliverTx(resDeliverTx) + res, err := utils.DecodeExecTxResult(txResult) Expect(err).To(BeNil()) Expect(res.VmError).To(Equal(expErr), "expected different vm error") Expect(res.Ret).To(Equal(expOutput)) @@ -110,8 +116,9 @@ var _ = Describe("Calling p256 precompile directly", Label("P256 Precompile"), O }) When("the precompile is not enabled in the EVM params", func() { - BeforeEach(func() { - params := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + BeforeAll(func() { + customGenesis := exampleapp.NewEVMGenesisState() + params := customGenesis.Params addr := s.precompileAddress.String() var activePrecompiles []string for _, precompile := range params.ActiveStaticPrecompiles { @@ -120,8 +127,8 @@ var _ = Describe("Calling p256 precompile directly", Label("P256 Precompile"), O } } params.ActiveStaticPrecompiles = activePrecompiles - err := s.network.UpdateEvmParams(params) - Expect(err).To(BeNil()) + customGenesis.Params = params + s = setupIntegrationTestSuite(customGenesis) }) DescribeTable("execute contract call", func(inputFn func() (input []byte)) { @@ -166,3 +173,31 @@ var _ = Describe("Calling p256 precompile directly", Label("P256 Precompile"), O ) }) }) + +// setupIntegrationTestSuite is a helper function to setup a integration test suite +// with a network with a specified custom genesis state for the EVM module +func setupIntegrationTestSuite(customEVMGenesis *evmtypes.GenesisState) *IntegrationTestSuite { + customGenesis := network.CustomGenesisState{} + if customEVMGenesis != nil { + customGenesis[evmtypes.ModuleName] = customEVMGenesis + } + keyring := testkeyring.New(1) + integrationNetwork := network.New( + network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), + network.WithCustomGenesis(customGenesis), + ) + grpcHandler := grpc.NewIntegrationHandler(integrationNetwork) + txFactory := factory.New(integrationNetwork, grpcHandler) + p256Priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + Expect(err).To(BeNil()) + + suite := &IntegrationTestSuite{ + network: integrationNetwork, + factory: txFactory, + keyring: keyring, + precompileAddress: p256.Precompile{}.Address(), + p256Priv: p256Priv, + } + + return suite +} diff --git a/precompiles/p256/p256.go b/precompiles/p256/p256.go index d6356882..7486a001 100644 --- a/precompiles/p256/p256.go +++ b/precompiles/p256/p256.go @@ -36,7 +36,7 @@ const ( // Precompile secp256r1 (P256) signature verification // implemented as a native contract as per EIP-7212. -// See https://eips.ethereum.org/EIPS/eip-7212 for details +// See https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7212.md for details. type Precompile struct{} // Address defines the address of the p256 precompiled contract. diff --git a/precompiles/staking/approve.go b/precompiles/staking/approve.go index 0b728a6e..29c0923f 100644 --- a/precompiles/staking/approve.go +++ b/precompiles/staking/approve.go @@ -39,7 +39,11 @@ func (p Precompile) Approve( method *abi.Method, args []interface{}, ) ([]byte, error) { - grantee, coin, typeURLs, err := authorization.CheckApprovalArgs(args, p.stakingKeeper.BondDenom(ctx)) + bondDenom, err := p.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + grantee, coin, typeURLs, err := authorization.CheckApprovalArgs(args, bondDenom) if err != nil { return nil, err } @@ -123,7 +127,11 @@ func (p Precompile) DecreaseAllowance( method *abi.Method, args []interface{}, ) ([]byte, error) { - grantee, coin, typeUrls, err := authorization.CheckApprovalArgs(args, p.stakingKeeper.BondDenom(ctx)) + bondDenom, err := p.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + grantee, coin, typeUrls, err := authorization.CheckApprovalArgs(args, bondDenom) if err != nil { return nil, err } @@ -166,7 +174,11 @@ func (p Precompile) IncreaseAllowance( method *abi.Method, args []interface{}, ) ([]byte, error) { - grantee, coin, typeUrls, err := authorization.CheckApprovalArgs(args, p.stakingKeeper.BondDenom(ctx)) + bondDenom, err := p.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + grantee, coin, typeUrls, err := authorization.CheckApprovalArgs(args, bondDenom) if err != nil { return nil, err } @@ -231,16 +243,29 @@ func (p Precompile) createStakingAuthz( authzType stakingtypes.AuthorizationType, ) error { // Get all available validators and filter out jailed validators + var iterErr error validators := make([]sdk.ValAddress, 0) - p.stakingKeeper.IterateValidators( + if err := p.stakingKeeper.IterateValidators( ctx, func(_ int64, validator stakingtypes.ValidatorI) (stop bool) { if validator.IsJailed() { return } - validators = append(validators, validator.GetOperator()) + var valAddr sdk.ValAddress + valAddr, iterErr = sdk.ValAddressFromBech32(validator.GetOperator()) + if iterErr != nil { + return true + } + validators = append(validators, valAddr) return }, - ) + ); err != nil { + return err + } + + if iterErr != nil { + return iterErr + } + stakingAuthz, err := stakingtypes.NewStakeAuthorization(validators, nil, authzType, coin) if err != nil { return err diff --git a/precompiles/staking/approve_test.go b/precompiles/staking/approve_test.go index 7125018c..ace3ca6a 100644 --- a/precompiles/staking/approve_test.go +++ b/precompiles/staking/approve_test.go @@ -6,51 +6,54 @@ import ( "time" "cosmossdk.io/math" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - evmosutiltx "github.com/evmos/os/testutil/tx" - sdk "github.com/cosmos/cosmos-sdk/types" sdkauthz "github.com/cosmos/cosmos-sdk/x/authz" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/ethereum/go-ethereum/accounts/abi" - chainutil "github.com/evmos/os/example_chain/testutil" "github.com/evmos/os/precompiles/authorization" cmn "github.com/evmos/os/precompiles/common" "github.com/evmos/os/precompiles/staking" "github.com/evmos/os/precompiles/testutil" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" "github.com/evmos/os/x/evm/core/vm" + "github.com/evmos/os/x/evm/statedb" ) func (s *PrecompileTestSuite) TestApprove() { + var ( + ctx sdk.Context + stDB *statedb.StateDB + ) method := s.precompile.Methods[authorization.ApproveMethod] testCases := []struct { name string - malleate func(*vm.Contract) []interface{} - postCheck func(data []byte, inputArgs []interface{}) + malleate func(contract *vm.Contract, granter, grantee testkeyring.Key) []interface{} + postCheck func(granter, grantee testkeyring.Key, data []byte, inputArgs []interface{}) gas uint64 expError bool errContains string }{ { "fail - empty input args", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, _, _ testkeyring.Key) []interface{} { return []interface{}{} }, - func([]byte, []interface{}) {}, + func(_, _ testkeyring.Key, _ []byte, _ []interface{}) {}, 200000, true, fmt.Sprintf(cmn.ErrInvalidNumberOfArgs, 3, 0), }, { "fail - invalid message type", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, _, grantee testkeyring.Key) []interface{} { return []interface{}{ - s.address, + grantee.Addr, abi.MaxUint256, []string{"invalid"}, } }, - func([]byte, []interface{}) {}, + func(_, _ testkeyring.Key, _ []byte, _ []interface{}) {}, 200000, true, fmt.Sprintf(cmn.ErrInvalidMsgType, "staking", "invalid"), @@ -60,7 +63,7 @@ func (s *PrecompileTestSuite) TestApprove() { // "fail - origin address is the same the spender address", // func(_ *vm.Contract) []interface{} { // return []interface{}{ - // s.address, + // s.keyring.GetAddr(0), // abi.MaxUint256, // []string{"invalid"}, // } @@ -72,16 +75,16 @@ func (s *PrecompileTestSuite) TestApprove() { // }, { "success - MsgDelegate with unlimited coins", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, _, grantee testkeyring.Key) []interface{} { return []interface{}{ - s.address, + grantee.Addr, abi.MaxUint256, []string{staking.DelegateMsg}, } }, - func(data []byte, _ []interface{}) { + func(granter, grantee testkeyring.Key, data []byte, _ []interface{}) { s.Require().Equal(data, cmn.TrueValue) - authz, expirationTime := s.CheckAuthorization(staking.DelegateAuthz, s.address, s.address) + authz, expirationTime := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.DelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().NotNil(expirationTime) @@ -95,17 +98,17 @@ func (s *PrecompileTestSuite) TestApprove() { }, { "success - MsgUndelegate with unlimited coins", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, _, grantee testkeyring.Key) []interface{} { return []interface{}{ - s.address, + grantee.Addr, abi.MaxUint256, []string{staking.UndelegateMsg}, } }, - func(data []byte, _ []interface{}) { + func(granter, grantee testkeyring.Key, data []byte, _ []interface{}) { s.Require().Equal(data, cmn.TrueValue) - authz, expirationTime := s.CheckAuthorization(staking.UndelegateAuthz, s.address, s.address) + authz, expirationTime := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.UndelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().NotNil(expirationTime) s.Require().Equal(authz.AuthorizationType, staking.UndelegateAuthz) @@ -118,17 +121,17 @@ func (s *PrecompileTestSuite) TestApprove() { }, { "success - MsgRedelegate with unlimited coins", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, _, grantee testkeyring.Key) []interface{} { return []interface{}{ - s.address, + grantee.Addr, abi.MaxUint256, []string{staking.RedelegateMsg}, } }, - func(data []byte, _ []interface{}) { + func(granter, grantee testkeyring.Key, data []byte, _ []interface{}) { s.Require().Equal(data, cmn.TrueValue) - authz, expirationTime := s.CheckAuthorization(staking.RedelegateAuthz, s.address, s.address) + authz, expirationTime := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.RedelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().NotNil(expirationTime) s.Require().Equal(authz.AuthorizationType, staking.RedelegateAuthz) @@ -141,9 +144,9 @@ func (s *PrecompileTestSuite) TestApprove() { }, { "success - All staking methods with certain amount of coins", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, _, grantee testkeyring.Key) []interface{} { return []interface{}{ - s.address, + grantee.Addr, big.NewInt(1e18), []string{ staking.DelegateMsg, @@ -152,10 +155,10 @@ func (s *PrecompileTestSuite) TestApprove() { }, } }, - func(data []byte, _ []interface{}) { + func(granter, grantee testkeyring.Key, data []byte, _ []interface{}) { s.Require().Equal(data, cmn.TrueValue) - allAuthz, err := s.app.AuthzKeeper.GetAuthorizations(s.ctx, s.address.Bytes(), s.address.Bytes()) + allAuthz, err := s.network.App.AuthzKeeper.GetAuthorizations(ctx, grantee.AccAddr, granter.AccAddr) s.Require().NoError(err) s.Require().Len(allAuthz, 3) }, @@ -165,25 +168,27 @@ func (s *PrecompileTestSuite) TestApprove() { }, { "success - remove MsgDelegate authorization", - func(*vm.Contract) []interface{} { - res, err := s.precompile.Approve(s.ctx, s.address, s.stateDB, &method, []interface{}{s.address, big.NewInt(1), []string{staking.DelegateMsg}}) + func(_ *vm.Contract, granter, grantee testkeyring.Key) []interface{} { + res, err := s.precompile.Approve(ctx, granter.Addr, stDB, &method, []interface{}{ + grantee.Addr, big.NewInt(1), []string{staking.DelegateMsg}, + }) s.Require().NoError(err) s.Require().Equal(res, cmn.TrueValue) - authz, expirationTime := s.CheckAuthorization(staking.DelegateAuthz, s.address, s.address) + authz, expirationTime := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.DelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().NotNil(expirationTime) return []interface{}{ - s.address, + grantee.Addr, big.NewInt(0), []string{staking.DelegateMsg}, } }, - func(data []byte, _ []interface{}) { + func(granter, grantee testkeyring.Key, data []byte, _ []interface{}) { s.Require().Equal(data, cmn.TrueValue) - authz, expirationTime := s.CheckAuthorization(staking.DelegateAuthz, s.address, s.address) + authz, expirationTime := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.DelegateAuthz, grantee.Addr, granter.Addr) s.Require().Nil(authz) s.Require().Nil(expirationTime) }, @@ -191,19 +196,19 @@ func (s *PrecompileTestSuite) TestApprove() { false, "", }, - { + { //nolint:dupl "success - MsgDelegate with 1 Evmos as limit amount", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, _, grantee testkeyring.Key) []interface{} { return []interface{}{ - s.address, + grantee.Addr, big.NewInt(1e18), []string{staking.DelegateMsg}, } }, - func(data []byte, _ []interface{}) { + func(granter, grantee testkeyring.Key, data []byte, _ []interface{}) { s.Require().Equal(data, cmn.TrueValue) - authz, expirationTime := s.CheckAuthorization(staking.DelegateAuthz, s.address, s.address) + authz, expirationTime := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.DelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().NotNil(expirationTime) s.Require().Equal(authz.AuthorizationType, staking.DelegateAuthz) @@ -215,38 +220,35 @@ func (s *PrecompileTestSuite) TestApprove() { }, { "success - Authorization should only be created for validators that are not jailed", - func(_ *vm.Contract) []interface{} { - // Commit block (otherwise test logic will not be executed correctly, i.e. somehow unbonding does not take effect) + func(_ *vm.Contract, granter, grantee testkeyring.Key) []interface{} { var err error - s.ctx, err = chainutil.Commit(s.ctx, s.app, time.Second, nil) - s.Require().NoError(err, "failed to commit block") - // Jail a validator - s.app.StakingKeeper.Jail(s.ctx, sdk.ConsAddress(s.validators[0].GetOperator())) + valAddr, err = sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) + err = s.network.App.StakingKeeper.Jail(ctx, sdk.ConsAddress(valAddr)) + s.Require().NoError(err, "failed to jail a validator") // When a delegator redelegates/undelegates from a validator, the validator // switches to Unbonding status. // Thus, validators with this status should be considered for the authorization // Unbond another validator - amount, err := s.app.StakingKeeper.Unbond(s.ctx, s.address.Bytes(), s.validators[1].GetOperator(), math.LegacyOneDec()) + valAddr1, err := sdk.ValAddressFromBech32(s.network.GetValidators()[1].GetOperator()) + s.Require().NoError(err) + amount, err := s.network.App.StakingKeeper.Unbond(ctx, granter.AccAddr, valAddr1, math.LegacyOneDec()) s.Require().NoError(err, "expected no error unbonding validator") s.Require().Equal(math.NewInt(1e18), amount, "expected different amount of tokens to be unbonded") - // Commit block and update time to one year later - s.ctx, err = chainutil.Commit(s.ctx, s.app, time.Hour*24*365, nil) - s.Require().NoError(err, "failed to commit block") - return []interface{}{ - s.address, + grantee.Addr, big.NewInt(1e18), []string{staking.DelegateMsg}, } }, - func(data []byte, _ []interface{}) { + func(granter, grantee testkeyring.Key, data []byte, _ []interface{}) { s.Require().Equal(data, cmn.TrueValue) - authz, expirationTime := s.CheckAuthorization(staking.DelegateAuthz, s.address, s.address) + authz, expirationTime := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.DelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().NotNil(expirationTime) s.Require().Equal(authz.AuthorizationType, staking.DelegateAuthz) @@ -258,19 +260,19 @@ func (s *PrecompileTestSuite) TestApprove() { false, "", }, - { + { //nolint:dupl "success - MsgUndelegate with 1 Evmos as limit amount", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, _, grantee testkeyring.Key) []interface{} { return []interface{}{ - s.address, + grantee.Addr, big.NewInt(1e18), []string{staking.UndelegateMsg}, } }, - func(data []byte, _ []interface{}) { + func(granter, grantee testkeyring.Key, data []byte, _ []interface{}) { s.Require().Equal(data, cmn.TrueValue) - authz, expirationTime := s.CheckAuthorization(staking.UndelegateAuthz, s.address, s.address) + authz, expirationTime := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.UndelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().NotNil(expirationTime) s.Require().Equal(authz.AuthorizationType, staking.UndelegateAuthz) @@ -282,17 +284,17 @@ func (s *PrecompileTestSuite) TestApprove() { }, { "success - MsgRedelegate with 1 Evmos as limit amount", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, _, grantee testkeyring.Key) []interface{} { return []interface{}{ - s.address, + grantee.Addr, big.NewInt(1e18), []string{staking.RedelegateMsg}, } }, - func(data []byte, _ []interface{}) { + func(granter, grantee testkeyring.Key, data []byte, _ []interface{}) { s.Require().Equal(data, cmn.TrueValue) - authz, expirationTime := s.CheckAuthorization(staking.RedelegateAuthz, s.address, s.address) + authz, expirationTime := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.RedelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().NotNil(expirationTime) }, @@ -302,9 +304,9 @@ func (s *PrecompileTestSuite) TestApprove() { }, { "success - MsgRedelegate, MsgUndelegate and MsgDelegate with 1 Evmos as limit amount", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, _, grantee testkeyring.Key) []interface{} { return []interface{}{ - s.address, + grantee.Addr, big.NewInt(1e18), []string{ staking.RedelegateMsg, @@ -313,23 +315,23 @@ func (s *PrecompileTestSuite) TestApprove() { }, } }, - func(data []byte, _ []interface{}) { + func(granter, grantee testkeyring.Key, data []byte, _ []interface{}) { s.Require().Equal(data, cmn.TrueValue) - authz, expirationTime := s.CheckAuthorization(staking.DelegateAuthz, s.address, s.address) + authz, expirationTime := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.DelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().NotNil(expirationTime) s.Require().Equal(authz.AuthorizationType, staking.DelegateAuthz) s.Require().Equal(authz.MaxTokens, &sdk.Coin{Denom: s.bondDenom, Amount: math.NewInt(1e18)}) - authz, expirationTime = s.CheckAuthorization(staking.UndelegateAuthz, s.address, s.address) + authz, expirationTime = CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.UndelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().NotNil(expirationTime) s.Require().Equal(authz.AuthorizationType, staking.UndelegateAuthz) s.Require().Equal(authz.MaxTokens, &sdk.Coin{Denom: s.bondDenom, Amount: math.NewInt(1e18)}) - authz, expirationTime = s.CheckAuthorization(staking.RedelegateAuthz, s.address, s.address) + authz, expirationTime = CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.RedelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().NotNil(expirationTime) @@ -337,7 +339,7 @@ func (s *PrecompileTestSuite) TestApprove() { s.Require().Equal(authz.MaxTokens, &sdk.Coin{Denom: s.bondDenom, Amount: math.NewInt(1e18)}) // TODO: Bug here it returns 3 REDELEGATE authorizations - allAuthz, err := s.app.AuthzKeeper.GetAuthorizations(s.ctx, s.address.Bytes(), s.address.Bytes()) + allAuthz, err := s.network.App.AuthzKeeper.GetAuthorizations(s.network.GetContext(), grantee.AccAddr, granter.AccAddr) s.Require().NoError(err) s.Require().Len(allAuthz, 3) }, @@ -347,15 +349,20 @@ func (s *PrecompileTestSuite) TestApprove() { }, } - for _, tc := range testCases { + for _, tc := range testCases { //nolint:dupl s.Run(tc.name, func() { s.SetupTest() + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() + + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) var contract *vm.Contract - contract, s.ctx = testutil.NewPrecompileContract(s.T(), s.ctx, s.address, s.precompile, tc.gas) + contract, ctx = testutil.NewPrecompileContract(s.T(), ctx, granter.Addr, s.precompile, tc.gas) - args := tc.malleate(contract) - bz, err := s.precompile.Approve(s.ctx, s.address, s.stateDB, &method, args) + args := tc.malleate(contract, granter, grantee) + bz, err := s.precompile.Approve(ctx, granter.Addr, stDB, &method, args) if tc.expError { s.Require().ErrorContains(err, tc.errContains) @@ -363,29 +370,33 @@ func (s *PrecompileTestSuite) TestApprove() { } else { s.Require().NoError(err) s.Require().NotEmpty(bz) - tc.postCheck(bz, args) + tc.postCheck(granter, grantee, bz, args) } }) } } func (s *PrecompileTestSuite) TestDecreaseAllowance() { + var ( + ctx sdk.Context + stDB *statedb.StateDB + ) method := s.precompile.Methods[authorization.DecreaseAllowanceMethod] testCases := []struct { name string - malleate func(_ *vm.Contract) []interface{} - postCheck func(data []byte, inputArgs []interface{}) + malleate func(_ *vm.Contract, granter, grantee testkeyring.Key) []interface{} + postCheck func(granter, grantee testkeyring.Key, data []byte, inputArgs []interface{}) gas uint64 expError bool errContains string }{ { "fail - empty input args", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, _, _ testkeyring.Key) []interface{} { return []interface{}{} }, - func([]byte, []interface{}) {}, + func(_, _ testkeyring.Key, _ []byte, _ []interface{}) {}, 200000, true, fmt.Sprintf(cmn.ErrInvalidNumberOfArgs, 3, 0), @@ -395,7 +406,7 @@ func (s *PrecompileTestSuite) TestDecreaseAllowance() { // "fail - origin address is the spender address", // func(_ *vm.Contract) []interface{} { // return []interface{}{ - // s.address, + // s.keyring.GetAddr(0), // abi.MaxUint256, // []string{staking.DelegateMsg}, // } @@ -407,14 +418,14 @@ func (s *PrecompileTestSuite) TestDecreaseAllowance() { // }, { "fail - delegate authorization does not exists", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, _, grantee testkeyring.Key) []interface{} { return []interface{}{ - s.address, + grantee.Addr, big.NewInt(15000), []string{staking.DelegateMsg}, } }, - func([]byte, []interface{}) { + func(_, _ testkeyring.Key, _ []byte, _ []interface{}) { }, 200000, true, @@ -422,18 +433,18 @@ func (s *PrecompileTestSuite) TestDecreaseAllowance() { }, { "fail - delegate authorization is a generic Authorization", - func(_ *vm.Contract) []interface{} { + func(_ *vm.Contract, granter, grantee testkeyring.Key) []interface{} { authz := sdkauthz.NewGenericAuthorization(staking.DelegateMsg) exp := time.Now().Add(time.Hour) - err := s.app.AuthzKeeper.SaveGrant(s.ctx, s.address.Bytes(), s.address.Bytes(), authz, &exp) + err := s.network.App.AuthzKeeper.SaveGrant(ctx, grantee.AccAddr, granter.AccAddr, authz, &exp) s.Require().NoError(err) return []interface{}{ - s.address, + grantee.Addr, big.NewInt(15000), []string{staking.DelegateMsg}, } }, - func([]byte, []interface{}) { + func(_, _ testkeyring.Key, _ []byte, _ []interface{}) { }, 200000, true, @@ -441,44 +452,44 @@ func (s *PrecompileTestSuite) TestDecreaseAllowance() { }, { "fail - decrease allowance amount is greater than the authorization limit", - func(*vm.Contract) []interface{} { + func(_ *vm.Contract, granter, grantee testkeyring.Key) []interface{} { approveArgs := []interface{}{ - s.address, + grantee.Addr, big.NewInt(1e18), []string{staking.DelegateMsg}, } - resp, err := s.precompile.Approve(s.ctx, s.address, s.stateDB, &method, approveArgs) + resp, err := s.precompile.Approve(ctx, granter.Addr, stDB, &method, approveArgs) s.Require().NoError(err) s.Require().Equal(resp, cmn.TrueValue) - authz, _ := s.CheckAuthorization(staking.DelegateAuthz, s.address, s.address) + authz, _ := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.DelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().Equal(authz.AuthorizationType, staking.DelegateAuthz) s.Require().Equal(authz.MaxTokens, &sdk.Coin{Denom: s.bondDenom, Amount: math.NewInt(1e18)}) return []interface{}{ - s.address, + grantee.Addr, big.NewInt(2e18), []string{staking.DelegateMsg}, } }, - func([]byte, []interface{}) {}, + func(_, _ testkeyring.Key, _ []byte, _ []interface{}) {}, 200000, true, "amount by which the allowance should be decreased is greater than the authorization limit", }, { "success - decrease delegate authorization allowance by 1 Evmos", - func(_ *vm.Contract) []interface{} { - s.ApproveAndCheckAuthz(method, staking.DelegateMsg, big.NewInt(2e18)) + func(_ *vm.Contract, granter, grantee testkeyring.Key) []interface{} { + s.ApproveAndCheckAuthz(method, granter, grantee, staking.DelegateMsg, big.NewInt(2e18)) return []interface{}{ - s.address, + grantee.Addr, big.NewInt(1e18), []string{staking.DelegateMsg}, } }, - func([]byte, []interface{}) { - authz, _ := s.CheckAuthorization(staking.DelegateAuthz, s.address, s.address) + func(granter, grantee testkeyring.Key, _ []byte, _ []interface{}) { + authz, _ := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.DelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().Equal(authz.AuthorizationType, staking.DelegateAuthz) s.Require().Equal(authz.MaxTokens, &sdk.Coin{Denom: s.bondDenom, Amount: math.NewInt(1e18)}) @@ -489,15 +500,20 @@ func (s *PrecompileTestSuite) TestDecreaseAllowance() { }, } - for _, tc := range testCases { + for _, tc := range testCases { //nolint:dupl s.Run(tc.name, func() { s.SetupTest() // reset + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() + + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) var contract *vm.Contract - contract, s.ctx = testutil.NewPrecompileContract(s.T(), s.ctx, s.address, s.precompile, tc.gas) + contract, ctx = testutil.NewPrecompileContract(s.T(), ctx, granter.Addr, s.precompile, tc.gas) - args := tc.malleate(contract) - bz, err := s.precompile.DecreaseAllowance(s.ctx, s.address, s.stateDB, &method, args) + args := tc.malleate(contract, granter, grantee) + bz, err := s.precompile.DecreaseAllowance(ctx, granter.Addr, stDB, &method, args) if tc.expError { s.Require().ErrorContains(err, tc.errContains) @@ -505,29 +521,33 @@ func (s *PrecompileTestSuite) TestDecreaseAllowance() { } else { s.Require().NoError(err) s.Require().NotEmpty(bz) - tc.postCheck(bz, args) + tc.postCheck(granter, grantee, bz, args) } }) } } func (s *PrecompileTestSuite) TestIncreaseAllowance() { + var ( + ctx sdk.Context + stDB *statedb.StateDB + ) method := s.precompile.Methods[authorization.IncreaseAllowanceMethod] testCases := []struct { name string - malleate func() []interface{} - postCheck func(data []byte, inputArgs []interface{}) + malleate func(granter, grantee testkeyring.Key) []interface{} + postCheck func(granter, grantee testkeyring.Key, data []byte, inputArgs []interface{}) gas uint64 expError bool errContains string }{ { "fail - empty input args", - func() []interface{} { + func(_, _ testkeyring.Key) []interface{} { return []interface{}{} }, - func([]byte, []interface{}) {}, + func(_, _ testkeyring.Key, _ []byte, _ []interface{}) {}, 200000, true, fmt.Sprintf(cmn.ErrInvalidNumberOfArgs, 3, 0), @@ -537,7 +557,7 @@ func (s *PrecompileTestSuite) TestIncreaseAllowance() { // "fail - origin address is the spender address", // func(_ *vm.Contract) []interface{} { // return []interface{}{ - // s.address, + // s.keyring.GetAddr(0), // abi.MaxUint256, // []string{staking.DelegateMsg}, // } @@ -549,14 +569,14 @@ func (s *PrecompileTestSuite) TestIncreaseAllowance() { // }, { "fail - delegate authorization does not exists", - func() []interface{} { + func(_, grantee testkeyring.Key) []interface{} { return []interface{}{ - s.address, + grantee.Addr, big.NewInt(15000), []string{staking.DelegateMsg}, } }, - func([]byte, []interface{}) { + func(_, _ testkeyring.Key, _ []byte, _ []interface{}) { }, 200000, true, @@ -564,45 +584,45 @@ func (s *PrecompileTestSuite) TestIncreaseAllowance() { }, { "success - no-op, allowance amount is already set to the maximum value", - func() []interface{} { + func(granter, grantee testkeyring.Key) []interface{} { approveArgs := []interface{}{ - s.address, + grantee.Addr, abi.MaxUint256, []string{staking.DelegateMsg}, } - resp, err := s.precompile.Approve(s.ctx, s.address, s.stateDB, &method, approveArgs) + resp, err := s.precompile.Approve(ctx, granter.Addr, stDB, &method, approveArgs) s.Require().NoError(err) s.Require().Equal(resp, cmn.TrueValue) - authz, _ := s.CheckAuthorization(staking.DelegateAuthz, s.address, s.address) + authz, _ := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.DelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().Equal(authz.AuthorizationType, staking.DelegateAuthz) var coin *sdk.Coin s.Require().Equal(authz.MaxTokens, coin) return []interface{}{ - s.address, + grantee.Addr, big.NewInt(2e18), []string{staking.DelegateMsg}, } }, - func([]byte, []interface{}) {}, + func(_, _ testkeyring.Key, _ []byte, _ []interface{}) {}, 200000, false, "", }, { "success - increase delegate authorization allowance by 1 Evmos", - func() []interface{} { - s.ApproveAndCheckAuthz(method, staking.DelegateMsg, big.NewInt(1e18)) + func(granter, grantee testkeyring.Key) []interface{} { + s.ApproveAndCheckAuthz(method, granter, grantee, staking.DelegateMsg, big.NewInt(1e18)) return []interface{}{ - s.address, + grantee.Addr, big.NewInt(1e18), []string{staking.DelegateMsg}, } }, - func([]byte, []interface{}) { - authz, _ := s.CheckAuthorization(staking.DelegateAuthz, s.address, s.address) + func(granter, grantee testkeyring.Key, _ []byte, _ []interface{}) { + authz, _ := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, staking.DelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) s.Require().Equal(authz.AuthorizationType, staking.DelegateAuthz) s.Require().Equal(authz.MaxTokens, &sdk.Coin{Denom: s.bondDenom, Amount: math.NewInt(2e18)}) @@ -616,9 +636,14 @@ func (s *PrecompileTestSuite) TestIncreaseAllowance() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() - args := tc.malleate() - bz, err := s.precompile.IncreaseAllowance(s.ctx, s.address, s.stateDB, &method, args) + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + + args := tc.malleate(granter, grantee) + bz, err := s.precompile.IncreaseAllowance(ctx, granter.Addr, stDB, &method, args) if tc.expError { s.Require().ErrorContains(err, tc.errContains) @@ -626,29 +651,29 @@ func (s *PrecompileTestSuite) TestIncreaseAllowance() { } else { s.Require().NoError(err) s.Require().NotEmpty(bz) - tc.postCheck(bz, args) + tc.postCheck(granter, grantee, bz, args) } }) } } func (s *PrecompileTestSuite) TestRevoke() { + var ctx sdk.Context + method := s.precompile.Methods[authorization.RevokeMethod] - granteeAddr := evmosutiltx.GenerateAddress() - granterAddr := s.address createdAuthz := staking.DelegateAuthz approvedCoin := &sdk.Coin{Denom: s.bondDenom, Amount: math.NewInt(1e18)} testCases := []struct { name string - malleate func() []interface{} - postCheck func(data []byte, inputArgs []interface{}) + malleate func(grantee testkeyring.Key) []interface{} + postCheck func(granter, grantee testkeyring.Key, data []byte, inputArgs []interface{}) expError bool errContains string }{ { name: "fail - empty input args", - malleate: func() []interface{} { + malleate: func(_ testkeyring.Key) []interface{} { return []interface{}{} }, expError: true, @@ -656,15 +681,15 @@ func (s *PrecompileTestSuite) TestRevoke() { }, { name: "fail - authorization does not exist", - malleate: func() []interface{} { + malleate: func(grantee testkeyring.Key) []interface{} { return []interface{}{ - granteeAddr, + grantee.Addr, []string{staking.UndelegateMsg}, } }, - postCheck: func([]byte, []interface{}) { + postCheck: func(granter, grantee testkeyring.Key, _ []byte, _ []interface{}) { // expect authorization to still be there - authz, _ := s.CheckAuthorization(createdAuthz, granteeAddr, granterAddr) + authz, _ := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, createdAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz) }, expError: true, @@ -672,15 +697,15 @@ func (s *PrecompileTestSuite) TestRevoke() { }, { name: "pass - authorization revoked", - malleate: func() []interface{} { + malleate: func(grantee testkeyring.Key) []interface{} { return []interface{}{ - granteeAddr, + grantee.Addr, []string{staking.DelegateMsg}, } }, - postCheck: func([]byte, []interface{}) { + postCheck: func(granter, grantee testkeyring.Key, _ []byte, _ []interface{}) { // expect authorization to be removed - authz, _ := s.CheckAuthorization(createdAuthz, granteeAddr, granterAddr) + authz, _ := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, createdAuthz, grantee.Addr, granter.Addr) s.Require().Nil(authz, "expected authorization to be removed") }, }, @@ -690,12 +715,17 @@ func (s *PrecompileTestSuite) TestRevoke() { tc := tc s.Run(tc.name, func() { s.SetupTest() // reset + ctx = s.network.GetContext() + + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) // Create a delegate authorization - validators := s.app.StakingKeeper.GetLastValidators(s.ctx) + validators, err := s.network.App.StakingKeeper.GetLastValidators(ctx) + s.Require().NoError(err) valAddrs := make([]sdk.ValAddress, len(validators)) for i, val := range validators { - valAddrs[i] = val.GetOperator() + valAddrs[i] = sdk.ValAddress(val.GetOperator()) } delegationAuthz, err := stakingtypes.NewStakeAuthorization( valAddrs, @@ -705,14 +735,14 @@ func (s *PrecompileTestSuite) TestRevoke() { ) s.Require().NoError(err) - expiration := s.ctx.BlockTime().Add(time.Hour * 24 * 365).UTC() - err = s.app.AuthzKeeper.SaveGrant(s.ctx, granteeAddr.Bytes(), granterAddr.Bytes(), delegationAuthz, &expiration) + expiration := ctx.BlockTime().Add(time.Hour * 24 * 365).UTC() + err = s.network.App.AuthzKeeper.SaveGrant(ctx, grantee.AccAddr, granter.AccAddr, delegationAuthz, &expiration) s.Require().NoError(err, "failed to save authorization") - authz, _ := s.CheckAuthorization(createdAuthz, granteeAddr, granterAddr) + authz, _ := CheckAuthorizationWithContext(ctx, s.network.App.AuthzKeeper, createdAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(authz, "expected authorization to be set") - args := tc.malleate() - bz, err := s.precompile.Revoke(s.ctx, granterAddr, s.stateDB, &method, args) + args := tc.malleate(grantee) + bz, err := s.precompile.Revoke(ctx, granter.Addr, s.network.GetStateDB(), &method, args) if tc.expError { s.Require().ErrorContains(err, tc.errContains) @@ -720,7 +750,7 @@ func (s *PrecompileTestSuite) TestRevoke() { } else { s.Require().NoError(err) s.Require().NotEmpty(bz) - tc.postCheck(bz, args) + tc.postCheck(granter, grantee, bz, args) } }) } diff --git a/precompiles/staking/events.go b/precompiles/staking/events.go index 69cc111f..c466a797 100644 --- a/precompiles/staking/events.go +++ b/precompiles/staking/events.go @@ -71,7 +71,7 @@ func (p Precompile) EmitApprovalEvent(ctx sdk.Context, stateDB vm.StateDB, grant Address: p.Address(), Topics: topics, Data: packed, - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil @@ -120,7 +120,7 @@ func (p Precompile) EmitAllowanceChangeEvent(ctx sdk.Context, stateDB vm.StateDB Address: p.Address(), Topics: topics, Data: packed, - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil @@ -144,7 +144,7 @@ func (p Precompile) EmitCreateValidatorEvent(ctx sdk.Context, stateDB vm.StateDB Address: p.Address(), Topics: topics, Data: b.Bytes(), - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil @@ -179,7 +179,7 @@ func (p Precompile) EmitEditValidatorEvent(ctx sdk.Context, stateDB vm.StateDB, Address: p.Address(), Topics: topics, Data: b.Bytes(), - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil @@ -218,7 +218,7 @@ func (p Precompile) EmitDelegateEvent(ctx sdk.Context, stateDB vm.StateDB, msg * Address: p.Address(), Topics: topics, Data: b.Bytes(), - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil @@ -247,7 +247,7 @@ func (p Precompile) EmitUnbondEvent(ctx sdk.Context, stateDB vm.StateDB, msg *st Address: p.Address(), Topics: topics, Data: b.Bytes(), - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil @@ -286,7 +286,7 @@ func (p Precompile) EmitRedelegateEvent(ctx sdk.Context, stateDB vm.StateDB, msg Address: p.Address(), Topics: topics, Data: b.Bytes(), - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil @@ -315,7 +315,7 @@ func (p Precompile) EmitCancelUnbondingDelegationEvent(ctx sdk.Context, stateDB Address: p.Address(), Topics: topics, Data: b.Bytes(), - BlockNumber: uint64(ctx.BlockHeight()), + BlockNumber: uint64(ctx.BlockHeight()), //nolint:gosec // G115 // won't exceed uint64 }) return nil diff --git a/precompiles/staking/events_test.go b/precompiles/staking/events_test.go index 51808a26..f206d0d4 100644 --- a/precompiles/staking/events_test.go +++ b/precompiles/staking/events_test.go @@ -3,6 +3,8 @@ package staking_test import ( "math/big" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -13,22 +15,27 @@ import ( cmn "github.com/evmos/os/precompiles/common" "github.com/evmos/os/precompiles/staking" "github.com/evmos/os/x/evm/core/vm" + "github.com/evmos/os/x/evm/statedb" ) func (s *PrecompileTestSuite) TestApprovalEvent() { + var ( + stDB *statedb.StateDB + ctx sdk.Context + ) method := s.precompile.Methods[authorization.ApproveMethod] testCases := []struct { name string - malleate func() []interface{} + malleate func(grantee common.Address) []interface{} expErr bool errContains string - postCheck func() + postCheck func(granter, grantee common.Address) }{ { "success - all four methods are present in the emitted event", - func() []interface{} { + func(grantee common.Address) []interface{} { return []interface{}{ - s.address, + grantee, abi.MaxUint256, []string{ staking.DelegateMsg, @@ -40,19 +47,19 @@ func (s *PrecompileTestSuite) TestApprovalEvent() { }, false, "", - func() { - log := s.stateDB.Logs()[0] + func(granter, grantee common.Address) { + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[authorization.EventTypeApproval] s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 var approvalEvent authorization.EventApproval err := cmn.UnpackLog(s.precompile.ABI, &approvalEvent, authorization.EventTypeApproval, *log) s.Require().NoError(err) - s.Require().Equal(s.address, approvalEvent.Grantee) - s.Require().Equal(s.address, approvalEvent.Granter) + s.Require().Equal(grantee, approvalEvent.Grantee) + s.Require().Equal(granter, approvalEvent.Granter) s.Require().Equal(abi.MaxUint256, approvalEvent.Value) s.Require().Equal(4, len(approvalEvent.Methods)) s.Require().Equal(staking.DelegateMsg, approvalEvent.Methods[0]) @@ -66,38 +73,48 @@ func (s *PrecompileTestSuite) TestApprovalEvent() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() + + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) - err := s.CreateAuthorization(s.address, staking.DelegateAuthz, nil) + err := s.CreateAuthorization(ctx, granter.AccAddr, grantee.AccAddr, staking.DelegateAuthz, nil) s.Require().NoError(err) - _, err = s.precompile.Approve(s.ctx, s.address, s.stateDB, &method, tc.malleate()) + approveArgs := tc.malleate(grantee.Addr) + _, err = s.precompile.Approve(ctx, granter.Addr, stDB, &method, approveArgs) if tc.expErr { s.Require().Error(err) s.Require().Contains(err.Error(), tc.errContains) } else { s.Require().NoError(err) - tc.postCheck() + tc.postCheck(granter.Addr, grantee.Addr) } }) } } func (s *PrecompileTestSuite) TestIncreaseAllowanceEvent() { + var ( + stDB *statedb.StateDB + ctx sdk.Context + ) approvalMethod := s.precompile.Methods[authorization.ApproveMethod] method := s.precompile.Methods[authorization.IncreaseAllowanceMethod] testCases := []struct { name string - malleate func() []interface{} + malleate func(grantee common.Address) []interface{} expErr bool errContains string - postCheck func() + postCheck func(granter, grantee common.Address) }{ { "success - increased allowance for all 3 methods by 1 evmos", - func() []interface{} { + func(grantee common.Address) []interface{} { return []interface{}{ - s.address, + grantee, big.NewInt(1000000000000000000), []string{ staking.DelegateMsg, @@ -108,8 +125,8 @@ func (s *PrecompileTestSuite) TestIncreaseAllowanceEvent() { }, false, "", - func() { - log := s.stateDB.Logs()[1] + func(granter, grantee common.Address) { + log := stDB.Logs()[1] methods := []string{ staking.DelegateMsg, staking.UndelegateMsg, @@ -120,7 +137,7 @@ func (s *PrecompileTestSuite) TestIncreaseAllowanceEvent() { big.NewInt(2000000000000000000), big.NewInt(2000000000000000000), } - s.CheckAllowanceChangeEvent(log, methods, amounts) + s.CheckAllowanceChangeEvent(log, methods, amounts, granter, grantee) }, }, } @@ -128,43 +145,53 @@ func (s *PrecompileTestSuite) TestIncreaseAllowanceEvent() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() + + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) - err := s.CreateAuthorization(s.address, staking.DelegateAuthz, nil) + err := s.CreateAuthorization(ctx, granter.AccAddr, grantee.AccAddr, staking.DelegateAuthz, nil) s.Require().NoError(err) // Approve first with 1 evmos - _, err = s.precompile.Approve(s.ctx, s.address, s.stateDB, &approvalMethod, tc.malleate()) + approveArgs := tc.malleate(grantee.Addr) + _, err = s.precompile.Approve(ctx, granter.Addr, stDB, &approvalMethod, approveArgs) s.Require().NoError(err) // Increase allowance after approval - _, err = s.precompile.IncreaseAllowance(s.ctx, s.address, s.stateDB, &method, tc.malleate()) + _, err = s.precompile.IncreaseAllowance(ctx, granter.Addr, stDB, &method, approveArgs) if tc.expErr { s.Require().Error(err) s.Require().Contains(err.Error(), tc.errContains) } else { s.Require().NoError(err) - tc.postCheck() + tc.postCheck(granter.Addr, grantee.Addr) } }) } } func (s *PrecompileTestSuite) TestDecreaseAllowanceEvent() { + var ( + stDB *statedb.StateDB + ctx sdk.Context + ) approvalMethod := s.precompile.Methods[authorization.ApproveMethod] method := s.precompile.Methods[authorization.DecreaseAllowanceMethod] testCases := []struct { name string - malleate func() []interface{} + malleate func(grantee common.Address) []interface{} expErr bool errContains string - postCheck func() + postCheck func(granter, grantee common.Address) }{ { "success - decreased allowance for all 3 methods by 1 evmos", - func() []interface{} { + func(grantee common.Address) []interface{} { return []interface{}{ - s.address, + grantee, big.NewInt(1000000000000000000), []string{ staking.DelegateMsg, @@ -175,8 +202,8 @@ func (s *PrecompileTestSuite) TestDecreaseAllowanceEvent() { }, false, "", - func() { - log := s.stateDB.Logs()[1] + func(granter, grantee common.Address) { + log := stDB.Logs()[1] methods := []string{ staking.DelegateMsg, staking.UndelegateMsg, @@ -187,7 +214,7 @@ func (s *PrecompileTestSuite) TestDecreaseAllowanceEvent() { big.NewInt(1000000000000000000), big.NewInt(1000000000000000000), } - s.CheckAllowanceChangeEvent(log, methods, amounts) + s.CheckAllowanceChangeEvent(log, methods, amounts, granter, grantee) }, }, } @@ -195,13 +222,18 @@ func (s *PrecompileTestSuite) TestDecreaseAllowanceEvent() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() - err := s.CreateAuthorization(s.address, staking.DelegateAuthz, nil) + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + + err := s.CreateAuthorization(ctx, granter.AccAddr, grantee.AccAddr, staking.DelegateAuthz, nil) s.Require().NoError(err) // Approve first with 2 evmos args := []interface{}{ - s.address, + grantee.Addr, big.NewInt(2000000000000000000), []string{ staking.DelegateMsg, @@ -209,18 +241,18 @@ func (s *PrecompileTestSuite) TestDecreaseAllowanceEvent() { staking.RedelegateMsg, }, } - _, err = s.precompile.Approve(s.ctx, s.address, s.stateDB, &approvalMethod, args) + _, err = s.precompile.Approve(ctx, granter.Addr, stDB, &approvalMethod, args) s.Require().NoError(err) // Decrease allowance after approval - _, err = s.precompile.DecreaseAllowance(s.ctx, s.address, s.stateDB, &method, tc.malleate()) + _, err = s.precompile.DecreaseAllowance(ctx, granter.Addr, stDB, &method, tc.malleate(grantee.Addr)) if tc.expErr { s.Require().Error(err) s.Require().Contains(err.Error(), tc.errContains) } else { s.Require().NoError(err) - tc.postCheck() + tc.postCheck(granter.Addr, grantee.Addr) } }) } @@ -228,6 +260,8 @@ func (s *PrecompileTestSuite) TestDecreaseAllowanceEvent() { func (s *PrecompileTestSuite) TestCreateValidatorEvent() { var ( + stDB *statedb.StateDB + ctx sdk.Context delegationValue = big.NewInt(1205000000000000000) method = s.precompile.Methods[staking.CreateValidatorMethod] pubkey = "nfJ0axJC9dhta1MAE1EBFaVdxxkYzxYrBaHuJVjG//M=" @@ -235,14 +269,14 @@ func (s *PrecompileTestSuite) TestCreateValidatorEvent() { testCases := []struct { name string - malleate func() []interface{} + malleate func(delegator common.Address) []interface{} expErr bool errContains string - postCheck func() + postCheck func(delegator common.Address) }{ { name: "success - the correct event is emitted", - malleate: func() []interface{} { + malleate: func(delegator common.Address) []interface{} { return []interface{}{ staking.Description{ Moniker: "node0", @@ -257,25 +291,25 @@ func (s *PrecompileTestSuite) TestCreateValidatorEvent() { MaxChangeRate: math.LegacyOneDec().BigInt(), }, big.NewInt(1), - s.address, + delegator, pubkey, delegationValue, } }, - postCheck: func() { - log := s.stateDB.Logs()[0] + postCheck: func(delegator common.Address) { + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[staking.EventTypeCreateValidator] s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 // Check the fully unpacked event matches the one emitted var createValidatorEvent staking.EventCreateValidator err := cmn.UnpackLog(s.precompile.ABI, &createValidatorEvent, staking.EventTypeCreateValidator, *log) s.Require().NoError(err) - s.Require().Equal(s.address, createValidatorEvent.ValidatorAddress) + s.Require().Equal(delegator, createValidatorEvent.ValidatorAddress) s.Require().Equal(delegationValue, createValidatorEvent.Value) }, }, @@ -284,16 +318,20 @@ func (s *PrecompileTestSuite) TestCreateValidatorEvent() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), 200000) - _, err := s.precompile.CreateValidator(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate()) + delegator := s.keyring.GetKey(0) + + contract := vm.NewContract(vm.AccountRef(delegator.Addr), s.precompile, big.NewInt(0), 200000) + _, err := s.precompile.CreateValidator(ctx, delegator.Addr, contract, stDB, &method, tc.malleate(delegator.Addr)) if tc.expErr { s.Require().Error(err) s.Require().Contains(err.Error(), tc.errContains) } else { s.Require().NoError(err) - tc.postCheck() + tc.postCheck(delegator.Addr) } }) } @@ -301,6 +339,8 @@ func (s *PrecompileTestSuite) TestCreateValidatorEvent() { func (s *PrecompileTestSuite) TestEditValidatorEvent() { var ( + stDB *statedb.StateDB + ctx sdk.Context valOperAddr common.Address method = s.precompile.Methods[staking.EditValidatorMethod] minSelfDel = big.NewInt(11) @@ -330,14 +370,14 @@ func (s *PrecompileTestSuite) TestEditValidatorEvent() { } }, postCheck: func() { - s.Require().Equal(len(s.stateDB.Logs()), 1) - log := s.stateDB.Logs()[0] + s.Require().Equal(len(stDB.Logs()), 1) + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[staking.EventTypeEditValidator] s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 // Check the fully unpacked event matches the one emitted var editValidatorEvent staking.EventEditValidator @@ -353,10 +393,15 @@ func (s *PrecompileTestSuite) TestEditValidatorEvent() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - valOperAddr = common.BytesToAddress(s.validators[0].GetOperator().Bytes()) + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() + + acc, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) + valOperAddr = common.BytesToAddress(acc.Bytes()) contract := vm.NewContract(vm.AccountRef(valOperAddr), s.precompile, big.NewInt(0), 200000) - _, err := s.precompile.EditValidator(s.ctx, valOperAddr, contract, s.stateDB, &method, tc.malleate()) + _, err = s.precompile.EditValidator(ctx, valOperAddr, contract, stDB, &method, tc.malleate()) if tc.expErr { s.Require().Error(err) @@ -371,38 +416,40 @@ func (s *PrecompileTestSuite) TestEditValidatorEvent() { func (s *PrecompileTestSuite) TestDelegateEvent() { var ( + stDB *statedb.StateDB + ctx sdk.Context delegationAmt = big.NewInt(1500000000000000000) newSharesExp = delegationAmt method = s.precompile.Methods[staking.DelegateMethod] ) testCases := []struct { name string - malleate func() []interface{} + malleate func(delegator common.Address) []interface{} expErr bool errContains string - postCheck func() + postCheck func(delegator common.Address) }{ { "success - the correct event is emitted", - func() []interface{} { + func(delegator common.Address) []interface{} { return []interface{}{ - s.address, - s.validators[0].OperatorAddress, + delegator, + s.network.GetValidators()[0].OperatorAddress, delegationAmt, } }, false, "", - func() { - log := s.stateDB.Logs()[0] + func(delegator common.Address) { + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[staking.EventTypeDelegate] s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 - optAddr, err := sdk.ValAddressFromBech32(s.validators[0].OperatorAddress) + optAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].OperatorAddress) s.Require().NoError(err) optHexAddr := common.BytesToAddress(optAddr) @@ -410,7 +457,7 @@ func (s *PrecompileTestSuite) TestDelegateEvent() { var delegationEvent staking.EventDelegate err = cmn.UnpackLog(s.precompile.ABI, &delegationEvent, staking.EventTypeDelegate, *log) s.Require().NoError(err) - s.Require().Equal(s.address, delegationEvent.DelegatorAddress) + s.Require().Equal(delegator, delegationEvent.DelegatorAddress) s.Require().Equal(optHexAddr, delegationEvent.ValidatorAddress) s.Require().Equal(delegationAmt, delegationEvent.Amount) s.Require().Equal(newSharesExp, delegationEvent.NewShares) @@ -418,56 +465,65 @@ func (s *PrecompileTestSuite) TestDelegateEvent() { }, } - for _, tc := range testCases { + for _, tc := range testCases { //nolint:dupl s.Run(tc.name, func() { s.SetupTest() // reset + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() - err := s.CreateAuthorization(s.address, staking.DelegateAuthz, nil) + delegator := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.DelegateAuthz, nil) s.Require().NoError(err) - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), 20000) - _, err = s.precompile.Delegate(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate()) + contract := vm.NewContract(vm.AccountRef(delegator.Addr), s.precompile, big.NewInt(0), 20000) + _, err = s.precompile.Delegate(ctx, delegator.Addr, contract, stDB, &method, tc.malleate(delegator.Addr)) if tc.expErr { s.Require().Error(err) s.Require().Contains(err.Error(), tc.errContains) } else { s.Require().NoError(err) - tc.postCheck() + tc.postCheck(delegator.Addr) } }) } } func (s *PrecompileTestSuite) TestUnbondEvent() { + var ( + stDB *statedb.StateDB + ctx sdk.Context + ) method := s.precompile.Methods[staking.UndelegateMethod] testCases := []struct { name string - malleate func() []interface{} + malleate func(delegator common.Address) []interface{} expErr bool errContains string - postCheck func() + postCheck func(delegator common.Address) }{ { "success - the correct event is emitted", - func() []interface{} { + func(delegator common.Address) []interface{} { return []interface{}{ - s.address, - s.validators[0].OperatorAddress, + delegator, + s.network.GetValidators()[0].OperatorAddress, big.NewInt(1000000000000000000), } }, false, "", - func() { - log := s.stateDB.Logs()[0] + func(delegator common.Address) { + log := stDB.Logs()[0] // Check event signature matches the one emitted event := s.precompile.ABI.Events[staking.EventTypeUnbond] s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 - optAddr, err := sdk.ValAddressFromBech32(s.validators[0].OperatorAddress) + optAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].OperatorAddress) s.Require().NoError(err) optHexAddr := common.BytesToAddress(optAddr) @@ -475,75 +531,84 @@ func (s *PrecompileTestSuite) TestUnbondEvent() { var unbondEvent staking.EventUnbond err = cmn.UnpackLog(s.precompile.ABI, &unbondEvent, staking.EventTypeUnbond, *log) s.Require().NoError(err) - s.Require().Equal(s.address, unbondEvent.DelegatorAddress) + s.Require().Equal(delegator, unbondEvent.DelegatorAddress) s.Require().Equal(optHexAddr, unbondEvent.ValidatorAddress) s.Require().Equal(big.NewInt(1000000000000000000), unbondEvent.Amount) }, }, } - for _, tc := range testCases { + for _, tc := range testCases { //nolint:dupl s.Run(tc.name, func() { s.SetupTest() // reset + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() + + delegator := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) - err := s.CreateAuthorization(s.address, staking.UndelegateAuthz, nil) + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.UndelegateAuthz, nil) s.Require().NoError(err) - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), 20000) - _, err = s.precompile.Undelegate(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate()) + contract := vm.NewContract(vm.AccountRef(delegator.Addr), s.precompile, big.NewInt(0), 20000) + _, err = s.precompile.Undelegate(ctx, delegator.Addr, contract, stDB, &method, tc.malleate(delegator.Addr)) if tc.expErr { s.Require().Error(err) s.Require().Contains(err.Error(), tc.errContains) } else { s.Require().NoError(err) - tc.postCheck() + tc.postCheck(delegator.Addr) } }) } } func (s *PrecompileTestSuite) TestRedelegateEvent() { + var ( + stDB *statedb.StateDB + ctx sdk.Context + ) method := s.precompile.Methods[staking.RedelegateMethod] testCases := []struct { name string - malleate func() []interface{} + malleate func(delegator common.Address) []interface{} expErr bool errContains string - postCheck func() + postCheck func(delegator common.Address) }{ { "success - the correct event is emitted", - func() []interface{} { + func(delegator common.Address) []interface{} { return []interface{}{ - s.address, - s.validators[0].OperatorAddress, - s.validators[1].OperatorAddress, + delegator, + s.network.GetValidators()[0].OperatorAddress, + s.network.GetValidators()[1].OperatorAddress, big.NewInt(1000000000000000000), } }, false, "", - func() { - log := s.stateDB.Logs()[0] + func(delegator common.Address) { + log := stDB.Logs()[0] // Check event signature matches the one emitted event := s.precompile.ABI.Events[staking.EventTypeRedelegate] s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 - optSrcAddr, err := sdk.ValAddressFromBech32(s.validators[0].OperatorAddress) + optSrcAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].OperatorAddress) s.Require().NoError(err) optSrcHexAddr := common.BytesToAddress(optSrcAddr) - optDstAddr, err := sdk.ValAddressFromBech32(s.validators[1].OperatorAddress) + optDstAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[1].OperatorAddress) s.Require().NoError(err) optDstHexAddr := common.BytesToAddress(optDstAddr) var redelegateEvent staking.EventRedelegate err = cmn.UnpackLog(s.precompile.ABI, &redelegateEvent, staking.EventTypeRedelegate, *log) s.Require().NoError(err) - s.Require().Equal(s.address, redelegateEvent.DelegatorAddress) + s.Require().Equal(delegator, redelegateEvent.DelegatorAddress) s.Require().Equal(optSrcHexAddr, redelegateEvent.ValidatorSrcAddress) s.Require().Equal(optDstHexAddr, redelegateEvent.ValidatorDstAddress) s.Require().Equal(big.NewInt(1000000000000000000), redelegateEvent.Amount) @@ -554,66 +619,75 @@ func (s *PrecompileTestSuite) TestRedelegateEvent() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() + + delegator := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) - err := s.CreateAuthorization(s.address, staking.RedelegateAuthz, nil) + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.RedelegateAuthz, nil) s.Require().NoError(err) - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), 20000) - _, err = s.precompile.Redelegate(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate()) + contract := vm.NewContract(vm.AccountRef(delegator.Addr), s.precompile, big.NewInt(0), 20000) + _, err = s.precompile.Redelegate(ctx, delegator.Addr, contract, stDB, &method, tc.malleate(delegator.Addr)) s.Require().NoError(err) if tc.expErr { s.Require().Error(err) s.Require().Contains(err.Error(), tc.errContains) } else { - tc.postCheck() + tc.postCheck(delegator.Addr) } }) } } func (s *PrecompileTestSuite) TestCancelUnbondingDelegationEvent() { + var ( + stDB *statedb.StateDB + ctx sdk.Context + ) methodCancelUnbonding := s.precompile.Methods[staking.CancelUnbondingDelegationMethod] methodUndelegate := s.precompile.Methods[staking.UndelegateMethod] testCases := []struct { name string - malleate func(contract *vm.Contract) []interface{} + malleate func(contract *vm.Contract, delegator, grantee testkeyring.Key) []interface{} expErr bool errContains string - postCheck func() + postCheck func(delegator common.Address) }{ { "success - the correct event is emitted", - func(contract *vm.Contract) []interface{} { - err := s.CreateAuthorization(s.address, staking.UndelegateAuthz, nil) + func(contract *vm.Contract, delegator, grantee testkeyring.Key) []interface{} { + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.UndelegateAuthz, nil) s.Require().NoError(err) undelegateArgs := []interface{}{ - s.address, - s.validators[0].OperatorAddress, + delegator.Addr, + s.network.GetValidators()[0].OperatorAddress, big.NewInt(1000000000000000000), } - _, err = s.precompile.Undelegate(s.ctx, s.address, contract, s.stateDB, &methodUndelegate, undelegateArgs) + _, err = s.precompile.Undelegate(ctx, delegator.Addr, contract, stDB, &methodUndelegate, undelegateArgs) s.Require().NoError(err) return []interface{}{ - s.address, - s.validators[0].OperatorAddress, + delegator.Addr, + s.network.GetValidators()[0].OperatorAddress, big.NewInt(1000000000000000000), - big.NewInt(2), + big.NewInt(1), } }, false, "", - func() { - log := s.stateDB.Logs()[1] + func(delegator common.Address) { + log := stDB.Logs()[1] // Check event signature matches the one emitted event := s.precompile.ABI.Events[staking.EventTypeCancelUnbondingDelegation] s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 - optAddr, err := sdk.ValAddressFromBech32(s.validators[0].OperatorAddress) + optAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].OperatorAddress) s.Require().NoError(err) optHexAddr := common.BytesToAddress(optAddr) @@ -621,10 +695,10 @@ func (s *PrecompileTestSuite) TestCancelUnbondingDelegationEvent() { var cancelUnbondEvent staking.EventCancelUnbonding err = cmn.UnpackLog(s.precompile.ABI, &cancelUnbondEvent, staking.EventTypeCancelUnbondingDelegation, *log) s.Require().NoError(err) - s.Require().Equal(s.address, cancelUnbondEvent.DelegatorAddress) + s.Require().Equal(delegator, cancelUnbondEvent.DelegatorAddress) s.Require().Equal(optHexAddr, cancelUnbondEvent.ValidatorAddress) s.Require().Equal(big.NewInt(1000000000000000000), cancelUnbondEvent.Amount) - s.Require().Equal(big.NewInt(2), cancelUnbondEvent.CreationHeight) + s.Require().Equal(big.NewInt(1), cancelUnbondEvent.CreationHeight) }, }, } @@ -632,20 +706,25 @@ func (s *PrecompileTestSuite) TestCancelUnbondingDelegationEvent() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() + + delegator := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) - err := s.CreateAuthorization(s.address, staking.CancelUnbondingDelegationAuthz, nil) + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.CancelUnbondingDelegationAuthz, nil) s.Require().NoError(err) - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), 20000) - callArgs := tc.malleate(contract) - _, err = s.precompile.CancelUnbondingDelegation(s.ctx, s.address, contract, s.stateDB, &methodCancelUnbonding, callArgs) + contract := vm.NewContract(vm.AccountRef(delegator.Addr), s.precompile, big.NewInt(0), 20000) + callArgs := tc.malleate(contract, delegator, grantee) + _, err = s.precompile.CancelUnbondingDelegation(ctx, delegator.Addr, contract, stDB, &methodCancelUnbonding, callArgs) s.Require().NoError(err) if tc.expErr { s.Require().Error(err) s.Require().Contains(err.Error(), tc.errContains) } else { - tc.postCheck() + tc.postCheck(delegator.Addr) } }) } diff --git a/precompiles/staking/integration_test.go b/precompiles/staking/integration_test.go index 18e6875f..b0745dc5 100644 --- a/precompiles/staking/integration_test.go +++ b/precompiles/staking/integration_test.go @@ -5,14 +5,18 @@ package staking_test import ( "fmt" "math/big" + "testing" "time" + evmosutil "github.com/evmos/os/testutil/constants" + //nolint:revive // dot imports are fine for Ginkgo . "github.com/onsi/ginkgo/v2" //nolint:revive // dot imports are fine for Ginkgo . "github.com/onsi/gomega" "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -21,7 +25,6 @@ import ( "github.com/ethereum/go-ethereum/common" compiledcontracts "github.com/evmos/os/contracts" "github.com/evmos/os/crypto/ethsecp256k1" - chainutil "github.com/evmos/os/example_chain/testutil" "github.com/evmos/os/precompiles/authorization" cmn "github.com/evmos/os/precompiles/common" "github.com/evmos/os/precompiles/distribution" @@ -29,23 +32,31 @@ import ( "github.com/evmos/os/precompiles/staking/testdata" "github.com/evmos/os/precompiles/testutil" "github.com/evmos/os/precompiles/testutil/contracts" - evmosutil "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/integration/os/factory" + testutils "github.com/evmos/os/testutil/integration/os/utils" testutiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/evm/core/vm" evmtypes "github.com/evmos/os/x/evm/types" ) +func TestPrecompileIntegrationTestSuite(t *testing.T) { + // Run Ginkgo integration tests + RegisterFailHandler(Fail) + RunSpecs(t, "Staking Precompile Integration Tests") +} + // General variables used for integration tests var ( // valAddr and valAddr2 are the two validator addresses used for testing valAddr, valAddr2 sdk.ValAddress - // defaultCallArgs and defaultApproveArgs are the default arguments for calling the smart contract and to + // callArgs and approveCallArgs are the default arguments for calling the smart contract and to // call the approve method specifically. // // NOTE: this has to be populated in a BeforeEach block because the contractAddr would otherwise be a nil address. - defaultCallArgs, defaultApproveArgs contracts.CallArgs - + callArgs, approveCallArgs factory.CallArgs + // txArgs are the EVM transaction arguments to use in the transactions + txArgs evmtypes.EvmTxArgs // defaultLogCheck instantiates a log check arguments struct with the precompile ABI events populated. defaultLogCheck testutil.LogCheckArgs // passCheck defines the arguments to check if the precompile returns no error @@ -56,25 +67,37 @@ var ( var _ = Describe("Calling staking precompile directly", func() { var ( + // s is the precompile test suite to use for the tests + s *PrecompileTestSuite // oneE18Coin is a sdk.Coin with an amount of 1e18 in the test suite's bonding denomination - oneE18Coin = sdk.NewCoin(s.bondDenom, math.NewInt(1e18)) + oneE18Coin = sdk.NewCoin(evmosutil.ExampleAttoDenom, math.NewInt(1e18)) // twoE18Coin is a sdk.Coin with an amount of 2e18 in the test suite's bonding denomination - twoE18Coin = sdk.NewCoin(s.bondDenom, math.NewInt(2e18)) + twoE18Coin = sdk.NewCoin(evmosutil.ExampleAttoDenom, math.NewInt(2e18)) ) BeforeEach(func() { + var err error + s = new(PrecompileTestSuite) s.SetupTest() - s.NextBlock() - valAddr = s.validators[0].GetOperator() - valAddr2 = s.validators[1].GetOperator() + valAddr, err = sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + Expect(err).To(BeNil()) + valAddr2, err = sdk.ValAddressFromBech32(s.network.GetValidators()[1].GetOperator()) + Expect(err).To(BeNil()) + + approveCallArgs = factory.CallArgs{ + ContractABI: s.precompile.ABI, + MethodName: authorization.ApproveMethod, + } + + callArgs = factory.CallArgs{ + ContractABI: s.precompile.ABI, + } - defaultCallArgs = contracts.CallArgs{ - ContractAddr: s.precompile.Address(), - ContractABI: s.precompile.ABI, - PrivKey: s.privKey, + precompileAddr := s.precompile.Address() + txArgs = evmtypes.EvmTxArgs{ + To: &precompileAddr, } - defaultApproveArgs = defaultCallArgs.WithMethodName(authorization.ApproveMethod) defaultLogCheck = testutil.LogCheckArgs{ABIEvents: s.precompile.ABI.Events} passCheck = defaultLogCheck.WithExpPass(true) @@ -83,27 +106,35 @@ var _ = Describe("Calling staking precompile directly", func() { Describe("when the precompile is not enabled in the EVM params", func() { It("should succeed but not perform delegation", func() { + delegator := s.keyring.GetKey(0) // disable the precompile - params := s.app.EVMKeeper.GetParams(s.ctx) + res, err := s.grpcHandler.GetEvmParams() + Expect(err).To(BeNil()) + var activePrecompiles []string - for _, precompile := range params.ActiveStaticPrecompiles { + for _, precompile := range res.Params.ActiveStaticPrecompiles { if precompile != s.precompile.Address().String() { activePrecompiles = append(activePrecompiles, precompile) } } - params.ActiveStaticPrecompiles = activePrecompiles - err := s.app.EVMKeeper.SetParams(s.ctx, params) + res.Params.ActiveStaticPrecompiles = activePrecompiles + + err = testutils.UpdateEvmParams(testutils.UpdateParamsInput{ + Tf: s.factory, + Network: s.network, + Pk: delegator.Priv, + Params: res.Params, + }) Expect(err).To(BeNil(), "error while setting params") // get the delegation that is available prior to the test - prevDelegation, _ := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), valAddr) - + qRes, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), valAddr.String()) + Expect(err).To(BeNil()) + prevDelegation := qRes.DelegationResponse.Balance // try to call the precompile - delegateArgs := defaultCallArgs. - WithMethodName(staking.DelegateMethod). - WithArgs( - s.address, valAddr.String(), big.NewInt(2e18), - ) + callArgs.MethodName = staking.DelegateMethod + callArgs.Args = []interface{}{delegator.Addr, valAddr.String(), big.NewInt(2e18)} + // Contract should not be called but the transaction should be successful // This is the expected behavior in Ethereum where there is a contract call // to a non existing contract @@ -111,31 +142,39 @@ var _ = Describe("Calling staking precompile directly", func() { WithExpEvents([]string{}...). WithExpPass(true) - _, _, err = contracts.CallContractAndCheckLogs( - s.ctx, - s.app, - delegateArgs, + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, expectedCheck, ) - Expect(err).To(BeNil(), "unexpected error while calling the precompile") - - postDelegation, _ := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), valAddr) + Expect(err).To(BeNil(), "expected error while calling the precompile") + qRes, err = s.grpcHandler.GetDelegation(delegator.AccAddr.String(), valAddr.String()) + Expect(err).To(BeNil()) + postDelegation := qRes.DelegationResponse.Balance Expect(postDelegation).To(Equal(prevDelegation), "expected delegation to not change") }) }) Describe("Revert transaction", func() { It("should run out of gas if the gas limit is too low", func() { - outOfGasArgs := defaultApproveArgs. - WithGasLimit(30000). - WithArgs( - s.precompile.Address(), - abi.MaxUint256, - []string{staking.DelegateMsg}, - ) + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + + approveCallArgs.Args = []interface{}{ + grantee.Addr, + abi.MaxUint256, + []string{staking.DelegateMsg}, + } + txArgs.GasLimit = 30000 - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, outOfGasArgs, outOfGasCheck) - Expect(err).To(HaveOccurred(), "error while calling precompile") + _, _, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, + approveCallArgs, + outOfGasCheck, + ) + Expect(err).To(BeNil(), "error while calling precompile") }) }) @@ -143,75 +182,94 @@ var _ = Describe("Calling staking precompile directly", func() { // TODO: enable once we check that the spender is not the origin // It("should return error if the origin is the spender", func() { // args := defaultApproveArgs.WithArgs( - // s.address, + // granter.Addr, // abi.MaxUint256, // []string{staking.DelegateMsg}, // ) // - // differentOriginCheck := defaultLogCheck.WithErrContains(cmn.ErrDifferentOrigin, s.address, addr) + // differentOriginCheck := defaultLogCheck.WithErrContains(cmn.ErrDifferentOrigin, granter.Addr, addr) // - // _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, args, differentOriginCheck) + // _, _, err := s.factory.CallContractAndCheckLogs( // Expect(err).To(BeNil(), "error while calling precompile") // }) It("should return error if the staking method is not supported on the precompile", func() { - approveArgs := defaultApproveArgs.WithArgs( - s.precompile.Address(), abi.MaxUint256, []string{distribution.DelegationRewardsMethod}, - ) + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + + approveCallArgs.Args = []interface{}{ + grantee.Addr, + abi.MaxUint256, + []string{distribution.DelegationRewardsMethod}, + } logCheckArgs := defaultLogCheck.WithErrContains( cmn.ErrInvalidMsgType, "staking", distribution.DelegationRewardsMethod, ) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, approveArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the contract and checking logs") + _, _, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, + approveCallArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the contract and checking logs") }) It("should approve the delegate method with the max uint256 value", func() { + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + s.SetupApproval( - s.privKey, s.precompile.Address(), abi.MaxUint256, []string{staking.DelegateMsg}, + granter.Priv, grantee.Addr, abi.MaxUint256, []string{staking.DelegateMsg}, ) - s.ExpectAuthorization(staking.DelegateAuthz, s.precompile.Address(), s.address, nil) + s.ExpectAuthorization(staking.DelegateAuthz, grantee.Addr, granter.Addr, nil) }) It("should approve the undelegate method with 1 evmos", func() { + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + s.SetupApproval( - s.privKey, s.precompile.Address(), big.NewInt(1e18), []string{staking.UndelegateMsg}, + granter.Priv, grantee.Addr, big.NewInt(1e18), []string{staking.UndelegateMsg}, ) - s.ExpectAuthorization(staking.UndelegateAuthz, s.precompile.Address(), s.address, &oneE18Coin) + s.ExpectAuthorization(staking.UndelegateAuthz, grantee.Addr, granter.Addr, &oneE18Coin) }) It("should approve the redelegate method with 2 evmos", func() { + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + s.SetupApproval( - s.privKey, s.precompile.Address(), big.NewInt(2e18), []string{staking.RedelegateMsg}, + granter.Priv, grantee.Addr, big.NewInt(2e18), []string{staking.RedelegateMsg}, ) - s.ExpectAuthorization(staking.RedelegateAuthz, s.precompile.Address(), s.address, &twoE18Coin) + s.ExpectAuthorization(staking.RedelegateAuthz, grantee.Addr, granter.Addr, &twoE18Coin) }) It("should approve the cancel unbonding delegation method with 1 evmos", func() { + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + s.SetupApproval( - s.privKey, s.precompile.Address(), big.NewInt(1e18), []string{staking.CancelUnbondingDelegationMsg}, + granter.Priv, grantee.Addr, big.NewInt(1e18), []string{staking.CancelUnbondingDelegationMsg}, ) - s.ExpectAuthorization(staking.CancelUnbondingDelegationAuthz, s.precompile.Address(), s.address, &oneE18Coin) + s.ExpectAuthorization(staking.CancelUnbondingDelegationAuthz, grantee.Addr, granter.Addr, &oneE18Coin) }) }) Describe("Execute increase allowance transaction", func() { - // defaultIncreaseArgs are the default arguments to call the increase allowance method. - // - // NOTE: this has to be populated in BeforeEach, because the private key is not initialized outside of it. - var defaultIncreaseArgs contracts.CallArgs - BeforeEach(func() { + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + s.SetupApproval( - s.privKey, s.precompile.Address(), big.NewInt(1e18), []string{staking.DelegateMsg}, + granter.Priv, grantee.Addr, big.NewInt(1e18), []string{staking.DelegateMsg}, ) - - defaultIncreaseArgs = defaultCallArgs.WithMethodName(authorization.IncreaseAllowanceMethod) + callArgs.MethodName = authorization.IncreaseAllowanceMethod }) // TODO: enable once we check that the spender is not the origin @@ -219,203 +277,253 @@ var _ = Describe("Calling staking precompile directly", func() { // increaseArgs := defaultCallArgs. // WithMethodName(authorization.IncreaseAllowanceMethod). // WithArgs( - // s.address, big.NewInt(1e18), []string{staking.DelegateMsg}, + // granter.Addr, big.NewInt(1e18), []string{staking.DelegateMsg}, // ) // - // _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, increaseArgs, differentOriginCheck) + // _, _, err := s.factory.CallContractAndCheckLogs( // Expect(err).To(BeNil(), "error while calling the contract and checking logs") // }) It("Should increase the allowance of the delegate method with 1 evmos", func() { - increaseArgs := defaultCallArgs. - WithMethodName(authorization.IncreaseAllowanceMethod). - WithArgs( - s.precompile.Address(), big.NewInt(1e18), []string{staking.DelegateMsg}, - ) + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + + callArgs.Args = []interface{}{ + grantee.Addr, big.NewInt(1e18), []string{staking.DelegateMsg}, + } logCheckArgs := passCheck.WithExpEvents(authorization.EventTypeAllowanceChange) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, increaseArgs, logCheckArgs) + _, _, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the contract and checking logs") + Expect(s.network.NextBlock()).To(BeNil()) - s.ExpectAuthorization(staking.DelegateAuthz, s.precompile.Address(), s.address, &twoE18Coin) + s.ExpectAuthorization(staking.DelegateAuthz, grantee.Addr, granter.Addr, &twoE18Coin) }) It("should return error if the allowance to increase does not exist", func() { - increaseArgs := defaultIncreaseArgs.WithArgs( - s.precompile.Address(), big.NewInt(1e18), []string{staking.UndelegateMsg}, - ) + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + + callArgs.Args = []interface{}{ + grantee.Addr, big.NewInt(1e18), []string{staking.UndelegateMsg}, + } logCheckArgs := defaultLogCheck.WithErrContains( "does not exist", ) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, increaseArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the contract and checking logs") - Expect(err.Error()).To(ContainSubstring("does not exist")) + _, _, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, + callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the contract and checking logs") + Expect(s.network.NextBlock()).To(BeNil()) - authz, _ := s.CheckAuthorization(staking.UndelegateAuthz, s.precompile.Address(), s.address) + authz, _, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, staking.UndelegateAuthz, grantee.Addr, granter.Addr) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("invalid authorization type. Expected: %d, got: %d", staking.UndelegateAuthz, staking.DelegateAuthz))) Expect(authz).To(BeNil(), "expected authorization to not be set") }) }) Describe("Execute decrease allowance transaction", func() { - // defaultDecreaseArgs are the default arguments to call the decrease allowance method. - // - // NOTE: this has to be populated in BeforeEach, because the private key is not initialized outside of it. - var defaultDecreaseArgs contracts.CallArgs - BeforeEach(func() { + granteeAddr := s.precompile.Address() + granter := s.keyring.GetKey(0) + s.SetupApproval( - s.privKey, s.precompile.Address(), big.NewInt(2e18), []string{staking.DelegateMsg}, + granter.Priv, granteeAddr, big.NewInt(2e18), []string{staking.DelegateMsg}, ) - defaultDecreaseArgs = defaultCallArgs.WithMethodName(authorization.DecreaseAllowanceMethod) + callArgs.MethodName = authorization.DecreaseAllowanceMethod }) // TODO: enable once we check that the spender is not the origin // It("should return error if the origin is the spender", func() { // addr, _ := testutiltx.NewAddrKey() // decreaseArgs := defaultDecreaseArgs.WithArgs( - // s.precompile.Address(), big.NewInt(1e18), []string{staking.DelegateMsg}, + // grantee.Addr, big.NewInt(1e18), []string{staking.DelegateMsg}, // ) // // logCheckArgs := defaultLogCheck.WithErrContains( - // cmn.ErrDifferentOrigin, s.address, addr, + // cmn.ErrDifferentOrigin, granter.Addr, addr, // ) // - // _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, decreaseArgs, logCheckArgs) + // _, _, err := s.factory.CallContractAndCheckLogs( // Expect(err).To(BeNil(), "error while calling the contract and checking logs") // }) It("Should decrease the allowance of the delegate method with 1 evmos", func() { - decreaseArgs := defaultDecreaseArgs.WithArgs( - s.precompile.Address(), big.NewInt(1e18), []string{staking.DelegateMsg}, - ) + granteeAddr := s.precompile.Address() + granter := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + granteeAddr, big.NewInt(1e18), []string{staking.DelegateMsg}, + } logCheckArgs := passCheck.WithExpEvents(authorization.EventTypeAllowanceChange) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, decreaseArgs, logCheckArgs) + _, _, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the contract and checking logs") + Expect(s.network.NextBlock()).To(BeNil()) - s.ExpectAuthorization(staking.DelegateAuthz, s.precompile.Address(), s.address, &oneE18Coin) + s.ExpectAuthorization(staking.DelegateAuthz, granteeAddr, granter.Addr, &oneE18Coin) }) It("should return error if the allowance to decrease does not exist", func() { - decreaseArgs := defaultDecreaseArgs.WithArgs( - s.precompile.Address(), big.NewInt(1e18), []string{staking.UndelegateMsg}, - ) + granteeAddr := s.precompile.Address() + granter := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + granteeAddr, big.NewInt(1e18), []string{staking.UndelegateMsg}, + } logCheckArgs := defaultLogCheck.WithErrContains( "does not exist", ) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, decreaseArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the contract and checking logs") - Expect(err.Error()).To(ContainSubstring("does not exist")) + _, _, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the contract and checking logs") + Expect(s.network.NextBlock()).To(BeNil()) - authz, _ := s.CheckAuthorization(staking.UndelegateAuthz, s.precompile.Address(), s.address) + authz, _, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, staking.UndelegateAuthz, granteeAddr, granter.Addr) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("invalid authorization type. Expected: %d, got: %d", staking.UndelegateAuthz, staking.DelegateAuthz))) Expect(authz).To(BeNil(), "expected authorization to not be set") }) }) Describe("to revoke an approval", func() { - var ( - // defaultRevokeArgs are the default arguments to call the revoke method. - // - // NOTE: this has to be populated in BeforeEach, because the default call args are not initialized outside of it. - defaultRevokeArgs contracts.CallArgs - - // granteeAddr is the address of the grantee used in the revocation tests. - granteeAddr = testutiltx.GenerateAddress() - ) + // granteeAddr is the address of the grantee used in the revocation tests. + granteeAddr := testutiltx.GenerateAddress() BeforeEach(func() { - defaultRevokeArgs = defaultCallArgs.WithMethodName(authorization.RevokeMethod) + callArgs.MethodName = authorization.RevokeMethod }) It("should revoke the approval when executing as the granter", func() { + granter := s.keyring.GetKey(0) typeURLs := []string{staking.DelegateMsg} s.SetupApproval( - s.privKey, granteeAddr, abi.MaxUint256, typeURLs, + granter.Priv, granteeAddr, abi.MaxUint256, typeURLs, ) - s.ExpectAuthorization(staking.DelegateAuthz, granteeAddr, s.address, nil) + s.ExpectAuthorization(staking.DelegateAuthz, granteeAddr, granter.Addr, nil) - revokeArgs := defaultRevokeArgs.WithArgs( + callArgs.Args = []interface{}{ granteeAddr, typeURLs, - ) + } revocationCheck := passCheck.WithExpEvents(authorization.EventTypeRevocation) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, revokeArgs, revocationCheck) + _, _, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + revocationCheck) Expect(err).To(BeNil(), "error while calling the contract and checking logs") + Expect(s.network.NextBlock()).To(BeNil()) // check that the authorization is revoked - authz, _ := s.CheckAuthorization(staking.DelegateAuthz, granteeAddr, s.address) + authz, _, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, staking.DelegateAuthz, granteeAddr, granter.Addr) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("no authorizations found for grantee %s and granter %s", granteeAddr.Hex(), granter.Addr.Hex()))) Expect(authz).To(BeNil(), "expected authorization to be revoked") }) It("should not revoke the approval when trying to revoke for a different message type", func() { + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + typeURLs := []string{staking.DelegateMsg} s.SetupApproval( - s.privKey, granteeAddr, abi.MaxUint256, typeURLs, + granter.Priv, grantee.Addr, abi.MaxUint256, typeURLs, ) - s.ExpectAuthorization(staking.DelegateAuthz, granteeAddr, s.address, nil) + s.ExpectAuthorization(staking.DelegateAuthz, grantee.Addr, granter.Addr, nil) - revokeArgs := defaultRevokeArgs.WithArgs( - granteeAddr, []string{staking.UndelegateMsg}, - ) + callArgs.Args = []interface{}{ + grantee.Addr, []string{staking.UndelegateMsg}, + } notFoundCheck := defaultLogCheck. WithErrContains("failed to delete grant") - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, revokeArgs, notFoundCheck) - Expect(err).To(HaveOccurred(), "error while calling the contract and checking logs") + _, _, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + notFoundCheck, + ) + Expect(err).To(BeNil(), "error while calling the contract and checking logs") + Expect(s.network.NextBlock()).To(BeNil()) // the authorization should still be there. - s.ExpectAuthorization(staking.DelegateAuthz, granteeAddr, s.address, nil) + s.ExpectAuthorization(staking.DelegateAuthz, grantee.Addr, granter.Addr, nil) }) It("should return error if the approval does not exist", func() { - revokeArgs := defaultRevokeArgs.WithArgs( - s.address, []string{staking.DelegateMsg}, - ) + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + + callArgs.Args = []interface{}{ + grantee.Addr, []string{staking.DelegateMsg}, + } notFoundCheck := defaultLogCheck. WithErrContains("failed to delete grant") - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, revokeArgs, notFoundCheck) - Expect(err).To(HaveOccurred(), "error while calling the contract and checking logs") + _, _, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + notFoundCheck, + ) + Expect(err).To(BeNil(), "error while calling the contract and checking logs") }) It("should not revoke the approval if sent by someone else than the granter", func() { typeURLs := []string{staking.DelegateMsg} // set up an approval with a different key than the one used to sign the transaction. - differentAddr, differentPriv := testutiltx.NewAddrKey() - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, differentAddr.Bytes(), 1e18) - Expect(err).To(BeNil(), "error while funding account") + granter := s.keyring.GetKey(0) + differentSender := s.keyring.GetKey(1) - s.NextBlock() s.SetupApproval( - differentPriv, granteeAddr, abi.MaxUint256, typeURLs, + granter.Priv, granteeAddr, abi.MaxUint256, typeURLs, ) - s.ExpectAuthorization(staking.DelegateAuthz, granteeAddr, differentAddr, nil) + s.ExpectAuthorization(staking.DelegateAuthz, granteeAddr, granter.Addr, nil) - revokeArgs := defaultRevokeArgs.WithArgs( - differentAddr, typeURLs, - ) + callArgs.Args = []interface{}{ + granteeAddr, typeURLs, + } notFoundCheck := defaultLogCheck. WithErrContains("failed to delete grant") - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, revokeArgs, notFoundCheck) - Expect(err).To(HaveOccurred(), "error while calling the contract and checking logs") + _, _, err := s.factory.CallContractAndCheckLogs( + differentSender.Priv, + txArgs, callArgs, + notFoundCheck, + ) + Expect(err).To(BeNil(), "error while calling the contract and checking logs") + Expect(s.network.NextBlock()).To(BeNil()) // the authorization should still be set - s.ExpectAuthorization(staking.DelegateAuthz, granteeAddr, differentAddr, nil) + s.ExpectAuthorization(staking.DelegateAuthz, granteeAddr, granter.Addr, nil) }) }) @@ -436,31 +544,37 @@ var _ = Describe("Calling staking precompile directly", func() { defaultMinSelfDelegation = big.NewInt(1) defaultPubkeyBase64Str = GenerateBase64PubKey() defaultValue = big.NewInt(1) - - // defaultCreateValidatorArgs are the default arguments for the createValidator call - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - defaultCreateValidatorArgs contracts.CallArgs ) BeforeEach(func() { // populate the default createValidator args - defaultCreateValidatorArgs = defaultCallArgs.WithMethodName(staking.CreateValidatorMethod) + callArgs.MethodName = staking.CreateValidatorMethod }) Context("when validator address is the origin", func() { It("should succeed", func() { - createValidatorArgs := defaultCreateValidatorArgs.WithArgs( - defaultDescription, defaultCommission, defaultMinSelfDelegation, s.address, defaultPubkeyBase64Str, defaultValue, - ) + callArgs.Args = []interface{}{ + defaultDescription, defaultCommission, defaultMinSelfDelegation, s.keyring.GetAddr(0), defaultPubkeyBase64Str, defaultValue, + } + // NOTE: increase gas limit here + txArgs.GasLimit = 2e5 logCheckArgs := passCheck.WithExpEvents(staking.EventTypeCreateValidator) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, createValidatorArgs, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - _, found := s.app.StakingKeeper.GetValidator(s.ctx, s.address.Bytes()) - Expect(found).To(BeTrue(), "expected validator to be found") + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the contract and checking logs") + Expect(s.network.NextBlock()).To(BeNil()) + + valOperAddr := sdk.ValAddress(s.keyring.GetAccAddr(0)).String() + qc := s.network.GetStakingClient() + res, err := qc.Validator(s.network.GetContext(), &stakingtypes.QueryValidatorRequest{ValidatorAddr: valOperAddr}) + Expect(err).To(BeNil()) + Expect(res).NotTo(BeNil()) + Expect(res.Validator.OperatorAddress).To(Equal(valOperAddr)) }) }) @@ -468,16 +582,20 @@ var _ = Describe("Calling staking precompile directly", func() { It("should fail", func() { differentAddr := testutiltx.GenerateAddress() - createValidatorArgs := defaultCreateValidatorArgs.WithArgs( + callArgs.Args = []interface{}{ defaultDescription, defaultCommission, defaultMinSelfDelegation, differentAddr, defaultPubkeyBase64Str, defaultValue, - ) + } logCheckArgs := defaultLogCheck.WithErrContains( - fmt.Sprintf(staking.ErrDifferentOriginFromDelegator, s.address, differentAddr), + fmt.Sprintf(staking.ErrDifferentOriginFromDelegator, s.keyring.GetAddr(0), differentAddr), ) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, createValidatorArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the contract and checking logs") }) }) }) @@ -493,16 +611,11 @@ var _ = Describe("Calling staking precompile directly", func() { } defaultCommissionRate = big.NewInt(staking.DoNotModifyCommissionRate) defaultMinSelfDelegation = big.NewInt(staking.DoNotModifyMinSelfDelegation) - - // defaultEditValidatorArgs are the default arguments for the editValidator call - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - defaultEditValidatorArgs contracts.CallArgs ) BeforeEach(func() { // populate the default editValidator args - defaultEditValidatorArgs = defaultCallArgs.WithMethodName(staking.EditValidatorMethod) + callArgs.MethodName = staking.EditValidatorMethod }) Context("when origin is equal to validator address", func() { @@ -510,8 +623,10 @@ var _ = Describe("Calling staking precompile directly", func() { // create a new validator newAddr, newPriv := testutiltx.NewAccAddressAndKey() hexAddr := common.BytesToAddress(newAddr.Bytes()) - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, newAddr, 2e18) - Expect(err).To(BeNil(), "error while funding account: %v", err) + + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), newAddr, math.NewInt(2e18)) + Expect(err).To(BeNil(), "error while sending coins") + Expect(s.network.NextBlock()).To(BeNil()) description := staking.Description{ Moniker: "new node", @@ -529,29 +644,40 @@ var _ = Describe("Calling staking precompile directly", func() { pubkeyBase64Str := "UuhHQmkUh2cPBA6Rg4ei0M2B04cVYGNn/F8SAUsYIb4=" value := big.NewInt(1e18) - createValidatorArgs := defaultCallArgs.WithMethodName(staking.CreateValidatorMethod). - WithPrivKey(newPriv). - WithArgs(description, commission, minSelfDelegation, hexAddr, pubkeyBase64Str, value) + createValidatorArgs := factory.CallArgs{ + ContractABI: s.precompile.ABI, + MethodName: staking.CreateValidatorMethod, + Args: []interface{}{description, commission, minSelfDelegation, hexAddr, pubkeyBase64Str, value}, + } logCheckArgs := passCheck.WithExpEvents(staking.EventTypeCreateValidator) - - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, createValidatorArgs, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - s.NextBlock() + _, _, err = s.factory.CallContractAndCheckLogs( + newPriv, + txArgs, createValidatorArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the contract and checking logs") + Expect(s.network.NextBlock()).To(BeNil()) // edit validator - editValidatorArgs := defaultEditValidatorArgs. - WithPrivKey(newPriv). - WithArgs(defaultDescription, hexAddr, defaultCommissionRate, defaultMinSelfDelegation) + callArgs.Args = []interface{}{defaultDescription, hexAddr, defaultCommissionRate, defaultMinSelfDelegation} logCheckArgs = passCheck.WithExpEvents(staking.EventTypeEditValidator) - - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, editValidatorArgs, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - validator, found := s.app.StakingKeeper.GetValidator(s.ctx, newAddr.Bytes()) - Expect(found).To(BeTrue(), "expected validator to be found") + _, _, err = s.factory.CallContractAndCheckLogs( + newPriv, + txArgs, callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the contract and checking logs") + Expect(s.network.NextBlock()).To(BeNil()) + + valOperAddr := sdk.ValAddress(newAddr.Bytes()).String() + qc := s.network.GetStakingClient() + res, err := qc.Validator(s.network.GetContext(), &stakingtypes.QueryValidatorRequest{ValidatorAddr: valOperAddr}) + Expect(err).To(BeNil()) + Expect(res).NotTo(BeNil()) + validator := res.Validator + Expect(validator.OperatorAddress).To(Equal(valOperAddr)) Expect(validator.Description.Moniker).To(Equal(defaultDescription.Moniker), "expected validator moniker is updated") // Other fields should not be modified due to the value "[do-not-modify]". Expect(validator.Description.Identity).To(Equal(description.Identity), "expected validator identity not to be updated") @@ -568,369 +694,459 @@ var _ = Describe("Calling staking precompile directly", func() { Context("with origin different than validator address", func() { It("should fail", func() { - editValidatorArgs := defaultEditValidatorArgs.WithArgs( - defaultDescription, common.BytesToAddress(valAddr.Bytes()), defaultCommissionRate, defaultMinSelfDelegation, - ) + valHexAddr := common.BytesToAddress(valAddr.Bytes()) + callArgs.Args = []interface{}{ + defaultDescription, valHexAddr, defaultCommissionRate, defaultMinSelfDelegation, + } logCheckArgs := passCheck.WithExpEvents(staking.EventTypeEditValidator) - - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, editValidatorArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(1), + txArgs, callArgs, + logCheckArgs, + ) + Expect(err).NotTo(BeNil(), "error while calling the contract and checking logs") + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("origin address %s is not the same as validator operator address %s", s.keyring.GetAddr(1), valHexAddr))) }) }) }) - Describe("to delegate", func() { - var ( - // prevDelegation is the delegation that is available prior to the test (an initial delegation is - // added in the test suite setup). - prevDelegation stakingtypes.Delegation - // defaultDelegateArgs are the default arguments for the delegate call - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - defaultDelegateArgs contracts.CallArgs - ) + // prevDelegation is the delegation that is available prior to the test (an initial delegation is + // added in the test suite setup). + var prevDelegation stakingtypes.Delegation BeforeEach(func() { + delegator := s.keyring.GetKey(0) + // get the delegation that is available prior to the test - prevDelegation, _ = s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), valAddr) + res, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), valAddr.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) + prevDelegation = res.DelegationResponse.Delegation // populate the default delegate args - defaultDelegateArgs = defaultCallArgs.WithMethodName(staking.DelegateMethod) + callArgs.MethodName = staking.DelegateMethod }) Context("as the token owner", func() { It("should delegate without need for authorization", func() { - delegateArgs := defaultDelegateArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(2e18), - ) + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(2e18), + } logCheckArgs := passCheck.WithExpEvents(staking.EventTypeDelegate) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, delegateArgs, logCheckArgs) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - delegation, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), valAddr) - Expect(found).To(BeTrue(), "expected delegation to be found") + res, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), valAddr.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) expShares := prevDelegation.GetShares().Add(math.LegacyNewDec(2)) - Expect(delegation.GetShares()).To(Equal(expShares), "expected different delegation shares") + Expect(res.DelegationResponse.Delegation.GetShares()).To(Equal(expShares), "expected different delegation shares") }) It("should not delegate if the account has no sufficient balance", func() { - // send funds away from account to only have target balance remaining - balance := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - targetBalance := math.NewInt(1e17) - sentBalance := balance.Amount.Sub(targetBalance) - newAddr, _ := testutiltx.NewAccAddressAndKey() - err := s.app.BankKeeper.SendCoins(s.ctx, s.address.Bytes(), newAddr, - sdk.Coins{sdk.Coin{Denom: s.bondDenom, Amount: sentBalance}}) + newAddr, newAddrPriv := testutiltx.NewAccAddressAndKey() + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), newAddr, math.NewInt(1e17)) Expect(err).To(BeNil(), "error while sending coins") + Expect(s.network.NextBlock()).To(BeNil()) // try to delegate more than left in account - delegateArgs := defaultDelegateArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(1e18), - ) + callArgs.Args = []interface{}{ + common.BytesToAddress(newAddr), valAddr.String(), big.NewInt(1e18), + } logCheckArgs := defaultLogCheck.WithErrContains("insufficient funds") - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, delegateArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring("insufficient funds")) + _, _, err = s.factory.CallContractAndCheckLogs( + newAddrPriv, + txArgs, + callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) }) It("should not delegate if the validator does not exist", func() { nonExistingAddr := testutiltx.GenerateAddress() nonExistingValAddr := sdk.ValAddress(nonExistingAddr.Bytes()) + delegator := s.keyring.GetKey(0) - delegateArgs := defaultDelegateArgs.WithArgs( - s.address, nonExistingValAddr.String(), big.NewInt(2e18), - ) + callArgs.Args = []interface{}{ + delegator.Addr, nonExistingValAddr.String(), big.NewInt(2e18), + } logCheckArgs := defaultLogCheck.WithErrContains("validator does not exist") - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, delegateArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring("validator does not exist")) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) }) }) Context("on behalf of another account", func() { It("should not delegate if delegator address is not the origin", func() { + delegator := s.keyring.GetKey(0) differentAddr := testutiltx.GenerateAddress() - delegateArgs := defaultDelegateArgs.WithArgs( + callArgs.Args = []interface{}{ differentAddr, valAddr.String(), big.NewInt(2e18), - ) + } logCheckArgs := defaultLogCheck.WithErrContains( - fmt.Sprintf(staking.ErrDifferentOriginFromDelegator, s.address, differentAddr), + fmt.Sprintf(staking.ErrDifferentOriginFromDelegator, delegator.Addr, differentAddr), ) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, delegateArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) }) }) }) Describe("to undelegate", func() { - // defaultUndelegateArgs are the default arguments for the undelegate call - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - var defaultUndelegateArgs contracts.CallArgs - BeforeEach(func() { - defaultUndelegateArgs = defaultCallArgs.WithMethodName(staking.UndelegateMethod) + callArgs.MethodName = staking.UndelegateMethod }) Context("as the token owner", func() { It("should undelegate without need for authorization", func() { - undelegations := s.app.StakingKeeper.GetUnbondingDelegationsFromValidator(s.ctx, s.validators[0].GetOperator()) - Expect(undelegations).To(HaveLen(0), "expected no unbonding delegations before test") + delegator := s.keyring.GetKey(0) - undelegateArgs := defaultUndelegateArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(1e18), - ) + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + Expect(err).To(BeNil()) + + res, err := s.grpcHandler.GetValidatorUnbondingDelegations(valAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(0), "expected no unbonding delegations before test") + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), + } logCheckArgs := passCheck.WithExpEvents(staking.EventTypeUnbond) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, undelegateArgs, logCheckArgs) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - undelegations = s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(undelegations).To(HaveLen(1), "expected one undelegation") - Expect(undelegations[0].ValidatorAddress).To(Equal(valAddr.String()), "expected validator address to be %s", valAddr) + delUbdRes, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(delUbdRes.UnbondingResponses).To(HaveLen(1), "expected one undelegation") + Expect(delUbdRes.UnbondingResponses[0].ValidatorAddress).To(Equal(valAddr.String()), "expected validator address to be %s", valAddr) }) It("should not undelegate if the amount exceeds the delegation", func() { - undelegateArgs := defaultUndelegateArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(2e18), - ) + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(2e18), + } logCheckArgs := defaultLogCheck.WithErrContains("invalid shares amount") - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, undelegateArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring("invalid shares amount")) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) }) It("should not undelegate if the validator does not exist", func() { + delegator := s.keyring.GetKey(0) nonExistingAddr := testutiltx.GenerateAddress() nonExistingValAddr := sdk.ValAddress(nonExistingAddr.Bytes()) - undelegateArgs := defaultUndelegateArgs.WithArgs( - s.address, nonExistingValAddr.String(), big.NewInt(1e18), - ) + callArgs.Args = []interface{}{ + delegator.Addr, nonExistingValAddr.String(), big.NewInt(1e18), + } logCheckArgs := defaultLogCheck.WithErrContains("validator does not exist") - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, undelegateArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring("validator does not exist")) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) }) }) Context("on behalf of another account", func() { It("should not undelegate if delegator address is not the origin", func() { differentAddr := testutiltx.GenerateAddress() + delegator := s.keyring.GetKey(0) - undelegateArgs := defaultUndelegateArgs.WithArgs( + callArgs.Args = []interface{}{ differentAddr, valAddr.String(), big.NewInt(1e18), - ) + } logCheckArgs := defaultLogCheck.WithErrContains( - fmt.Sprintf(staking.ErrDifferentOriginFromDelegator, s.address, differentAddr), + fmt.Sprintf(staking.ErrDifferentOriginFromDelegator, delegator.Addr, differentAddr), ) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, undelegateArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) }) }) }) Describe("to redelegate", func() { - // defaultRedelegateArgs are the default arguments for the redelegate call - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - var defaultRedelegateArgs contracts.CallArgs - BeforeEach(func() { - defaultRedelegateArgs = defaultCallArgs.WithMethodName(staking.RedelegateMethod) + callArgs.MethodName = staking.RedelegateMethod }) Context("as the token owner", func() { It("should redelegate without need for authorization", func() { - redelegateArgs := defaultRedelegateArgs.WithArgs( - s.address, valAddr.String(), valAddr2.String(), big.NewInt(1e18), - ) + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), valAddr2.String(), big.NewInt(1e18), + } logCheckArgs := passCheck. WithExpEvents(staking.EventTypeRedelegate) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, logCheckArgs) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - redelegations := s.app.StakingKeeper.GetAllRedelegations(s.ctx, s.address.Bytes(), valAddr, valAddr2) - Expect(redelegations).To(HaveLen(1), "expected one redelegation to be found") - bech32Addr := sdk.AccAddress(s.address.Bytes()) - Expect(redelegations[0].DelegatorAddress).To(Equal(bech32Addr.String()), "expected delegator address to be %s", s.address) - Expect(redelegations[0].ValidatorSrcAddress).To(Equal(valAddr.String()), "expected source validator address to be %s", valAddr) - Expect(redelegations[0].ValidatorDstAddress).To(Equal(valAddr2.String()), "expected destination validator address to be %s", valAddr2) + Expect(s.network.NextBlock()).To(BeNil()) + + res, err := s.grpcHandler.GetRedelegations(delegator.AccAddr.String(), valAddr.String(), valAddr2.String()) + Expect(err).To(BeNil()) + Expect(res.RedelegationResponses).To(HaveLen(1), "expected one redelegation to be found") + bech32Addr := delegator.AccAddr + Expect(res.RedelegationResponses[0].Redelegation.DelegatorAddress).To(Equal(bech32Addr.String()), "expected delegator address to be %s", delegator.Addr) + Expect(res.RedelegationResponses[0].Redelegation.ValidatorSrcAddress).To(Equal(valAddr.String()), "expected source validator address to be %s", valAddr) + Expect(res.RedelegationResponses[0].Redelegation.ValidatorDstAddress).To(Equal(valAddr2.String()), "expected destination validator address to be %s", valAddr2) }) It("should not redelegate if the amount exceeds the delegation", func() { - redelegateArgs := defaultRedelegateArgs.WithArgs( - s.address, valAddr.String(), valAddr2.String(), big.NewInt(2e18), - ) + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), valAddr2.String(), big.NewInt(2e18), + } logCheckArgs := defaultLogCheck.WithErrContains("invalid shares amount") - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring("invalid shares amount")) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) }) It("should not redelegate if the validator does not exist", func() { nonExistingAddr := testutiltx.GenerateAddress() nonExistingValAddr := sdk.ValAddress(nonExistingAddr.Bytes()) + delegator := s.keyring.GetKey(0) - redelegateArgs := defaultRedelegateArgs.WithArgs( - s.address, valAddr.String(), nonExistingValAddr.String(), big.NewInt(1e18), - ) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), nonExistingValAddr.String(), big.NewInt(1e18), + } logCheckArgs := defaultLogCheck.WithErrContains("redelegation destination validator not found") - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring("redelegation destination validator not found")) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) }) }) Context("on behalf of another account", func() { It("should not redelegate if delegator address is not the origin", func() { differentAddr := testutiltx.GenerateAddress() + delegator := s.keyring.GetKey(0) - redelegateArgs := defaultRedelegateArgs.WithArgs( + callArgs.Args = []interface{}{ differentAddr, valAddr.String(), valAddr2.String(), big.NewInt(1e18), - ) + } logCheckArgs := defaultLogCheck.WithErrContains( - fmt.Sprintf(staking.ErrDifferentOriginFromDelegator, s.address, differentAddr), + fmt.Sprintf(staking.ErrDifferentOriginFromDelegator, delegator.Addr, differentAddr), ) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) }) }) }) Describe("to cancel an unbonding delegation", func() { - var ( - // defaultCancelUnbondingArgs are the default arguments for the cancelUnbondingDelegation call - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - defaultCancelUnbondingArgs contracts.CallArgs - - // expCreationHeight is the expected creation height of the unbonding delegation - expCreationHeight = int64(3) - ) - BeforeEach(func() { - defaultCancelUnbondingArgs = defaultCallArgs.WithMethodName(staking.CancelUnbondingDelegationMethod) + callArgs.MethodName = staking.CancelUnbondingDelegationMethod + delegator := s.keyring.GetKey(0) // Set up an unbonding delegation - undelegateArgs := defaultCallArgs. - WithMethodName(staking.UndelegateMethod). - WithArgs(s.address, valAddr.String(), big.NewInt(1e18)) + undelegateArgs := factory.CallArgs{ + ContractABI: s.precompile.ABI, + MethodName: staking.UndelegateMethod, + Args: []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), + }, + } logCheckArgs := passCheck. WithExpEvents(staking.EventTypeUnbond) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, undelegateArgs, logCheckArgs) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + undelegateArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while setting up an unbonding delegation: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - s.NextBlock() + creationHeight := s.network.GetContext().BlockHeight() // Check that the unbonding delegation was created - unbondingDelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(unbondingDelegations).To(HaveLen(1), "expected one unbonding delegation to be found") - Expect(unbondingDelegations[0].DelegatorAddress).To(Equal(sdk.AccAddress(s.address.Bytes()).String()), "expected delegator address to be %s", s.address) - Expect(unbondingDelegations[0].ValidatorAddress).To(Equal(valAddr.String()), "expected validator address to be %s", valAddr) - Expect(unbondingDelegations[0].Entries).To(HaveLen(1), "expected one unbonding delegation entry to be found") - Expect(unbondingDelegations[0].Entries[0].CreationHeight).To(Equal(expCreationHeight), "expected different creation height") - Expect(unbondingDelegations[0].Entries[0].Balance).To(Equal(math.NewInt(1e18)), "expected different balance") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(1), "expected one unbonding delegation to be found") + Expect(res.UnbondingResponses[0].DelegatorAddress).To(Equal(delegator.AccAddr.String()), "expected delegator address to be %s", delegator.Addr) + Expect(res.UnbondingResponses[0].ValidatorAddress).To(Equal(valAddr.String()), "expected validator address to be %s", valAddr) + Expect(res.UnbondingResponses[0].Entries).To(HaveLen(1), "expected one unbonding delegation entry to be found") + Expect(res.UnbondingResponses[0].Entries[0].CreationHeight).To(Equal(creationHeight), "expected different creation height") + Expect(res.UnbondingResponses[0].Entries[0].Balance).To(Equal(math.NewInt(1e18)), "expected different balance") }) Context("as the token owner", func() { It("should cancel unbonding delegation", func() { - delegations := s.app.StakingKeeper.GetValidatorDelegations(s.ctx, s.validators[0].GetOperator()) - Expect(delegations).To(HaveLen(0)) + delegator := s.keyring.GetKey(0) - cArgs := defaultCancelUnbondingArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(1e18), big.NewInt(expCreationHeight), - ) + valDelRes, err := s.grpcHandler.GetValidatorDelegations(s.network.GetValidators()[0].GetOperator()) + Expect(err).To(BeNil()) + Expect(valDelRes.DelegationResponses).To(HaveLen(0)) + + creationHeight := s.network.GetContext().BlockHeight() + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), big.NewInt(creationHeight), + } logCheckArgs := passCheck. WithExpEvents(staking.EventTypeCancelUnbondingDelegation) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, logCheckArgs) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - unbondingDelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(unbondingDelegations).To(HaveLen(0), "expected unbonding delegation to be canceled") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(0), "expected unbonding delegation to be canceled") - delegations = s.app.StakingKeeper.GetValidatorDelegations(s.ctx, s.validators[0].GetOperator()) - Expect(delegations).To(HaveLen(1), "expected one delegation to be found") + valDelRes, err = s.grpcHandler.GetValidatorDelegations(s.network.GetValidators()[0].GetOperator()) + Expect(err).To(BeNil()) + Expect(valDelRes.DelegationResponses).To(HaveLen(1), "expected one delegation to be found") }) It("should not cancel an unbonding delegation if the amount is not correct", func() { - cArgs := defaultCancelUnbondingArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(2e18), big.NewInt(expCreationHeight), - ) + delegator := s.keyring.GetKey(0) + + creationHeight := s.network.GetContext().BlockHeight() + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(2e18), big.NewInt(creationHeight), + } logCheckArgs := defaultLogCheck.WithErrContains("amount is greater than the unbonding delegation entry balance") - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring("amount is greater than the unbonding delegation entry balance")) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - unbondingDelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(unbondingDelegations).To(HaveLen(1), "expected unbonding delegation not to have been canceled") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(1), "expected unbonding delegation not to have been canceled") }) It("should not cancel an unbonding delegation if the creation height is not correct", func() { - cArgs := defaultCancelUnbondingArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(1e18), big.NewInt(expCreationHeight+1), - ) + delegator := s.keyring.GetKey(0) + + creationHeight := s.network.GetContext().BlockHeight() + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), big.NewInt(creationHeight + 1), + } logCheckArgs := defaultLogCheck.WithErrContains("unbonding delegation entry is not found at block height") - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring("unbonding delegation entry is not found at block height")) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - unbondingDelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(unbondingDelegations).To(HaveLen(1), "expected unbonding delegation not to have been canceled") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(1), "expected unbonding delegation not to have been canceled") }) }) }) Describe("to query allowance", func() { - var ( - defaultAllowanceArgs contracts.CallArgs - - differentAddr = testutiltx.GenerateAddress() - ) + differentAddr := testutiltx.GenerateAddress() BeforeEach(func() { - defaultAllowanceArgs = defaultCallArgs.WithMethodName(authorization.AllowanceMethod) + callArgs.MethodName = authorization.AllowanceMethod }) It("should return an empty allowance if none is set", func() { - allowanceArgs := defaultAllowanceArgs.WithArgs( - s.address, differentAddr, staking.CancelUnbondingDelegationMsg, - ) + granter := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + granter.Addr, differentAddr, staking.CancelUnbondingDelegationMsg, + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, allowanceArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var allowanceInt *big.Int @@ -940,17 +1156,23 @@ var _ = Describe("Calling staking precompile directly", func() { }) It("should return the granted allowance if set", func() { + granter := s.keyring.GetKey(0) + // setup approval for another address s.SetupApproval( - s.privKey, differentAddr, big.NewInt(1e18), []string{staking.CancelUnbondingDelegationMsg}, + granter.Priv, differentAddr, big.NewInt(1e18), []string{staking.CancelUnbondingDelegationMsg}, ) // query allowance - allowanceArgs := defaultAllowanceArgs.WithArgs( - differentAddr, s.address, staking.CancelUnbondingDelegationMsg, - ) + callArgs.Args = []interface{}{ + differentAddr, granter.Addr, staking.CancelUnbondingDelegationMsg, + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, allowanceArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var allowanceInt *big.Int @@ -961,22 +1183,21 @@ var _ = Describe("Calling staking precompile directly", func() { }) Describe("Validator queries", func() { - // defaultValidatorArgs are the default arguments for the validator call - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - var defaultValidatorArgs contracts.CallArgs - BeforeEach(func() { - defaultValidatorArgs = defaultCallArgs.WithMethodName(staking.ValidatorMethod) + callArgs.MethodName = staking.ValidatorMethod }) It("should return validator", func() { + delegator := s.keyring.GetKey(0) + varHexAddr := common.BytesToAddress(valAddr.Bytes()) - validatorArgs := defaultValidatorArgs.WithArgs( - varHexAddr, - ) + callArgs.Args = []interface{}{varHexAddr} - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var valOut staking.ValidatorOutput @@ -987,12 +1208,16 @@ var _ = Describe("Calling staking precompile directly", func() { }) It("should return an empty validator if the validator is not found", func() { + delegator := s.keyring.GetKey(0) + newValHexAddr := testutiltx.GenerateAddress() - validatorArgs := defaultValidatorArgs.WithArgs( - newValHexAddr, - ) + callArgs.Args = []interface{}{newValHexAddr} - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var valOut staking.ValidatorOutput @@ -1004,19 +1229,23 @@ var _ = Describe("Calling staking precompile directly", func() { }) Describe("Validators queries", func() { - var defaultValidatorArgs contracts.CallArgs - BeforeEach(func() { - defaultValidatorArgs = defaultCallArgs.WithMethodName(staking.ValidatorsMethod) + callArgs.MethodName = staking.ValidatorsMethod }) It("should return validators (default pagination)", func() { - validatorArgs := defaultValidatorArgs.WithArgs( + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ stakingtypes.Bonded.String(), query.PageRequest{}, - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var valOut staking.ValidatorsOutput @@ -1024,9 +1253,9 @@ var _ = Describe("Calling staking precompile directly", func() { Expect(err).To(BeNil(), "error while unpacking the validator output: %v", err) Expect(valOut.PageResponse.NextKey).To(BeEmpty()) - Expect(valOut.PageResponse.Total).To(Equal(uint64(len(s.validators)))) + Expect(valOut.PageResponse.Total).To(Equal(uint64(len(s.network.GetValidators())))) - Expect(valOut.Validators).To(HaveLen(len(s.validators)), "expected two validators to be returned") + Expect(valOut.Validators).To(HaveLen(len(s.network.GetValidators())), "expected two validators to be returned") // return order can change, that's why each validator is checked individually for _, val := range valOut.Validators { s.CheckValidatorOutput(val) @@ -1036,15 +1265,22 @@ var _ = Describe("Calling staking precompile directly", func() { //nolint:dupl // this is a duplicate of the test for smart contract calls to the precompile It("should return validators w/pagination limit = 1", func() { const limit uint64 = 1 - validatorArgs := defaultValidatorArgs.WithArgs( + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ stakingtypes.Bonded.String(), query.PageRequest{ Limit: limit, CountTotal: true, }, - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var valOut staking.ValidatorsOutput @@ -1053,7 +1289,7 @@ var _ = Describe("Calling staking precompile directly", func() { // no pagination, should return default values Expect(valOut.PageResponse.NextKey).NotTo(BeEmpty()) - Expect(valOut.PageResponse.Total).To(Equal(uint64(len(s.validators)))) + Expect(valOut.PageResponse.Total).To(Equal(uint64(len(s.network.GetValidators())))) Expect(valOut.Validators).To(HaveLen(int(limit)), "expected one validator to be returned") @@ -1064,25 +1300,38 @@ var _ = Describe("Calling staking precompile directly", func() { }) It("should return an error if the bonding type is not known", func() { - validatorArgs := defaultValidatorArgs.WithArgs( + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ "15", // invalid bonding type query.PageRequest{}, - ) + } invalidStatusCheck := defaultLogCheck.WithErrContains("invalid validator status 15") - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorArgs, invalidStatusCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) - Expect(err.Error()).To(ContainSubstring("invalid validator status 15")) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, + invalidStatusCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) }) It("should return an empty array if there are no validators with the given bonding type", func() { - validatorArgs := defaultValidatorArgs.WithArgs( + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ stakingtypes.Unbonded.String(), query.PageRequest{}, - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var valOut staking.ValidatorsOutput @@ -1096,19 +1345,24 @@ var _ = Describe("Calling staking precompile directly", func() { }) Describe("Delegation queries", func() { - var defaultDelegationArgs contracts.CallArgs - BeforeEach(func() { - defaultDelegationArgs = defaultCallArgs.WithMethodName(staking.DelegationMethod) + callArgs.MethodName = staking.DelegationMethod }) It("should return a delegation if it is found", func() { - delegationArgs := defaultDelegationArgs.WithArgs( - s.address, + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, delegationArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var delOut staking.DelegationOutput @@ -1119,12 +1373,20 @@ var _ = Describe("Calling staking precompile directly", func() { }) It("should return an empty delegation if it is not found", func() { + delegator := s.keyring.GetKey(0) + newValAddr := sdk.ValAddress(testutiltx.GenerateAddress().Bytes()) - delegationArgs := defaultDelegationArgs.WithArgs( - s.address, newValAddr.String(), - ) + callArgs.Args = []interface{}{ + delegator.Addr, + newValAddr.String(), + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, delegationArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var delOut staking.DelegationOutput @@ -1137,38 +1399,55 @@ var _ = Describe("Calling staking precompile directly", func() { }) Describe("UnbondingDelegation queries", func() { - var ( - defaultUnbondingDelegationArgs contracts.CallArgs - - // undelAmount is the amount of tokens to be unbonded - undelAmount = big.NewInt(1e17) - ) + // undelAmount is the amount of tokens to be unbonded + undelAmount := big.NewInt(1e17) BeforeEach(func() { - defaultUnbondingDelegationArgs = defaultCallArgs.WithMethodName(staking.UnbondingDelegationMethod) + callArgs.MethodName = staking.UnbondingDelegationMethod + + delegator := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) // unbond a delegation - s.SetupApproval(s.privKey, s.precompile.Address(), abi.MaxUint256, []string{staking.UndelegateMsg}) + s.SetupApproval(delegator.Priv, grantee.Addr, abi.MaxUint256, []string{staking.UndelegateMsg}) + + undelegateArgs := factory.CallArgs{ + ContractABI: s.precompile.ABI, + MethodName: staking.UndelegateMethod, + Args: []interface{}{ + delegator.Addr, valAddr.String(), undelAmount, + }, + } - unbondArgs := defaultCallArgs. - WithMethodName(staking.UndelegateMethod). - WithArgs(s.address, valAddr.String(), undelAmount) unbondCheck := passCheck.WithExpEvents(staking.EventTypeUnbond) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, unbondArgs, unbondCheck) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, undelegateArgs, + unbondCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // check that the unbonding delegation exists - unbondingDelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(unbondingDelegations).To(HaveLen(1), "expected one unbonding delegation") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(1), "expected one unbonding delegation") }) It("should return an unbonding delegation if it is found", func() { - unbondingDelegationsArgs := defaultUnbondingDelegationArgs.WithArgs( - s.address, + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, unbondingDelegationsArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var unbondingDelegationOutput staking.UnbondingDelegationOutput @@ -1181,12 +1460,19 @@ var _ = Describe("Calling staking precompile directly", func() { }) It("should return an empty slice if the unbonding delegation is not found", func() { - unbondingDelegationsArgs := defaultUnbondingDelegationArgs.WithArgs( - s.address, + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr2.String(), - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, unbondingDelegationsArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var unbondingDelegationOutput staking.UnbondingDelegationOutput @@ -1197,34 +1483,48 @@ var _ = Describe("Calling staking precompile directly", func() { }) Describe("to query a redelegation", func() { - var defaultRedelegationArgs contracts.CallArgs - BeforeEach(func() { - defaultRedelegationArgs = defaultCallArgs.WithMethodName(staking.RedelegationMethod) + callArgs.MethodName = staking.RedelegationMethod }) It("should return the redelegation if it exists", func() { + delegator := s.keyring.GetKey(0) + granteeAddr := s.precompile.Address() + // approve the redelegation - s.SetupApproval(s.privKey, s.precompile.Address(), abi.MaxUint256, []string{staking.RedelegateMsg}) + s.SetupApproval(delegator.Priv, granteeAddr, abi.MaxUint256, []string{staking.RedelegateMsg}) // create a redelegation - redelegateArgs := defaultCallArgs. - WithMethodName(staking.RedelegateMethod). - WithArgs(s.address, valAddr.String(), valAddr2.String(), big.NewInt(1e17)) + redelegateArgs := factory.CallArgs{ + ContractABI: s.precompile.ABI, + MethodName: staking.RedelegateMethod, + Args: []interface{}{ + delegator.Addr, valAddr.String(), valAddr2.String(), big.NewInt(1e17), + }, + } redelegateCheck := passCheck.WithExpEvents(staking.EventTypeRedelegate) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, redelegateCheck) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, redelegateArgs, + redelegateCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // query the redelegation - redelegationArgs := defaultRedelegationArgs.WithArgs( - s.address, + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), valAddr2.String(), - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegationArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var redelegationOutput staking.RedelegationOutput @@ -1236,13 +1536,19 @@ var _ = Describe("Calling staking precompile directly", func() { }) It("should return an empty output if the redelegation is not found", func() { - redelegationArgs := defaultRedelegationArgs.WithArgs( - s.address, + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), valAddr2.String(), - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegationArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var redelegationOutput staking.RedelegationOutput @@ -1254,11 +1560,6 @@ var _ = Describe("Calling staking precompile directly", func() { Describe("Redelegations queries", func() { var ( - // defaultRedelegationsArgs are the default arguments for the redelegations query - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - defaultRedelegationsArgs contracts.CallArgs - // delAmt is the amount of tokens to be delegated delAmt = big.NewInt(3e17) // redelTotalCount is the total number of redelegations @@ -1266,40 +1567,62 @@ var _ = Describe("Calling staking precompile directly", func() { ) BeforeEach(func() { - defaultRedelegationsArgs = defaultCallArgs.WithMethodName(staking.RedelegationsMethod) + delegator := s.keyring.GetKey(0) + granteeAddr := s.precompile.Address() + + callArgs.MethodName = staking.RedelegationsMethod // create some redelegations s.SetupApproval( - s.privKey, s.precompile.Address(), abi.MaxUint256, []string{staking.RedelegateMsg}, + delegator.Priv, granteeAddr, abi.MaxUint256, []string{staking.RedelegateMsg}, ) - defaultRedelegateArgs := defaultCallArgs.WithMethodName(staking.RedelegateMethod) - redelegationsArgs := []contracts.CallArgs{ - defaultRedelegateArgs.WithArgs( - s.address, valAddr.String(), valAddr2.String(), delAmt, - ), - defaultRedelegateArgs.WithArgs( - s.address, valAddr.String(), valAddr2.String(), delAmt, - ), + redelegationsArgs := []factory.CallArgs{ + { + ContractABI: s.precompile.ABI, + MethodName: staking.RedelegateMethod, + Args: []interface{}{ + delegator.Addr, valAddr.String(), valAddr2.String(), delAmt, + }, + }, + { + ContractABI: s.precompile.ABI, + MethodName: staking.RedelegateMethod, + Args: []interface{}{ + delegator.Addr, valAddr.String(), valAddr2.String(), delAmt, + }, + }, } logCheckArgs := passCheck. WithExpEvents(staking.EventTypeRedelegate) + txArgs.GasLimit = 500_000 for _, args := range redelegationsArgs { - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, args, logCheckArgs) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, args, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while creating redelegation: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) } }) It("should return all redelegations for delegator (default pagination)", func() { - redelegationArgs := defaultRedelegationsArgs.WithArgs( - s.address, + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, "", "", query.PageRequest{}, - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegationArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var redelOut staking.RedelegationsOutput @@ -1322,6 +1645,8 @@ var _ = Describe("Calling staking precompile directly", func() { }) It("should return all redelegations for delegator w/pagination", func() { + delegator := s.keyring.GetKey(0) + // make 2 queries // 1st one with pagination limit = 1 // 2nd using the next page key @@ -1334,15 +1659,21 @@ var _ = Describe("Calling staking precompile directly", func() { } else { pagination.Key = nextPageKey } - redelegationArgs := defaultRedelegationsArgs.WithArgs( - s.address, + callArgs.Args = []interface{}{ + delegator.Addr, "", "", pagination, - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegationArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) var redelOut staking.RedelegationsOutput err = s.precompile.UnpackIntoInterface(&redelOut, staking.RedelegationsMethod, ethRes.Ret) @@ -1379,14 +1710,20 @@ var _ = Describe("Calling staking precompile directly", func() { // --> filtering for all redelegations with the given source validator // - delegator is NOT empty, source validator is NOT empty, destination validator is NOT empty // --> filtering for all redelegations with the given combination of delegator, source and destination validator - redelegationsArgs := defaultRedelegationsArgs.WithArgs( + callArgs.Args = []interface{}{ common.Address{}, // passing in an empty address to filter for all redelegations from valAddr2 valAddr2.String(), "", query.PageRequest{}, - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegationsArgs, passCheck) + sender := s.keyring.GetKey(0) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + sender.Priv, + txArgs, + callArgs, + passCheck, + ) Expect(err).To(BeNil(), "expected error while calling the smart contract") var redelOut staking.RedelegationsOutput @@ -1401,23 +1738,33 @@ var _ = Describe("Calling staking precompile directly", func() { }) It("Should refund leftover gas", func() { - balancePre := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + delegator := s.keyring.GetKey(0) + + resBal, err := s.grpcHandler.GetBalance(delegator.AccAddr, s.bondDenom) + Expect(err).To(BeNil(), "error while getting balance") + balancePre := resBal.Balance gasPrice := big.NewInt(1e9) // Call the precompile with a lot of gas - approveArgs := defaultApproveArgs. - WithGasPrice(gasPrice). - WithArgs(s.precompile.Address(), big.NewInt(1e18), []string{staking.DelegateMsg}) + approveCallArgs.Args = []interface{}{ + s.precompile.Address(), big.NewInt(1e18), []string{staking.DelegateMsg}, + } + txArgs.GasPrice = gasPrice approvalCheck := passCheck.WithExpEvents(authorization.EventTypeApproval) - res, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, approveArgs, approvalCheck) + res, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, approveCallArgs, + approvalCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - s.NextBlock() - - balancePost := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - difference := balancePre.Sub(balancePost) + resBal, err = s.grpcHandler.GetBalance(delegator.AccAddr, s.bondDenom) + Expect(err).To(BeNil(), "error while getting balance") + balancePost := resBal.Balance + difference := balancePre.Sub(*balancePost) // NOTE: the expected difference is the gas price multiplied by the gas used, because the rest should be refunded expDifference := gasPrice.Int64() * res.GasUsed @@ -1425,8 +1772,10 @@ var _ = Describe("Calling staking precompile directly", func() { }) }) -var _ = Describe("Calling staking precompile via Solidity", func() { +var _ = Describe("Calling staking precompile via Solidity", Ordered, func() { var ( + // s is the precompile test suite to use for the tests + s *PrecompileTestSuite // contractAddr is the address of the smart contract that will be deployed contractAddr common.Address contractTwoAddr common.Address @@ -1448,62 +1797,86 @@ var _ = Describe("Calling staking precompile via Solidity", func() { // nonExistingAddr is an address that does not exist in the state of the test suite nonExistingAddr = testutiltx.GenerateAddress() // nonExistingVal is a validator address that does not exist in the state of the test suite - nonExistingVal = sdk.ValAddress(nonExistingAddr.Bytes()) - - testContractInitialBalance = math.NewInt(100) + nonExistingVal = sdk.ValAddress(nonExistingAddr.Bytes()) + testContractInitialBalance = math.NewInt(1e18) ) - BeforeEach(func() { - s.SetupTest() - + BeforeAll(func() { stakingCallerContract, err = testdata.LoadStakingCallerContract() - Expect(err).To(BeNil(), "error while loading the staking caller contract: %v", err) + Expect(err).To(BeNil()) + stakingCallerTwoContract, err = testdata.LoadStakingCallerTwoContract() + Expect(err).To(BeNil(), "error while loading the StakingCallerTwo contract") + stakingReverterContract, err = contracts.LoadStakingReverterContract() + Expect(err).To(BeNil(), "error while loading the StakingReverter contract") + }) - contractAddr, err = s.DeployContract(stakingCallerContract) + BeforeEach(func() { + s = new(PrecompileTestSuite) + s.SetupTest() + delegator := s.keyring.GetKey(0) + + contractAddr, err = s.factory.DeployContract( + delegator.Priv, + evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values + factory.ContractDeploymentData{ + Contract: stakingCallerContract, + }, + ) Expect(err).To(BeNil(), "error while deploying the smart contract: %v", err) - s.NextBlock() + valAddr, err = sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + Expect(err).To(BeNil()) + valAddr2, err = sdk.ValAddressFromBech32(s.network.GetValidators()[1].GetOperator()) + Expect(err).To(BeNil()) - // Deploy StakingCallerTwo contract - stakingCallerTwoContract, err = testdata.LoadStakingCallerTwoContract() - Expect(err).To(BeNil(), "error while loading the StakingCallerTwo contract") + Expect(s.network.NextBlock()).To(BeNil()) - contractTwoAddr, err = s.DeployContract(stakingCallerTwoContract) + // Deploy StakingCallerTwo contract + contractTwoAddr, err = s.factory.DeployContract( + delegator.Priv, + evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values + factory.ContractDeploymentData{ + Contract: stakingCallerTwoContract, + }, + ) Expect(err).To(BeNil(), "error while deploying the StakingCallerTwo contract") - s.NextBlock() + Expect(s.network.NextBlock()).To(BeNil()) // Deploy StakingReverter contract - stakingReverterContract, err = contracts.LoadStakingReverterContract() - Expect(err).To(BeNil(), "error while loading the StakingReverter contract") - - stkReverterAddr, err = s.DeployContract(stakingReverterContract) + stkReverterAddr, err = s.factory.DeployContract( + delegator.Priv, + evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values + factory.ContractDeploymentData{ + Contract: stakingReverterContract, + }, + ) Expect(err).To(BeNil(), "error while deploying the StakingReverter contract") - s.NextBlock() + Expect(s.network.NextBlock()).To(BeNil()) // send some funds to the StakingCallerTwo & StakingReverter contracts to transfer to the // delegator during the tx - err = chainutil.FundAccount(s.ctx, s.app.BankKeeper, contractTwoAddr.Bytes(), sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, testContractInitialBalance))) + err := testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), contractTwoAddr.Bytes(), testContractInitialBalance) Expect(err).To(BeNil(), "error while funding the smart contract: %v", err) - - err = chainutil.FundAccount(s.ctx, s.app.BankKeeper, stkReverterAddr.Bytes(), sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, testContractInitialBalance))) + Expect(s.network.NextBlock()).To(BeNil()) + err = testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), stkReverterAddr.Bytes(), testContractInitialBalance) Expect(err).To(BeNil(), "error while funding the smart contract: %v", err) - - valAddr = s.validators[0].GetOperator() - valAddr2 = s.validators[1].GetOperator() + Expect(s.network.NextBlock()).To(BeNil()) // check contract was correctly deployed - cAcc := s.app.EVMKeeper.GetAccount(s.ctx, contractAddr) + cAcc := s.network.App.EVMKeeper.GetAccount(s.network.GetContext(), contractAddr) Expect(cAcc).ToNot(BeNil(), "contract account should exist") Expect(cAcc.IsContract()).To(BeTrue(), "account should be a contract") + // populate default TxArgs + txArgs.To = &contractAddr // populate default call args - defaultCallArgs = contracts.CallArgs{ - ContractAddr: contractAddr, - ContractABI: stakingCallerContract.ABI, - PrivKey: s.privKey, + callArgs = factory.CallArgs{ + ContractABI: stakingCallerContract.ABI, } // populate default approval args - defaultApproveArgs = defaultCallArgs.WithMethodName("testApprove") - + approveCallArgs = factory.CallArgs{ + ContractABI: stakingCallerContract.ABI, + MethodName: "testApprove", + } // populate default log check args defaultLogCheck = testutil.LogCheckArgs{ ABIEvents: s.precompile.Events, @@ -1515,8 +1888,12 @@ var _ = Describe("Calling staking precompile via Solidity", func() { Describe("when the precompile is not enabled in the EVM params", func() { It("should return an error", func() { + delegator := s.keyring.GetKey(0) + // disable the precompile - params := s.app.EVMKeeper.GetParams(s.ctx) + res, err := s.grpcHandler.GetEvmParams() + Expect(err).To(BeNil(), "error while setting params") + params := res.Params var activePrecompiles []string for _, precompile := range params.ActiveStaticPrecompiles { if precompile != s.precompile.Address().String() { @@ -1524,60 +1901,78 @@ var _ = Describe("Calling staking precompile via Solidity", func() { } } params.ActiveStaticPrecompiles = activePrecompiles - err := s.app.EVMKeeper.SetParams(s.ctx, params) + + err = testutils.UpdateEvmParams(testutils.UpdateParamsInput{ + Tf: s.factory, + Network: s.network, + Pk: delegator.Priv, + Params: params, + }) Expect(err).To(BeNil(), "error while setting params") // try to call the precompile - delegateArgs := defaultCallArgs. - WithMethodName("testDelegate"). - WithArgs( - s.address, valAddr.String(), big.NewInt(2e18), - ) + callArgs.MethodName = "testDelegate" + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(2e18), + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, delegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "expected error while calling the precompile") - Expect(err.Error()).To(ContainSubstring(vm.ErrExecutionReverted.Error())) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "expected error while calling the precompile") }) }) Context("approving methods", func() { Context("with valid input", func() { It("should approve one method", func() { - approvalArgs := defaultApproveArgs.WithArgs( + granter := s.keyring.GetKey(0) + + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.DelegateMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(approvalArgs) + } + + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) }) It("should approve all methods", func() { - approvalArgs := defaultApproveArgs. - WithGasLimit(1e8). - WithArgs( - contractAddr, - []string{staking.DelegateMsg, staking.RedelegateMsg, staking.UndelegateMsg, staking.CancelUnbondingDelegationMsg}, - big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(approvalArgs) + granter := s.keyring.GetKey(0) + + approveCallArgs.Args = []interface{}{ + contractAddr, + []string{staking.DelegateMsg, staking.RedelegateMsg, staking.UndelegateMsg, staking.CancelUnbondingDelegationMsg}, + big.NewInt(1e18), + } + txArgs.GasLimit = 1e8 + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) }) It("should update a previous approval", func() { - approvalArgs := defaultApproveArgs.WithArgs( + granter := s.keyring.GetKey(0) + + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.DelegateMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(approvalArgs) + } - s.NextBlock() + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) // update approval - approvalArgs = defaultApproveArgs.WithArgs( + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.DelegateMsg}, big.NewInt(2e18), + } + _, _, err = s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, approveCallArgs, + approvalCheck, ) - - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, approvalArgs, approvalCheck) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // check approvals - authorization, expirationTime := s.CheckAuthorization(staking.DelegateAuthz, contractAddr, s.address) + authorization, expirationTime, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, staking.DelegateAuthz, contractAddr, granter.Addr) + Expect(err).To(BeNil()) Expect(authorization).ToNot(BeNil(), "expected authorization to not be nil") Expect(expirationTime).ToNot(BeNil(), "expected expiration time to not be nil") Expect(authorization.MsgTypeURL()).To(Equal(staking.DelegateMsg), "expected authorization msg type url to be %s", staking.DelegateMsg) @@ -1585,46 +1980,58 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) It("should remove approval when setting amount to zero", func() { - s.SetupApprovalWithContractCalls( - defaultApproveArgs.WithArgs(contractAddr, []string{staking.DelegateMsg}, big.NewInt(1e18)), - ) + granter := s.keyring.GetKey(0) - s.NextBlock() + approveCallArgs.Args = []interface{}{ + contractAddr, []string{staking.DelegateMsg}, big.NewInt(1e18), + } + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) + Expect(s.network.NextBlock()).To(BeNil()) // check approvals pre-removal - allAuthz, err := s.app.AuthzKeeper.GetAuthorizations(s.ctx, contractAddr.Bytes(), s.address.Bytes()) + allAuthz, err := s.grpcHandler.GetAuthorizations(sdk.AccAddress(contractAddr.Bytes()).String(), granter.AccAddr.String()) Expect(err).To(BeNil(), "error while reading authorizations") Expect(allAuthz).To(HaveLen(1), "expected no authorizations") - approveArgs := defaultApproveArgs.WithArgs( + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.DelegateMsg}, big.NewInt(0), - ) + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, approveArgs, approvalCheck) + _, _, err = s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, approveCallArgs, + approvalCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract") + Expect(s.network.NextBlock()).To(BeNil()) // check approvals after approving with amount 0 - allAuthz, err = s.app.AuthzKeeper.GetAuthorizations(s.ctx, contractAddr.Bytes(), s.address.Bytes()) + allAuthz, err = s.grpcHandler.GetAuthorizations(sdk.AccAddress(contractAddr.Bytes()).String(), granter.AccAddr.String()) Expect(err).To(BeNil(), "error while reading authorizations") Expect(allAuthz).To(HaveLen(0), "expected no authorizations") }) It("should not approve if the gas is not enough", func() { - approveArgs := defaultApproveArgs. - WithGasLimit(1e5). - WithArgs( - contractAddr, - []string{ - staking.DelegateMsg, - staking.UndelegateMsg, - staking.RedelegateMsg, - staking.CancelUnbondingDelegationMsg, - }, - big.NewInt(1e18), - ) + granter := s.keyring.GetKey(0) + + txArgs.GasLimit = 1e5 + approveCallArgs.Args = []interface{}{ + contractAddr, + []string{ + staking.DelegateMsg, + staking.UndelegateMsg, + staking.RedelegateMsg, + staking.CancelUnbondingDelegationMsg, + }, + big.NewInt(1e18), + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, approveArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract") + _, _, err = s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, approveCallArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract") }) }) @@ -1635,25 +2042,31 @@ var _ = Describe("Calling staking precompile via Solidity", func() { // nonExistingAddr, []string{staking.DelegateMsg}, big.NewInt(1e18), // ) // - // _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, approveArgs, execRevertedCheck) + // _, _, err = s.factory.CallContractAndCheckLogs( // Expect(err).To(BeNil(), "error while calling the smart contract") // // // check approvals - // allAuthz, err := s.app.AuthzKeeper.GetAuthorizations(s.ctx, contractAddr.Bytes(), s.address.Bytes()) + // allAuthz, err := s.network.App.AuthzKeeper.GetAuthorizations(s.network.GetContext(), contractAddr.Bytes(), delegator.AccAddr) // Expect(err).To(BeNil(), "error while reading authorizations") // Expect(allAuthz).To(HaveLen(0), "expected no authorizations") // }) It("shouldn't approve for invalid methods", func() { - approveArgs := defaultApproveArgs.WithArgs( + granter := s.keyring.GetKey(0) + + approveCallArgs.Args = []interface{}{ contractAddr, []string{"invalid method"}, big.NewInt(1e18), - ) + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, approveArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract") + _, _, err = s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, approveCallArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract") // check approvals - allAuthz, err := s.app.AuthzKeeper.GetAuthorizations(s.ctx, contractAddr.Bytes(), s.address.Bytes()) + allAuthz, err := s.grpcHandler.GetAuthorizations(sdk.AccAddress(contractAddr.Bytes()).String(), granter.AccAddr.String()) Expect(err).To(BeNil(), "error while reading authorizations") Expect(allAuthz).To(HaveLen(0), "expected no authorizations") }) @@ -1661,42 +2074,54 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) Context("to revoke an approval", func() { - var defaultRevokeArgs contracts.CallArgs - BeforeEach(func() { - defaultRevokeArgs = defaultCallArgs.WithMethodName("testRevoke") + callArgs.MethodName = "testRevoke" }) It("should revoke when sending as the granter", func() { + granter := s.keyring.GetKey(0) + // set up an approval to be revoked - cArgs := defaultApproveArgs.WithArgs( + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.DelegateMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(cArgs) + } - s.NextBlock() + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) - revokeArgs := defaultRevokeArgs.WithArgs(contractAddr, []string{staking.DelegateMsg}) + callArgs.Args = []interface{}{contractAddr, []string{staking.DelegateMsg}} revocationCheck := passCheck.WithExpEvents(authorization.EventTypeRevocation) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, revokeArgs, revocationCheck) + _, _, err = s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + revocationCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract") + Expect(s.network.NextBlock()).To(BeNil()) // check approvals - authz, _ := s.CheckAuthorization(staking.DelegateAuthz, contractAddr, s.address) + authz, _, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, staking.DelegateAuthz, contractAddr, granter.Addr) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("no authorizations found for grantee %s and granter %s", contractAddr.Hex(), granter.Addr.Hex()))) Expect(authz).To(BeNil(), "expected authorization to be revoked") }) It("should not revoke when approval is issued by a different granter", func() { // Create a delegate authorization where the granter is a different account from the default test suite one createdAuthz := staking.DelegateAuthz - granteeAddr := testutiltx.GenerateAddress() - granterAddr := testutiltx.GenerateAddress() - validators := s.app.StakingKeeper.GetLastValidators(s.ctx) + granter := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + differentGranterIdx := s.keyring.AddKey() + differentGranter := s.keyring.GetKey(differentGranterIdx) + validators, err := s.network.App.StakingKeeper.GetLastValidators(s.network.GetContext()) + Expect(err).To(BeNil()) + valAddrs := make([]sdk.ValAddress, len(validators)) for i, val := range validators { - valAddrs[i] = val.GetOperator() + parsedAddr, err := sdk.ValAddressFromBech32(val.GetOperator()) + Expect(err).To(BeNil()) + valAddrs[i] = parsedAddr } delegationAuthz, err := stakingtypes.NewStakeAuthorization( valAddrs, @@ -1706,52 +2131,72 @@ var _ = Describe("Calling staking precompile via Solidity", func() { ) Expect(err).To(BeNil(), "failed to create authorization") - expiration := s.ctx.BlockTime().Add(time.Hour * 24 * 365).UTC() - err = s.app.AuthzKeeper.SaveGrant(s.ctx, granteeAddr.Bytes(), granterAddr.Bytes(), delegationAuthz, &expiration) + expiration := s.network.GetContext().BlockTime().Add(time.Hour * 24 * 365).UTC() + err = s.network.App.AuthzKeeper.SaveGrant(s.network.GetContext(), grantee.AccAddr, differentGranter.AccAddr, delegationAuthz, &expiration) Expect(err).ToNot(HaveOccurred(), "failed to save authorization") - authz, _ := s.CheckAuthorization(createdAuthz, granteeAddr, granterAddr) + authz, _, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, createdAuthz, grantee.Addr, differentGranter.Addr) + Expect(err).To(BeNil()) Expect(authz).ToNot(BeNil(), "expected authorization to be created") - revokeArgs := defaultRevokeArgs.WithArgs(granteeAddr, []string{staking.DelegateMsg}) + callArgs.Args = []interface{}{grantee.Addr, []string{staking.DelegateMsg}} - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, revokeArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract") + _, _, err = s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract") // check approvals - authz, _ = s.CheckAuthorization(createdAuthz, granteeAddr, granterAddr) + authz, _, err = CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, createdAuthz, grantee.Addr, differentGranter.Addr) + Expect(err).To(BeNil()) Expect(authz).ToNot(BeNil(), "expected authorization not to be revoked") }) It("should revert the execution when no approval is found", func() { - revokeArgs := defaultRevokeArgs.WithArgs(contractAddr, []string{staking.DelegateMsg}) + granter := s.keyring.GetKey(0) + callArgs.Args = []interface{}{contractAddr, []string{staking.DelegateMsg}} - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, revokeArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract") + _, _, err = s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract") // check approvals - authz, _ := s.CheckAuthorization(staking.DelegateAuthz, contractAddr, s.address) + authz, _, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, staking.DelegateAuthz, contractAddr, granter.Addr) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("no authorizations found for grantee %s and granter %s", contractAddr.Hex(), granter.Addr.Hex()))) Expect(authz).To(BeNil(), "expected no authorization to be found") }) It("should not revoke if the approval is for a different message type", func() { + granter := s.keyring.GetKey(0) + // set up an approval - cArgs := defaultApproveArgs.WithArgs( + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.DelegateMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(cArgs) + } - s.NextBlock() + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) - revokeArgs := defaultRevokeArgs.WithArgs(contractAddr, []string{staking.UndelegateMsg}) + Expect(s.network.NextBlock()).To(BeNil(), "failed to advance block") - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, revokeArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract") + callArgs.Args = []interface{}{contractAddr, []string{staking.UndelegateMsg}} + + _, _, err = s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract") // check approval is still there s.ExpectAuthorization( staking.DelegateAuthz, contractAddr, - s.address, + granter.Addr, &sdk.Coin{Denom: s.bondDenom, Amount: math.NewInt(1e18)}, ) }) @@ -1759,8 +2204,9 @@ var _ = Describe("Calling staking precompile via Solidity", func() { Context("create a validator", func() { var ( - valPriv *ethsecp256k1.PrivKey - valAddr sdk.AccAddress + valPriv *ethsecp256k1.PrivKey + valAddr sdk.AccAddress + valHexAddr common.Address defaultDescription = staking.Description{ Moniker: "new node", @@ -1777,54 +2223,61 @@ var _ = Describe("Calling staking precompile via Solidity", func() { defaultMinSelfDelegation = big.NewInt(1) defaultPubkeyBase64Str = GenerateBase64PubKey() defaultValue = big.NewInt(1e8) - - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - defaultCreateValidatorArgs contracts.CallArgs ) BeforeEach(func() { - defaultCreateValidatorArgs = defaultCallArgs.WithMethodName("testCreateValidator") + callArgs.MethodName = "testCreateValidator" valAddr, valPriv = testutiltx.NewAccAddressAndKey() - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, valAddr, 1e18) + valHexAddr = common.BytesToAddress(valAddr.Bytes()) + err = testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), valAddr.Bytes(), math.NewInt(1e18)) Expect(err).To(BeNil(), "error while funding account: %v", err) - - s.NextBlock() + Expect(s.network.NextBlock()).To(BeNil()) }) It("tx from validator operator - should NOT create a validator", func() { - cArgs := defaultCreateValidatorArgs. - WithPrivKey(s.privKey). - WithArgs(defaultDescription, defaultCommission, defaultMinSelfDelegation, s.address, defaultPubkeyBase64Str, defaultValue) + callArgs.Args = []interface{}{ + defaultDescription, defaultCommission, defaultMinSelfDelegation, valHexAddr, defaultPubkeyBase64Str, defaultValue, + } - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, execRevertedCheck) - Expect(err).NotTo(BeNil(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + valPriv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract") + Expect(s.network.NextBlock()).To(BeNil()) - _, found := s.app.StakingKeeper.GetValidator(s.ctx, s.address.Bytes()) - Expect(found).To(BeFalse(), "expected validator NOT to be found") + qc := s.network.GetStakingClient() + _, err := qc.Validator(s.network.GetContext(), &stakingtypes.QueryValidatorRequest{ValidatorAddr: sdk.ValAddress(valAddr).String()}) + Expect(err).NotTo(BeNil(), "expected validator NOT to be found") + Expect(err.Error()).To(ContainSubstring("not found"), "expected validator NOT to be found") }) It("tx from another EOA - should create a validator fail", func() { - cArgs := defaultCreateValidatorArgs. - WithPrivKey(valPriv). - WithArgs(defaultDescription, defaultCommission, defaultMinSelfDelegation, s.address, defaultPubkeyBase64Str, defaultValue) - - logCheckArgs := defaultLogCheck.WithErrContains(fmt.Sprintf(staking.ErrDifferentOriginFromDelegator, s.address.String(), common.BytesToAddress(valAddr.Bytes()).String())) + callArgs.Args = []interface{}{ + defaultDescription, defaultCommission, defaultMinSelfDelegation, valHexAddr, defaultPubkeyBase64Str, defaultValue, + } - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, logCheckArgs) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract") + Expect(s.network.NextBlock()).To(BeNil()) - _, found := s.app.StakingKeeper.GetValidator(s.ctx, s.address.Bytes()) - Expect(found).To(BeFalse(), "expected validator not to be found") + qc := s.network.GetStakingClient() + _, err := qc.Validator(s.network.GetContext(), &stakingtypes.QueryValidatorRequest{ValidatorAddr: sdk.ValAddress(valAddr).String()}) + Expect(err).NotTo(BeNil(), "expected validator NOT to be found") + Expect(err.Error()).To(ContainSubstring("not found"), "expected validator NOT to be found") }) }) Context("to edit a validator", func() { var ( - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - defaultEditValArgs contracts.CallArgs - valPriv *ethsecp256k1.PrivKey - valAddr sdk.AccAddress - valHexAddr common.Address + valPriv *ethsecp256k1.PrivKey + valAddr sdk.AccAddress + valHexAddr common.Address defaultDescription = staking.Description{ Moniker: "edit node", @@ -1843,13 +2296,14 @@ var _ = Describe("Calling staking precompile via Solidity", func() { ) BeforeEach(func() { - defaultEditValArgs = defaultCallArgs.WithMethodName("testEditValidator") + callArgs.MethodName = "testEditValidator" // create a new validator valAddr, valPriv = testutiltx.NewAccAddressAndKey() valHexAddr = common.BytesToAddress(valAddr.Bytes()) - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, valAddr, 2e18) + err = testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), valAddr.Bytes(), math.NewInt(2e18)) Expect(err).To(BeNil(), "error while funding account: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) description = staking.Description{ Moniker: "original moniker", @@ -1866,191 +2320,259 @@ var _ = Describe("Calling staking precompile via Solidity", func() { pubkeyBase64Str := "UuhHQmkUh2cPBA6Rg4ei0M2B04cVYGNn/F8SAUsYIb4=" value := big.NewInt(1e18) - createValidatorArgs := contracts.CallArgs{ - ContractAddr: s.precompile.Address(), - ContractABI: s.precompile.ABI, - MethodName: staking.CreateValidatorMethod, - PrivKey: valPriv, - Args: []interface{}{description, commission, minSelfDelegation, valHexAddr, pubkeyBase64Str, value}, + createValidatorArgs := factory.CallArgs{ + ContractABI: s.precompile.ABI, + MethodName: staking.CreateValidatorMethod, + Args: []interface{}{description, commission, minSelfDelegation, valHexAddr, pubkeyBase64Str, value}, } logCheckArgs := passCheck.WithExpEvents(staking.EventTypeCreateValidator) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, createValidatorArgs, logCheckArgs) - Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - s.NextBlock() + toAddr := s.precompile.Address() + _, _, err = s.factory.CallContractAndCheckLogs( + valPriv, + evmtypes.EvmTxArgs{ + To: &toAddr, + }, + createValidatorArgs, + logCheckArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract") + Expect(s.network.NextBlock()).To(BeNil()) }) It("with tx from validator operator - should NOT edit a validator", func() { - cArgs := defaultEditValArgs. - WithPrivKey(valPriv). - WithArgs( - defaultDescription, valHexAddr, - defaultCommissionRate, defaultMinSelfDelegation, - ) + callArgs.Args = []interface{}{ + defaultDescription, valHexAddr, + defaultCommissionRate, defaultMinSelfDelegation, + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, execRevertedCheck) - Expect(err).NotTo(BeNil(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + valPriv, + txArgs, + callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract") + Expect(s.network.NextBlock()).To(BeNil()) - validator, found := s.app.StakingKeeper.GetValidator(s.ctx, valAddr.Bytes()) - Expect(found).To(BeTrue(), "expected validator to be found") + qc := s.network.GetStakingClient() + qRes, err := qc.Validator(s.network.GetContext(), &stakingtypes.QueryValidatorRequest{ValidatorAddr: sdk.ValAddress(valAddr).String()}) + Expect(err).To(BeNil()) + Expect(qRes).NotTo(BeNil()) + validator := qRes.Validator Expect(validator.Description.Moniker).NotTo(Equal(defaultDescription.Moniker), "expected validator moniker NOT to be updated") }) It("with tx from another EOA - should fail", func() { - cArgs := defaultEditValArgs. - WithPrivKey(s.privKey). - WithArgs( - defaultDescription, valHexAddr, - defaultCommissionRate, defaultMinSelfDelegation, - ) + callArgs.Args = []interface{}{ + defaultDescription, valHexAddr, + defaultCommissionRate, defaultMinSelfDelegation, + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "expected error while calling the precompile") - Expect(err.Error()).To(ContainSubstring(vm.ErrExecutionReverted.Error())) + _, _, err = s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract") + Expect(s.network.NextBlock()).To(BeNil()) // validator should remain unchanged - validator, found := s.app.StakingKeeper.GetValidator(s.ctx, valAddr.Bytes()) - Expect(found).To(BeTrue(), "expected validator to be found") + qc := s.network.GetStakingClient() + qRes, err := qc.Validator(s.network.GetContext(), &stakingtypes.QueryValidatorRequest{ValidatorAddr: sdk.ValAddress(valAddr).String()}) + Expect(err).To(BeNil()) + Expect(qRes).NotTo(BeNil()) + + validator := qRes.Validator Expect(validator.Description.Moniker).To(Equal("original moniker"), "expected validator moniker is updated") Expect(validator.Commission.Rate.BigInt().String()).To(Equal("100000000000000000"), "expected validator commission rate remain unchanged") }) }) Context("delegating", func() { - var ( - // prevDelegation is the delegation that is available prior to the test (an initial delegation is - // added in the test suite setup). - prevDelegation stakingtypes.Delegation - // defaultDelegateArgs are the default arguments for the delegate call - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - defaultDelegateArgs contracts.CallArgs - ) + // prevDelegation is the delegation that is available prior to the test (an initial delegation is + // added in the test suite setup). + var prevDelegation stakingtypes.Delegation BeforeEach(func() { + delegator := s.keyring.GetKey(0) + // get the delegation that is available prior to the test - prevDelegation, _ = s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), valAddr) + res, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), valAddr.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) - defaultDelegateArgs = defaultCallArgs.WithMethodName("testDelegate") + prevDelegation = res.DelegationResponse.Delegation + callArgs.MethodName = "testDelegate" }) - Context("without approval set", func() { BeforeEach(func() { - authz, _ := s.CheckAuthorization(staking.DelegateAuthz, contractAddr, s.address) + granter := s.keyring.GetKey(0) + + authz, _, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, staking.DelegateAuthz, contractAddr, granter.Addr) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("no authorizations found for grantee %s and granter %s", contractAddr.Hex(), granter.Addr.Hex()))) Expect(authz).To(BeNil(), "expected authorization to be nil") }) It("should not delegate", func() { - Expect(s.app.EVMKeeper.GetAccount(s.ctx, contractAddr)).ToNot(BeNil(), "expected contract to exist") + Expect(s.network.App.EVMKeeper.GetAccount(s.network.GetContext(), contractAddr)).ToNot(BeNil(), "expected contract to exist") + delegator := s.keyring.GetKey(0) - cArgs := defaultDelegateArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(1e18), - ) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - del, _ := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), valAddr) - Expect(del).To(Equal(prevDelegation), "no new delegation to be found") + res, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), valAddr.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) + Expect(res.DelegationResponse.Delegation).To(Equal(prevDelegation), "no new delegation to be found") }) }) Context("with approval set", func() { BeforeEach(func() { - cArgs := defaultApproveArgs.WithArgs( + granter := s.keyring.GetKey(0) + + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.DelegateMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(cArgs) + } + + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) + // add gas limit to avoid out of gas error + txArgs.GasLimit = 500_000 }) It("should delegate when not exceeding the allowance", func() { - cArgs := defaultDelegateArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(1e18), - ) + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), + } logCheckArgs := passCheck. WithExpEvents(staking.EventTypeDelegate) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, logCheckArgs) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) + + res, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), valAddr.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) + delegation := res.DelegationResponse.Delegation - delegation, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), valAddr) - Expect(found).To(BeTrue(), "expected delegation to be found") expShares := prevDelegation.GetShares().Add(math.LegacyNewDec(1)) Expect(delegation.GetShares()).To(Equal(expShares), "expected delegation shares to be 2") }) Context("Calling the precompile from the StakingReverter contract", func() { var ( - txSenderInitialBal sdk.Coin - contractInitialBalance sdk.Coin + txSenderInitialBal *sdk.Coin + contractInitialBalance *sdk.Coin gasPrice = math.NewInt(1e9) delAmt = math.NewInt(1e18) ) BeforeEach(func() { // set approval for the StakingReverter contract - s.SetupApproval(s.privKey, stkReverterAddr, delAmt.BigInt(), []string{staking.DelegateMsg}) + s.SetupApproval(s.keyring.GetPrivKey(0), stkReverterAddr, delAmt.BigInt(), []string{staking.DelegateMsg}) - txSenderInitialBal = s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - contractInitialBalance = s.app.BankKeeper.GetBalance(s.ctx, stkReverterAddr.Bytes(), s.bondDenom) + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + txSenderInitialBal = balRes.Balance + balRes, err = s.grpcHandler.GetBalance(stkReverterAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + contractInitialBalance = balRes.Balance }) It("should revert the changes and NOT delegate - successful tx", func() { - callArgs := contracts.CallArgs{ - ContractAddr: stkReverterAddr, - ContractABI: stakingReverterContract.ABI, - PrivKey: s.privKey, - MethodName: "run", + callArgs := factory.CallArgs{ + ContractABI: stakingReverterContract.ABI, + MethodName: "run", Args: []interface{}{ - big.NewInt(5), s.validators[0].GetOperator().String(), + big.NewInt(5), s.network.GetValidators()[0].OperatorAddress, }, - GasPrice: gasPrice.BigInt(), } // Tx should be successful, but no state changes happened - res, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, callArgs, passCheck) - Expect(err).To(BeNil()) + res, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{ + To: &stkReverterAddr, + GasPrice: gasPrice.BigInt(), + }, + callArgs, + passCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) + fees := gasPrice.MulRaw(res.GasUsed) // contract balance should remain unchanged - contractFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, stkReverterAddr.Bytes(), s.bondDenom) + balRes, err := s.grpcHandler.GetBalance(stkReverterAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + contractFinalBalance := balRes.Balance Expect(contractFinalBalance.Amount).To(Equal(contractInitialBalance.Amount)) // No delegation should be created - _, found := s.app.StakingKeeper.GetDelegation(s.ctx, stkReverterAddr.Bytes(), s.validators[0].GetOperator()) - Expect(found).To(BeFalse(), "expected NO delegation to be found") + _, err = s.grpcHandler.GetDelegation(sdk.AccAddress(stkReverterAddr.Bytes()).String(), s.network.GetValidators()[0].OperatorAddress) + Expect(err).NotTo(BeNil()) + Expect(err.Error()).To(ContainSubstring("not found"), "expected NO delegation created") // Only fees deducted on tx sender - txSenderFinalBal := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + txSenderFinalBal := balRes.Balance Expect(txSenderFinalBal.Amount).To(Equal(txSenderInitialBal.Amount.Sub(fees))) }) It("should revert the changes and NOT delegate - failed tx - max precompile calls reached", func() { - callArgs := contracts.CallArgs{ - ContractAddr: stkReverterAddr, - ContractABI: stakingReverterContract.ABI, - PrivKey: s.privKey, - MethodName: "run", + callArgs := factory.CallArgs{ + ContractABI: stakingReverterContract.ABI, + MethodName: "multipleDelegations", Args: []interface{}{ - big.NewInt(7), s.validators[0].GetOperator().String(), + big.NewInt(int64(evmtypes.MaxPrecompileCalls + 2)), s.network.GetValidators()[0].OperatorAddress, }, - GasPrice: gasPrice.BigInt(), } // Tx should fail due to MaxPrecompileCalls - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, callArgs, execRevertedCheck) - Expect(err).NotTo(BeNil()) + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{ + To: &stkReverterAddr, + GasPrice: gasPrice.BigInt(), + }, + callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) // contract balance should remain unchanged - contractFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, stkReverterAddr.Bytes(), s.bondDenom) + balRes, err := s.grpcHandler.GetBalance(stkReverterAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + contractFinalBalance := balRes.Balance Expect(contractFinalBalance.Amount).To(Equal(contractInitialBalance.Amount)) // No delegation should be created - _, found := s.app.StakingKeeper.GetDelegation(s.ctx, stkReverterAddr.Bytes(), s.validators[0].GetOperator()) - Expect(found).To(BeFalse(), "expected NO delegation to be found") + _, err = s.grpcHandler.GetDelegation(sdk.AccAddress(stkReverterAddr.Bytes()).String(), s.network.GetValidators()[0].OperatorAddress) + Expect(err).NotTo(BeNil()) + Expect(err.Error()).To(ContainSubstring("not found"), "expected NO delegation created") }) }) @@ -2063,10 +2585,10 @@ var _ = Describe("Calling staking precompile via Solidity", func() { } var ( - args contracts.CallArgs - delegatorInitialBal sdk.Coin - contractInitialBalance sdk.Coin - bondedTokensPoolInitialBalance sdk.Coin + args factory.CallArgs + delegatorInitialBal *sdk.Coin + contractInitialBalance *sdk.Coin + bondedTokensPoolInitialBalance *sdk.Coin delAmt = math.NewInt(1e18) gasPrice = math.NewInt(1e9) bondedTokensPoolAccAddr = authtypes.NewModuleAddress("bonded_tokens_pool") @@ -2074,32 +2596,37 @@ var _ = Describe("Calling staking precompile via Solidity", func() { BeforeEach(func() { // set authorization for contract - callCArgs := contracts.CallArgs{ - ContractAddr: contractTwoAddr, - ContractABI: stakingCallerTwoContract.ABI, - PrivKey: s.privKey, - MethodName: "testApprove", + args = factory.CallArgs{ + ContractABI: stakingCallerTwoContract.ABI, + MethodName: "testApprove", Args: []interface{}{ contractTwoAddr, []string{staking.DelegateMsg}, delAmt.BigInt(), }, } - s.SetupApprovalWithContractCalls(callCArgs) + s.SetupApprovalWithContractCalls( + s.keyring.GetKey(0), + evmtypes.EvmTxArgs{ + To: &contractTwoAddr, + }, args) - args = callCArgs. - WithMethodName("testDelegateWithCounterAndTransfer"). - WithGasPrice(gasPrice.BigInt()) + balRes, err := s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + delegatorInitialBal = balRes.Balance + balRes, err = s.grpcHandler.GetBalance(contractTwoAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + contractInitialBalance = balRes.Balance + balRes, err = s.grpcHandler.GetBalance(bondedTokensPoolAccAddr, s.bondDenom) + Expect(err).To(BeNil()) + bondedTokensPoolInitialBalance = balRes.Balance - delegatorInitialBal = s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) - contractInitialBalance = s.app.BankKeeper.GetBalance(s.ctx, contractTwoAddr.Bytes(), s.bondDenom) - bondedTokensPoolInitialBalance = s.app.BankKeeper.GetBalance(s.ctx, bondedTokensPoolAccAddr, s.bondDenom) + args.MethodName = "testDelegateWithCounterAndTransfer" }) DescribeTable("should delegate and update balances accordingly", func(tc testCase) { - cArgs := args. - WithArgs( - s.address, valAddr.String(), delAmt.BigInt(), tc.before, tc.after, - ) + args.Args = []interface{}{ + s.keyring.GetAddr(0), valAddr.String(), delAmt.BigInt(), tc.before, tc.after, + } // This is the amount of tokens transferred from the contract to the delegator // during the contract call @@ -2113,24 +2640,42 @@ var _ = Describe("Calling staking precompile via Solidity", func() { logCheckArgs := passCheck. WithExpEvents(staking.EventTypeDelegate) - res, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, logCheckArgs) + res, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{ + To: &contractTwoAddr, + GasPrice: gasPrice.BigInt(), + }, + args, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) + fees := gasPrice.MulRaw(res.GasUsed) // check the contract's balance was deducted to fund the vesting account - contractFinalBal := s.app.BankKeeper.GetBalance(s.ctx, contractTwoAddr.Bytes(), s.bondDenom) + balRes, err := s.grpcHandler.GetBalance(contractTwoAddr.Bytes(), s.bondDenom) + contractFinalBal := balRes.Balance + Expect(err).To(BeNil()) Expect(contractFinalBal.Amount).To(Equal(contractInitialBalance.Amount.Sub(transferToDelAmt))) - delegation, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), valAddr) - Expect(found).To(BeTrue(), "expected delegation to be found") + qRes, err := s.grpcHandler.GetDelegation(s.keyring.GetAccAddr(0).String(), valAddr.String()) + Expect(err).To(BeNil()) + Expect(qRes).NotTo(BeNil(), "expected delegation to be found") + delegation := qRes.DelegationResponse.Delegation expShares := prevDelegation.GetShares().Add(math.LegacyNewDec(1)) Expect(delegation.GetShares()).To(Equal(expShares), "expected delegation shares to be 2") - delegatorFinalBal := s.app.BankKeeper.GetBalance(s.ctx, s.address.Bytes(), s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(s.keyring.GetAccAddr(0), s.bondDenom) + Expect(err).To(BeNil()) + delegatorFinalBal := balRes.Balance Expect(delegatorFinalBal.Amount).To(Equal(delegatorInitialBal.Amount.Sub(fees).Sub(delAmt).Add(transferToDelAmt))) // check the bondedTokenPool is updated with the delegated tokens - bondedTokensPoolFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, bondedTokensPoolAccAddr, s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(bondedTokensPoolAccAddr, s.bondDenom) + bondedTokensPoolFinalBalance := balRes.Balance + Expect(err).To(BeNil()) Expect(bondedTokensPoolFinalBalance.Amount).To(Equal(bondedTokensPoolInitialBalance.Amount.Add(delAmt))) }, Entry("contract tx with transfer to delegator before and after precompile call ", testCase{ @@ -2148,82 +2693,132 @@ var _ = Describe("Calling staking precompile via Solidity", func() { ) It("should NOT delegate and update balances accordingly - internal transfer to tokens pool", func() { - cArgs := args. - WithMethodName("testDelegateWithTransfer"). - WithArgs( - common.BytesToAddress(bondedTokensPoolAccAddr), - s.address, valAddr.String(), delAmt.BigInt(), true, true, - ) - - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, execRevertedCheck) - Expect(err).NotTo(BeNil()) + args.MethodName = "testDelegateWithTransfer" + args.Args = []interface{}{ + common.BytesToAddress(bondedTokensPoolAccAddr), + s.keyring.GetAddr(0), valAddr.String(), delAmt.BigInt(), true, true, + } + + _, _, err := s.factory.CallContractAndCheckLogs( + s.keyring.GetPrivKey(0), + txArgs, + args, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // contract balance should remain unchanged - contractFinalBal := s.app.BankKeeper.GetBalance(s.ctx, contractTwoAddr.Bytes(), s.bondDenom) + balRes, err := s.grpcHandler.GetBalance(contractTwoAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil()) + contractFinalBal := balRes.Balance Expect(contractFinalBal.Amount).To(Equal(contractInitialBalance.Amount)) // check the bondedTokenPool should remain unchanged - bondedTokensPoolFinalBalance := s.app.BankKeeper.GetBalance(s.ctx, bondedTokensPoolAccAddr, s.bondDenom) + balRes, err = s.grpcHandler.GetBalance(bondedTokensPoolAccAddr, s.bondDenom) + Expect(err).To(BeNil()) + bondedTokensPoolFinalBalance := balRes.Balance Expect(bondedTokensPoolFinalBalance.Amount).To(Equal(bondedTokensPoolInitialBalance.Amount)) }) }) It("should not delegate when exceeding the allowance", func() { - cArgs := defaultDelegateArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(2e18), - ) + delegator := s.keyring.GetKey(0) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(2e18), + } + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - del, _ := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), valAddr) - Expect(del).To(Equal(prevDelegation), "no new delegation to be found") + res, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), valAddr.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) + Expect(res.DelegationResponse.Delegation).To(Equal(prevDelegation), "no new delegation to be found") }) It("should not delegate when sending from a different address", func() { - newAddr, newPriv := testutiltx.NewAccAddressAndKey() - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, newAddr, 1e18) - Expect(err).To(BeNil(), "error while funding account: %v", err) - - s.NextBlock() + delegator := s.keyring.GetKey(0) + differentSender := s.keyring.GetKey(1) - delegateArgs := defaultDelegateArgs. - WithPrivKey(newPriv). - WithArgs(s.address, valAddr.String(), big.NewInt(1e18)) - - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, delegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), + } + _, _, err = s.factory.CallContractAndCheckLogs( + differentSender.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - del, _ := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), valAddr) - Expect(del).To(Equal(prevDelegation), "no new delegation to be found") + res, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), valAddr.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) + Expect(res.DelegationResponse.Delegation).To(Equal(prevDelegation), "no new delegation to be found") }) It("should not delegate when validator does not exist", func() { - delegateArgs := defaultDelegateArgs.WithArgs( - s.address, nonExistingVal.String(), big.NewInt(1e18), - ) + delegator := s.keyring.GetKey(0) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, delegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + callArgs.Args = []interface{}{ + delegator.Addr, nonExistingVal.String(), big.NewInt(1e18), + } - del, _ := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), nonExistingVal) - Expect(del).To(BeZero(), "expected no delegation to be found") + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) + + res, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), nonExistingVal.String()) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("delegation with delegator %s not found for validator %s", delegator.AccAddr.String(), nonExistingVal.String()))) + Expect(res).To(BeNil()) }) It("shouldn't delegate to a validator that is not in the allow list of the approval", func() { // create a new validator, which is not included in the active set of the last block - testutil.CreateValidator(s.ctx, s.T(), s.privKey.PubKey(), *s.app.StakingKeeper, math.NewInt(100)) - newValAddr := sdk.ValAddress(s.address.Bytes()) + commValue := math.LegacyNewDecWithPrec(5, 2) + commission := stakingtypes.NewCommissionRates(commValue, commValue, commValue) + validatorKey := ed25519.GenPrivKey() + delegator := s.keyring.GetKey(0) + err := s.factory.CreateValidator(delegator.Priv, validatorKey.PubKey(), sdk.NewCoin(s.bondDenom, math.NewInt(1)), stakingtypes.Description{Moniker: "NewValidator"}, commission, math.NewInt(1)) + Expect(err).To(BeNil()) + Expect(s.network.NextBlock()).To(BeNil()) + + newValAddr := sdk.ValAddress(delegator.AccAddr.Bytes()) + + res, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), newValAddr.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) + prevDelegation = res.DelegationResponse.Delegation + + callArgs.Args = []interface{}{ + delegator.Addr, newValAddr.String(), big.NewInt(2e18), + } - delegateArgs := defaultDelegateArgs.WithArgs( - s.address, newValAddr.String(), big.NewInt(2e18), + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, delegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + res, err = s.grpcHandler.GetDelegation(delegator.AccAddr.String(), newValAddr.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) - delegation, _ := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), newValAddr) - Expect(delegation.GetShares()).To(Equal(math.LegacyNewDecFromInt(math.NewInt(100))), "expected only the delegation from creating the validator, no more") + delegation := res.DelegationResponse.Delegation + Expect(delegation.GetShares()).To(Equal(prevDelegation.GetShares()), "expected only the delegation from creating the validator, no more") }) }) }) @@ -2231,99 +2826,131 @@ var _ = Describe("Calling staking precompile via Solidity", func() { Context("unbonding", func() { // NOTE: there's no additional setup necessary because the test suite is already set up with // delegations to the validator - - // defaultUndelegateArgs are the default arguments for the undelegate call - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - var defaultUndelegateArgs contracts.CallArgs - BeforeEach(func() { - defaultUndelegateArgs = defaultCallArgs.WithMethodName("testUndelegate") + callArgs.MethodName = "testUndelegate" }) - Context("without approval set", func() { BeforeEach(func() { - authz, _ := s.CheckAuthorization(staking.UndelegateAuthz, contractAddr, s.address) + delegator := s.keyring.GetKey(0) + + authz, _, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, staking.UndelegateAuthz, contractAddr, delegator.Addr) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("no authorizations found for grantee %s and granter %s", contractAddr.Hex(), delegator.Addr.Hex()))) Expect(authz).To(BeNil(), "expected authorization to be nil before test execution") }) It("should not undelegate", func() { - undelegateArgs := defaultUndelegateArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(1e18), - ) + delegator := s.keyring.GetKey(0) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, undelegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), + } + + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - undelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(undelegations).To(HaveLen(0), "expected no undelegations to be found") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(BeEmpty()) }) }) Context("with approval set", func() { BeforeEach(func() { - approveArgs := defaultApproveArgs.WithArgs( + granter := s.keyring.GetKey(0) + + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.UndelegateMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(approveArgs) + } + + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) + // set gas limit to avoid out of gas error + txArgs.GasLimit = 500_000 }) It("should undelegate when not exceeding the allowance", func() { - undelegateArgs := defaultUndelegateArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(1e18), - ) + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), + } logCheckArgs := defaultLogCheck. WithExpEvents(staking.EventTypeUnbond). WithExpPass(true) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, undelegateArgs, logCheckArgs) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - undelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(undelegations).To(HaveLen(1), "expected one undelegation") - Expect(undelegations[0].ValidatorAddress).To(Equal(valAddr.String()), "expected validator address to be %s", valAddr) + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(1), "expected one undelegation") + Expect(res.UnbondingResponses[0].ValidatorAddress).To(Equal(valAddr.String()), "expected validator address to be %s", valAddr) }) It("should not undelegate when exceeding the allowance", func() { - undelegateArgs := defaultUndelegateArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(2e18), - ) + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(2e18), + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, undelegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - undelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(undelegations).To(HaveLen(0), "expected no undelegations to be found") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(BeEmpty()) }) It("should not undelegate if the delegation does not exist", func() { - undelegateArgs := defaultUndelegateArgs.WithArgs( - s.address, nonExistingVal.String(), big.NewInt(1e18), - ) + delegator := s.keyring.GetKey(0) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, undelegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + callArgs.Args = []interface{}{ + delegator.Addr, nonExistingVal.String(), big.NewInt(1e18), + } + + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - undelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(undelegations).To(HaveLen(0), "expected no undelegations to be found") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(BeEmpty()) }) It("should not undelegate when called from a different address", func() { - newAddr, newPriv := testutiltx.NewAccAddressAndKey() - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, newAddr, 1e18) - Expect(err).To(BeNil(), "error while funding account: %v", err) - - s.NextBlock() + delegator := s.keyring.GetKey(0) + differentSender := s.keyring.GetKey(1) - undelegateArgs := defaultUndelegateArgs. - WithPrivKey(newPriv). - WithArgs(s.address, valAddr.String(), big.NewInt(1e18)) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, undelegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + differentSender.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - undelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(undelegations).To(HaveLen(0), "expected no undelegations to be found") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(BeEmpty()) }) }) }) @@ -2332,267 +2959,349 @@ var _ = Describe("Calling staking precompile via Solidity", func() { // NOTE: there's no additional setup necessary because the test suite is already set up with // delegations to the validator - // defaultRedelegateArgs are the default arguments for the redelegate call - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - var defaultRedelegateArgs contracts.CallArgs - BeforeEach(func() { - defaultRedelegateArgs = defaultCallArgs.WithMethodName("testRedelegate") + callArgs.MethodName = "testRedelegate" }) - Context("without approval set", func() { BeforeEach(func() { - authz, _ := s.CheckAuthorization(staking.UndelegateAuthz, contractAddr, s.address) + granter := s.keyring.GetKey(0) + + authz, _, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, staking.UndelegateAuthz, contractAddr, granter.Addr) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("no authorizations found for grantee %s and granter %s", contractAddr.Hex(), granter.Addr.Hex()))) Expect(authz).To(BeNil(), "expected authorization to be nil before test execution") }) It("should not redelegate", func() { - redelegateArgs := defaultRedelegateArgs.WithArgs( - s.address, valAddr.String(), valAddr2.String(), big.NewInt(1e18), - ) + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), valAddr2.String(), big.NewInt(1e18), + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - redelegations := s.app.StakingKeeper.GetAllRedelegations(s.ctx, s.address.Bytes(), valAddr, valAddr2) - Expect(redelegations).To(HaveLen(0), "expected no redelegations to be found") + res, err := s.grpcHandler.GetRedelegations(delegator.AccAddr.String(), valAddr.String(), valAddr2.String()) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("redelegation not found for delegator address %s from validator address %s", delegator.AccAddr, valAddr))) + Expect(res).To(BeNil(), "expected no redelegations to be found") }) }) Context("with approval set", func() { BeforeEach(func() { - approveArgs := defaultApproveArgs.WithArgs( + granter := s.keyring.GetKey(0) + + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.RedelegateMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(approveArgs) + } + + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) }) It("should redelegate when not exceeding the allowance", func() { - redelegateArgs := defaultRedelegateArgs.WithArgs( - s.address, valAddr.String(), valAddr2.String(), big.NewInt(1e18), - ) + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), valAddr2.String(), big.NewInt(1e18), + } logCheckArgs := defaultLogCheck. WithExpEvents(staking.EventTypeRedelegate). WithExpPass(true) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, logCheckArgs) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - - redelegations := s.app.StakingKeeper.GetAllRedelegations(s.ctx, s.address.Bytes(), valAddr, valAddr2) - Expect(redelegations).To(HaveLen(1), "expected one redelegation to be found") - bech32Addr := sdk.AccAddress(s.address.Bytes()) - Expect(redelegations[0].DelegatorAddress).To(Equal(bech32Addr.String()), "expected delegator address to be %s", s.address) - Expect(redelegations[0].ValidatorSrcAddress).To(Equal(valAddr.String()), "expected source validator address to be %s", valAddr) - Expect(redelegations[0].ValidatorDstAddress).To(Equal(valAddr2.String()), "expected destination validator address to be %s", valAddr2) + Expect(s.network.NextBlock()).To(BeNil()) + + res, err := s.grpcHandler.GetRedelegations(delegator.AccAddr.String(), valAddr.String(), valAddr2.String()) + Expect(err).To(BeNil()) + Expect(res.RedelegationResponses).To(HaveLen(1), "expected one redelegation to be found") + Expect(res.RedelegationResponses[0].Redelegation.DelegatorAddress).To(Equal(delegator.AccAddr.String()), "expected delegator address to be %s", delegator.AccAddr) + Expect(res.RedelegationResponses[0].Redelegation.ValidatorSrcAddress).To(Equal(valAddr.String()), "expected source validator address to be %s", valAddr) + Expect(res.RedelegationResponses[0].Redelegation.ValidatorDstAddress).To(Equal(valAddr2.String()), "expected destination validator address to be %s", valAddr2) }) It("should not redelegate when exceeding the allowance", func() { - redelegateArgs := defaultRedelegateArgs.WithArgs( - s.address, valAddr.String(), valAddr2.String(), big.NewInt(2e18), - ) + delegator := s.keyring.GetKey(0) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), valAddr2.String(), big.NewInt(2e18), + } - redelegations := s.app.StakingKeeper.GetAllRedelegations(s.ctx, s.address.Bytes(), valAddr, valAddr2) - Expect(redelegations).To(HaveLen(0), "expected no redelegations to be found") + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + + res, err := s.grpcHandler.GetRedelegations(delegator.AccAddr.String(), valAddr.String(), valAddr2.String()) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("redelegation not found for delegator address %s from validator address %s", delegator.AccAddr, valAddr))) + Expect(res).To(BeNil(), "expected no redelegations to be found") }) It("should not redelegate if the delegation does not exist", func() { - redelegateArgs := defaultRedelegateArgs.WithArgs( - s.address, nonExistingVal.String(), valAddr2.String(), big.NewInt(1e18), - ) + delegator := s.keyring.GetKey(0) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + callArgs.Args = []interface{}{ + delegator.Addr, nonExistingVal.String(), valAddr2.String(), big.NewInt(1e18), + } + + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - redelegations := s.app.StakingKeeper.GetAllRedelegations(s.ctx, s.address.Bytes(), nonExistingVal, valAddr2) - Expect(redelegations).To(HaveLen(0), "expected no redelegations to be found") + res, err := s.grpcHandler.GetRedelegations(delegator.AccAddr.String(), nonExistingVal.String(), valAddr2.String()) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("redelegation not found for delegator address %s from validator address %s", delegator.AccAddr, nonExistingVal))) + Expect(res).To(BeNil(), "expected no redelegations to be found") }) It("should not redelegate when calling from a different address", func() { - newAddr, newPriv := testutiltx.NewAccAddressAndKey() - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, newAddr, 1e18) - Expect(err).To(BeNil(), "error while funding account: %v", err) - - s.NextBlock() + delegator := s.keyring.GetKey(0) + differentSender := s.keyring.GetKey(1) - redelegateArgs := defaultRedelegateArgs. - WithPrivKey(newPriv). - WithArgs(s.address, valAddr.String(), valAddr2.String(), big.NewInt(1e18)) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), valAddr2.String(), big.NewInt(1e18), + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + differentSender.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - redelegations := s.app.StakingKeeper.GetAllRedelegations(s.ctx, s.address.Bytes(), valAddr, valAddr2) - Expect(redelegations).To(HaveLen(0), "expected no redelegations to be found") + res, err := s.grpcHandler.GetRedelegations(delegator.AccAddr.String(), valAddr.String(), valAddr2.String()) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("redelegation not found for delegator address %s from validator address %s", delegator.AccAddr, valAddr))) + Expect(res).To(BeNil(), "expected no redelegations to be found") }) It("should not redelegate when the validator does not exist", func() { - redelegateArgs := defaultRedelegateArgs.WithArgs( - s.address, valAddr.String(), nonExistingVal.String(), big.NewInt(1e18), - ) + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), nonExistingVal.String(), big.NewInt(1e18), + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - redelegations := s.app.StakingKeeper.GetAllRedelegations(s.ctx, s.address.Bytes(), valAddr, nonExistingVal) - Expect(redelegations).To(HaveLen(0), "expected no redelegations to be found") + res, err := s.grpcHandler.GetRedelegations(delegator.AccAddr.String(), valAddr.String(), nonExistingVal.String()) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("redelegation not found for delegator address %s from validator address %s", delegator.AccAddr, valAddr))) + Expect(res).To(BeNil()) }) }) }) Context("canceling unbonding delegations", func() { - var ( - // defaultCancelUnbondingArgs are the default arguments for the cancelUnbondingDelegation call - // - // NOTE: this has to be set up in the BeforeEach block because the private key is only available then - defaultCancelUnbondingArgs contracts.CallArgs - - // expCreationHeight is the expected creation height of the unbonding delegation - expCreationHeight = int64(6) - ) + // expCreationHeight is the expected creation height of the unbonding delegation + var expCreationHeight int64 BeforeEach(func() { - defaultCancelUnbondingArgs = defaultCallArgs.WithMethodName("testCancelUnbonding") + granter := s.keyring.GetKey(0) + callArgs.MethodName = "testCancelUnbonding" // Set up an unbonding delegation - approvalArgs := defaultApproveArgs.WithArgs( + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.UndelegateMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(approvalArgs) + } + + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) - s.NextBlock() + Expect(s.network.NextBlock()).To(BeNil(), "failed to advance block") - undelegateArgs := defaultCallArgs. - WithMethodName("testUndelegate"). - WithArgs(s.address, valAddr.String(), big.NewInt(1e18)) + delegator := s.keyring.GetKey(0) + undelegateArgs := factory.CallArgs{ + ContractABI: stakingCallerContract.ABI, + MethodName: "testUndelegate", + Args: []interface{}{delegator.Addr, valAddr.String(), big.NewInt(1e18)}, + } logCheckArgs := defaultLogCheck. WithExpEvents(staking.EventTypeUnbond). WithExpPass(true) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, undelegateArgs, logCheckArgs) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, undelegateArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while setting up an unbonding delegation: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - s.NextBlock() - + expCreationHeight = s.network.GetContext().BlockHeight() // Check that the unbonding delegation was created - unbondingDelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(unbondingDelegations).To(HaveLen(1), "expected one unbonding delegation to be found") - Expect(unbondingDelegations[0].DelegatorAddress).To(Equal(sdk.AccAddress(s.address.Bytes()).String()), "expected delegator address to be %s", s.address) - Expect(unbondingDelegations[0].ValidatorAddress).To(Equal(valAddr.String()), "expected validator address to be %s", valAddr) - Expect(unbondingDelegations[0].Entries).To(HaveLen(1), "expected one unbonding delegation entry to be found") - Expect(unbondingDelegations[0].Entries[0].CreationHeight).To(Equal(s.ctx.BlockHeight()-1), "expected different creation height") - Expect(unbondingDelegations[0].Entries[0].Balance).To(Equal(math.NewInt(1e18)), "expected different balance") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(1), "expected one unbonding delegation to be found") + Expect(res.UnbondingResponses[0].DelegatorAddress).To(Equal(delegator.AccAddr.String()), "expected delegator address to be %s", delegator.Addr) + Expect(res.UnbondingResponses[0].ValidatorAddress).To(Equal(valAddr.String()), "expected validator address to be %s", valAddr) + Expect(res.UnbondingResponses[0].Entries).To(HaveLen(1), "expected one unbonding delegation entry to be found") + Expect(res.UnbondingResponses[0].Entries[0].CreationHeight).To(Equal(expCreationHeight), "expected different creation height") + Expect(res.UnbondingResponses[0].Entries[0].Balance).To(Equal(math.NewInt(1e18)), "expected different balance") }) Context("without approval set", func() { It("should not cancel unbonding delegations", func() { - cArgs := defaultCancelUnbondingArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(1e18), big.NewInt(s.ctx.BlockHeight()), - ) + delegator := s.keyring.GetKey(0) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), big.NewInt(expCreationHeight), + } + + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - unbondingDelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(unbondingDelegations).To(HaveLen(1), "expected unbonding delegation not to be canceled") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(1), "expected unbonding delegation not to be canceled") }) }) Context("with approval set", func() { BeforeEach(func() { + granter := s.keyring.GetKey(0) + // Set up an unbonding delegation - approvalArgs := defaultApproveArgs.WithArgs( + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.CancelUnbondingDelegationMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(approvalArgs) + } + + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) - s.NextBlock() + Expect(s.network.NextBlock()).To(BeNil(), "failed to advance block") }) It("should cancel unbonding delegations when not exceeding allowance", func() { - cArgs := defaultCancelUnbondingArgs.WithGasLimit(1e9).WithArgs( - s.address, valAddr.String(), big.NewInt(1e18), big.NewInt(expCreationHeight), - ) + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), big.NewInt(expCreationHeight), + } + + txArgs.GasLimit = 1e9 logCheckArgs := passCheck. WithExpEvents(staking.EventTypeCancelUnbondingDelegation) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, logCheckArgs) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - unbondingDelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(unbondingDelegations).To(HaveLen(0), "expected unbonding delegation to be canceled") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(BeEmpty(), "expected unbonding delegation to be canceled") }) It("should not cancel unbonding delegations when exceeding allowance", func() { - approvalArgs := defaultApproveArgs. - WithArgs(contractAddr, []string{staking.CancelUnbondingDelegationMsg}, big.NewInt(1)) - s.SetupApprovalWithContractCalls(approvalArgs) + delegator := s.keyring.GetKey(0) - cArgs := defaultCancelUnbondingArgs.WithArgs( - s.address, valAddr.String(), big.NewInt(1e18), big.NewInt(s.ctx.BlockHeight()), - ) + approveCallArgs.Args = []interface{}{contractAddr, []string{staking.CancelUnbondingDelegationMsg}, big.NewInt(1)} + s.SetupApprovalWithContractCalls(delegator, txArgs, approveCallArgs) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), big.NewInt(expCreationHeight), + } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - unbondingDelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(unbondingDelegations).To(HaveLen(1), "expected unbonding delegation to not be canceled") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(1), "expected unbonding delegation to not be canceled") }) It("should not cancel unbonding any delegations when unbonding delegation does not exist", func() { - cancelArgs := defaultCancelUnbondingArgs.WithArgs( - s.address, nonExistingVal.String(), big.NewInt(1e18), big.NewInt(s.ctx.BlockHeight()), - ) + delegator := s.keyring.GetKey(0) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, cancelArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + callArgs.Args = []interface{}{ + delegator.Addr, + nonExistingVal.String(), + big.NewInt(1e18), + big.NewInt(expCreationHeight), + } + + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, + callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - unbondingDelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(unbondingDelegations).To(HaveLen(1), "expected unbonding delegation to not be canceled") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(1), "expected unbonding delegation to not be canceled") }) It("should not cancel unbonding delegations when calling from a different address", func() { - newAddr, newPriv := testutiltx.NewAccAddressAndKey() - err := chainutil.FundAccountWithBaseDenom(s.ctx, s.app.BankKeeper, newAddr, 1e18) - Expect(err).To(BeNil(), "error while funding account: %v", err) - - s.NextBlock() + delegator := s.keyring.GetKey(0) + differentSender := s.keyring.GetKey(1) - cancelUnbondArgs := defaultCancelUnbondingArgs. - WithPrivKey(newPriv). - WithArgs(s.address, valAddr.String(), big.NewInt(1e18), big.NewInt(s.ctx.BlockHeight())) + callArgs.Args = []interface{}{delegator.Addr, valAddr.String(), big.NewInt(1e18), big.NewInt(expCreationHeight)} - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, cancelUnbondArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + differentSender.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - unbondingDelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(unbondingDelegations).To(HaveLen(1), "expected unbonding delegation to not be canceled") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(1), "expected unbonding delegation to not be canceled") }) }) }) Context("querying allowance", func() { - // defaultAllowanceArgs are the default arguments for querying the allowance - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - var defaultAllowanceArgs contracts.CallArgs - BeforeEach(func() { - defaultAllowanceArgs = defaultCallArgs.WithMethodName("getAllowance") + callArgs.MethodName = "getAllowance" }) - It("without approval set it should show no allowance", func() { - allowanceArgs := defaultAllowanceArgs.WithArgs( + granter := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ contractAddr, staking.CancelUnbondingDelegationMsg, - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, allowanceArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var allowanceInt *big.Int @@ -2602,19 +3311,25 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) It("with approval set it should show the granted allowance", func() { + granter := s.keyring.GetKey(0) + // setup approval - approvalArgs := defaultApproveArgs.WithArgs( + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.CancelUnbondingDelegationMsg}, big.NewInt(1e18), - ) + } - s.SetupApprovalWithContractCalls(approvalArgs) + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) // query allowance - allowanceArgs := defaultAllowanceArgs.WithArgs( + callArgs.Args = []interface{}{ contractAddr, staking.CancelUnbondingDelegationMsg, - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, allowanceArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var allowanceInt *big.Int @@ -2625,21 +3340,21 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) Context("querying validator", func() { - // defaultValidatorArgs are the default arguments for querying the validator - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - var defaultValidatorArgs contracts.CallArgs - BeforeEach(func() { - defaultValidatorArgs = defaultCallArgs.WithMethodName("getValidator") + callArgs.MethodName = "getValidator" }) - It("with non-existing address should return an empty validator", func() { - validatorArgs := defaultValidatorArgs.WithArgs( + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ nonExistingAddr, - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var valOut staking.ValidatorOutput @@ -2650,66 +3365,78 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) It("with existing address should return the validator", func() { - varHexAddr := common.BytesToAddress(valAddr.Bytes()) - validatorArgs := defaultValidatorArgs.WithArgs( - varHexAddr, - ) + delegator := s.keyring.GetKey(0) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorArgs, passCheck) + valHexAddr := common.BytesToAddress(valAddr.Bytes()) + callArgs.Args = []interface{}{valHexAddr} + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var valOut staking.ValidatorOutput err = s.precompile.UnpackIntoInterface(&valOut, staking.ValidatorMethod, ethRes.Ret) Expect(err).To(BeNil(), "error while unpacking the validator output: %v", err) - Expect(valOut.Validator.OperatorAddress).To(Equal(varHexAddr.String()), "expected validator address to match") + Expect(valOut.Validator.OperatorAddress).To(Equal(valHexAddr.String()), "expected validator address to match") Expect(valOut.Validator.DelegatorShares).To(Equal(big.NewInt(1e18)), "expected different delegator shares") }) It("with status bonded and pagination", func() { - validatorArgs := defaultCallArgs. - WithMethodName("getValidators"). - WithArgs( - stakingtypes.Bonded.String(), - query.PageRequest{ - Limit: 1, - CountTotal: true, - }, - ) + delegator := s.keyring.GetKey(0) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorArgs, passCheck) + callArgs.MethodName = "getValidators" + callArgs.Args = []interface{}{ + stakingtypes.Bonded.String(), + query.PageRequest{ + Limit: 1, + CountTotal: true, + }, + } + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var valOut staking.ValidatorsOutput err = s.precompile.UnpackIntoInterface(&valOut, staking.ValidatorsMethod, ethRes.Ret) Expect(err).To(BeNil(), "error while unpacking the validator output: %v", err) - Expect(valOut.PageResponse.Total).To(Equal(uint64(len(s.validators)))) + Expect(valOut.PageResponse.Total).To(Equal(uint64(len(s.network.GetValidators())))) Expect(valOut.PageResponse.NextKey).NotTo(BeEmpty()) Expect(valOut.Validators[0].DelegatorShares).To(Equal(big.NewInt(1e18)), "expected different delegator shares") }) }) Context("querying validators", func() { - var defaultValidatorsArgs contracts.CallArgs - BeforeEach(func() { - defaultValidatorsArgs = defaultCallArgs.WithMethodName("getValidators") + callArgs.MethodName = "getValidators" }) - It("should return validators (default pagination)", func() { - validatorsArgs := defaultValidatorsArgs.WithArgs( + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ stakingtypes.Bonded.String(), query.PageRequest{}, - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorsArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var valOut staking.ValidatorsOutput err = s.precompile.UnpackIntoInterface(&valOut, staking.ValidatorsMethod, ethRes.Ret) Expect(err).To(BeNil(), "error while unpacking the validator output: %v", err) - Expect(valOut.PageResponse.Total).To(Equal(uint64(len(s.validators)))) + Expect(valOut.PageResponse.Total).To(Equal(uint64(len(s.network.GetValidators())))) Expect(valOut.PageResponse.NextKey).To(BeEmpty()) - Expect(valOut.Validators).To(HaveLen(len(s.validators)), "expected all validators to be returned") + Expect(valOut.Validators).To(HaveLen(len(s.network.GetValidators())), "expected all validators to be returned") // return order can change, that's why each validator is checked individually for _, val := range valOut.Validators { s.CheckValidatorOutput(val) @@ -2719,15 +3446,21 @@ var _ = Describe("Calling staking precompile via Solidity", func() { //nolint:dupl // this is a duplicate of the test for EOA calls to the precompile It("should return validators with pagination limit = 1", func() { const limit uint64 = 1 - validatorArgs := defaultValidatorsArgs.WithArgs( + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ stakingtypes.Bonded.String(), query.PageRequest{ Limit: limit, CountTotal: true, }, - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var valOut staking.ValidatorsOutput @@ -2736,7 +3469,7 @@ var _ = Describe("Calling staking precompile via Solidity", func() { // no pagination, should return default values Expect(valOut.PageResponse.NextKey).NotTo(BeEmpty()) - Expect(valOut.PageResponse.Total).To(Equal(uint64(len(s.validators)))) + Expect(valOut.PageResponse.Total).To(Equal(uint64(len(s.network.GetValidators())))) Expect(valOut.Validators).To(HaveLen(int(limit)), "expected one validator to be returned") @@ -2747,22 +3480,34 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) It("should revert the execution if the bonding type is not known", func() { - validatorArgs := defaultValidatorsArgs.WithArgs( + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ "15", // invalid bonding type query.PageRequest{}, - ) + } - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) }) It("should return an empty array if there are no validators with the given bonding type", func() { - validatorArgs := defaultValidatorsArgs.WithArgs( + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ stakingtypes.Unbonded.String(), query.PageRequest{}, - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, validatorArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var valOut staking.ValidatorsOutput @@ -2776,21 +3521,21 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) Context("querying delegation", func() { - // defaultDelegationArgs are the default arguments for querying the delegation - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - var defaultDelegationArgs contracts.CallArgs - BeforeEach(func() { - defaultDelegationArgs = defaultCallArgs.WithMethodName("getDelegation") + callArgs.MethodName = "getDelegation" }) - It("which does not exist should return an empty delegation", func() { - delegationArgs := defaultDelegationArgs.WithArgs( + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ nonExistingAddr, valAddr.String(), - ) + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, delegationArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var delOut staking.DelegationOutput @@ -2801,11 +3546,17 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) It("which exists should return the delegation", func() { - delegationArgs := defaultDelegationArgs.WithArgs( - s.address, valAddr.String(), - ) + delegator := s.keyring.GetKey(0) + + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, delegationArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var delOut staking.DelegationOutput @@ -2819,21 +3570,22 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) Context("querying redelegation", func() { - // defaultRedelegationArgs are the default arguments for querying the redelegation - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - var defaultRedelegationArgs contracts.CallArgs - BeforeEach(func() { - defaultRedelegationArgs = defaultCallArgs.WithMethodName("getRedelegation") + callArgs.MethodName = "getRedelegation" }) It("which does not exist should return an empty redelegation", func() { - redelegationArgs := defaultRedelegationArgs.WithArgs( - s.address, valAddr.String(), nonExistingVal.String(), - ) + delegator := s.keyring.GetKey(0) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegationArgs, passCheck) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), nonExistingVal.String(), + } + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var redOut staking.RedelegationOutput @@ -2843,39 +3595,53 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) It("which exists should return the redelegation", func() { + delegator := s.keyring.GetKey(0) + // set up approval - approvalArgs := defaultApproveArgs.WithArgs( + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.RedelegateMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(approvalArgs) + } + s.SetupApprovalWithContractCalls(delegator, txArgs, approveCallArgs) - s.NextBlock() + Expect(s.network.NextBlock()).To(BeNil(), "failed to advance block") // set up redelegation - redelegateArgs := defaultCallArgs. - WithMethodName("testRedelegate"). - WithArgs(s.address, valAddr.String(), valAddr2.String(), big.NewInt(1)) + redelegateArgs := factory.CallArgs{ + ContractABI: stakingCallerContract.ABI, + MethodName: "testRedelegate", + Args: []interface{}{delegator.Addr, valAddr.String(), valAddr2.String(), big.NewInt(1)}, + } redelegateCheck := passCheck. WithExpEvents(staking.EventTypeRedelegate) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, redelegateCheck) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, redelegateArgs, + redelegateCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // check that the redelegation was created - redelegations := s.app.StakingKeeper.GetAllRedelegations(s.ctx, s.address.Bytes(), valAddr, valAddr2) - Expect(redelegations).To(HaveLen(1), "expected one redelegation to be found") - bech32Addr := sdk.AccAddress(s.address.Bytes()) - Expect(redelegations[0].DelegatorAddress).To(Equal(bech32Addr.String()), "expected delegator address to be %s", s.address) - Expect(redelegations[0].ValidatorSrcAddress).To(Equal(valAddr.String()), "expected source validator address to be %s", valAddr) - Expect(redelegations[0].ValidatorDstAddress).To(Equal(valAddr2.String()), "expected destination validator address to be %s", valAddr2) + res, err := s.grpcHandler.GetRedelegations(delegator.AccAddr.String(), valAddr.String(), valAddr2.String()) + Expect(err).To(BeNil()) + Expect(res.RedelegationResponses).To(HaveLen(1), "expected one redelegation to be found") + bech32Addr := delegator.AccAddr + Expect(res.RedelegationResponses[0].Redelegation.DelegatorAddress).To(Equal(bech32Addr.String()), "expected delegator address to be %s", delegator.Addr) + Expect(res.RedelegationResponses[0].Redelegation.ValidatorSrcAddress).To(Equal(valAddr.String()), "expected source validator address to be %s", valAddr) + Expect(res.RedelegationResponses[0].Redelegation.ValidatorDstAddress).To(Equal(valAddr2.String()), "expected destination validator address to be %s", valAddr2) // query redelegation - redelegationArgs := defaultRedelegationArgs.WithArgs( - s.address, valAddr.String(), valAddr2.String(), - ) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), valAddr2.String(), + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegationArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var redOut staking.RedelegationOutput @@ -2886,47 +3652,57 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) Describe("query redelegations", func() { - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - var defaultRedelegationsArgs contracts.CallArgs - BeforeEach(func() { - defaultRedelegationsArgs = defaultCallArgs.WithMethodName("getRedelegations") + callArgs.MethodName = "getRedelegations" }) - It("which exists should return all the existing redelegations w/pagination", func() { + delegator := s.keyring.GetKey(0) + // set up approval - approvalArgs := defaultApproveArgs.WithArgs( + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.RedelegateMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(approvalArgs) - s.NextBlock() + } + s.SetupApprovalWithContractCalls(delegator, txArgs, approveCallArgs) + Expect(s.network.NextBlock()).To(BeNil(), "failed to advance block") // set up redelegation - redelegateArgs := defaultCallArgs. - WithMethodName("testRedelegate"). - WithArgs(s.address, valAddr.String(), valAddr2.String(), big.NewInt(1)) + redelegateArgs := factory.CallArgs{ + ContractABI: stakingCallerContract.ABI, + MethodName: "testRedelegate", + Args: []interface{}{delegator.Addr, valAddr.String(), valAddr2.String(), big.NewInt(1)}, + } redelegateCheck := passCheck. WithExpEvents(staking.EventTypeRedelegate) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegateArgs, redelegateCheck) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, redelegateArgs, + redelegateCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // check that the redelegation was created - redelegations := s.app.StakingKeeper.GetAllRedelegations(s.ctx, s.address.Bytes(), valAddr, valAddr2) - Expect(redelegations).To(HaveLen(1), "expected one redelegation to be found") - bech32Addr := sdk.AccAddress(s.address.Bytes()) - Expect(redelegations[0].DelegatorAddress).To(Equal(bech32Addr.String()), "expected delegator address to be %s", s.address) - Expect(redelegations[0].ValidatorSrcAddress).To(Equal(valAddr.String()), "expected source validator address to be %s", valAddr) - Expect(redelegations[0].ValidatorDstAddress).To(Equal(valAddr2.String()), "expected destination validator address to be %s", valAddr2) + res, err := s.grpcHandler.GetRedelegations(delegator.AccAddr.String(), valAddr.String(), valAddr2.String()) + Expect(err).To(BeNil()) + Expect(res.RedelegationResponses).To(HaveLen(1), "expected one redelegation to be found") + bech32Addr := delegator.AccAddr + Expect(res.RedelegationResponses[0].Redelegation.DelegatorAddress).To(Equal(bech32Addr.String()), "expected delegator address to be %s", delegator.Addr) + Expect(res.RedelegationResponses[0].Redelegation.ValidatorSrcAddress).To(Equal(valAddr.String()), "expected source validator address to be %s", valAddr) + Expect(res.RedelegationResponses[0].Redelegation.ValidatorDstAddress).To(Equal(valAddr2.String()), "expected destination validator address to be %s", valAddr2) // query redelegations by delegator address - redelegationArgs := defaultRedelegationsArgs. - WithArgs( - s.address, "", "", query.PageRequest{Limit: 1, CountTotal: true}, - ) + callArgs.Args = []interface{}{ + delegator.Addr, "", "", query.PageRequest{Limit: 1, CountTotal: true}, + } - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, redelegationArgs, passCheck) + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + passCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) var redOut staking.RedelegationsOutput err = s.precompile.UnpackIntoInterface(&redOut, staking.RedelegationsMethod, ethRes.Ret) @@ -2939,48 +3715,55 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) Context("querying unbonding delegation", func() { - // defaultQueryUnbondingArgs are the default arguments for querying the unbonding delegation - // - // NOTE: this has to be populated in the BeforeEach block because the private key is not initialized before - var defaultQueryUnbondingArgs contracts.CallArgs - BeforeEach(func() { - defaultQueryUnbondingArgs = defaultCallArgs.WithMethodName("getUnbondingDelegation") + delegator := s.keyring.GetKey(0) + callArgs.MethodName = "getUnbondingDelegation" // Set up an unbonding delegation - approvalArgs := defaultApproveArgs.WithArgs( + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.UndelegateMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(approvalArgs) + } - s.NextBlock() + s.SetupApprovalWithContractCalls(delegator, txArgs, approveCallArgs) - undelegateArgs := defaultCallArgs. - WithMethodName("testUndelegate"). - WithArgs(s.address, valAddr.String(), big.NewInt(1e18)) + Expect(s.network.NextBlock()).To(BeNil(), "failed to advance block") + + undelegateArgs := factory.CallArgs{ + ContractABI: stakingCallerContract.ABI, + MethodName: "testUndelegate", + Args: []interface{}{delegator.Addr, valAddr.String(), big.NewInt(1e18)}, + } logCheckArgs := passCheck. WithExpEvents(staking.EventTypeUnbond) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, undelegateArgs, logCheckArgs) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, undelegateArgs, logCheckArgs) Expect(err).To(BeNil(), "error while setting up an unbonding delegation: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) // Check that the unbonding delegation was created - unbondingDelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(unbondingDelegations).To(HaveLen(1), "expected one unbonding delegation to be found") - Expect(unbondingDelegations[0].DelegatorAddress).To(Equal(sdk.AccAddress(s.address.Bytes()).String()), "expected delegator address to be %s", s.address) - Expect(unbondingDelegations[0].ValidatorAddress).To(Equal(valAddr.String()), "expected validator address to be %s", valAddr) - Expect(unbondingDelegations[0].Entries).To(HaveLen(1), "expected one unbonding delegation entry to be found") - Expect(unbondingDelegations[0].Entries[0].CreationHeight).To(Equal(s.ctx.BlockHeight()), "expected different creation height") - Expect(unbondingDelegations[0].Entries[0].Balance).To(Equal(math.NewInt(1e18)), "expected different balance") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(1), "expected one unbonding delegation to be found") + Expect(res.UnbondingResponses[0].DelegatorAddress).To(Equal(delegator.AccAddr.String()), "expected delegator address to be %s", delegator.Addr) + Expect(res.UnbondingResponses[0].ValidatorAddress).To(Equal(valAddr.String()), "expected validator address to be %s", valAddr) + Expect(res.UnbondingResponses[0].Entries).To(HaveLen(1), "expected one unbonding delegation entry to be found") + Expect(res.UnbondingResponses[0].Entries[0].CreationHeight).To(Equal(s.network.GetContext().BlockHeight()), "expected different creation height") + Expect(res.UnbondingResponses[0].Entries[0].Balance).To(Equal(math.NewInt(1e18)), "expected different balance") }) It("which does not exist should return an empty unbonding delegation", func() { - queryUnbondingArgs := defaultQueryUnbondingArgs.WithArgs( - s.address, valAddr2.String(), - ) + delegator := s.keyring.GetKey(0) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, queryUnbondingArgs, passCheck) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr2.String(), + } + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, passCheck) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var unbondingDelegationOutput staking.UnbondingDelegationOutput @@ -2990,11 +3773,15 @@ var _ = Describe("Calling staking precompile via Solidity", func() { }) It("which exists should return the unbonding delegation", func() { - queryUnbondingArgs := defaultQueryUnbondingArgs.WithArgs( - s.address, valAddr.String(), - ) + delegator := s.keyring.GetKey(0) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, queryUnbondingArgs, passCheck) + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), + } + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, passCheck) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) var unbondOut staking.UnbondingDelegationOutput @@ -3009,40 +3796,62 @@ var _ = Describe("Calling staking precompile via Solidity", func() { // NOTE: there's no additional setup necessary because the test suite is already set up with // delegations to the validator It("should revert everything if any operation fails", func() { - cArgs := defaultCallArgs. - WithMethodName("testApproveAndThenUndelegate"). - WithGasLimit(1e8). - WithArgs(contractAddr, big.NewInt(250), big.NewInt(500), valAddr.String()) + delegator := s.keyring.GetKey(0) + + cArgs := factory.CallArgs{ + ContractABI: stakingCallerContract.ABI, + MethodName: "testApproveAndThenUndelegate", + Args: []interface{}{contractAddr, big.NewInt(250), big.NewInt(500), valAddr.String()}, + } + txArgs.GasLimit = 1e8 - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, cArgs, + execRevertedCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) // There should be no authorizations because everything should have been reverted - authz, _ := s.CheckAuthorization(staking.UndelegateAuthz, contractAddr, s.address) + authz, _, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, staking.UndelegateAuthz, contractAddr, delegator.Addr) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("no authorizations found for grantee %s and granter %s", contractAddr.Hex(), delegator.Addr.Hex()))) Expect(authz).To(BeNil(), "expected authorization to be nil") - undelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(undelegations).To(HaveLen(0), "expected no unbonding delegations") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(0), "expected no unbonding delegations") }) It("should write to state if all operations succeed", func() { - cArgs := defaultCallArgs. - WithMethodName("testApproveAndThenUndelegate"). - WithGasLimit(1e8). - WithArgs(contractAddr, big.NewInt(1000), big.NewInt(500), valAddr.String()) + delegator := s.keyring.GetKey(0) + + cArgs := factory.CallArgs{ + ContractABI: stakingCallerContract.ABI, + MethodName: "testApproveAndThenUndelegate", + Args: []interface{}{contractAddr, big.NewInt(1000), big.NewInt(500), valAddr.String()}, + } + txArgs.GasLimit = 1e8 logCheckArgs := passCheck. WithExpEvents(authorization.EventTypeApproval, staking.EventTypeUnbond) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, cArgs, logCheckArgs) + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, cArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - authz, _ := s.CheckAuthorization(staking.UndelegateAuthz, contractAddr, s.address) + authz, _, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, staking.UndelegateAuthz, contractAddr, delegator.Addr) + Expect(err).To(BeNil()) Expect(authz).ToNot(BeNil(), "expected authorization not to be nil") - undelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) - Expect(undelegations).To(HaveLen(1), "expected one unbonding delegation") - Expect(undelegations[0].ValidatorAddress).To(Equal(valAddr.String()), "expected different validator address") + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.UnbondingResponses).To(HaveLen(1), "expected one unbonding delegation") + Expect(res.UnbondingResponses[0].ValidatorAddress).To(Equal(valAddr.String()), "expected different validator address") }) }) @@ -3061,13 +3870,16 @@ var _ = Describe("Calling staking precompile via Solidity", func() { } BeforeEach(func() { + granter := s.keyring.GetKey(0) + // approve undelegate message - approveArgs := defaultApproveArgs.WithArgs( + approveCallArgs.Args = []interface{}{ contractAddr, []string{staking.UndelegateMsg}, big.NewInt(1e18), - ) - s.SetupApprovalWithContractCalls(approveArgs) + } + + s.SetupApprovalWithContractCalls(granter, txArgs, approveCallArgs) - s.NextBlock() + Expect(s.network.NextBlock()).To(BeNil(), "failed to advance block") }) for _, tc := range testcases { @@ -3076,40 +3888,50 @@ var _ = Describe("Calling staking precompile via Solidity", func() { testcase := tc It(fmt.Sprintf("should not execute transactions for calltype %q", testcase.calltype), func() { - args := defaultCallArgs. - WithMethodName("testCallUndelegate"). - WithArgs(s.address, valAddr.String(), big.NewInt(1e18), testcase.calltype) + delegator := s.keyring.GetKey(0) + + callArgs.MethodName = "testCallUndelegate" + callArgs.Args = []interface{}{ + delegator.Addr, valAddr.String(), big.NewInt(1e18), testcase.calltype, + } checkArgs := execRevertedCheck if testcase.expTxPass { checkArgs = passCheck.WithExpEvents(staking.EventTypeUnbond) } - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, args, checkArgs) - if testcase.expTxPass { - Expect(err).To(BeNil(), "error while calling the smart contract for calltype %s: %v", testcase.calltype, err) - } else { - Expect(err).To(HaveOccurred(), "error while calling the smart contract for calltype %s: %v", testcase.calltype, err) - } + _, _, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + checkArgs, + ) + Expect(err).To(BeNil(), "error while calling the smart contract for calltype %s: %v", testcase.calltype, err) + Expect(s.network.NextBlock()).To(BeNil()) + // check no delegations are unbonding - undelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) + res, err := s.grpcHandler.GetDelegatorUnbondingDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) if testcase.expTxPass { - Expect(undelegations).To(HaveLen(1), "expected an unbonding delegation") - Expect(undelegations[0].ValidatorAddress).To(Equal(valAddr.String()), "expected different validator address") - Expect(undelegations[0].DelegatorAddress).To(Equal(sdk.AccAddress(s.address.Bytes()).String()), "expected different delegator address") + Expect(res.UnbondingResponses).To(HaveLen(1), "expected an unbonding delegation") + Expect(res.UnbondingResponses[0].ValidatorAddress).To(Equal(valAddr.String()), "expected different validator address") + Expect(res.UnbondingResponses[0].DelegatorAddress).To(Equal(delegator.AccAddr.String()), "expected different delegator address") } else { - Expect(undelegations).To(HaveLen(0), "expected no unbonding delegations for calltype %s", testcase.calltype) + Expect(res.UnbondingResponses).To(HaveLen(0), "expected no unbonding delegations for calltype %s", testcase.calltype) } }) It(fmt.Sprintf("should execute queries for calltype %q", testcase.calltype), func() { - args := defaultCallArgs. - WithMethodName("testCallDelegation"). - WithArgs(s.address, valAddr.String(), testcase.calltype) + delegator := s.keyring.GetKey(0) - _, ethRes, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, args, passCheck) + callArgs.MethodName = "testCallDelegation" + callArgs.Args = []interface{}{delegator.Addr, valAddr.String(), testcase.calltype} + + _, ethRes, err := s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, passCheck) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) var delOut staking.DelegationOutput err = s.precompile.UnpackIntoInterface(&delOut, staking.DelegationMethod, ethRes.Ret) @@ -3138,105 +3960,152 @@ var _ = Describe("Calling staking precompile via Solidity", func() { // Set up funding for the contract address. // NOTE: we are first asserting that no balance exists and then check successful // funding afterwards. - balanceBefore := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) + resBal, err := s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil(), "error while getting balance") + + balanceBefore := resBal.Balance Expect(balanceBefore.Amount.Int64()).To(BeZero(), "expected contract balance to be 0 before funding") - err = s.app.BankKeeper.SendCoins( - s.ctx, s.address.Bytes(), contractAddr.Bytes(), - sdk.Coins{sdk.Coin{Denom: s.bondDenom, Amount: math.NewIntFromBigInt(delegationAmount)}}, - ) - Expect(err).To(BeNil(), "error while sending coins: %v", err) + err = testutils.FundAccountWithBaseDenom(s.factory, s.network, s.keyring.GetKey(0), contractAddr.Bytes(), math.NewIntFromBigInt(delegationAmount)) + Expect(err).To(BeNil(), "error while funding account") + Expect(s.network.NextBlock()).To(BeNil()) - s.NextBlock() + resBal, err = s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil(), "error while getting balance") - balanceAfterFunding := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) + balanceAfterFunding := resBal.Balance Expect(balanceAfterFunding.Amount.BigInt()).To(Equal(delegationAmount), "expected different contract balance after funding") // Check no delegation exists from the contract to the validator - _, found := s.app.StakingKeeper.GetDelegation(s.ctx, contractAddr.Bytes(), valAddr) - Expect(found).To(BeFalse(), "expected delegation not to be found before testing") + res, err := s.grpcHandler.GetDelegation(sdk.AccAddress(contractAddr.Bytes()).String(), valAddr.String()) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("delegation with delegator %s not found for validator %s", sdk.AccAddress(contractAddr.Bytes()), valAddr))) + Expect(res).To(BeNil()) }) It("delegating and increasing counter should change the bank balance accordingly", func() { - delegationArgs := defaultCallArgs. - WithGasLimit(1e9). - WithMethodName("testDelegateIncrementCounter"). - WithArgs(valAddr.String(), delegationAmount) + delegator := s.keyring.GetKey(0) + + callArgs.MethodName = "testDelegateIncrementCounter" + callArgs.Args = []interface{}{valAddr.String(), delegationAmount} + txArgs.GasLimit = 1e9 approvalAndDelegationCheck := passCheck.WithExpEvents( authorization.EventTypeApproval, staking.EventTypeDelegate, ) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, delegationArgs, approvalAndDelegationCheck) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + approvalAndDelegationCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) - del, found := s.app.StakingKeeper.GetDelegation(s.ctx, contractAddr.Bytes(), valAddr) + res, err := s.grpcHandler.GetDelegation(sdk.AccAddress(contractAddr.Bytes()).String(), valAddr.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) + Expect(res.DelegationResponse.Delegation.GetShares().BigInt()).To(Equal(delegationAmount), "expected different delegation shares") - Expect(found).To(BeTrue(), "expected delegation to be found") - Expect(del.GetShares().BigInt()).To(Equal(delegationAmount), "expected different delegation shares") + resBal, err := s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil(), "error while getting balance") - postBalance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) + postBalance := resBal.Balance Expect(postBalance.Amount.Int64()).To(BeZero(), "expected balance to be 0 after contract call") }) }) Context("when updating the stateDB prior to calling the precompile", func() { It("should utilize the same contract balance to delegate", func() { - delegationArgs := defaultCallArgs. - WithGasLimit(1e9). - WithMethodName("approveDepositAndDelegate"). - WithArgs(valAddr.String()). - WithAmount(big.NewInt(2e18)) + delegator := s.keyring.GetKey(0) + + callArgs.MethodName = "approveDepositAndDelegate" + callArgs.Args = []interface{}{valAddr.String()} + + txArgs.Amount = big.NewInt(2e18) + txArgs.GasLimit = 1e9 approvalAndDelegationCheck := passCheck.WithExpEvents( authorization.EventTypeApproval, staking.EventTypeDelegate, ) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, delegationArgs, approvalAndDelegationCheck) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + approvalAndDelegationCheck, + ) Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) - balance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) + Expect(s.network.NextBlock()).To(BeNil()) + + resBal, err := s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil(), "error while getting balance") + balance := resBal.Balance + Expect(balance.Amount.Int64()).To(BeZero(), "expected different contract balance after funding") - delegation := s.app.StakingKeeper.GetAllDelegatorDelegations(s.ctx, contractAddr.Bytes()) - Expect(delegation).To(HaveLen(1), "expected one delegation") - Expect(delegation[0].GetShares().BigInt()).To(Equal(big.NewInt(2e18)), "expected different delegation shares") + res, err := s.grpcHandler.GetDelegatorDelegations(sdk.AccAddress(contractAddr.Bytes()).String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponses).To(HaveLen(1), "expected one delegation") + Expect(res.DelegationResponses[0].Delegation.GetShares().BigInt()).To(Equal(big.NewInt(2e18)), "expected different delegation shares") }) //nolint:dupl It("should revert the contract balance to the original value when the precompile fails", func() { - delegationArgs := defaultCallArgs. - WithGasLimit(1e9). - WithMethodName("approveDepositAndDelegateExceedingAllowance"). - WithArgs(valAddr.String()). - WithAmount(big.NewInt(2e18)) + delegator := s.keyring.GetKey(0) + + callArgs.MethodName = "approveDepositAndDelegateExceedingAllowance" + callArgs.Args = []interface{}{valAddr.String()} + + txArgs.Amount = big.NewInt(2e18) + txArgs.GasLimit = 1e9 approvalAndDelegationCheck := defaultLogCheck.WithErrContains(vm.ErrExecutionReverted.Error()) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, delegationArgs, approvalAndDelegationCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + approvalAndDelegationCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) + + resBal, err := s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil(), "error while getting balance") + balance := resBal.Balance - balance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) Expect(balance.Amount.Int64()).To(BeZero(), "expected different contract balance after funding") - auth, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, contractAddr.Bytes(), s.address.Bytes(), staking.DelegateMsg) + auth, _ := s.network.App.AuthzKeeper.GetAuthorization(s.network.GetContext(), contractAddr.Bytes(), delegator.AccAddr, staking.DelegateMsg) Expect(auth).To(BeNil(), "expected no authorization") - delegation := s.app.StakingKeeper.GetAllDelegatorDelegations(s.ctx, contractAddr.Bytes()) - Expect(delegation).To(HaveLen(0), "expected no delegations") + res, err := s.grpcHandler.GetDelegatorDelegations(sdk.AccAddress(contractAddr.Bytes()).String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponses).To(HaveLen(0), "expected no delegations") }) //nolint:dupl It("should revert the contract balance to the original value when the custom logic after the precompile fails ", func() { - delegationArgs := defaultCallArgs. - WithGasLimit(1e9). - WithMethodName("approveDepositDelegateAndFailCustomLogic"). - WithArgs(valAddr.String()). - WithAmount(big.NewInt(2e18)) + delegator := s.keyring.GetKey(0) + + callArgs.MethodName = "approveDepositDelegateAndFailCustomLogic" + callArgs.Args = []interface{}{valAddr.String()} + + txArgs.Amount = big.NewInt(2e18) + txArgs.GasLimit = 1e9 approvalAndDelegationCheck := defaultLogCheck.WithErrContains(vm.ErrExecutionReverted.Error()) - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, delegationArgs, approvalAndDelegationCheck) - Expect(err).To(HaveOccurred(), "error while calling the smart contract: %v", err) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + approvalAndDelegationCheck, + ) + Expect(err).To(BeNil(), "error while calling the smart contract: %v", err) + Expect(s.network.NextBlock()).To(BeNil()) + + resBal, err := s.grpcHandler.GetBalance(contractAddr.Bytes(), s.bondDenom) + Expect(err).To(BeNil(), "error while getting balance") - balance := s.app.BankKeeper.GetBalance(s.ctx, contractAddr.Bytes(), s.bondDenom) + balance := resBal.Balance Expect(balance.Amount.Int64()).To(BeZero(), "expected different contract balance after funding") - auth, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, contractAddr.Bytes(), s.address.Bytes(), staking.DelegateMsg) + auth, _ := s.network.App.AuthzKeeper.GetAuthorization(s.network.GetContext(), contractAddr.Bytes(), delegator.AccAddr, staking.DelegateMsg) Expect(auth).To(BeNil(), "expected no authorization") - delegation := s.app.StakingKeeper.GetAllDelegatorDelegations(s.ctx, contractAddr.Bytes()) - Expect(delegation).To(HaveLen(0), "expected no delegations") + res, err := s.grpcHandler.GetDelegatorDelegations(sdk.AccAddress(contractAddr.Bytes()).String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponses).To(HaveLen(0), "expected no delegations") }) }) }) @@ -3260,6 +4129,7 @@ var _ = Describe("Batching cosmos and eth interactions", func() { ) var ( + s *PrecompileTestSuite // contractAddr is the address of the deployed StakingCaller contract contractAddr common.Address // stakingCallerContract is the contract instance calling into the staking precompile @@ -3278,32 +4148,49 @@ var _ = Describe("Batching cosmos and eth interactions", func() { mintAmount = big.NewInt(1e18) // transferredAmount is the amount of ERC20 tokens to transfer during the tests transferredAmount = big.NewInt(1234e9) + // s is the precompile test suite to use for the tests ) BeforeEach(func() { + s = new(PrecompileTestSuite) s.SetupTest() - s.NextBlock() + delegator := s.keyring.GetKey(0) stakingCallerContract, err = testdata.LoadStakingCallerContract() Expect(err).To(BeNil(), "error while loading the StakingCaller contract") // Deploy StakingCaller contract - contractAddr, err = chainutil.DeployContract(s.ctx, s.app, s.privKey, s.queryClientEVM, stakingCallerContract) + contractAddr, err = s.factory.DeployContract( + delegator.Priv, + evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values + factory.ContractDeploymentData{ + Contract: stakingCallerContract, + }, + ) Expect(err).To(BeNil(), "error while deploying the StakingCaller contract") + Expect(s.network.NextBlock()).To(BeNil()) // Deploy ERC20 contract - erc20ContractAddr, err = chainutil.DeployContract(s.ctx, s.app, s.privKey, s.queryClientEVM, erc20Contract, - erc20Name, erc20Token, erc20Decimals, + erc20ContractAddr, err = s.factory.DeployContract( + delegator.Priv, + evmtypes.EvmTxArgs{}, // NOTE: passing empty struct to use default values + factory.ContractDeploymentData{ + Contract: erc20Contract, + ConstructorArgs: []interface{}{erc20Name, erc20Token, erc20Decimals}, + }, ) Expect(err).To(BeNil(), "error while deploying the ERC20 contract") + Expect(s.network.NextBlock()).To(BeNil()) // Mint tokens to the StakingCaller contract - mintArgs := contracts.CallArgs{ - ContractAddr: erc20ContractAddr, - ContractABI: erc20Contract.ABI, - MethodName: "mint", - PrivKey: s.privKey, - Args: []interface{}{contractAddr, mintAmount}, + mintArgs := factory.CallArgs{ + ContractABI: erc20Contract.ABI, + MethodName: "mint", + Args: []interface{}{contractAddr, mintAmount}, + } + + txArgs = evmtypes.EvmTxArgs{ + To: &erc20ContractAddr, } mintCheck := testutil.LogCheckArgs{ @@ -3312,21 +4199,24 @@ var _ = Describe("Batching cosmos and eth interactions", func() { ExpPass: true, } - _, _, err = contracts.CallContractAndCheckLogs(s.ctx, s.app, mintArgs, mintCheck) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, mintArgs, mintCheck) Expect(err).To(BeNil(), "error while minting tokens to the StakingCaller contract") + Expect(s.network.NextBlock()).To(BeNil()) // Check that the StakingCaller contract has the correct balance - erc20Balance := s.app.Erc20Keeper.BalanceOf(s.ctx, erc20Contract.ABI, erc20ContractAddr, contractAddr) + erc20Balance := s.network.App.Erc20Keeper.BalanceOf(s.network.GetContext(), erc20Contract.ABI, erc20ContractAddr, contractAddr) Expect(erc20Balance).To(Equal(mintAmount), "expected different ERC20 balance for the StakingCaller contract") // populate default call args - defaultCallArgs = contracts.CallArgs{ - ContractABI: stakingCallerContract.ABI, - ContractAddr: contractAddr, - MethodName: "callERC20AndDelegate", - PrivKey: s.privKey, + callArgs = factory.CallArgs{ + ContractABI: stakingCallerContract.ABI, + MethodName: "callERC20AndDelegate", } + txArgs.To = &contractAddr + // populate default log check args defaultLogCheck = testutil.LogCheckArgs{ ABIEvents: s.precompile.Events, @@ -3340,42 +4230,48 @@ var _ = Describe("Batching cosmos and eth interactions", func() { var validator sdk.ValAddress BeforeEach(func() { - delegations := s.app.StakingKeeper.GetAllDelegatorDelegations(s.ctx, s.address.Bytes()) - Expect(delegations).ToNot(HaveLen(0), "expected address to have delegations") + delegator := s.keyring.GetKey(0) + + res, err := s.grpcHandler.GetDelegatorDelegations(delegator.AccAddr.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponses).ToNot(HaveLen(0), "expected address to have delegations") - validator = delegations[0].GetValidatorAddr() + validator, err = sdk.ValAddressFromBech32(res.DelegationResponses[0].Delegation.ValidatorAddress) + Expect(err).To(BeNil()) _ = erc20ContractAddr }) It("should revert both states if a staking transaction fails", func() { - delegationPre, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), validator) - Expect(found).To(BeTrue(), - "expected delegation from %s to validator %s to be found", - sdk.AccAddress(s.address.Bytes()).String(), validator.String(), - ) + delegator := s.keyring.GetKey(0) + + res, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), validator.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) + delegationPre := res.DelegationResponse.Delegation sharesPre := delegationPre.GetShares() // NOTE: passing an invalid validator address here should fail AFTER the erc20 transfer was made in the smart contract. // Therefore this can be used to check that both EVM and Cosmos states are reverted correctly. - failArgs := defaultCallArgs. - WithArgs(erc20ContractAddr, "invalid validator", transferredAmount) + callArgs.Args = []interface{}{erc20ContractAddr, "invalid validator", transferredAmount} - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, failArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "expected error while calling the smart contract") - Expect(err.Error()).To(ContainSubstring("execution reverted"), "expected different error message") + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck) + Expect(err).To(BeNil(), "expected error while calling the smart contract") + Expect(s.network.NextBlock()).To(BeNil()) - delegationPost, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), validator) - Expect(found).To(BeTrue(), - "expected delegation from %s to validator %s to be found after calling the smart contract", - sdk.AccAddress(s.address.Bytes()).String(), validator.String(), - ) + res, err = s.grpcHandler.GetDelegation(delegator.AccAddr.String(), validator.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) + delegationPost := res.DelegationResponse.Delegation - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.ctx, contractAddr.Bytes(), s.address.Bytes()) + auths, err := s.grpcHandler.GetAuthorizations(sdk.AccAddress(contractAddr.Bytes()).String(), delegator.AccAddr.String()) Expect(err).To(BeNil(), "error while getting authorizations: %v", err) sharesPost := delegationPost.GetShares() - erc20BalancePost := s.app.Erc20Keeper.BalanceOf(s.ctx, erc20Contract.ABI, erc20ContractAddr, s.address) + erc20BalancePost := s.network.App.Erc20Keeper.BalanceOf(s.network.GetContext(), erc20Contract.ABI, erc20ContractAddr, delegator.Addr) Expect(auths).To(BeEmpty(), "expected no authorizations when reverting state") Expect(sharesPost).To(Equal(sharesPre), "expected shares to be equal when reverting state") @@ -3383,35 +4279,37 @@ var _ = Describe("Batching cosmos and eth interactions", func() { }) It("should revert both states if an ERC20 transaction fails", func() { - delegationPre, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), validator) - Expect(found).To(BeTrue(), - "expected delegation from %s to validator %s to be found", - sdk.AccAddress(s.address.Bytes()).String(), validator.String(), - ) + delegator := s.keyring.GetKey(0) + + res, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), validator.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) + delegationPre := res.DelegationResponse.Delegation sharesPre := delegationPre.GetShares() // NOTE: trying to transfer more than the balance of the contract should fail AFTER the approval // for delegating was made in the smart contract. // Therefore this can be used to check that both EVM and Cosmos states are reverted correctly. moreThanMintedAmount := new(big.Int).Add(mintAmount, big.NewInt(1)) - failArgs := defaultCallArgs. - WithArgs(erc20ContractAddr, s.validators[0].OperatorAddress, moreThanMintedAmount) + callArgs.Args = []interface{}{erc20ContractAddr, s.network.GetValidators()[0].OperatorAddress, moreThanMintedAmount} - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, failArgs, execRevertedCheck) - Expect(err).To(HaveOccurred(), "expected error while calling the smart contract") - Expect(err.Error()).To(ContainSubstring("execution reverted"), "expected different error message") + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + execRevertedCheck) + Expect(err).To(BeNil(), "expected error while calling the smart contract") + Expect(s.network.NextBlock()).To(BeNil()) - delegationPost, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), validator) - Expect(found).To(BeTrue(), - "expected delegation from %s to validator %s to be found after calling the smart contract", - sdk.AccAddress(s.address.Bytes()).String(), validator.String(), - ) + res, err = s.grpcHandler.GetDelegation(delegator.AccAddr.String(), validator.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) + delegationPost := res.DelegationResponse.Delegation - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.ctx, contractAddr.Bytes(), s.address.Bytes()) + auths, err := s.grpcHandler.GetAuthorizations(sdk.AccAddress(contractAddr.Bytes()).String(), delegator.AccAddr.String()) Expect(err).To(BeNil(), "error while getting authorizations: %v", err) sharesPost := delegationPost.GetShares() - erc20BalancePost := s.app.Erc20Keeper.BalanceOf(s.ctx, erc20Contract.ABI, erc20ContractAddr, s.address) + erc20BalancePost := s.network.App.Erc20Keeper.BalanceOf(s.network.GetContext(), erc20Contract.ABI, erc20ContractAddr, delegator.Addr) Expect(auths).To(BeEmpty(), "expected no authorizations when reverting state") Expect(sharesPost).To(Equal(sharesPre), "expected shares to be equal when reverting state") @@ -3419,19 +4317,19 @@ var _ = Describe("Batching cosmos and eth interactions", func() { }) It("should persist changes in both the cosmos and eth states", func() { - delegationPre, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), validator) - Expect(found).To(BeTrue(), - "expected delegation from %s to validator %s to be found", - sdk.AccAddress(s.address.Bytes()).String(), validator.String(), - ) + delegator := s.keyring.GetKey(0) + + res, err := s.grpcHandler.GetDelegation(delegator.AccAddr.String(), validator.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil()) + delegationPre := res.DelegationResponse.Delegation sharesPre := delegationPre.GetShares() // NOTE: trying to transfer more than the balance of the contract should fail AFTER the approval // for delegating was made in the smart contract. // Therefore this can be used to check that both EVM and Cosmos states are reverted correctly. - successArgs := defaultCallArgs. - WithArgs(erc20ContractAddr, s.validators[0].OperatorAddress, transferredAmount) + callArgs.Args = []interface{}{erc20ContractAddr, s.network.GetValidators()[0].OperatorAddress, transferredAmount} // Build combined map of ABI events to check for both ERC20 events as well as precompile events // @@ -3447,19 +4345,25 @@ var _ = Describe("Batching cosmos and eth interactions", func() { authorization.EventTypeApproval, "Transfer", staking.EventTypeDelegate, ) - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, successArgs, successCheck) + _, _, err = s.factory.CallContractAndCheckLogs( + delegator.Priv, + txArgs, callArgs, + successCheck) Expect(err).ToNot(HaveOccurred(), "error while calling the smart contract") + Expect(s.network.NextBlock()).To(BeNil()) - delegationPost, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), validator) - Expect(found).To(BeTrue(), + res, err = s.grpcHandler.GetDelegation(delegator.AccAddr.String(), validator.String()) + Expect(err).To(BeNil()) + Expect(res.DelegationResponse).NotTo(BeNil(), "expected delegation from %s to validator %s to be found after calling the smart contract", - sdk.AccAddress(s.address.Bytes()).String(), validator.String(), + delegator.AccAddr.String(), validator.String(), ) + delegationPost := res.DelegationResponse.Delegation - auths, err := s.app.AuthzKeeper.GetAuthorizations(s.ctx, contractAddr.Bytes(), s.address.Bytes()) + auths, err := s.grpcHandler.GetAuthorizations(sdk.AccAddress(contractAddr.Bytes()).String(), delegator.AccAddr.String()) Expect(err).To(BeNil(), "error while getting authorizations: %v", err) sharesPost := delegationPost.GetShares() - erc20BalancePost := s.app.Erc20Keeper.BalanceOf(s.ctx, erc20Contract.ABI, erc20ContractAddr, s.address) + erc20BalancePost := s.network.App.Erc20Keeper.BalanceOf(s.network.GetContext(), erc20Contract.ABI, erc20ContractAddr, delegator.Addr) Expect(sharesPost.GT(sharesPre)).To(BeTrue(), "expected shares to be more than before") Expect(erc20BalancePost).To(Equal(transferredAmount), "expected different erc20 balance of target address") diff --git a/precompiles/staking/query.go b/precompiles/staking/query.go index e060f523..00ef3c8b 100644 --- a/precompiles/staking/query.go +++ b/precompiles/staking/query.go @@ -52,11 +52,15 @@ func (p Precompile) Delegation( queryServer := stakingkeeper.Querier{Keeper: &p.stakingKeeper} - res, err := queryServer.Delegation(sdk.WrapSDKContext(ctx), req) + res, err := queryServer.Delegation(ctx, req) if err != nil { // If there is no delegation found, return the response with zero values. if strings.Contains(err.Error(), fmt.Sprintf(ErrNoDelegationFound, req.DelegatorAddr, req.ValidatorAddr)) { - return method.Outputs.Pack(big.NewInt(0), cmn.Coin{Denom: p.stakingKeeper.BondDenom(ctx), Amount: big.NewInt(0)}) + bondDenom, err := p.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + return method.Outputs.Pack(big.NewInt(0), cmn.Coin{Denom: bondDenom, Amount: big.NewInt(0)}) } return nil, err @@ -82,7 +86,7 @@ func (p Precompile) UnbondingDelegation( queryServer := stakingkeeper.Querier{Keeper: &p.stakingKeeper} - res, err := queryServer.UnbondingDelegation(sdk.WrapSDKContext(ctx), req) + res, err := queryServer.UnbondingDelegation(ctx, req) if err != nil { // return empty unbonding delegation output if the unbonding delegation is not found expError := fmt.Sprintf("unbonding delegation with delegator %s not found for validator %s", req.DelegatorAddr, req.ValidatorAddr) @@ -111,7 +115,7 @@ func (p Precompile) Validator( queryServer := stakingkeeper.Querier{Keeper: &p.stakingKeeper} - res, err := queryServer.Validator(sdk.WrapSDKContext(ctx), req) + res, err := queryServer.Validator(ctx, req) if err != nil { // return empty validator info if the validator is not found expError := fmt.Sprintf("validator %s not found", req.ValidatorAddr) @@ -140,7 +144,7 @@ func (p Precompile) Validators( queryServer := stakingkeeper.Querier{Keeper: &p.stakingKeeper} - res, err := queryServer.Validators(sdk.WrapSDKContext(ctx), req) + res, err := queryServer.Validators(ctx, req) if err != nil { return nil, err } diff --git a/precompiles/staking/query_test.go b/precompiles/staking/query_test.go index 5836af1a..f1e62396 100644 --- a/precompiles/staking/query_test.go +++ b/precompiles/staking/query_test.go @@ -54,7 +54,7 @@ func (s *PrecompileTestSuite) TestDelegation() { "fail - invalid operator address", func(string) []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), "invalid", } }, @@ -86,7 +86,7 @@ func (s *PrecompileTestSuite) TestDelegation() { "success", func(operatorAddress string) []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), operatorAddress, } }, @@ -105,9 +105,9 @@ func (s *PrecompileTestSuite) TestDelegation() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - bz, err := s.precompile.Delegation(s.ctx, contract, &method, tc.malleate(s.validators[0].OperatorAddress)) + bz, err := s.precompile.Delegation(s.network.GetContext(), contract, &method, tc.malleate(s.network.GetValidators()[0].OperatorAddress)) if tc.expErr { s.Require().Error(err) @@ -178,7 +178,7 @@ func (s *PrecompileTestSuite) TestUnbondingDelegation() { "success", func(operatorAddress string) []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), operatorAddress, } }, @@ -187,7 +187,7 @@ func (s *PrecompileTestSuite) TestUnbondingDelegation() { err := s.precompile.UnpackIntoInterface(&ubdOut, staking.UnbondingDelegationMethod, data) s.Require().NoError(err, "failed to unpack output") s.Require().Len(ubdOut.UnbondingDelegation.Entries, 1) - s.Require().Equal(ubdOut.UnbondingDelegation.Entries[0].CreationHeight, s.ctx.BlockHeight()) + s.Require().Equal(ubdOut.UnbondingDelegation.Entries[0].CreationHeight, s.network.GetContext().BlockHeight()) s.Require().Equal(ubdOut.UnbondingDelegation.Entries[0].Balance, big.NewInt(1e18)) }, 100000, @@ -199,12 +199,14 @@ func (s *PrecompileTestSuite) TestUnbondingDelegation() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - _, err := s.app.StakingKeeper.Undelegate(s.ctx, s.address.Bytes(), s.validators[0].GetOperator(), math.LegacyNewDec(1)) + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) + _, _, err = s.network.App.StakingKeeper.Undelegate(s.network.GetContext(), s.keyring.GetAddr(0).Bytes(), valAddr, math.LegacyNewDec(1)) s.Require().NoError(err) - bz, err := s.precompile.UnbondingDelegation(s.ctx, contract, &method, tc.malleate(s.validators[0].OperatorAddress)) + bz, err := s.precompile.UnbondingDelegation(s.network.GetContext(), contract, &method, tc.malleate(s.network.GetValidators()[0].OperatorAddress)) if tc.expErr { s.Require().Error(err) @@ -251,7 +253,7 @@ func (s *PrecompileTestSuite) TestValidator() { err := s.precompile.UnpackIntoInterface(&valOut, staking.ValidatorMethod, data) s.Require().NoError(err, "failed to unpack output") - operatorAddress, err := sdk.ValAddressFromBech32(s.validators[0].OperatorAddress) + operatorAddress, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].OperatorAddress) s.Require().NoError(err) s.Require().Equal(common.HexToAddress(valOut.Validator.OperatorAddress), common.BytesToAddress(operatorAddress.Bytes())) @@ -283,12 +285,12 @@ func (s *PrecompileTestSuite) TestValidator() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - operatorAddress, err := sdk.ValAddressFromBech32(s.validators[0].OperatorAddress) + operatorAddress, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].OperatorAddress) s.Require().NoError(err) - bz, err := s.precompile.Validator(s.ctx, &method, contract, tc.malleate(common.BytesToAddress(operatorAddress.Bytes()))) + bz, err := s.precompile.Validator(s.network.GetContext(), &method, contract, tc.malleate(common.BytesToAddress(operatorAddress.Bytes()))) if tc.expErr { s.Require().Error(err) @@ -354,7 +356,7 @@ func (s *PrecompileTestSuite) TestValidators() { s.Require().Len(valOut.Validators, expLen) // passed CountTotal = true - s.Require().Equal(len(s.validators), int(valOut.PageResponse.Total)) //#nosec G115 -- int overflow is not a concern here + s.Require().Equal(len(s.network.GetValidators()), int(valOut.PageResponse.Total)) //nolint:gosec s.Require().NotEmpty(valOut.PageResponse.NextKey) s.assertValidatorsResponse(valOut.Validators, expLen) }, @@ -382,7 +384,7 @@ func (s *PrecompileTestSuite) TestValidators() { s.Require().Len(valOut.Validators, expLen) // passed CountTotal = true - s.Require().Equal(len(s.validators), int(valOut.PageResponse.Total)) //#nosec G115 -- int overflow is not a concern here + s.Require().Equal(len(s.network.GetValidators()), int(valOut.PageResponse.Total)) //nolint:gosec s.Require().NotEmpty(valOut.PageResponse.NextKey) s.assertValidatorsResponse(valOut.Validators, expLen) }, @@ -395,9 +397,9 @@ func (s *PrecompileTestSuite) TestValidators() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - bz, err := s.precompile.Validators(s.ctx, &method, contract, tc.malleate()) + bz, err := s.precompile.Validators(s.network.GetContext(), &method, contract, tc.malleate()) if tc.expErr { s.Require().Error(err) @@ -451,7 +453,7 @@ func (s *PrecompileTestSuite) TestRedelegation() { "fail - empty src validator addr", func(_, destOperatorAddr string) []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), "", destOperatorAddr, } @@ -465,7 +467,7 @@ func (s *PrecompileTestSuite) TestRedelegation() { "fail - empty destination addr", func(srcOperatorAddr, _ string) []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), srcOperatorAddr, "", } @@ -479,7 +481,7 @@ func (s *PrecompileTestSuite) TestRedelegation() { "success", func(srcOperatorAddr, destOperatorAddr string) []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), srcOperatorAddr, destOperatorAddr, } @@ -489,7 +491,7 @@ func (s *PrecompileTestSuite) TestRedelegation() { err := s.precompile.UnpackIntoInterface(&redOut, staking.RedelegationMethod, data) s.Require().NoError(err, "failed to unpack output") s.Require().Len(redOut.Redelegation.Entries, 1) - s.Require().Equal(redOut.Redelegation.Entries[0].CreationHeight, s.ctx.BlockHeight()) + s.Require().Equal(redOut.Redelegation.Entries[0].CreationHeight, s.network.GetContext().BlockHeight()) s.Require().Equal(redOut.Redelegation.Entries[0].SharesDst, big.NewInt(1e18)) }, 100000, @@ -501,7 +503,7 @@ func (s *PrecompileTestSuite) TestRedelegation() { malleate: func(srcOperatorAddr, _ string) []interface{} { nonExistentOperator := sdk.ValAddress([]byte("non-existent-operator")) return []interface{}{ - s.address, + s.keyring.GetAddr(0), srcOperatorAddr, nonExistentOperator.String(), } @@ -519,22 +521,22 @@ func (s *PrecompileTestSuite) TestRedelegation() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) delegationArgs := []interface{}{ - s.address, - s.validators[0].OperatorAddress, - s.validators[1].OperatorAddress, + s.keyring.GetAddr(0), + s.network.GetValidators()[0].OperatorAddress, + s.network.GetValidators()[1].OperatorAddress, big.NewInt(1e18), } - err := s.CreateAuthorization(s.address, staking.RedelegateAuthz, nil) + err := s.CreateAuthorization(s.network.GetContext(), s.keyring.GetAccAddr(0), s.keyring.GetAccAddr(0), staking.RedelegateAuthz, nil) s.Require().NoError(err) - _, err = s.precompile.Redelegate(s.ctx, s.address, contract, s.stateDB, &redelegateMethod, delegationArgs) + _, err = s.precompile.Redelegate(s.network.GetContext(), s.keyring.GetAddr(0), contract, s.network.GetStateDB(), &redelegateMethod, delegationArgs) s.Require().NoError(err) - bz, err := s.precompile.Redelegation(s.ctx, &method, contract, tc.malleate(s.validators[0].OperatorAddress, s.validators[1].OperatorAddress)) + bz, err := s.precompile.Redelegation(s.network.GetContext(), &method, contract, tc.malleate(s.network.GetValidators()[0].OperatorAddress, s.network.GetValidators()[1].OperatorAddress)) if tc.expErr { s.Require().Error(err) @@ -578,8 +580,8 @@ func (s *PrecompileTestSuite) TestRedelegations() { func() []interface{} { return []interface{}{ common.BytesToAddress([]byte("invalid")), - s.validators[0].OperatorAddress, - s.validators[1].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, + s.network.GetValidators()[1].OperatorAddress, query.PageRequest{}, } }, @@ -609,7 +611,7 @@ func (s *PrecompileTestSuite) TestRedelegations() { return []interface{}{ common.Address{}, "", - s.validators[1].OperatorAddress, + s.network.GetValidators()[1].OperatorAddress, query.PageRequest{}, } }, @@ -622,14 +624,14 @@ func (s *PrecompileTestSuite) TestRedelegations() { "success - specified delegator, source & destination", func() []interface{} { return []interface{}{ - s.address, - s.validators[0].OperatorAddress, - s.validators[1].OperatorAddress, + s.keyring.GetAddr(0), + s.network.GetValidators()[0].OperatorAddress, + s.network.GetValidators()[1].OperatorAddress, query.PageRequest{}, } }, func(data []byte) { - s.assertRedelegationsOutput(data, 0, delAmt, 2, false) + s.assertRedelegationsOutput(data, 0, delAmt, s.network.GetContext().BlockHeight(), false) }, 100000, false, @@ -640,7 +642,7 @@ func (s *PrecompileTestSuite) TestRedelegations() { func() []interface{} { return []interface{}{ common.Address{}, - s.validators[0].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, "", query.PageRequest{ Limit: 1, @@ -649,7 +651,7 @@ func (s *PrecompileTestSuite) TestRedelegations() { } }, func(data []byte) { - s.assertRedelegationsOutput(data, redelTotalCount, delAmt, 2, true) + s.assertRedelegationsOutput(data, redelTotalCount, delAmt, s.network.GetContext().BlockHeight(), true) }, 100000, false, @@ -659,7 +661,7 @@ func (s *PrecompileTestSuite) TestRedelegations() { "success - get all existing redelegations for a delegator w/pagination", func() []interface{} { return []interface{}{ - s.address, + s.keyring.GetAddr(0), "", "", query.PageRequest{ @@ -669,7 +671,7 @@ func (s *PrecompileTestSuite) TestRedelegations() { } }, func(data []byte) { - s.assertRedelegationsOutput(data, redelTotalCount, delAmt, 2, true) + s.assertRedelegationsOutput(data, redelTotalCount, delAmt, s.network.GetContext().BlockHeight(), true) }, 100000, false, @@ -680,13 +682,13 @@ func (s *PrecompileTestSuite) TestRedelegations() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) - err := s.setupRedelegations(delAmt) + err := s.setupRedelegations(s.network.GetContext(), delAmt) s.Require().NoError(err) // query redelegations - bz, err := s.precompile.Redelegations(s.ctx, &method, contract, tc.malleate()) + bz, err := s.precompile.Redelegations(s.network.GetContext(), &method, contract, tc.malleate()) if tc.expErr { s.Require().Error(err) @@ -726,12 +728,12 @@ func (s *PrecompileTestSuite) TestAllowance() { { "success - query delegate method allowance", func() []interface{} { - err := s.CreateAuthorization(granteeAddr, staking.DelegateAuthz, &approvedCoin) + err := s.CreateAuthorization(s.network.GetContext(), s.keyring.GetAccAddr(0), granteeAddr.Bytes(), staking.DelegateAuthz, &approvedCoin) s.Require().NoError(err) return []interface{}{ granteeAddr, - s.address, + s.keyring.GetAddr(0), staking.DelegateMsg, } }, @@ -750,7 +752,7 @@ func (s *PrecompileTestSuite) TestAllowance() { func() []interface{} { return []interface{}{ granteeAddr, - s.address, + s.keyring.GetAddr(0), staking.UndelegateMsg, } }, @@ -769,10 +771,10 @@ func (s *PrecompileTestSuite) TestAllowance() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() // reset - contract := vm.NewContract(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + contract := vm.NewContract(vm.AccountRef(s.keyring.GetAddr(0)), s.precompile, big.NewInt(0), tc.gas) args := tc.malleate() - bz, err := s.precompile.Allowance(s.ctx, &method, contract, args) + bz, err := s.precompile.Allowance(s.network.GetContext(), &method, contract, args) if tc.expErr { s.Require().Error(err) diff --git a/precompiles/staking/setup_test.go b/precompiles/staking/setup_test.go index 395d8424..b5fc5088 100644 --- a/precompiles/staking/setup_test.go +++ b/precompiles/staking/setup_test.go @@ -3,53 +3,55 @@ package staking_test import ( "testing" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - exampleapp "github.com/evmos/os/example_chain" "github.com/evmos/os/precompiles/staking" - "github.com/evmos/os/x/evm/statedb" - evmtypes "github.com/evmos/os/x/evm/types" + "github.com/evmos/os/testutil/integration/os/factory" + "github.com/evmos/os/testutil/integration/os/grpc" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" + "github.com/evmos/os/testutil/integration/os/network" "github.com/stretchr/testify/suite" - - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/ginkgo/v2" - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/gomega" ) -var s *PrecompileTestSuite - type PrecompileTestSuite struct { suite.Suite - ctx sdk.Context - app *exampleapp.ExampleChain - address common.Address - validators []stakingtypes.Validator - ethSigner ethtypes.Signer - privKey cryptotypes.PrivKey - signer keyring.Signer - bondDenom string + network *network.UnitTestNetwork + factory factory.TxFactory + grpcHandler grpc.Handler + keyring testkeyring.Keyring + bondDenom string precompile *staking.Precompile - stateDB *statedb.StateDB - - queryClientEVM evmtypes.QueryClient } -func TestPrecompileTestSuite(t *testing.T) { - s = new(PrecompileTestSuite) - suite.Run(t, s) - - // Run Ginkgo integration tests - RegisterFailHandler(Fail) - RunSpecs(t, "Precompile Test Suite") +func TestPrecompileUnitTestSuite(t *testing.T) { + suite.Run(t, new(PrecompileTestSuite)) } func (s *PrecompileTestSuite) SetupTest() { - s.DoSetupTest() + keyring := testkeyring.New(2) + nw := network.NewUnitTestNetwork( + network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), + ) + grpcHandler := grpc.NewIntegrationHandler(nw) + txFactory := factory.New(nw, grpcHandler) + + ctx := nw.GetContext() + sk := nw.App.StakingKeeper + bondDenom, err := sk.BondDenom(ctx) + if err != nil { + panic(err) + } + + s.bondDenom = bondDenom + s.factory = txFactory + s.grpcHandler = grpcHandler + s.keyring = keyring + s.network = nw + + if s.precompile, err = staking.NewPrecompile( + *s.network.App.StakingKeeper, + s.network.App.AuthzKeeper, + ); err != nil { + panic(err) + } } diff --git a/precompiles/staking/staking.go b/precompiles/staking/staking.go index 952dc8ad..c84dfe85 100644 --- a/precompiles/staking/staking.go +++ b/precompiles/staking/staking.go @@ -6,8 +6,8 @@ package staking import ( "embed" - "github.com/cometbft/cometbft/libs/log" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" diff --git a/precompiles/staking/staking_test.go b/precompiles/staking/staking_test.go index 3e807696..3a71737e 100644 --- a/precompiles/staking/staking_test.go +++ b/precompiles/staking/staking_test.go @@ -4,16 +4,19 @@ import ( "math/big" "time" + chainutil "github.com/evmos/os/example_chain/testutil" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" - chainutil "github.com/evmos/os/example_chain/testutil" "github.com/evmos/os/precompiles/authorization" "github.com/evmos/os/precompiles/staking" - "github.com/evmos/os/testutil" + testconstants "github.com/evmos/os/testutil/constants" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" "github.com/evmos/os/x/evm/core/vm" + "github.com/evmos/os/x/evm/statedb" evmtypes "github.com/evmos/os/x/evm/types" ) @@ -93,8 +96,8 @@ func (s *PrecompileTestSuite) TestRequiredGas() { func() []byte { input, err := s.precompile.Pack( staking.DelegateMethod, - s.address, - s.validators[0].GetOperator().String(), + s.keyring.GetAddr(0), + s.network.GetValidators()[0].GetOperator(), big.NewInt(10000000000), ) s.Require().NoError(err) @@ -107,8 +110,8 @@ func (s *PrecompileTestSuite) TestRequiredGas() { func() []byte { input, err := s.precompile.Pack( staking.UndelegateMethod, - s.address, - s.validators[0].GetOperator().String(), + s.keyring.GetAddr(0), + s.network.GetValidators()[0].GetOperator(), big.NewInt(1), ) s.Require().NoError(err) @@ -133,9 +136,10 @@ func (s *PrecompileTestSuite) TestRequiredGas() { // TestRun tests the precompile's Run method. func (s *PrecompileTestSuite) TestRun() { + var ctx sdk.Context testcases := []struct { name string - malleate func() []byte + malleate func(delegator, grantee testkeyring.Key) []byte gas uint64 readOnly bool expPass bool @@ -143,14 +147,15 @@ func (s *PrecompileTestSuite) TestRun() { }{ { "fail - contract gas limit is < gas cost to run a query / tx", - func() []byte { - err := s.CreateAuthorization(s.address, staking.DelegateAuthz, nil) + func(delegator, grantee testkeyring.Key) []byte { + // TODO: why is this required? + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.DelegateAuthz, nil) s.Require().NoError(err) input, err := s.precompile.Pack( staking.DelegateMethod, - s.address, - s.validators[0].GetOperator().String(), + delegator.Addr, + s.network.GetValidators()[0].GetOperator(), big.NewInt(1000), ) s.Require().NoError(err, "failed to pack input") @@ -163,14 +168,14 @@ func (s *PrecompileTestSuite) TestRun() { }, { "pass - delegate transaction", - func() []byte { - err := s.CreateAuthorization(s.address, staking.DelegateAuthz, nil) + func(delegator, grantee testkeyring.Key) []byte { + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.DelegateAuthz, nil) s.Require().NoError(err) input, err := s.precompile.Pack( staking.DelegateMethod, - s.address, - s.validators[0].GetOperator().String(), + delegator.Addr, + s.network.GetValidators()[0].GetOperator(), big.NewInt(1000), ) s.Require().NoError(err, "failed to pack input") @@ -183,14 +188,14 @@ func (s *PrecompileTestSuite) TestRun() { }, { "pass - undelegate transaction", - func() []byte { - err := s.CreateAuthorization(s.address, staking.UndelegateAuthz, nil) + func(delegator, grantee testkeyring.Key) []byte { + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.UndelegateAuthz, nil) s.Require().NoError(err) input, err := s.precompile.Pack( staking.UndelegateMethod, - s.address, - s.validators[0].GetOperator().String(), + delegator.Addr, + s.network.GetValidators()[0].GetOperator(), big.NewInt(1), ) s.Require().NoError(err, "failed to pack input") @@ -203,15 +208,15 @@ func (s *PrecompileTestSuite) TestRun() { }, { "pass - redelegate transaction", - func() []byte { - err := s.CreateAuthorization(s.address, staking.RedelegateAuthz, nil) + func(delegator, grantee testkeyring.Key) []byte { + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.RedelegateAuthz, nil) s.Require().NoError(err) input, err := s.precompile.Pack( staking.RedelegateMethod, - s.address, - s.validators[0].GetOperator().String(), - s.validators[1].GetOperator().String(), + delegator.Addr, + s.network.GetValidators()[0].GetOperator(), + s.network.GetValidators()[1].GetOperator(), big.NewInt(1), ) s.Require().NoError(err, "failed to pack input") @@ -224,33 +229,38 @@ func (s *PrecompileTestSuite) TestRun() { }, { "pass - cancel unbonding delegation transaction", - func() []byte { + func(delegator, grantee testkeyring.Key) []byte { + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) // add unbonding delegation to staking keeper ubd := stakingtypes.NewUnbondingDelegation( - s.address.Bytes(), - s.validators[0].GetOperator(), - 1000, + delegator.AccAddr, + valAddr, + ctx.BlockHeight(), time.Now().Add(time.Hour), math.NewInt(1000), 0, + s.network.App.StakingKeeper.ValidatorAddressCodec(), + s.network.App.AccountKeeper.AddressCodec(), ) - s.app.StakingKeeper.SetUnbondingDelegation(s.ctx, ubd) + err = s.network.App.StakingKeeper.SetUnbondingDelegation(ctx, ubd) + s.Require().NoError(err, "failed to set unbonding delegation") - err := s.CreateAuthorization(s.address, staking.CancelUnbondingDelegationAuthz, nil) + err = s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.CancelUnbondingDelegationAuthz, nil) s.Require().NoError(err) // Needs to be called after setting unbonding delegation // In order to mimic the coins being added to the unboding pool - coin := sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1000)) - err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, sdk.Coins{coin}) + coin := sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(1000)) + err = s.network.App.BankKeeper.SendCoinsFromModuleToModule(ctx, stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, sdk.Coins{coin}) s.Require().NoError(err, "failed to send coins from module to module") input, err := s.precompile.Pack( staking.CancelUnbondingDelegationMethod, - s.address, - s.validators[0].GetOperator().String(), - big.NewInt(1000), + delegator.Addr, + s.network.GetValidators()[0].GetOperator(), big.NewInt(1000), + big.NewInt(ctx.BlockHeight()), ) s.Require().NoError(err, "failed to pack input") return input @@ -262,11 +272,11 @@ func (s *PrecompileTestSuite) TestRun() { }, { "pass - delegation query", - func() []byte { + func(delegator, _ testkeyring.Key) []byte { input, err := s.precompile.Pack( staking.DelegationMethod, - s.address, - s.validators[0].GetOperator().String(), + delegator.Addr, + s.network.GetValidators()[0].GetOperator(), ) s.Require().NoError(err, "failed to pack input") return input @@ -278,8 +288,8 @@ func (s *PrecompileTestSuite) TestRun() { }, { "pass - validator query", - func() []byte { - valAddr, err := sdk.ValAddressFromBech32(s.validators[0].OperatorAddress) + func(_, _ testkeyring.Key) []byte { + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].OperatorAddress) s.Require().NoError(err) input, err := s.precompile.Pack( @@ -296,26 +306,33 @@ func (s *PrecompileTestSuite) TestRun() { }, { "pass - redelgation query", - func() []byte { + func(delegator, _ testkeyring.Key) []byte { + valAddr1, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) + valAddr2, err := sdk.ValAddressFromBech32(s.network.GetValidators()[1].GetOperator()) + s.Require().NoError(err) // add redelegation to staking keeper redelegation := stakingtypes.NewRedelegation( - s.address.Bytes(), - s.validators[0].GetOperator(), - s.validators[1].GetOperator(), - 1000, + delegator.AccAddr, + valAddr1, + valAddr2, + ctx.BlockHeight(), time.Now().Add(time.Hour), math.NewInt(1000), math.LegacyNewDec(1), 0, + s.network.App.StakingKeeper.ValidatorAddressCodec(), + s.network.App.AccountKeeper.AddressCodec(), ) - s.app.StakingKeeper.SetRedelegation(s.ctx, redelegation) + err = s.network.App.StakingKeeper.SetRedelegation(ctx, redelegation) + s.Require().NoError(err, "failed to set redelegation") input, err := s.precompile.Pack( staking.RedelegationMethod, - s.address, - s.validators[0].GetOperator().String(), - s.validators[1].GetOperator().String(), + delegator.Addr, + s.network.GetValidators()[0].GetOperator(), + s.network.GetValidators()[1].GetOperator(), ) s.Require().NoError(err, "failed to pack input") return input @@ -327,11 +344,11 @@ func (s *PrecompileTestSuite) TestRun() { }, { "pass - delegation query - read only", - func() []byte { + func(delegator, _ testkeyring.Key) []byte { input, err := s.precompile.Pack( staking.DelegationMethod, - s.address, - s.validators[0].GetOperator().String(), + delegator.Addr, + s.network.GetValidators()[0].GetOperator(), ) s.Require().NoError(err, "failed to pack input") return input @@ -343,28 +360,33 @@ func (s *PrecompileTestSuite) TestRun() { }, { "pass - unbonding delegation query", - func() []byte { + func(delegator, _ testkeyring.Key) []byte { + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) // add unbonding delegation to staking keeper ubd := stakingtypes.NewUnbondingDelegation( - s.address.Bytes(), - s.validators[0].GetOperator(), - 1000, + delegator.AccAddr, + valAddr, + ctx.BlockHeight(), time.Now().Add(time.Hour), math.NewInt(1000), 0, + s.network.App.StakingKeeper.ValidatorAddressCodec(), + s.network.App.AccountKeeper.AddressCodec(), ) - s.app.StakingKeeper.SetUnbondingDelegation(s.ctx, ubd) + err = s.network.App.StakingKeeper.SetUnbondingDelegation(ctx, ubd) + s.Require().NoError(err, "failed to set unbonding delegation") // Needs to be called after setting unbonding delegation // In order to mimic the coins being added to the unboding pool - coin := sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1000)) - err := s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, sdk.Coins{coin}) + coin := sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(1000)) + err = s.network.App.BankKeeper.SendCoinsFromModuleToModule(ctx, stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, sdk.Coins{coin}) s.Require().NoError(err, "failed to send coins from module to module") input, err := s.precompile.Pack( staking.UnbondingDelegationMethod, - s.address, - s.validators[0].GetOperator().String(), + delegator.Addr, + s.network.GetValidators()[0].GetOperator(), ) s.Require().NoError(err, "failed to pack input") return input @@ -376,27 +398,27 @@ func (s *PrecompileTestSuite) TestRun() { }, { "fail - delegate method - read only", - func() []byte { + func(delegator, _ testkeyring.Key) []byte { input, err := s.precompile.Pack( staking.DelegateMethod, - s.address, - s.validators[0].GetOperator().String(), + delegator.Addr, + s.network.GetValidators()[0].GetOperator(), big.NewInt(1000), ) s.Require().NoError(err, "failed to pack input") return input }, - 0, + 1, // use gas > 0 to avoid doing gas estimation true, false, "write protection", }, { "fail - invalid method", - func() []byte { + func(_, _ testkeyring.Key) []byte { return []byte("invalid") }, - 0, + 1, // use gas > 0 to avoid doing gas estimation false, false, "no method with id", @@ -407,18 +429,22 @@ func (s *PrecompileTestSuite) TestRun() { s.Run(tc.name, func() { // setup basic test suite s.SetupTest() + ctx = s.network.GetContext().WithBlockTime(time.Now()) + + baseFee := s.network.App.FeeMarketKeeper.GetBaseFee(ctx) - baseFee := s.app.FeeMarketKeeper.GetBaseFee(s.ctx) + delegator := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) - contract := vm.NewPrecompile(vm.AccountRef(s.address), s.precompile, big.NewInt(0), tc.gas) + contract := vm.NewPrecompile(vm.AccountRef(delegator.Addr), s.precompile, big.NewInt(0), tc.gas) contractAddr := contract.Address() // malleate testcase - contract.Input = tc.malleate() + contract.Input = tc.malleate(delegator, grantee) // Build and sign Ethereum transaction txArgs := evmtypes.EvmTxArgs{ - ChainID: s.app.EVMKeeper.ChainID(), + ChainID: s.network.App.EVMKeeper.ChainID(), Nonce: 0, To: &contractAddr, Amount: nil, @@ -428,28 +454,29 @@ func (s *PrecompileTestSuite) TestRun() { GasTipCap: big.NewInt(1), Accesses: ðtypes.AccessList{}, } - msgEthereumTx := evmtypes.NewTx(&txArgs) - msgEthereumTx.From = s.address.String() - err := msgEthereumTx.Sign(s.ethSigner, s.signer) - s.Require().NoError(err, "failed to sign Ethereum message") + msg, err := s.factory.GenerateGethCoreMsg(delegator.Priv, txArgs) + s.Require().NoError(err) // Instantiate config - proposerAddress := s.ctx.BlockHeader().ProposerAddress - cfg, err := s.app.EVMKeeper.EVMConfig(s.ctx, proposerAddress, s.app.EVMKeeper.ChainID()) + proposerAddress := ctx.BlockHeader().ProposerAddress + cfg, err := s.network.App.EVMKeeper.EVMConfig(ctx, proposerAddress, s.network.App.EVMKeeper.ChainID()) s.Require().NoError(err, "failed to instantiate EVM config") - msg, err := msgEthereumTx.AsMessage(s.ethSigner, baseFee) - s.Require().NoError(err, "failed to instantiate Ethereum message") - // Instantiate EVM - evm := s.app.EVMKeeper.NewEVM( - s.ctx, msg, cfg, nil, s.stateDB, + headerHash := ctx.HeaderHash() + stDB := statedb.New( + ctx, + s.network.App.EVMKeeper, + statedb.NewEmptyTxConfig(common.BytesToHash(headerHash)), + ) + evm := s.network.App.EVMKeeper.NewEVM( + ctx, msg, cfg, nil, stDB, ) - precompiles, found, err := s.app.EVMKeeper.GetPrecompileInstance(s.ctx, contractAddr) + precompiles, found, err := s.network.App.EVMKeeper.GetPrecompileInstance(ctx, contractAddr) s.Require().NoError(err, "failed to instantiate precompile") - s.Require().True(found, "precompile not found") + s.Require().True(found, "not found precompile") evm.WithPrecompiles(precompiles.Map, precompiles.Addresses) // Run precompiled contract @@ -463,7 +490,7 @@ func (s *PrecompileTestSuite) TestRun() { s.Require().Error(err, "expected error to be returned when running the precompile") s.Require().Nil(bz, "expected returned bytes to be nil") s.Require().ErrorContains(err, tc.errContains) - consumed := s.ctx.GasMeter().GasConsumed() + consumed := ctx.GasMeter().GasConsumed() // LessThanOrEqual because the gas is consumed before the error is returned s.Require().LessOrEqual(tc.gas, consumed, "expected gas consumed to be equal to gas limit") diff --git a/precompiles/staking/testdata/StakingCaller.json b/precompiles/staking/testdata/StakingCaller.json index fa01a3c8..6e391565 100644 --- a/precompiles/staking/testdata/StakingCaller.json +++ b/precompiles/staking/testdata/StakingCaller.json @@ -1071,8 +1071,8 @@ "type": "function" } ], - "bytecode": "0x60806040526040518060200160405280604051806060016040528060238152602001620062646023913981525060019060016200003e92919062000053565b503480156200004c57600080fd5b50620004a1565b828054828255906000526020600020908101928215620000a0579160200282015b828111156200009f5782518290816200008e9190620003ba565b509160200191906001019062000074565b5b509050620000af9190620000b3565b5090565b5b80821115620000d75760008181620000cd9190620000db565b50600101620000b4565b5090565b508054620000e990620001a9565b6000825580601f10620000fd57506200011e565b601f0160209004906000526020600020908101906200011d919062000121565b5b50565b5b808211156200013c57600081600090555060010162000122565b5090565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620001c257607f821691505b602082108103620001d857620001d76200017a565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620002427fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000203565b6200024e868362000203565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b60006200029b620002956200028f8462000266565b62000270565b62000266565b9050919050565b6000819050919050565b620002b7836200027a565b620002cf620002c682620002a2565b84845462000210565b825550505050565b600090565b620002e6620002d7565b620002f3818484620002ac565b505050565b5b818110156200031b576200030f600082620002dc565b600181019050620002f9565b5050565b601f8211156200036a576200033481620001de565b6200033f84620001f3565b810160208510156200034f578190505b620003676200035e85620001f3565b830182620002f8565b50505b505050565b600082821c905092915050565b60006200038f600019846008026200036f565b1980831691505092915050565b6000620003aa83836200037c565b9150826002028217905092915050565b620003c58262000140565b67ffffffffffffffff811115620003e157620003e06200014b565b5b620003ed8254620001a9565b620003fa8282856200031f565b600060209050601f8311600181146200043257600084156200041d578287015190505b6200042985826200039c565b86555062000499565b601f1984166200044286620001de565b60005b828110156200046c5784890151825560018201915060208501945060208101905062000445565b868310156200048c578489015162000488601f8916826200037c565b8355505b6001600288020188555050505b505050505050565b615db380620004b16000396000f3fe60806040526004361061014b5760003560e01c80637e51b811116100b6578063cf2753cf1161006f578063cf2753cf146104a8578063ec9485df146104e6578063f40a214614610523578063f5714e641461054c578063f700dbd214610568578063f732b065146105915761014b565b80637e51b811146103965780638939e783146103bf5780638edb3f8b146103e85780639eab671114610404578063af9a90b21461042d578063b13d42421461046a5761014b565b806355dc4b221161010857806355dc4b2214610283578063570467ac146102ac5780635e269bfe146102e957806360deaa2a1461031257806361bc221a1461032e57806368ac3df3146103595761014b565b80630a4433e2146101505780631904bb2e1461017957806319b16c4c146101b657806331bcbcb3146101f45780633566cb951461021d578063455b855114610246575b600080fd5b34801561015c57600080fd5b5061017760048036038101906101729190612402565b6105cf565b005b34801561018557600080fd5b506101a0600480360381019061019b9190612476565b61069e565b6040516101ad91906126ed565b60405180910390f35b3480156101c257600080fd5b506101dd60048036038101906101d8919061283f565b61072e565b6040516101eb929190612916565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612946565b610c2d565b005b34801561022957600080fd5b50610244600480360381019061023f91906129b5565b610eba565b005b34801561025257600080fd5b5061026d60048036038101906102689190612a11565b611022565b60405161027a9190612c18565b60405180910390f35b34801561028f57600080fd5b506102aa60048036038101906102a59190612c3a565b6110b5565b005b3480156102b857600080fd5b506102d360048036038101906102ce919061283f565b6114a7565b6040516102e09190612e55565b60405180910390f35b3480156102f557600080fd5b50610310600480360381019061030b9190612e77565b61153d565b005b61032c60048036038101906103279190612efa565b6115c8565b005b34801561033a57600080fd5b50610343611716565b6040516103509190612f43565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b9190612fa1565b61171c565b60405161038d9190613076565b60405180910390f35b3480156103a257600080fd5b506103bd60048036038101906103b89190612946565b6117b2565b005b3480156103cb57600080fd5b506103e660048036038101906103e19190612946565b61183a565b005b61040260048036038101906103fd9190612efa565b6118f0565b005b34801561041057600080fd5b5061042b60048036038101906104269190613091565b611a85565b005b34801561043957600080fd5b50610454600480360381019061044f9190613166565b611b10565b6040516104619190613076565b60405180910390f35b34801561047657600080fd5b50610491600480360381019061048c9190613208565b611ba0565b60405161049f9291906134d1565b60405180910390f35b3480156104b457600080fd5b506104cf60048036038101906104ca9190612a11565b611c38565b6040516104dd929190612916565b60405180910390f35b3480156104f257600080fd5b5061050d60048036038101906105089190612a11565b611cd0565b60405161051a9190612f43565b60405180910390f35b34801561052f57600080fd5b5061054a60048036038101906105459190613508565b611d5a565b005b61056660048036038101906105619190612efa565b611f36565b005b34801561057457600080fd5b5061058f600480360381019061058a919061358b565b612090565b005b34801561059d57600080fd5b506105b860048036038101906105b39190613796565b61215c565b6040516105c6929190613aad565b60405180910390f35b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895868487876040518563ffffffff1660e01b81526004016106129493929190613c46565b6020604051808303816000875af1158015610631573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106559190613c9b565b905080610697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068e90613d4b565b60405180910390fd5b5050505050565b6106a66121fa565b61080073ffffffffffffffffffffffffffffffffffffffff1663223b3b7a836040518263ffffffff1660e01b81526004016106e19190613d6b565b600060405180830381865afa1580156106fe573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906107279190613fbc565b9050919050565b600061073861226e565b600061080090506000868660405160240161075492919061403e565b6040516020818303038152906040527f241774e6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000856040516020016107e691906140aa565b60405160208183030381529060405280519060200120905060405160200161080d9061410d565b6040516020818303038152906040528051906020012081036108f9576000808473ffffffffffffffffffffffffffffffffffffffff1684604051610851919061415e565b600060405180830381855af49150503d806000811461088c576040519150601f19603f3d011682016040523d82523d6000602084013e610891565b606091505b5091509150816108d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cd906141e7565b60405180910390fd5b808060200190518101906108ea9190614273565b80975081985050505050610c22565b6040516020016109089061431b565b6040516020818303038152906040528051906020012081036109f4576000808473ffffffffffffffffffffffffffffffffffffffff168460405161094c919061415e565b600060405180830381855afa9150503d8060008114610987576040519150601f19603f3d011682016040523d82523d6000602084013e61098c565b606091505b5091509150816109d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c89061437c565b60405180910390fd5b808060200190518101906109e59190614273565b80975081985050505050610c21565b604051602001610a03906143e8565b604051602081830303815290604052805190602001208103610af1576000808473ffffffffffffffffffffffffffffffffffffffff1684604051610a47919061415e565b6000604051808303816000865af19150503d8060008114610a84576040519150601f19603f3d011682016040523d82523d6000602084013e610a89565b606091505b509150915081610ace576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac590614449565b60405180910390fd5b80806020019051810190610ae29190614273565b80975081985050505050610c20565b604051602001610b00906144b5565b604051602081830303815290604052805190602001208103610be45760006040518060400160405280601a81526020017f64656c65676174696f6e28616464726573732c737472696e6729000000000000815250805190602001209050600060a490506060600060208b01516020808d0101516040518681528e6004820152604060248201526033604482015282606482015281608482015260c081878360008e5af281519c5060608201519450610100820160405280610bc057600080fd5b50505050604051806040016040528083815260200182815250975050505050610c1f565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1690614516565b60405180910390fd5b5b5b5b505050935093915050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895308460016040518463ffffffff1660e01b8152600401610c6f939291906146e4565b6020604051808303816000875af1158015610c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb29190613c9b565b905080610cf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ceb9061476e565b60405180910390fd5b60008473ffffffffffffffffffffffffffffffffffffffff163384604051602401610d2092919061478e565b6040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610daa919061415e565b6000604051808303816000865af19150503d8060008114610de7576040519150601f19603f3d011682016040523d82523d6000602084013e610dec565b606091505b5050905080610e30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2790614803565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3386866040518463ffffffff1660e01b8152600401610e6f93929190614823565b6020604051808303816000875af1158015610e8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb29190613c9b565b505050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895308460016040518463ffffffff1660e01b8152600401610efc939291906146e4565b6020604051808303816000875af1158015610f1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3f9190613c9b565b905080610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f78906148ad565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3085856040518463ffffffff1660e01b8152600401610fc093929190614823565b6020604051808303816000875af1158015610fdf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110039190613c9b565b50600160008082825461101691906148fc565b92505081905550505050565b61102a612288565b61080073ffffffffffffffffffffffffffffffffffffffff1663a03ffee184846040518363ffffffff1660e01b815260040161106792919061403e565b600060405180830381865afa158015611084573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906110ad9190614b60565b905092915050565b6000610800905060008585856040516024016110d393929190614823565b6040516020818303038152906040527f3edab33c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905060008360405160200161116591906140aa565b60405160208183030381529060405280519060200120905060405160200161118c9061410d565b6040516020818303038152906040528051906020012081036112595760008373ffffffffffffffffffffffffffffffffffffffff16836040516111cf919061415e565b600060405180830381855af49150503d806000811461120a576040519150601f19603f3d011682016040523d82523d6000602084013e61120f565b606091505b5050905080611253576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124a906141e7565b60405180910390fd5b5061149e565b6040516020016112689061431b565b6040516020818303038152906040528051906020012081036113355760008373ffffffffffffffffffffffffffffffffffffffff16836040516112ab919061415e565b600060405180830381855afa9150503d80600081146112e6576040519150601f19603f3d011682016040523d82523d6000602084013e6112eb565b606091505b505090508061132f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113269061437c565b60405180910390fd5b5061149d565b604051602001611344906143e8565b6040516020818303038152906040528051906020012081036114135760008373ffffffffffffffffffffffffffffffffffffffff1683604051611387919061415e565b6000604051808303816000865af19150503d80600081146113c4576040519150601f19603f3d011682016040523d82523d6000602084013e6113c9565b606091505b505090508061140d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140490614449565b60405180910390fd5b5061149c565b604051602001611422906144b5565b6040516020818303038152906040528051906020012081036114605760208201825160008082846000895af28061145857600080fd5b50505061149b565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149290614516565b60405180910390fd5b5b5b5b50505050505050565b6114af6122a9565b61080073ffffffffffffffffffffffffffffffffffffffff16637d9f939c8585856040518463ffffffff1660e01b81526004016114ee93929190614ba9565b600060405180830381865afa15801561150b573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906115349190614e11565b90509392505050565b61080073ffffffffffffffffffffffffffffffffffffffff166312d58dfe858585856040518563ffffffff1660e01b815260040161157e9493929190614e5a565b6020604051808303816000875af115801561159d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c19190613c9b565b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895303460016040518463ffffffff1660e01b815260040161160a939291906146e4565b6020604051808303816000875af1158015611629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164d9190613c9b565b90508061168f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168690614ef2565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3084346040518463ffffffff1660e01b81526004016116ce93929190614823565b6020604051808303816000875af11580156116ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117119190613c9b565b505050565b60005481565b600061080073ffffffffffffffffffffffffffffffffffffffff1663f7cd55168888888888886040518763ffffffff1660e01b815260040161176396959493929190615047565b6020604051808303816000875af1158015611782573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a69190613c9b565b90509695505050505050565b61080073ffffffffffffffffffffffffffffffffffffffff16633edab33c8484846040518463ffffffff1660e01b81526004016117f193929190614823565b6020604051808303816000875af1158015611810573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061183491906150b7565b50505050565b60008081548092919061184c906150e4565b919050555061080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8484846040518463ffffffff1660e01b815260040161189093929190614823565b6020604051808303816000875af11580156118af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d39190613c9b565b506000808154809291906118e69061512c565b9190505550505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895323460016040518463ffffffff1660e01b8152600401611932939291906146e4565b6020604051808303816000875af1158015611951573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119759190613c9b565b9050806119b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ae90614ef2565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3084346040518463ffffffff1660e01b81526004016119f693929190614823565b6020604051808303816000875af1158015611a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a399190613c9b565b503373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015611a80573d6000803e3d6000fd5b505050565b61080073ffffffffffffffffffffffffffffffffffffffff166354b826f5858585856040518563ffffffff1660e01b8152600401611ac69493929190615155565b6020604051808303816000875af1158015611ae5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0991906150b7565b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663a50f05ac868686866040518563ffffffff1660e01b8152600401611b5394939291906151b7565b6020604051808303816000875af1158015611b72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b969190613c9b565b9050949350505050565b6060611baa6122d1565b61080073ffffffffffffffffffffffffffffffffffffffff1663186b216785856040518363ffffffff1660e01b8152600401611be7929190615361565b600060405180830381865afa158015611c04573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611c2d9190615555565b915091509250929050565b6000611c4261226e565b61080073ffffffffffffffffffffffffffffffffffffffff1663241774e685856040518363ffffffff1660e01b8152600401611c7f92919061403e565b600060405180830381865afa158015611c9c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611cc59190614273565b915091509250929050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663fc08930c8433856040518463ffffffff1660e01b8152600401611d11939291906155cd565b602060405180830381865afa158015611d2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d52919061560b565b905092915050565b6000600167ffffffffffffffff811115611d7757611d76612714565b5b604051908082528060200260200182016040528015611daa57816020015b6060815260200190600190039081611d955790505b509050604051806060016040528060258152602001615d596025913981600081518110611dda57611dd9615638565b5b6020026020010181905250600061080073ffffffffffffffffffffffffffffffffffffffff1663b60398958787856040518463ffffffff1660e01b8152600401611e2693929190615718565b6020604051808303816000875af1158015611e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e699190613c9b565b905080611eab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea2906157c8565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff16633edab33c3285876040518463ffffffff1660e01b8152600401611eea93929190614823565b6020604051808303816000875af1158015611f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2d91906150b7565b50505050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895323460016040518463ffffffff1660e01b8152600401611f78939291906146e4565b6020604051808303816000875af1158015611f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbb9190613c9b565b905080611ffd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff490614ef2565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb308460013461202a91906148fc565b6040518463ffffffff1660e01b815260040161204893929190614823565b6020604051808303816000875af1158015612067573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208b9190613c9b565b505050565b600061080073ffffffffffffffffffffffffffffffffffffffff166361dc5c3b8585856040518463ffffffff1660e01b81526004016120d1939291906157e8565b6020604051808303816000875af11580156120f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121149190613c9b565b905080612156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214d9061588c565b60405180910390fd5b50505050565b60606121666122d1565b61080073ffffffffffffffffffffffffffffffffffffffff166310a2851c878787876040518563ffffffff1660e01b81526004016121a79493929190615922565b600060405180830381865afa1580156121c4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906121ed9190615ce0565b9150915094509492505050565b6040518061016001604052806060815260200160608152602001600015158152602001600060038111156122315761223061254e565b5b8152602001600081526020016000815260200160608152602001600060070b8152602001600060070b815260200160008152602001600081525090565b604051806040016040528060608152602001600081525090565b60405180606001604052806060815260200160608152602001606081525090565b6040518060800160405280606081526020016060815260200160608152602001606081525090565b604051806040016040528060608152602001600067ffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061233482612309565b9050919050565b61234481612329565b811461234f57600080fd5b50565b6000813590506123618161233b565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261238c5761238b612367565b5b8235905067ffffffffffffffff8111156123a9576123a861236c565b5b6020830191508360208202830111156123c5576123c4612371565b5b9250929050565b6000819050919050565b6123df816123cc565b81146123ea57600080fd5b50565b6000813590506123fc816123d6565b92915050565b6000806000806060858703121561241c5761241b6122ff565b5b600061242a87828801612352565b945050602085013567ffffffffffffffff81111561244b5761244a612304565b5b61245787828801612376565b9350935050604061246a878288016123ed565b91505092959194509250565b60006020828403121561248c5761248b6122ff565b5b600061249a84828501612352565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156124dd5780820151818401526020810190506124c2565b60008484015250505050565b6000601f19601f8301169050919050565b6000612505826124a3565b61250f81856124ae565b935061251f8185602086016124bf565b612528816124e9565b840191505092915050565b60008115159050919050565b61254881612533565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061258e5761258d61254e565b5b50565b600081905061259f8261257d565b919050565b60006125af82612591565b9050919050565b6125bf816125a4565b82525050565b6125ce816123cc565b82525050565b60008160070b9050919050565b6125ea816125d4565b82525050565b600061016083016000830151848203600086015261260e82826124fa565b9150506020830151848203602086015261262882826124fa565b915050604083015161263d604086018261253f565b50606083015161265060608601826125b6565b50608083015161266360808601826125c5565b5060a083015161267660a08601826125c5565b5060c083015184820360c086015261268e82826124fa565b91505060e08301516126a360e08601826125e1565b506101008301516126b86101008601826125e1565b506101208301516126cd6101208601826125c5565b506101408301516126e26101408601826125c5565b508091505092915050565b6000602082019050818103600083015261270781846125f0565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61274c826124e9565b810181811067ffffffffffffffff8211171561276b5761276a612714565b5b80604052505050565b600061277e6122f5565b905061278a8282612743565b919050565b600067ffffffffffffffff8211156127aa576127a9612714565b5b6127b3826124e9565b9050602081019050919050565b82818337600083830152505050565b60006127e26127dd8461278f565b612774565b9050828152602081018484840111156127fe576127fd61270f565b5b6128098482856127c0565b509392505050565b600082601f83011261282657612825612367565b5b81356128368482602086016127cf565b91505092915050565b600080600060608486031215612858576128576122ff565b5b600061286686828701612352565b935050602084013567ffffffffffffffff81111561288757612886612304565b5b61289386828701612811565b925050604084013567ffffffffffffffff8111156128b4576128b3612304565b5b6128c086828701612811565b9150509250925092565b6128d3816123cc565b82525050565b600060408301600083015184820360008601526128f682826124fa565b915050602083015161290b60208601826125c5565b508091505092915050565b600060408201905061292b60008301856128ca565b818103602083015261293d81846128d9565b90509392505050565b60008060006060848603121561295f5761295e6122ff565b5b600061296d86828701612352565b935050602084013567ffffffffffffffff81111561298e5761298d612304565b5b61299a86828701612811565b92505060406129ab868287016123ed565b9150509250925092565b600080604083850312156129cc576129cb6122ff565b5b600083013567ffffffffffffffff8111156129ea576129e9612304565b5b6129f685828601612811565b9250506020612a07858286016123ed565b9150509250929050565b60008060408385031215612a2857612a276122ff565b5b6000612a3685828601612352565b925050602083013567ffffffffffffffff811115612a5757612a56612304565b5b612a6385828601612811565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600067ffffffffffffffff82169050919050565b612ab681612a99565b82525050565b60c082016000820151612ad260008501826125e1565b506020820151612ae560208501826125e1565b506040820151612af860408501826125c5565b506060820151612b0b60608501826125c5565b506080820151612b1e6080850182612aad565b5060a0820151612b3160a08501826125e1565b50505050565b6000612b438383612abc565b60c08301905092915050565b6000602082019050919050565b6000612b6782612a6d565b612b718185612a78565b9350612b7c83612a89565b8060005b83811015612bad578151612b948882612b37565b9750612b9f83612b4f565b925050600181019050612b80565b5085935050505092915050565b60006060830160008301518482036000860152612bd782826124fa565b91505060208301518482036020860152612bf182826124fa565b91505060408301518482036040860152612c0b8282612b5c565b9150508091505092915050565b60006020820190508181036000830152612c328184612bba565b905092915050565b60008060008060808587031215612c5457612c536122ff565b5b6000612c6287828801612352565b945050602085013567ffffffffffffffff811115612c8357612c82612304565b5b612c8f87828801612811565b9350506040612ca0878288016123ed565b925050606085013567ffffffffffffffff811115612cc157612cc0612304565b5b612ccd87828801612811565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b608082016000820151612d1b60008501826125e1565b506020820151612d2e60208501826125e1565b506040820151612d4160408501826125c5565b506060820151612d5460608501826125c5565b50505050565b6000612d668383612d05565b60808301905092915050565b6000602082019050919050565b6000612d8a82612cd9565b612d948185612ce4565b9350612d9f83612cf5565b8060005b83811015612dd0578151612db78882612d5a565b9750612dc283612d72565b925050600181019050612da3565b5085935050505092915050565b60006080830160008301518482036000860152612dfa82826124fa565b91505060208301518482036020860152612e1482826124fa565b91505060408301518482036040860152612e2e82826124fa565b91505060608301518482036060860152612e488282612d7f565b9150508091505092915050565b60006020820190508181036000830152612e6f8184612ddd565b905092915050565b60008060008060808587031215612e9157612e906122ff565b5b6000612e9f87828801612352565b945050602085013567ffffffffffffffff811115612ec057612ebf612304565b5b612ecc87828801612811565b9350506040612edd878288016123ed565b9250506060612eee878288016123ed565b91505092959194509250565b600060208284031215612f1057612f0f6122ff565b5b600082013567ffffffffffffffff811115612f2e57612f2d612304565b5b612f3a84828501612811565b91505092915050565b6000602082019050612f5860008301846128ca565b92915050565b600080fd5b600060a08284031215612f7957612f78612f5e565b5b81905092915050565b600060608284031215612f9857612f97612f5e565b5b81905092915050565b6000806000806000806101008789031215612fbf57612fbe6122ff565b5b600087013567ffffffffffffffff811115612fdd57612fdc612304565b5b612fe989828a01612f63565b9650506020612ffa89828a01612f82565b955050608061300b89828a016123ed565b94505060a061301c89828a01612352565b93505060c087013567ffffffffffffffff81111561303d5761303c612304565b5b61304989828a01612811565b92505060e061305a89828a016123ed565b9150509295509295509295565b61307081612533565b82525050565b600060208201905061308b6000830184613067565b92915050565b600080600080608085870312156130ab576130aa6122ff565b5b60006130b987828801612352565b945050602085013567ffffffffffffffff8111156130da576130d9612304565b5b6130e687828801612811565b935050604085013567ffffffffffffffff81111561310757613106612304565b5b61311387828801612811565b9250506060613124878288016123ed565b91505092959194509250565b6000819050919050565b61314381613130565b811461314e57600080fd5b50565b6000813590506131608161313a565b92915050565b600080600080608085870312156131805761317f6122ff565b5b600085013567ffffffffffffffff81111561319e5761319d612304565b5b6131aa87828801612f63565b94505060206131bb87828801612352565b93505060406131cc87828801613151565b92505060606131dd87828801613151565b91505092959194509250565b600060a082840312156131ff576131fe612f5e565b5b81905092915050565b6000806040838503121561321f5761321e6122ff565b5b600083013567ffffffffffffffff81111561323d5761323c612304565b5b61324985828601612811565b925050602083013567ffffffffffffffff81111561326a57613269612304565b5b613276858286016131e9565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006101608301600083015184820360008601526132ca82826124fa565b915050602083015184820360208601526132e482826124fa565b91505060408301516132f9604086018261253f565b50606083015161330c60608601826125b6565b50608083015161331f60808601826125c5565b5060a083015161333260a08601826125c5565b5060c083015184820360c086015261334a82826124fa565b91505060e083015161335f60e08601826125e1565b506101008301516133746101008601826125e1565b506101208301516133896101208601826125c5565b5061014083015161339e6101408601826125c5565b508091505092915050565b60006133b583836132ac565b905092915050565b6000602082019050919050565b60006133d582613280565b6133df818561328b565b9350836020820285016133f18561329c565b8060005b8581101561342d578484038952815161340e85826133a9565b9450613419836133bd565b925060208a019950506001810190506133f5565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b60006134668261343f565b613470818561344a565b93506134808185602086016124bf565b613489816124e9565b840191505092915050565b600060408301600083015184820360008601526134b1828261345b565b91505060208301516134c66020860182612aad565b508091505092915050565b600060408201905081810360008301526134eb81856133ca565b905081810360208301526134ff8184613494565b90509392505050565b60008060008060808587031215613522576135216122ff565b5b600061353087828801612352565b9450506020613541878288016123ed565b9350506040613552878288016123ed565b925050606085013567ffffffffffffffff81111561357357613572612304565b5b61357f87828801612811565b91505092959194509250565b6000806000604084860312156135a4576135a36122ff565b5b60006135b286828701612352565b935050602084013567ffffffffffffffff8111156135d3576135d2612304565b5b6135df86828701612376565b92509250509250925092565b600080fd5b600080fd5b600067ffffffffffffffff8211156136105761360f612714565b5b613619826124e9565b9050602081019050919050565b6000613639613634846135f5565b612774565b9050828152602081018484840111156136555761365461270f565b5b6136608482856127c0565b509392505050565b600082601f83011261367d5761367c612367565b5b813561368d848260208601613626565b91505092915050565b61369f81612a99565b81146136aa57600080fd5b50565b6000813590506136bc81613696565b92915050565b6136cb81612533565b81146136d657600080fd5b50565b6000813590506136e8816136c2565b92915050565b600060a08284031215613704576137036135eb565b5b61370e60a0612774565b9050600082013567ffffffffffffffff81111561372e5761372d6135f0565b5b61373a84828501613668565b600083015250602061374e848285016136ad565b6020830152506040613762848285016136ad565b6040830152506060613776848285016136d9565b606083015250608061378a848285016136d9565b60808301525092915050565b600080600080608085870312156137b0576137af6122ff565b5b60006137be87828801612352565b945050602085013567ffffffffffffffff8111156137df576137de612304565b5b6137eb87828801612811565b935050604085013567ffffffffffffffff81111561380c5761380b612304565b5b61381887828801612811565b925050606085013567ffffffffffffffff81111561383957613838612304565b5b613845878288016136ee565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000608083016000830151848203600086015261389a82826124fa565b915050602083015184820360208601526138b482826124fa565b915050604083015184820360408601526138ce82826124fa565b915050606083015184820360608601526138e88282612d7f565b9150508091505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60a0820160008201516139376000850182612d05565b50602082015161394a60808501826125c5565b50505050565b600061395c8383613921565b60a08301905092915050565b6000602082019050919050565b6000613980826138f5565b61398a8185613900565b935061399583613911565b8060005b838110156139c65781516139ad8882613950565b97506139b883613968565b925050600181019050613999565b5085935050505092915050565b600060408301600083015184820360008601526139f0828261387d565b91505060208301518482036020860152613a0a8282613975565b9150508091505092915050565b6000613a2383836139d3565b905092915050565b6000602082019050919050565b6000613a4382613851565b613a4d818561385c565b935083602082028501613a5f8561386d565b8060005b85811015613a9b5784840389528151613a7c8582613a17565b9450613a8783613a2b565b925060208a01995050600181019050613a63565b50829750879550505050505092915050565b60006040820190508181036000830152613ac78185613a38565b90508181036020830152613adb8184613494565b90509392505050565b613aed81612329565b82525050565b600082825260208201905092915050565b6000819050919050565b6000613b1a83856124ae565b9350613b278385846127c0565b613b30836124e9565b840190509392505050565b6000613b48848484613b0e565b90509392505050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613b7d57613b7c613b5b565b5b83810192508235915060208301925067ffffffffffffffff821115613ba557613ba4613b51565b5b600182023603831315613bbb57613bba613b56565b5b509250929050565b6000602082019050919050565b6000613bdc8385613af3565b935083602084028501613bee84613b04565b8060005b87811015613c34578484038952613c098284613b60565b613c14868284613b3b565b9550613c1f84613bc3565b935060208b019a505050600181019050613bf2565b50829750879450505050509392505050565b6000606082019050613c5b6000830187613ae4565b613c6860208301866128ca565b8181036040830152613c7b818486613bd0565b905095945050505050565b600081519050613c95816136c2565b92915050565b600060208284031215613cb157613cb06122ff565b5b6000613cbf84828501613c86565b91505092915050565b600082825260208201905092915050565b7f4661696c656420746f20617070726f7665207374616b696e67206d6574686f6460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d35602183613cc8565b9150613d4082613cd9565b604082019050919050565b60006020820190508181036000830152613d6481613d28565b9050919050565b6000602082019050613d806000830184613ae4565b92915050565b6000613d99613d948461278f565b612774565b905082815260208101848484011115613db557613db461270f565b5b613dc08482856124bf565b509392505050565b600082601f830112613ddd57613ddc612367565b5b8151613ded848260208601613d86565b91505092915050565b60048110613e0357600080fd5b50565b600081519050613e1581613df6565b92915050565b600081519050613e2a816123d6565b92915050565b613e39816125d4565b8114613e4457600080fd5b50565b600081519050613e5681613e30565b92915050565b60006101608284031215613e7357613e726135eb565b5b613e7e610160612774565b9050600082015167ffffffffffffffff811115613e9e57613e9d6135f0565b5b613eaa84828501613dc8565b600083015250602082015167ffffffffffffffff811115613ece57613ecd6135f0565b5b613eda84828501613dc8565b6020830152506040613eee84828501613c86565b6040830152506060613f0284828501613e06565b6060830152506080613f1684828501613e1b565b60808301525060a0613f2a84828501613e1b565b60a08301525060c082015167ffffffffffffffff811115613f4e57613f4d6135f0565b5b613f5a84828501613dc8565b60c08301525060e0613f6e84828501613e47565b60e083015250610100613f8384828501613e47565b61010083015250610120613f9984828501613e1b565b61012083015250610140613faf84828501613e1b565b6101408301525092915050565b600060208284031215613fd257613fd16122ff565b5b600082015167ffffffffffffffff811115613ff057613fef612304565b5b613ffc84828501613e5c565b91505092915050565b6000614010826124a3565b61401a8185613cc8565b935061402a8185602086016124bf565b614033816124e9565b840191505092915050565b60006040820190506140536000830185613ae4565b81810360208301526140658184614005565b90509392505050565b600081905092915050565b6000614084826124a3565b61408e818561406e565b935061409e8185602086016124bf565b80840191505092915050565b60006140b68284614079565b915081905092915050565b7f64656c656761746563616c6c0000000000000000000000000000000000000000600082015250565b60006140f7600c8361406e565b9150614102826140c1565b600c82019050919050565b6000614118826140ea565b9150819050919050565b600081905092915050565b60006141388261343f565b6141428185614122565b93506141528185602086016124bf565b80840191505092915050565b600061416a828461412d565b915081905092915050565b7f6661696c65642064656c656761746563616c6c20746f20707265636f6d70696c60008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b60006141d1602183613cc8565b91506141dc82614175565b604082019050919050565b60006020820190508181036000830152614200816141c4565b9050919050565b60006040828403121561421d5761421c6135eb565b5b6142276040612774565b9050600082015167ffffffffffffffff811115614247576142466135f0565b5b61425384828501613dc8565b600083015250602061426784828501613e1b565b60208301525092915050565b6000806040838503121561428a576142896122ff565b5b600061429885828601613e1b565b925050602083015167ffffffffffffffff8111156142b9576142b8612304565b5b6142c585828601614207565b9150509250929050565b7f73746174696363616c6c00000000000000000000000000000000000000000000600082015250565b6000614305600a8361406e565b9150614310826142cf565b600a82019050919050565b6000614326826142f8565b9150819050919050565b7f6661696c65642073746174696363616c6c20746f20707265636f6d70696c6500600082015250565b6000614366601f83613cc8565b915061437182614330565b602082019050919050565b6000602082019050818103600083015261439581614359565b9050919050565b7f63616c6c00000000000000000000000000000000000000000000000000000000600082015250565b60006143d260048361406e565b91506143dd8261439c565b600482019050919050565b60006143f3826143c5565b9150819050919050565b7f6661696c65642063616c6c20746f20707265636f6d70696c6500000000000000600082015250565b6000614433601983613cc8565b915061443e826143fd565b602082019050919050565b6000602082019050818103600083015261446281614426565b9050919050565b7f63616c6c636f6465000000000000000000000000000000000000000000000000600082015250565b600061449f60088361406e565b91506144aa82614469565b600882019050919050565b60006144c082614492565b9150819050919050565b7f696e76616c69642063616c6c7479706500000000000000000000000000000000600082015250565b6000614500601083613cc8565b915061450b826144ca565b602082019050919050565b6000602082019050818103600083015261452f816144f3565b9050919050565b600081549050919050565b60008190508160005260206000209050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061459d57607f821691505b6020821081036145b0576145af614556565b5b50919050565b60008190508160005260206000209050919050565b600081546145d881614585565b6145e281866124ae565b945060018216600081146145fd576001811461461357614646565b60ff198316865281151560200286019350614646565b61461c856145b6565b60005b8381101561463e5781548189015260018201915060208101905061461f565b808801955050505b50505092915050565b600061465b83836145cb565b905092915050565b6000600182019050919050565b600061467b82614536565b6146858185613af3565b93508360208202850161469785614541565b8060005b858110156146d2578484038952816146b3858261464f565b94506146be83614663565b925060208a0199505060018101905061469b565b50829750879550505050505092915050565b60006060820190506146f96000830186613ae4565b61470660208301856128ca565b81810360408301526147188184614670565b9050949350505050565b7f64656c65676174696f6e20617070726f76616c206661696c6564000000000000600082015250565b6000614758601a83613cc8565b915061476382614722565b602082019050919050565b600060208201905081810360008301526147878161474b565b9050919050565b60006040820190506147a36000830185613ae4565b6147b060208301846128ca565b9392505050565b7f7472616e73666572206661696c65640000000000000000000000000000000000600082015250565b60006147ed600f83613cc8565b91506147f8826147b7565b602082019050919050565b6000602082019050818103600083015261481c816147e0565b9050919050565b60006060820190506148386000830186613ae4565b818103602083015261484a8185614005565b905061485960408301846128ca565b949350505050565b7f5374616b696e6720417070726f7665206661696c656400000000000000000000600082015250565b6000614897601683613cc8565b91506148a282614861565b602082019050919050565b600060208201905081810360008301526148c68161488a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614907826123cc565b9150614912836123cc565b925082820190508082111561492a576149296148cd565b5b92915050565b600067ffffffffffffffff82111561494b5761494a612714565b5b602082029050602081019050919050565b60008151905061496b81613696565b92915050565b600060c08284031215614987576149866135eb565b5b61499160c0612774565b905060006149a184828501613e47565b60008301525060206149b584828501613e47565b60208301525060406149c984828501613e1b565b60408301525060606149dd84828501613e1b565b60608301525060806149f18482850161495c565b60808301525060a0614a0584828501613e47565b60a08301525092915050565b6000614a24614a1f84614930565b612774565b90508083825260208201905060c08402830185811115614a4757614a46612371565b5b835b81811015614a705780614a5c8882614971565b84526020840193505060c081019050614a49565b5050509392505050565b600082601f830112614a8f57614a8e612367565b5b8151614a9f848260208601614a11565b91505092915050565b600060608284031215614abe57614abd6135eb565b5b614ac86060612774565b9050600082015167ffffffffffffffff811115614ae857614ae76135f0565b5b614af484828501613dc8565b600083015250602082015167ffffffffffffffff811115614b1857614b176135f0565b5b614b2484828501613dc8565b602083015250604082015167ffffffffffffffff811115614b4857614b476135f0565b5b614b5484828501614a7a565b60408301525092915050565b600060208284031215614b7657614b756122ff565b5b600082015167ffffffffffffffff811115614b9457614b93612304565b5b614ba084828501614aa8565b91505092915050565b6000606082019050614bbe6000830186613ae4565b8181036020830152614bd08185614005565b90508181036040830152614be48184614005565b9050949350505050565b600067ffffffffffffffff821115614c0957614c08612714565b5b602082029050602081019050919050565b600060808284031215614c3057614c2f6135eb565b5b614c3a6080612774565b90506000614c4a84828501613e47565b6000830152506020614c5e84828501613e47565b6020830152506040614c7284828501613e1b565b6040830152506060614c8684828501613e1b565b60608301525092915050565b6000614ca5614ca084614bee565b612774565b90508083825260208201905060808402830185811115614cc857614cc7612371565b5b835b81811015614cf15780614cdd8882614c1a565b845260208401935050608081019050614cca565b5050509392505050565b600082601f830112614d1057614d0f612367565b5b8151614d20848260208601614c92565b91505092915050565b600060808284031215614d3f57614d3e6135eb565b5b614d496080612774565b9050600082015167ffffffffffffffff811115614d6957614d686135f0565b5b614d7584828501613dc8565b600083015250602082015167ffffffffffffffff811115614d9957614d986135f0565b5b614da584828501613dc8565b602083015250604082015167ffffffffffffffff811115614dc957614dc86135f0565b5b614dd584828501613dc8565b604083015250606082015167ffffffffffffffff811115614df957614df86135f0565b5b614e0584828501614cfb565b60608301525092915050565b600060208284031215614e2757614e266122ff565b5b600082015167ffffffffffffffff811115614e4557614e44612304565b5b614e5184828501614d29565b91505092915050565b6000608082019050614e6f6000830187613ae4565b8181036020830152614e818186614005565b9050614e9060408301856128ca565b614e9d60608301846128ca565b95945050505050565b7f44656c656761746520417070726f7665206661696c6564000000000000000000600082015250565b6000614edc601783613cc8565b9150614ee782614ea6565b602082019050919050565b60006020820190508181036000830152614f0b81614ecf565b9050919050565b600060a08301614f256000840184613b60565b8583036000870152614f38838284613b0e565b92505050614f496020840184613b60565b8583036020870152614f5c838284613b0e565b92505050614f6d6040840184613b60565b8583036040870152614f80838284613b0e565b92505050614f916060840184613b60565b8583036060870152614fa4838284613b0e565b92505050614fb56080840184613b60565b8583036080870152614fc8838284613b0e565b925050508091505092915050565b6000614fe560208401846123ed565b905092915050565b60608201614ffe6000830183614fd6565b61500b60008501826125c5565b506150196020830183614fd6565b61502660208501826125c5565b506150346040830183614fd6565b61504160408501826125c5565b50505050565b60006101008201905081810360008301526150628189614f12565b90506150716020830188614fed565b61507e60808301876128ca565b61508b60a0830186613ae4565b81810360c083015261509d8185614005565b90506150ac60e08301846128ca565b979650505050505050565b6000602082840312156150cd576150cc6122ff565b5b60006150db84828501613e47565b91505092915050565b60006150ef826123cc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615121576151206148cd565b5b600182019050919050565b6000615137826123cc565b91506000820361514a576151496148cd565b5b600182039050919050565b600060808201905061516a6000830187613ae4565b818103602083015261517c8186614005565b905081810360408301526151908185614005565b905061519f60608301846128ca565b95945050505050565b6151b181613130565b82525050565b600060808201905081810360008301526151d18187614f12565b90506151e06020830186613ae4565b6151ed60408301856151a8565b6151fa60608301846151a8565b95945050505050565b600080833560016020038436030381126152205761521f613b5b565b5b83810192508235915060208301925067ffffffffffffffff82111561524857615247613b51565b5b60018202360383131561525e5761525d613b56565b5b509250929050565b6000615272838561344a565b935061527f8385846127c0565b615288836124e9565b840190509392505050565b60006152a260208401846136ad565b905092915050565b60006152b960208401846136d9565b905092915050565b600060a083016152d46000840184615203565b85830360008701526152e7838284615266565b925050506152f86020840184615293565b6153056020860182612aad565b506153136040840184615293565b6153206040860182612aad565b5061532e60608401846152aa565b61533b606086018261253f565b5061534960808401846152aa565b615356608086018261253f565b508091505092915050565b6000604082019050818103600083015261537b8185614005565b9050818103602083015261538f81846152c1565b90509392505050565b600067ffffffffffffffff8211156153b3576153b2612714565b5b602082029050602081019050919050565b60006153d76153d284615398565b612774565b905080838252602082019050602084028301858111156153fa576153f9612371565b5b835b8181101561544157805167ffffffffffffffff81111561541f5761541e612367565b5b80860161542c8982613e5c565b855260208501945050506020810190506153fc565b5050509392505050565b600082601f8301126154605761545f612367565b5b81516154708482602086016153c4565b91505092915050565b600061548c615487846135f5565b612774565b9050828152602081018484840111156154a8576154a761270f565b5b6154b38482856124bf565b509392505050565b600082601f8301126154d0576154cf612367565b5b81516154e0848260208601615479565b91505092915050565b6000604082840312156154ff576154fe6135eb565b5b6155096040612774565b9050600082015167ffffffffffffffff811115615529576155286135f0565b5b615535848285016154bb565b60008301525060206155498482850161495c565b60208301525092915050565b6000806040838503121561556c5761556b6122ff565b5b600083015167ffffffffffffffff81111561558a57615589612304565b5b6155968582860161544b565b925050602083015167ffffffffffffffff8111156155b7576155b6612304565b5b6155c3858286016154e9565b9150509250929050565b60006060820190506155e26000830186613ae4565b6155ef6020830185613ae4565b81810360408301526156018184614005565b9050949350505050565b600060208284031215615621576156206122ff565b5b600061562f84828501613e1b565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b6000819050602082019050919050565b600061568e83836124fa565b905092915050565b6000602082019050919050565b60006156ae82615667565b6156b88185613af3565b9350836020820285016156ca85615672565b8060005b8581101561570657848403895281516156e78582615682565b94506156f283615696565b925060208a019950506001810190506156ce565b50829750879550505050505092915050565b600060608201905061572d6000830186613ae4565b61573a60208301856128ca565b818103604083015261574c81846156a3565b9050949350505050565b7f6661696c656420746f20617070726f766520756e64656c65676174696f6e206d60008201527f6574686f64000000000000000000000000000000000000000000000000000000602082015250565b60006157b2602583613cc8565b91506157bd82615756565b604082019050919050565b600060208201905081810360008301526157e1816157a5565b9050919050565b60006040820190506157fd6000830186613ae4565b8181036020830152615810818486613bd0565b9050949350505050565b7f4661696c656420746f207265766f6b6520617070726f76616c20666f7220737460008201527f616b696e67206d6574686f647300000000000000000000000000000000000000602082015250565b6000615876602d83613cc8565b91506158818261581a565b604082019050919050565b600060208201905081810360008301526158a581615869565b9050919050565b600060a08301600083015184820360008601526158c9828261345b565b91505060208301516158de6020860182612aad565b5060408301516158f16040860182612aad565b506060830151615904606086018261253f565b506080830151615917608086018261253f565b508091505092915050565b60006080820190506159376000830187613ae4565b81810360208301526159498186614005565b9050818103604083015261595d8185614005565b9050818103606083015261597181846158ac565b905095945050505050565b600067ffffffffffffffff82111561599757615996612714565b5b602082029050602081019050919050565b6000608082840312156159be576159bd6135eb565b5b6159c86080612774565b9050600082015167ffffffffffffffff8111156159e8576159e76135f0565b5b6159f484828501613dc8565b600083015250602082015167ffffffffffffffff811115615a1857615a176135f0565b5b615a2484828501613dc8565b602083015250604082015167ffffffffffffffff811115615a4857615a476135f0565b5b615a5484828501613dc8565b604083015250606082015167ffffffffffffffff811115615a7857615a776135f0565b5b615a8484828501614cfb565b60608301525092915050565b600067ffffffffffffffff821115615aab57615aaa612714565b5b602082029050602081019050919050565b600060a08284031215615ad257615ad16135eb565b5b615adc6040612774565b90506000615aec84828501614c1a565b6000830152506080615b0084828501613e1b565b60208301525092915050565b6000615b1f615b1a84615a90565b612774565b90508083825260208201905060a08402830185811115615b4257615b41612371565b5b835b81811015615b6b5780615b578882615abc565b84526020840193505060a081019050615b44565b5050509392505050565b600082601f830112615b8a57615b89612367565b5b8151615b9a848260208601615b0c565b91505092915050565b600060408284031215615bb957615bb86135eb565b5b615bc36040612774565b9050600082015167ffffffffffffffff811115615be357615be26135f0565b5b615bef848285016159a8565b600083015250602082015167ffffffffffffffff811115615c1357615c126135f0565b5b615c1f84828501615b75565b60208301525092915050565b6000615c3e615c398461597c565b612774565b90508083825260208201905060208402830185811115615c6157615c60612371565b5b835b81811015615ca857805167ffffffffffffffff811115615c8657615c85612367565b5b808601615c938982615ba3565b85526020850194505050602081019050615c63565b5050509392505050565b600082601f830112615cc757615cc6612367565b5b8151615cd7848260208601615c2b565b91505092915050565b60008060408385031215615cf757615cf66122ff565b5b600083015167ffffffffffffffff811115615d1557615d14612304565b5b615d2185828601615cb2565b925050602083015167ffffffffffffffff811115615d4257615d41612304565b5b615d4e858286016154e9565b915050925092905056fe2f636f736d6f732e7374616b696e672e763162657461312e4d7367556e64656c6567617465a2646970667358221220610cb91a8933e1804929f56c9cd7a1adc794d98816aa48df9e694b7cd16e831b64736f6c634300081300332f636f736d6f732e7374616b696e672e763162657461312e4d736744656c6567617465", - "deployedBytecode": "0x60806040526004361061014b5760003560e01c80637e51b811116100b6578063cf2753cf1161006f578063cf2753cf146104a8578063ec9485df146104e6578063f40a214614610523578063f5714e641461054c578063f700dbd214610568578063f732b065146105915761014b565b80637e51b811146103965780638939e783146103bf5780638edb3f8b146103e85780639eab671114610404578063af9a90b21461042d578063b13d42421461046a5761014b565b806355dc4b221161010857806355dc4b2214610283578063570467ac146102ac5780635e269bfe146102e957806360deaa2a1461031257806361bc221a1461032e57806368ac3df3146103595761014b565b80630a4433e2146101505780631904bb2e1461017957806319b16c4c146101b657806331bcbcb3146101f45780633566cb951461021d578063455b855114610246575b600080fd5b34801561015c57600080fd5b5061017760048036038101906101729190612402565b6105cf565b005b34801561018557600080fd5b506101a0600480360381019061019b9190612476565b61069e565b6040516101ad91906126ed565b60405180910390f35b3480156101c257600080fd5b506101dd60048036038101906101d8919061283f565b61072e565b6040516101eb929190612916565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612946565b610c2d565b005b34801561022957600080fd5b50610244600480360381019061023f91906129b5565b610eba565b005b34801561025257600080fd5b5061026d60048036038101906102689190612a11565b611022565b60405161027a9190612c18565b60405180910390f35b34801561028f57600080fd5b506102aa60048036038101906102a59190612c3a565b6110b5565b005b3480156102b857600080fd5b506102d360048036038101906102ce919061283f565b6114a7565b6040516102e09190612e55565b60405180910390f35b3480156102f557600080fd5b50610310600480360381019061030b9190612e77565b61153d565b005b61032c60048036038101906103279190612efa565b6115c8565b005b34801561033a57600080fd5b50610343611716565b6040516103509190612f43565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b9190612fa1565b61171c565b60405161038d9190613076565b60405180910390f35b3480156103a257600080fd5b506103bd60048036038101906103b89190612946565b6117b2565b005b3480156103cb57600080fd5b506103e660048036038101906103e19190612946565b61183a565b005b61040260048036038101906103fd9190612efa565b6118f0565b005b34801561041057600080fd5b5061042b60048036038101906104269190613091565b611a85565b005b34801561043957600080fd5b50610454600480360381019061044f9190613166565b611b10565b6040516104619190613076565b60405180910390f35b34801561047657600080fd5b50610491600480360381019061048c9190613208565b611ba0565b60405161049f9291906134d1565b60405180910390f35b3480156104b457600080fd5b506104cf60048036038101906104ca9190612a11565b611c38565b6040516104dd929190612916565b60405180910390f35b3480156104f257600080fd5b5061050d60048036038101906105089190612a11565b611cd0565b60405161051a9190612f43565b60405180910390f35b34801561052f57600080fd5b5061054a60048036038101906105459190613508565b611d5a565b005b61056660048036038101906105619190612efa565b611f36565b005b34801561057457600080fd5b5061058f600480360381019061058a919061358b565b612090565b005b34801561059d57600080fd5b506105b860048036038101906105b39190613796565b61215c565b6040516105c6929190613aad565b60405180910390f35b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895868487876040518563ffffffff1660e01b81526004016106129493929190613c46565b6020604051808303816000875af1158015610631573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106559190613c9b565b905080610697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068e90613d4b565b60405180910390fd5b5050505050565b6106a66121fa565b61080073ffffffffffffffffffffffffffffffffffffffff1663223b3b7a836040518263ffffffff1660e01b81526004016106e19190613d6b565b600060405180830381865afa1580156106fe573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906107279190613fbc565b9050919050565b600061073861226e565b600061080090506000868660405160240161075492919061403e565b6040516020818303038152906040527f241774e6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000856040516020016107e691906140aa565b60405160208183030381529060405280519060200120905060405160200161080d9061410d565b6040516020818303038152906040528051906020012081036108f9576000808473ffffffffffffffffffffffffffffffffffffffff1684604051610851919061415e565b600060405180830381855af49150503d806000811461088c576040519150601f19603f3d011682016040523d82523d6000602084013e610891565b606091505b5091509150816108d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cd906141e7565b60405180910390fd5b808060200190518101906108ea9190614273565b80975081985050505050610c22565b6040516020016109089061431b565b6040516020818303038152906040528051906020012081036109f4576000808473ffffffffffffffffffffffffffffffffffffffff168460405161094c919061415e565b600060405180830381855afa9150503d8060008114610987576040519150601f19603f3d011682016040523d82523d6000602084013e61098c565b606091505b5091509150816109d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c89061437c565b60405180910390fd5b808060200190518101906109e59190614273565b80975081985050505050610c21565b604051602001610a03906143e8565b604051602081830303815290604052805190602001208103610af1576000808473ffffffffffffffffffffffffffffffffffffffff1684604051610a47919061415e565b6000604051808303816000865af19150503d8060008114610a84576040519150601f19603f3d011682016040523d82523d6000602084013e610a89565b606091505b509150915081610ace576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac590614449565b60405180910390fd5b80806020019051810190610ae29190614273565b80975081985050505050610c20565b604051602001610b00906144b5565b604051602081830303815290604052805190602001208103610be45760006040518060400160405280601a81526020017f64656c65676174696f6e28616464726573732c737472696e6729000000000000815250805190602001209050600060a490506060600060208b01516020808d0101516040518681528e6004820152604060248201526033604482015282606482015281608482015260c081878360008e5af281519c5060608201519450610100820160405280610bc057600080fd5b50505050604051806040016040528083815260200182815250975050505050610c1f565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1690614516565b60405180910390fd5b5b5b5b505050935093915050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895308460016040518463ffffffff1660e01b8152600401610c6f939291906146e4565b6020604051808303816000875af1158015610c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb29190613c9b565b905080610cf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ceb9061476e565b60405180910390fd5b60008473ffffffffffffffffffffffffffffffffffffffff163384604051602401610d2092919061478e565b6040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610daa919061415e565b6000604051808303816000865af19150503d8060008114610de7576040519150601f19603f3d011682016040523d82523d6000602084013e610dec565b606091505b5050905080610e30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2790614803565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3386866040518463ffffffff1660e01b8152600401610e6f93929190614823565b6020604051808303816000875af1158015610e8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb29190613c9b565b505050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895308460016040518463ffffffff1660e01b8152600401610efc939291906146e4565b6020604051808303816000875af1158015610f1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3f9190613c9b565b905080610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f78906148ad565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3085856040518463ffffffff1660e01b8152600401610fc093929190614823565b6020604051808303816000875af1158015610fdf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110039190613c9b565b50600160008082825461101691906148fc565b92505081905550505050565b61102a612288565b61080073ffffffffffffffffffffffffffffffffffffffff1663a03ffee184846040518363ffffffff1660e01b815260040161106792919061403e565b600060405180830381865afa158015611084573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906110ad9190614b60565b905092915050565b6000610800905060008585856040516024016110d393929190614823565b6040516020818303038152906040527f3edab33c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905060008360405160200161116591906140aa565b60405160208183030381529060405280519060200120905060405160200161118c9061410d565b6040516020818303038152906040528051906020012081036112595760008373ffffffffffffffffffffffffffffffffffffffff16836040516111cf919061415e565b600060405180830381855af49150503d806000811461120a576040519150601f19603f3d011682016040523d82523d6000602084013e61120f565b606091505b5050905080611253576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124a906141e7565b60405180910390fd5b5061149e565b6040516020016112689061431b565b6040516020818303038152906040528051906020012081036113355760008373ffffffffffffffffffffffffffffffffffffffff16836040516112ab919061415e565b600060405180830381855afa9150503d80600081146112e6576040519150601f19603f3d011682016040523d82523d6000602084013e6112eb565b606091505b505090508061132f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113269061437c565b60405180910390fd5b5061149d565b604051602001611344906143e8565b6040516020818303038152906040528051906020012081036114135760008373ffffffffffffffffffffffffffffffffffffffff1683604051611387919061415e565b6000604051808303816000865af19150503d80600081146113c4576040519150601f19603f3d011682016040523d82523d6000602084013e6113c9565b606091505b505090508061140d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140490614449565b60405180910390fd5b5061149c565b604051602001611422906144b5565b6040516020818303038152906040528051906020012081036114605760208201825160008082846000895af28061145857600080fd5b50505061149b565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149290614516565b60405180910390fd5b5b5b5b50505050505050565b6114af6122a9565b61080073ffffffffffffffffffffffffffffffffffffffff16637d9f939c8585856040518463ffffffff1660e01b81526004016114ee93929190614ba9565b600060405180830381865afa15801561150b573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906115349190614e11565b90509392505050565b61080073ffffffffffffffffffffffffffffffffffffffff166312d58dfe858585856040518563ffffffff1660e01b815260040161157e9493929190614e5a565b6020604051808303816000875af115801561159d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c19190613c9b565b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895303460016040518463ffffffff1660e01b815260040161160a939291906146e4565b6020604051808303816000875af1158015611629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164d9190613c9b565b90508061168f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168690614ef2565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3084346040518463ffffffff1660e01b81526004016116ce93929190614823565b6020604051808303816000875af11580156116ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117119190613c9b565b505050565b60005481565b600061080073ffffffffffffffffffffffffffffffffffffffff1663f7cd55168888888888886040518763ffffffff1660e01b815260040161176396959493929190615047565b6020604051808303816000875af1158015611782573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a69190613c9b565b90509695505050505050565b61080073ffffffffffffffffffffffffffffffffffffffff16633edab33c8484846040518463ffffffff1660e01b81526004016117f193929190614823565b6020604051808303816000875af1158015611810573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061183491906150b7565b50505050565b60008081548092919061184c906150e4565b919050555061080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8484846040518463ffffffff1660e01b815260040161189093929190614823565b6020604051808303816000875af11580156118af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d39190613c9b565b506000808154809291906118e69061512c565b9190505550505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895323460016040518463ffffffff1660e01b8152600401611932939291906146e4565b6020604051808303816000875af1158015611951573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119759190613c9b565b9050806119b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ae90614ef2565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3084346040518463ffffffff1660e01b81526004016119f693929190614823565b6020604051808303816000875af1158015611a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a399190613c9b565b503373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015611a80573d6000803e3d6000fd5b505050565b61080073ffffffffffffffffffffffffffffffffffffffff166354b826f5858585856040518563ffffffff1660e01b8152600401611ac69493929190615155565b6020604051808303816000875af1158015611ae5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0991906150b7565b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663a50f05ac868686866040518563ffffffff1660e01b8152600401611b5394939291906151b7565b6020604051808303816000875af1158015611b72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b969190613c9b565b9050949350505050565b6060611baa6122d1565b61080073ffffffffffffffffffffffffffffffffffffffff1663186b216785856040518363ffffffff1660e01b8152600401611be7929190615361565b600060405180830381865afa158015611c04573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611c2d9190615555565b915091509250929050565b6000611c4261226e565b61080073ffffffffffffffffffffffffffffffffffffffff1663241774e685856040518363ffffffff1660e01b8152600401611c7f92919061403e565b600060405180830381865afa158015611c9c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611cc59190614273565b915091509250929050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663fc08930c8433856040518463ffffffff1660e01b8152600401611d11939291906155cd565b602060405180830381865afa158015611d2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d52919061560b565b905092915050565b6000600167ffffffffffffffff811115611d7757611d76612714565b5b604051908082528060200260200182016040528015611daa57816020015b6060815260200190600190039081611d955790505b509050604051806060016040528060258152602001615d596025913981600081518110611dda57611dd9615638565b5b6020026020010181905250600061080073ffffffffffffffffffffffffffffffffffffffff1663b60398958787856040518463ffffffff1660e01b8152600401611e2693929190615718565b6020604051808303816000875af1158015611e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e699190613c9b565b905080611eab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea2906157c8565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff16633edab33c3285876040518463ffffffff1660e01b8152600401611eea93929190614823565b6020604051808303816000875af1158015611f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2d91906150b7565b50505050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895323460016040518463ffffffff1660e01b8152600401611f78939291906146e4565b6020604051808303816000875af1158015611f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbb9190613c9b565b905080611ffd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff490614ef2565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb308460013461202a91906148fc565b6040518463ffffffff1660e01b815260040161204893929190614823565b6020604051808303816000875af1158015612067573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208b9190613c9b565b505050565b600061080073ffffffffffffffffffffffffffffffffffffffff166361dc5c3b8585856040518463ffffffff1660e01b81526004016120d1939291906157e8565b6020604051808303816000875af11580156120f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121149190613c9b565b905080612156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214d9061588c565b60405180910390fd5b50505050565b60606121666122d1565b61080073ffffffffffffffffffffffffffffffffffffffff166310a2851c878787876040518563ffffffff1660e01b81526004016121a79493929190615922565b600060405180830381865afa1580156121c4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906121ed9190615ce0565b9150915094509492505050565b6040518061016001604052806060815260200160608152602001600015158152602001600060038111156122315761223061254e565b5b8152602001600081526020016000815260200160608152602001600060070b8152602001600060070b815260200160008152602001600081525090565b604051806040016040528060608152602001600081525090565b60405180606001604052806060815260200160608152602001606081525090565b6040518060800160405280606081526020016060815260200160608152602001606081525090565b604051806040016040528060608152602001600067ffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061233482612309565b9050919050565b61234481612329565b811461234f57600080fd5b50565b6000813590506123618161233b565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261238c5761238b612367565b5b8235905067ffffffffffffffff8111156123a9576123a861236c565b5b6020830191508360208202830111156123c5576123c4612371565b5b9250929050565b6000819050919050565b6123df816123cc565b81146123ea57600080fd5b50565b6000813590506123fc816123d6565b92915050565b6000806000806060858703121561241c5761241b6122ff565b5b600061242a87828801612352565b945050602085013567ffffffffffffffff81111561244b5761244a612304565b5b61245787828801612376565b9350935050604061246a878288016123ed565b91505092959194509250565b60006020828403121561248c5761248b6122ff565b5b600061249a84828501612352565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156124dd5780820151818401526020810190506124c2565b60008484015250505050565b6000601f19601f8301169050919050565b6000612505826124a3565b61250f81856124ae565b935061251f8185602086016124bf565b612528816124e9565b840191505092915050565b60008115159050919050565b61254881612533565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061258e5761258d61254e565b5b50565b600081905061259f8261257d565b919050565b60006125af82612591565b9050919050565b6125bf816125a4565b82525050565b6125ce816123cc565b82525050565b60008160070b9050919050565b6125ea816125d4565b82525050565b600061016083016000830151848203600086015261260e82826124fa565b9150506020830151848203602086015261262882826124fa565b915050604083015161263d604086018261253f565b50606083015161265060608601826125b6565b50608083015161266360808601826125c5565b5060a083015161267660a08601826125c5565b5060c083015184820360c086015261268e82826124fa565b91505060e08301516126a360e08601826125e1565b506101008301516126b86101008601826125e1565b506101208301516126cd6101208601826125c5565b506101408301516126e26101408601826125c5565b508091505092915050565b6000602082019050818103600083015261270781846125f0565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61274c826124e9565b810181811067ffffffffffffffff8211171561276b5761276a612714565b5b80604052505050565b600061277e6122f5565b905061278a8282612743565b919050565b600067ffffffffffffffff8211156127aa576127a9612714565b5b6127b3826124e9565b9050602081019050919050565b82818337600083830152505050565b60006127e26127dd8461278f565b612774565b9050828152602081018484840111156127fe576127fd61270f565b5b6128098482856127c0565b509392505050565b600082601f83011261282657612825612367565b5b81356128368482602086016127cf565b91505092915050565b600080600060608486031215612858576128576122ff565b5b600061286686828701612352565b935050602084013567ffffffffffffffff81111561288757612886612304565b5b61289386828701612811565b925050604084013567ffffffffffffffff8111156128b4576128b3612304565b5b6128c086828701612811565b9150509250925092565b6128d3816123cc565b82525050565b600060408301600083015184820360008601526128f682826124fa565b915050602083015161290b60208601826125c5565b508091505092915050565b600060408201905061292b60008301856128ca565b818103602083015261293d81846128d9565b90509392505050565b60008060006060848603121561295f5761295e6122ff565b5b600061296d86828701612352565b935050602084013567ffffffffffffffff81111561298e5761298d612304565b5b61299a86828701612811565b92505060406129ab868287016123ed565b9150509250925092565b600080604083850312156129cc576129cb6122ff565b5b600083013567ffffffffffffffff8111156129ea576129e9612304565b5b6129f685828601612811565b9250506020612a07858286016123ed565b9150509250929050565b60008060408385031215612a2857612a276122ff565b5b6000612a3685828601612352565b925050602083013567ffffffffffffffff811115612a5757612a56612304565b5b612a6385828601612811565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600067ffffffffffffffff82169050919050565b612ab681612a99565b82525050565b60c082016000820151612ad260008501826125e1565b506020820151612ae560208501826125e1565b506040820151612af860408501826125c5565b506060820151612b0b60608501826125c5565b506080820151612b1e6080850182612aad565b5060a0820151612b3160a08501826125e1565b50505050565b6000612b438383612abc565b60c08301905092915050565b6000602082019050919050565b6000612b6782612a6d565b612b718185612a78565b9350612b7c83612a89565b8060005b83811015612bad578151612b948882612b37565b9750612b9f83612b4f565b925050600181019050612b80565b5085935050505092915050565b60006060830160008301518482036000860152612bd782826124fa565b91505060208301518482036020860152612bf182826124fa565b91505060408301518482036040860152612c0b8282612b5c565b9150508091505092915050565b60006020820190508181036000830152612c328184612bba565b905092915050565b60008060008060808587031215612c5457612c536122ff565b5b6000612c6287828801612352565b945050602085013567ffffffffffffffff811115612c8357612c82612304565b5b612c8f87828801612811565b9350506040612ca0878288016123ed565b925050606085013567ffffffffffffffff811115612cc157612cc0612304565b5b612ccd87828801612811565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b608082016000820151612d1b60008501826125e1565b506020820151612d2e60208501826125e1565b506040820151612d4160408501826125c5565b506060820151612d5460608501826125c5565b50505050565b6000612d668383612d05565b60808301905092915050565b6000602082019050919050565b6000612d8a82612cd9565b612d948185612ce4565b9350612d9f83612cf5565b8060005b83811015612dd0578151612db78882612d5a565b9750612dc283612d72565b925050600181019050612da3565b5085935050505092915050565b60006080830160008301518482036000860152612dfa82826124fa565b91505060208301518482036020860152612e1482826124fa565b91505060408301518482036040860152612e2e82826124fa565b91505060608301518482036060860152612e488282612d7f565b9150508091505092915050565b60006020820190508181036000830152612e6f8184612ddd565b905092915050565b60008060008060808587031215612e9157612e906122ff565b5b6000612e9f87828801612352565b945050602085013567ffffffffffffffff811115612ec057612ebf612304565b5b612ecc87828801612811565b9350506040612edd878288016123ed565b9250506060612eee878288016123ed565b91505092959194509250565b600060208284031215612f1057612f0f6122ff565b5b600082013567ffffffffffffffff811115612f2e57612f2d612304565b5b612f3a84828501612811565b91505092915050565b6000602082019050612f5860008301846128ca565b92915050565b600080fd5b600060a08284031215612f7957612f78612f5e565b5b81905092915050565b600060608284031215612f9857612f97612f5e565b5b81905092915050565b6000806000806000806101008789031215612fbf57612fbe6122ff565b5b600087013567ffffffffffffffff811115612fdd57612fdc612304565b5b612fe989828a01612f63565b9650506020612ffa89828a01612f82565b955050608061300b89828a016123ed565b94505060a061301c89828a01612352565b93505060c087013567ffffffffffffffff81111561303d5761303c612304565b5b61304989828a01612811565b92505060e061305a89828a016123ed565b9150509295509295509295565b61307081612533565b82525050565b600060208201905061308b6000830184613067565b92915050565b600080600080608085870312156130ab576130aa6122ff565b5b60006130b987828801612352565b945050602085013567ffffffffffffffff8111156130da576130d9612304565b5b6130e687828801612811565b935050604085013567ffffffffffffffff81111561310757613106612304565b5b61311387828801612811565b9250506060613124878288016123ed565b91505092959194509250565b6000819050919050565b61314381613130565b811461314e57600080fd5b50565b6000813590506131608161313a565b92915050565b600080600080608085870312156131805761317f6122ff565b5b600085013567ffffffffffffffff81111561319e5761319d612304565b5b6131aa87828801612f63565b94505060206131bb87828801612352565b93505060406131cc87828801613151565b92505060606131dd87828801613151565b91505092959194509250565b600060a082840312156131ff576131fe612f5e565b5b81905092915050565b6000806040838503121561321f5761321e6122ff565b5b600083013567ffffffffffffffff81111561323d5761323c612304565b5b61324985828601612811565b925050602083013567ffffffffffffffff81111561326a57613269612304565b5b613276858286016131e9565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006101608301600083015184820360008601526132ca82826124fa565b915050602083015184820360208601526132e482826124fa565b91505060408301516132f9604086018261253f565b50606083015161330c60608601826125b6565b50608083015161331f60808601826125c5565b5060a083015161333260a08601826125c5565b5060c083015184820360c086015261334a82826124fa565b91505060e083015161335f60e08601826125e1565b506101008301516133746101008601826125e1565b506101208301516133896101208601826125c5565b5061014083015161339e6101408601826125c5565b508091505092915050565b60006133b583836132ac565b905092915050565b6000602082019050919050565b60006133d582613280565b6133df818561328b565b9350836020820285016133f18561329c565b8060005b8581101561342d578484038952815161340e85826133a9565b9450613419836133bd565b925060208a019950506001810190506133f5565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b60006134668261343f565b613470818561344a565b93506134808185602086016124bf565b613489816124e9565b840191505092915050565b600060408301600083015184820360008601526134b1828261345b565b91505060208301516134c66020860182612aad565b508091505092915050565b600060408201905081810360008301526134eb81856133ca565b905081810360208301526134ff8184613494565b90509392505050565b60008060008060808587031215613522576135216122ff565b5b600061353087828801612352565b9450506020613541878288016123ed565b9350506040613552878288016123ed565b925050606085013567ffffffffffffffff81111561357357613572612304565b5b61357f87828801612811565b91505092959194509250565b6000806000604084860312156135a4576135a36122ff565b5b60006135b286828701612352565b935050602084013567ffffffffffffffff8111156135d3576135d2612304565b5b6135df86828701612376565b92509250509250925092565b600080fd5b600080fd5b600067ffffffffffffffff8211156136105761360f612714565b5b613619826124e9565b9050602081019050919050565b6000613639613634846135f5565b612774565b9050828152602081018484840111156136555761365461270f565b5b6136608482856127c0565b509392505050565b600082601f83011261367d5761367c612367565b5b813561368d848260208601613626565b91505092915050565b61369f81612a99565b81146136aa57600080fd5b50565b6000813590506136bc81613696565b92915050565b6136cb81612533565b81146136d657600080fd5b50565b6000813590506136e8816136c2565b92915050565b600060a08284031215613704576137036135eb565b5b61370e60a0612774565b9050600082013567ffffffffffffffff81111561372e5761372d6135f0565b5b61373a84828501613668565b600083015250602061374e848285016136ad565b6020830152506040613762848285016136ad565b6040830152506060613776848285016136d9565b606083015250608061378a848285016136d9565b60808301525092915050565b600080600080608085870312156137b0576137af6122ff565b5b60006137be87828801612352565b945050602085013567ffffffffffffffff8111156137df576137de612304565b5b6137eb87828801612811565b935050604085013567ffffffffffffffff81111561380c5761380b612304565b5b61381887828801612811565b925050606085013567ffffffffffffffff81111561383957613838612304565b5b613845878288016136ee565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000608083016000830151848203600086015261389a82826124fa565b915050602083015184820360208601526138b482826124fa565b915050604083015184820360408601526138ce82826124fa565b915050606083015184820360608601526138e88282612d7f565b9150508091505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60a0820160008201516139376000850182612d05565b50602082015161394a60808501826125c5565b50505050565b600061395c8383613921565b60a08301905092915050565b6000602082019050919050565b6000613980826138f5565b61398a8185613900565b935061399583613911565b8060005b838110156139c65781516139ad8882613950565b97506139b883613968565b925050600181019050613999565b5085935050505092915050565b600060408301600083015184820360008601526139f0828261387d565b91505060208301518482036020860152613a0a8282613975565b9150508091505092915050565b6000613a2383836139d3565b905092915050565b6000602082019050919050565b6000613a4382613851565b613a4d818561385c565b935083602082028501613a5f8561386d565b8060005b85811015613a9b5784840389528151613a7c8582613a17565b9450613a8783613a2b565b925060208a01995050600181019050613a63565b50829750879550505050505092915050565b60006040820190508181036000830152613ac78185613a38565b90508181036020830152613adb8184613494565b90509392505050565b613aed81612329565b82525050565b600082825260208201905092915050565b6000819050919050565b6000613b1a83856124ae565b9350613b278385846127c0565b613b30836124e9565b840190509392505050565b6000613b48848484613b0e565b90509392505050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613b7d57613b7c613b5b565b5b83810192508235915060208301925067ffffffffffffffff821115613ba557613ba4613b51565b5b600182023603831315613bbb57613bba613b56565b5b509250929050565b6000602082019050919050565b6000613bdc8385613af3565b935083602084028501613bee84613b04565b8060005b87811015613c34578484038952613c098284613b60565b613c14868284613b3b565b9550613c1f84613bc3565b935060208b019a505050600181019050613bf2565b50829750879450505050509392505050565b6000606082019050613c5b6000830187613ae4565b613c6860208301866128ca565b8181036040830152613c7b818486613bd0565b905095945050505050565b600081519050613c95816136c2565b92915050565b600060208284031215613cb157613cb06122ff565b5b6000613cbf84828501613c86565b91505092915050565b600082825260208201905092915050565b7f4661696c656420746f20617070726f7665207374616b696e67206d6574686f6460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d35602183613cc8565b9150613d4082613cd9565b604082019050919050565b60006020820190508181036000830152613d6481613d28565b9050919050565b6000602082019050613d806000830184613ae4565b92915050565b6000613d99613d948461278f565b612774565b905082815260208101848484011115613db557613db461270f565b5b613dc08482856124bf565b509392505050565b600082601f830112613ddd57613ddc612367565b5b8151613ded848260208601613d86565b91505092915050565b60048110613e0357600080fd5b50565b600081519050613e1581613df6565b92915050565b600081519050613e2a816123d6565b92915050565b613e39816125d4565b8114613e4457600080fd5b50565b600081519050613e5681613e30565b92915050565b60006101608284031215613e7357613e726135eb565b5b613e7e610160612774565b9050600082015167ffffffffffffffff811115613e9e57613e9d6135f0565b5b613eaa84828501613dc8565b600083015250602082015167ffffffffffffffff811115613ece57613ecd6135f0565b5b613eda84828501613dc8565b6020830152506040613eee84828501613c86565b6040830152506060613f0284828501613e06565b6060830152506080613f1684828501613e1b565b60808301525060a0613f2a84828501613e1b565b60a08301525060c082015167ffffffffffffffff811115613f4e57613f4d6135f0565b5b613f5a84828501613dc8565b60c08301525060e0613f6e84828501613e47565b60e083015250610100613f8384828501613e47565b61010083015250610120613f9984828501613e1b565b61012083015250610140613faf84828501613e1b565b6101408301525092915050565b600060208284031215613fd257613fd16122ff565b5b600082015167ffffffffffffffff811115613ff057613fef612304565b5b613ffc84828501613e5c565b91505092915050565b6000614010826124a3565b61401a8185613cc8565b935061402a8185602086016124bf565b614033816124e9565b840191505092915050565b60006040820190506140536000830185613ae4565b81810360208301526140658184614005565b90509392505050565b600081905092915050565b6000614084826124a3565b61408e818561406e565b935061409e8185602086016124bf565b80840191505092915050565b60006140b68284614079565b915081905092915050565b7f64656c656761746563616c6c0000000000000000000000000000000000000000600082015250565b60006140f7600c8361406e565b9150614102826140c1565b600c82019050919050565b6000614118826140ea565b9150819050919050565b600081905092915050565b60006141388261343f565b6141428185614122565b93506141528185602086016124bf565b80840191505092915050565b600061416a828461412d565b915081905092915050565b7f6661696c65642064656c656761746563616c6c20746f20707265636f6d70696c60008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b60006141d1602183613cc8565b91506141dc82614175565b604082019050919050565b60006020820190508181036000830152614200816141c4565b9050919050565b60006040828403121561421d5761421c6135eb565b5b6142276040612774565b9050600082015167ffffffffffffffff811115614247576142466135f0565b5b61425384828501613dc8565b600083015250602061426784828501613e1b565b60208301525092915050565b6000806040838503121561428a576142896122ff565b5b600061429885828601613e1b565b925050602083015167ffffffffffffffff8111156142b9576142b8612304565b5b6142c585828601614207565b9150509250929050565b7f73746174696363616c6c00000000000000000000000000000000000000000000600082015250565b6000614305600a8361406e565b9150614310826142cf565b600a82019050919050565b6000614326826142f8565b9150819050919050565b7f6661696c65642073746174696363616c6c20746f20707265636f6d70696c6500600082015250565b6000614366601f83613cc8565b915061437182614330565b602082019050919050565b6000602082019050818103600083015261439581614359565b9050919050565b7f63616c6c00000000000000000000000000000000000000000000000000000000600082015250565b60006143d260048361406e565b91506143dd8261439c565b600482019050919050565b60006143f3826143c5565b9150819050919050565b7f6661696c65642063616c6c20746f20707265636f6d70696c6500000000000000600082015250565b6000614433601983613cc8565b915061443e826143fd565b602082019050919050565b6000602082019050818103600083015261446281614426565b9050919050565b7f63616c6c636f6465000000000000000000000000000000000000000000000000600082015250565b600061449f60088361406e565b91506144aa82614469565b600882019050919050565b60006144c082614492565b9150819050919050565b7f696e76616c69642063616c6c7479706500000000000000000000000000000000600082015250565b6000614500601083613cc8565b915061450b826144ca565b602082019050919050565b6000602082019050818103600083015261452f816144f3565b9050919050565b600081549050919050565b60008190508160005260206000209050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061459d57607f821691505b6020821081036145b0576145af614556565b5b50919050565b60008190508160005260206000209050919050565b600081546145d881614585565b6145e281866124ae565b945060018216600081146145fd576001811461461357614646565b60ff198316865281151560200286019350614646565b61461c856145b6565b60005b8381101561463e5781548189015260018201915060208101905061461f565b808801955050505b50505092915050565b600061465b83836145cb565b905092915050565b6000600182019050919050565b600061467b82614536565b6146858185613af3565b93508360208202850161469785614541565b8060005b858110156146d2578484038952816146b3858261464f565b94506146be83614663565b925060208a0199505060018101905061469b565b50829750879550505050505092915050565b60006060820190506146f96000830186613ae4565b61470660208301856128ca565b81810360408301526147188184614670565b9050949350505050565b7f64656c65676174696f6e20617070726f76616c206661696c6564000000000000600082015250565b6000614758601a83613cc8565b915061476382614722565b602082019050919050565b600060208201905081810360008301526147878161474b565b9050919050565b60006040820190506147a36000830185613ae4565b6147b060208301846128ca565b9392505050565b7f7472616e73666572206661696c65640000000000000000000000000000000000600082015250565b60006147ed600f83613cc8565b91506147f8826147b7565b602082019050919050565b6000602082019050818103600083015261481c816147e0565b9050919050565b60006060820190506148386000830186613ae4565b818103602083015261484a8185614005565b905061485960408301846128ca565b949350505050565b7f5374616b696e6720417070726f7665206661696c656400000000000000000000600082015250565b6000614897601683613cc8565b91506148a282614861565b602082019050919050565b600060208201905081810360008301526148c68161488a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614907826123cc565b9150614912836123cc565b925082820190508082111561492a576149296148cd565b5b92915050565b600067ffffffffffffffff82111561494b5761494a612714565b5b602082029050602081019050919050565b60008151905061496b81613696565b92915050565b600060c08284031215614987576149866135eb565b5b61499160c0612774565b905060006149a184828501613e47565b60008301525060206149b584828501613e47565b60208301525060406149c984828501613e1b565b60408301525060606149dd84828501613e1b565b60608301525060806149f18482850161495c565b60808301525060a0614a0584828501613e47565b60a08301525092915050565b6000614a24614a1f84614930565b612774565b90508083825260208201905060c08402830185811115614a4757614a46612371565b5b835b81811015614a705780614a5c8882614971565b84526020840193505060c081019050614a49565b5050509392505050565b600082601f830112614a8f57614a8e612367565b5b8151614a9f848260208601614a11565b91505092915050565b600060608284031215614abe57614abd6135eb565b5b614ac86060612774565b9050600082015167ffffffffffffffff811115614ae857614ae76135f0565b5b614af484828501613dc8565b600083015250602082015167ffffffffffffffff811115614b1857614b176135f0565b5b614b2484828501613dc8565b602083015250604082015167ffffffffffffffff811115614b4857614b476135f0565b5b614b5484828501614a7a565b60408301525092915050565b600060208284031215614b7657614b756122ff565b5b600082015167ffffffffffffffff811115614b9457614b93612304565b5b614ba084828501614aa8565b91505092915050565b6000606082019050614bbe6000830186613ae4565b8181036020830152614bd08185614005565b90508181036040830152614be48184614005565b9050949350505050565b600067ffffffffffffffff821115614c0957614c08612714565b5b602082029050602081019050919050565b600060808284031215614c3057614c2f6135eb565b5b614c3a6080612774565b90506000614c4a84828501613e47565b6000830152506020614c5e84828501613e47565b6020830152506040614c7284828501613e1b565b6040830152506060614c8684828501613e1b565b60608301525092915050565b6000614ca5614ca084614bee565b612774565b90508083825260208201905060808402830185811115614cc857614cc7612371565b5b835b81811015614cf15780614cdd8882614c1a565b845260208401935050608081019050614cca565b5050509392505050565b600082601f830112614d1057614d0f612367565b5b8151614d20848260208601614c92565b91505092915050565b600060808284031215614d3f57614d3e6135eb565b5b614d496080612774565b9050600082015167ffffffffffffffff811115614d6957614d686135f0565b5b614d7584828501613dc8565b600083015250602082015167ffffffffffffffff811115614d9957614d986135f0565b5b614da584828501613dc8565b602083015250604082015167ffffffffffffffff811115614dc957614dc86135f0565b5b614dd584828501613dc8565b604083015250606082015167ffffffffffffffff811115614df957614df86135f0565b5b614e0584828501614cfb565b60608301525092915050565b600060208284031215614e2757614e266122ff565b5b600082015167ffffffffffffffff811115614e4557614e44612304565b5b614e5184828501614d29565b91505092915050565b6000608082019050614e6f6000830187613ae4565b8181036020830152614e818186614005565b9050614e9060408301856128ca565b614e9d60608301846128ca565b95945050505050565b7f44656c656761746520417070726f7665206661696c6564000000000000000000600082015250565b6000614edc601783613cc8565b9150614ee782614ea6565b602082019050919050565b60006020820190508181036000830152614f0b81614ecf565b9050919050565b600060a08301614f256000840184613b60565b8583036000870152614f38838284613b0e565b92505050614f496020840184613b60565b8583036020870152614f5c838284613b0e565b92505050614f6d6040840184613b60565b8583036040870152614f80838284613b0e565b92505050614f916060840184613b60565b8583036060870152614fa4838284613b0e565b92505050614fb56080840184613b60565b8583036080870152614fc8838284613b0e565b925050508091505092915050565b6000614fe560208401846123ed565b905092915050565b60608201614ffe6000830183614fd6565b61500b60008501826125c5565b506150196020830183614fd6565b61502660208501826125c5565b506150346040830183614fd6565b61504160408501826125c5565b50505050565b60006101008201905081810360008301526150628189614f12565b90506150716020830188614fed565b61507e60808301876128ca565b61508b60a0830186613ae4565b81810360c083015261509d8185614005565b90506150ac60e08301846128ca565b979650505050505050565b6000602082840312156150cd576150cc6122ff565b5b60006150db84828501613e47565b91505092915050565b60006150ef826123cc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615121576151206148cd565b5b600182019050919050565b6000615137826123cc565b91506000820361514a576151496148cd565b5b600182039050919050565b600060808201905061516a6000830187613ae4565b818103602083015261517c8186614005565b905081810360408301526151908185614005565b905061519f60608301846128ca565b95945050505050565b6151b181613130565b82525050565b600060808201905081810360008301526151d18187614f12565b90506151e06020830186613ae4565b6151ed60408301856151a8565b6151fa60608301846151a8565b95945050505050565b600080833560016020038436030381126152205761521f613b5b565b5b83810192508235915060208301925067ffffffffffffffff82111561524857615247613b51565b5b60018202360383131561525e5761525d613b56565b5b509250929050565b6000615272838561344a565b935061527f8385846127c0565b615288836124e9565b840190509392505050565b60006152a260208401846136ad565b905092915050565b60006152b960208401846136d9565b905092915050565b600060a083016152d46000840184615203565b85830360008701526152e7838284615266565b925050506152f86020840184615293565b6153056020860182612aad565b506153136040840184615293565b6153206040860182612aad565b5061532e60608401846152aa565b61533b606086018261253f565b5061534960808401846152aa565b615356608086018261253f565b508091505092915050565b6000604082019050818103600083015261537b8185614005565b9050818103602083015261538f81846152c1565b90509392505050565b600067ffffffffffffffff8211156153b3576153b2612714565b5b602082029050602081019050919050565b60006153d76153d284615398565b612774565b905080838252602082019050602084028301858111156153fa576153f9612371565b5b835b8181101561544157805167ffffffffffffffff81111561541f5761541e612367565b5b80860161542c8982613e5c565b855260208501945050506020810190506153fc565b5050509392505050565b600082601f8301126154605761545f612367565b5b81516154708482602086016153c4565b91505092915050565b600061548c615487846135f5565b612774565b9050828152602081018484840111156154a8576154a761270f565b5b6154b38482856124bf565b509392505050565b600082601f8301126154d0576154cf612367565b5b81516154e0848260208601615479565b91505092915050565b6000604082840312156154ff576154fe6135eb565b5b6155096040612774565b9050600082015167ffffffffffffffff811115615529576155286135f0565b5b615535848285016154bb565b60008301525060206155498482850161495c565b60208301525092915050565b6000806040838503121561556c5761556b6122ff565b5b600083015167ffffffffffffffff81111561558a57615589612304565b5b6155968582860161544b565b925050602083015167ffffffffffffffff8111156155b7576155b6612304565b5b6155c3858286016154e9565b9150509250929050565b60006060820190506155e26000830186613ae4565b6155ef6020830185613ae4565b81810360408301526156018184614005565b9050949350505050565b600060208284031215615621576156206122ff565b5b600061562f84828501613e1b565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b6000819050602082019050919050565b600061568e83836124fa565b905092915050565b6000602082019050919050565b60006156ae82615667565b6156b88185613af3565b9350836020820285016156ca85615672565b8060005b8581101561570657848403895281516156e78582615682565b94506156f283615696565b925060208a019950506001810190506156ce565b50829750879550505050505092915050565b600060608201905061572d6000830186613ae4565b61573a60208301856128ca565b818103604083015261574c81846156a3565b9050949350505050565b7f6661696c656420746f20617070726f766520756e64656c65676174696f6e206d60008201527f6574686f64000000000000000000000000000000000000000000000000000000602082015250565b60006157b2602583613cc8565b91506157bd82615756565b604082019050919050565b600060208201905081810360008301526157e1816157a5565b9050919050565b60006040820190506157fd6000830186613ae4565b8181036020830152615810818486613bd0565b9050949350505050565b7f4661696c656420746f207265766f6b6520617070726f76616c20666f7220737460008201527f616b696e67206d6574686f647300000000000000000000000000000000000000602082015250565b6000615876602d83613cc8565b91506158818261581a565b604082019050919050565b600060208201905081810360008301526158a581615869565b9050919050565b600060a08301600083015184820360008601526158c9828261345b565b91505060208301516158de6020860182612aad565b5060408301516158f16040860182612aad565b506060830151615904606086018261253f565b506080830151615917608086018261253f565b508091505092915050565b60006080820190506159376000830187613ae4565b81810360208301526159498186614005565b9050818103604083015261595d8185614005565b9050818103606083015261597181846158ac565b905095945050505050565b600067ffffffffffffffff82111561599757615996612714565b5b602082029050602081019050919050565b6000608082840312156159be576159bd6135eb565b5b6159c86080612774565b9050600082015167ffffffffffffffff8111156159e8576159e76135f0565b5b6159f484828501613dc8565b600083015250602082015167ffffffffffffffff811115615a1857615a176135f0565b5b615a2484828501613dc8565b602083015250604082015167ffffffffffffffff811115615a4857615a476135f0565b5b615a5484828501613dc8565b604083015250606082015167ffffffffffffffff811115615a7857615a776135f0565b5b615a8484828501614cfb565b60608301525092915050565b600067ffffffffffffffff821115615aab57615aaa612714565b5b602082029050602081019050919050565b600060a08284031215615ad257615ad16135eb565b5b615adc6040612774565b90506000615aec84828501614c1a565b6000830152506080615b0084828501613e1b565b60208301525092915050565b6000615b1f615b1a84615a90565b612774565b90508083825260208201905060a08402830185811115615b4257615b41612371565b5b835b81811015615b6b5780615b578882615abc565b84526020840193505060a081019050615b44565b5050509392505050565b600082601f830112615b8a57615b89612367565b5b8151615b9a848260208601615b0c565b91505092915050565b600060408284031215615bb957615bb86135eb565b5b615bc36040612774565b9050600082015167ffffffffffffffff811115615be357615be26135f0565b5b615bef848285016159a8565b600083015250602082015167ffffffffffffffff811115615c1357615c126135f0565b5b615c1f84828501615b75565b60208301525092915050565b6000615c3e615c398461597c565b612774565b90508083825260208201905060208402830185811115615c6157615c60612371565b5b835b81811015615ca857805167ffffffffffffffff811115615c8657615c85612367565b5b808601615c938982615ba3565b85526020850194505050602081019050615c63565b5050509392505050565b600082601f830112615cc757615cc6612367565b5b8151615cd7848260208601615c2b565b91505092915050565b60008060408385031215615cf757615cf66122ff565b5b600083015167ffffffffffffffff811115615d1557615d14612304565b5b615d2185828601615cb2565b925050602083015167ffffffffffffffff811115615d4257615d41612304565b5b615d4e858286016154e9565b915050925092905056fe2f636f736d6f732e7374616b696e672e763162657461312e4d7367556e64656c6567617465a2646970667358221220610cb91a8933e1804929f56c9cd7a1adc794d98816aa48df9e694b7cd16e831b64736f6c63430008130033", + "bytecode": "0x60806040526040518060200160405280604051806060016040528060238152602001620062646023913981525060019060016200003e92919062000053565b503480156200004c57600080fd5b50620004a1565b828054828255906000526020600020908101928215620000a0579160200282015b828111156200009f5782518290816200008e9190620003ba565b509160200191906001019062000074565b5b509050620000af9190620000b3565b5090565b5b80821115620000d75760008181620000cd9190620000db565b50600101620000b4565b5090565b508054620000e990620001a9565b6000825580601f10620000fd57506200011e565b601f0160209004906000526020600020908101906200011d919062000121565b5b50565b5b808211156200013c57600081600090555060010162000122565b5090565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620001c257607f821691505b602082108103620001d857620001d76200017a565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620002427fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000203565b6200024e868362000203565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b60006200029b620002956200028f8462000266565b62000270565b62000266565b9050919050565b6000819050919050565b620002b7836200027a565b620002cf620002c682620002a2565b84845462000210565b825550505050565b600090565b620002e6620002d7565b620002f3818484620002ac565b505050565b5b818110156200031b576200030f600082620002dc565b600181019050620002f9565b5050565b601f8211156200036a576200033481620001de565b6200033f84620001f3565b810160208510156200034f578190505b620003676200035e85620001f3565b830182620002f8565b50505b505050565b600082821c905092915050565b60006200038f600019846008026200036f565b1980831691505092915050565b6000620003aa83836200037c565b9150826002028217905092915050565b620003c58262000140565b67ffffffffffffffff811115620003e157620003e06200014b565b5b620003ed8254620001a9565b620003fa8282856200031f565b600060209050601f8311600181146200043257600084156200041d578287015190505b6200042985826200039c565b86555062000499565b601f1984166200044286620001de565b60005b828110156200046c5784890151825560018201915060208501945060208101905062000445565b868310156200048c578489015162000488601f8916826200037c565b8355505b6001600288020188555050505b505050505050565b615db380620004b16000396000f3fe60806040526004361061014b5760003560e01c80637e51b811116100b6578063cf2753cf1161006f578063cf2753cf146104a8578063ec9485df146104e6578063f40a214614610523578063f5714e641461054c578063f700dbd214610568578063f732b065146105915761014b565b80637e51b811146103965780638939e783146103bf5780638edb3f8b146103e85780639eab671114610404578063af9a90b21461042d578063b13d42421461046a5761014b565b806355dc4b221161010857806355dc4b2214610283578063570467ac146102ac5780635e269bfe146102e957806360deaa2a1461031257806361bc221a1461032e57806368ac3df3146103595761014b565b80630a4433e2146101505780631904bb2e1461017957806319b16c4c146101b657806331bcbcb3146101f45780633566cb951461021d578063455b855114610246575b600080fd5b34801561015c57600080fd5b5061017760048036038101906101729190612402565b6105cf565b005b34801561018557600080fd5b506101a0600480360381019061019b9190612476565b61069e565b6040516101ad91906126ed565b60405180910390f35b3480156101c257600080fd5b506101dd60048036038101906101d8919061283f565b61072e565b6040516101eb929190612916565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612946565b610c2d565b005b34801561022957600080fd5b50610244600480360381019061023f91906129b5565b610eba565b005b34801561025257600080fd5b5061026d60048036038101906102689190612a11565b611022565b60405161027a9190612c18565b60405180910390f35b34801561028f57600080fd5b506102aa60048036038101906102a59190612c3a565b6110b5565b005b3480156102b857600080fd5b506102d360048036038101906102ce919061283f565b6114a7565b6040516102e09190612e55565b60405180910390f35b3480156102f557600080fd5b50610310600480360381019061030b9190612e77565b61153d565b005b61032c60048036038101906103279190612efa565b6115c8565b005b34801561033a57600080fd5b50610343611716565b6040516103509190612f43565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b9190612fa1565b61171c565b60405161038d9190613076565b60405180910390f35b3480156103a257600080fd5b506103bd60048036038101906103b89190612946565b6117b2565b005b3480156103cb57600080fd5b506103e660048036038101906103e19190612946565b61183a565b005b61040260048036038101906103fd9190612efa565b6118f0565b005b34801561041057600080fd5b5061042b60048036038101906104269190613091565b611a85565b005b34801561043957600080fd5b50610454600480360381019061044f9190613166565b611b10565b6040516104619190613076565b60405180910390f35b34801561047657600080fd5b50610491600480360381019061048c9190613208565b611ba0565b60405161049f9291906134d1565b60405180910390f35b3480156104b457600080fd5b506104cf60048036038101906104ca9190612a11565b611c38565b6040516104dd929190612916565b60405180910390f35b3480156104f257600080fd5b5061050d60048036038101906105089190612a11565b611cd0565b60405161051a9190612f43565b60405180910390f35b34801561052f57600080fd5b5061054a60048036038101906105459190613508565b611d5a565b005b61056660048036038101906105619190612efa565b611f36565b005b34801561057457600080fd5b5061058f600480360381019061058a919061358b565b612090565b005b34801561059d57600080fd5b506105b860048036038101906105b39190613796565b61215c565b6040516105c6929190613aad565b60405180910390f35b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895868487876040518563ffffffff1660e01b81526004016106129493929190613c46565b6020604051808303816000875af1158015610631573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106559190613c9b565b905080610697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068e90613d4b565b60405180910390fd5b5050505050565b6106a66121fa565b61080073ffffffffffffffffffffffffffffffffffffffff1663223b3b7a836040518263ffffffff1660e01b81526004016106e19190613d6b565b600060405180830381865afa1580156106fe573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906107279190613fbc565b9050919050565b600061073861226e565b600061080090506000868660405160240161075492919061403e565b6040516020818303038152906040527f241774e6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000856040516020016107e691906140aa565b60405160208183030381529060405280519060200120905060405160200161080d9061410d565b6040516020818303038152906040528051906020012081036108f9576000808473ffffffffffffffffffffffffffffffffffffffff1684604051610851919061415e565b600060405180830381855af49150503d806000811461088c576040519150601f19603f3d011682016040523d82523d6000602084013e610891565b606091505b5091509150816108d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cd906141e7565b60405180910390fd5b808060200190518101906108ea9190614273565b80975081985050505050610c22565b6040516020016109089061431b565b6040516020818303038152906040528051906020012081036109f4576000808473ffffffffffffffffffffffffffffffffffffffff168460405161094c919061415e565b600060405180830381855afa9150503d8060008114610987576040519150601f19603f3d011682016040523d82523d6000602084013e61098c565b606091505b5091509150816109d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c89061437c565b60405180910390fd5b808060200190518101906109e59190614273565b80975081985050505050610c21565b604051602001610a03906143e8565b604051602081830303815290604052805190602001208103610af1576000808473ffffffffffffffffffffffffffffffffffffffff1684604051610a47919061415e565b6000604051808303816000865af19150503d8060008114610a84576040519150601f19603f3d011682016040523d82523d6000602084013e610a89565b606091505b509150915081610ace576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac590614449565b60405180910390fd5b80806020019051810190610ae29190614273565b80975081985050505050610c20565b604051602001610b00906144b5565b604051602081830303815290604052805190602001208103610be45760006040518060400160405280601a81526020017f64656c65676174696f6e28616464726573732c737472696e6729000000000000815250805190602001209050600060a490506060600060208b01516020808d0101516040518681528e6004820152604060248201526033604482015282606482015281608482015260c081878360008e5af281519c5060608201519450610100820160405280610bc057600080fd5b50505050604051806040016040528083815260200182815250975050505050610c1f565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1690614516565b60405180910390fd5b5b5b5b505050935093915050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895308460016040518463ffffffff1660e01b8152600401610c6f939291906146e4565b6020604051808303816000875af1158015610c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb29190613c9b565b905080610cf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ceb9061476e565b60405180910390fd5b60008473ffffffffffffffffffffffffffffffffffffffff163384604051602401610d2092919061478e565b6040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610daa919061415e565b6000604051808303816000865af19150503d8060008114610de7576040519150601f19603f3d011682016040523d82523d6000602084013e610dec565b606091505b5050905080610e30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2790614803565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3386866040518463ffffffff1660e01b8152600401610e6f93929190614823565b6020604051808303816000875af1158015610e8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb29190613c9b565b505050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895308460016040518463ffffffff1660e01b8152600401610efc939291906146e4565b6020604051808303816000875af1158015610f1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3f9190613c9b565b905080610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f78906148ad565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3085856040518463ffffffff1660e01b8152600401610fc093929190614823565b6020604051808303816000875af1158015610fdf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110039190613c9b565b50600160008082825461101691906148fc565b92505081905550505050565b61102a612288565b61080073ffffffffffffffffffffffffffffffffffffffff1663a03ffee184846040518363ffffffff1660e01b815260040161106792919061403e565b600060405180830381865afa158015611084573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906110ad9190614b60565b905092915050565b6000610800905060008585856040516024016110d393929190614823565b6040516020818303038152906040527f3edab33c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905060008360405160200161116591906140aa565b60405160208183030381529060405280519060200120905060405160200161118c9061410d565b6040516020818303038152906040528051906020012081036112595760008373ffffffffffffffffffffffffffffffffffffffff16836040516111cf919061415e565b600060405180830381855af49150503d806000811461120a576040519150601f19603f3d011682016040523d82523d6000602084013e61120f565b606091505b5050905080611253576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124a906141e7565b60405180910390fd5b5061149e565b6040516020016112689061431b565b6040516020818303038152906040528051906020012081036113355760008373ffffffffffffffffffffffffffffffffffffffff16836040516112ab919061415e565b600060405180830381855afa9150503d80600081146112e6576040519150601f19603f3d011682016040523d82523d6000602084013e6112eb565b606091505b505090508061132f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113269061437c565b60405180910390fd5b5061149d565b604051602001611344906143e8565b6040516020818303038152906040528051906020012081036114135760008373ffffffffffffffffffffffffffffffffffffffff1683604051611387919061415e565b6000604051808303816000865af19150503d80600081146113c4576040519150601f19603f3d011682016040523d82523d6000602084013e6113c9565b606091505b505090508061140d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140490614449565b60405180910390fd5b5061149c565b604051602001611422906144b5565b6040516020818303038152906040528051906020012081036114605760208201825160008082846000895af28061145857600080fd5b50505061149b565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149290614516565b60405180910390fd5b5b5b5b50505050505050565b6114af6122a9565b61080073ffffffffffffffffffffffffffffffffffffffff16637d9f939c8585856040518463ffffffff1660e01b81526004016114ee93929190614ba9565b600060405180830381865afa15801561150b573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906115349190614e11565b90509392505050565b61080073ffffffffffffffffffffffffffffffffffffffff166312d58dfe858585856040518563ffffffff1660e01b815260040161157e9493929190614e5a565b6020604051808303816000875af115801561159d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c19190613c9b565b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895303460016040518463ffffffff1660e01b815260040161160a939291906146e4565b6020604051808303816000875af1158015611629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164d9190613c9b565b90508061168f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168690614ef2565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3084346040518463ffffffff1660e01b81526004016116ce93929190614823565b6020604051808303816000875af11580156116ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117119190613c9b565b505050565b60005481565b600061080073ffffffffffffffffffffffffffffffffffffffff1663f7cd55168888888888886040518763ffffffff1660e01b815260040161176396959493929190615047565b6020604051808303816000875af1158015611782573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a69190613c9b565b90509695505050505050565b61080073ffffffffffffffffffffffffffffffffffffffff16633edab33c8484846040518463ffffffff1660e01b81526004016117f193929190614823565b6020604051808303816000875af1158015611810573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061183491906150b7565b50505050565b60008081548092919061184c906150e4565b919050555061080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8484846040518463ffffffff1660e01b815260040161189093929190614823565b6020604051808303816000875af11580156118af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d39190613c9b565b506000808154809291906118e69061512c565b9190505550505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895323460016040518463ffffffff1660e01b8152600401611932939291906146e4565b6020604051808303816000875af1158015611951573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119759190613c9b565b9050806119b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ae90614ef2565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3084346040518463ffffffff1660e01b81526004016119f693929190614823565b6020604051808303816000875af1158015611a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a399190613c9b565b503373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015611a80573d6000803e3d6000fd5b505050565b61080073ffffffffffffffffffffffffffffffffffffffff166354b826f5858585856040518563ffffffff1660e01b8152600401611ac69493929190615155565b6020604051808303816000875af1158015611ae5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0991906150b7565b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663a50f05ac868686866040518563ffffffff1660e01b8152600401611b5394939291906151b7565b6020604051808303816000875af1158015611b72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b969190613c9b565b9050949350505050565b6060611baa6122d1565b61080073ffffffffffffffffffffffffffffffffffffffff1663186b216785856040518363ffffffff1660e01b8152600401611be7929190615361565b600060405180830381865afa158015611c04573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611c2d9190615555565b915091509250929050565b6000611c4261226e565b61080073ffffffffffffffffffffffffffffffffffffffff1663241774e685856040518363ffffffff1660e01b8152600401611c7f92919061403e565b600060405180830381865afa158015611c9c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611cc59190614273565b915091509250929050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663fc08930c8433856040518463ffffffff1660e01b8152600401611d11939291906155cd565b602060405180830381865afa158015611d2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d52919061560b565b905092915050565b6000600167ffffffffffffffff811115611d7757611d76612714565b5b604051908082528060200260200182016040528015611daa57816020015b6060815260200190600190039081611d955790505b509050604051806060016040528060258152602001615d596025913981600081518110611dda57611dd9615638565b5b6020026020010181905250600061080073ffffffffffffffffffffffffffffffffffffffff1663b60398958787856040518463ffffffff1660e01b8152600401611e2693929190615718565b6020604051808303816000875af1158015611e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e699190613c9b565b905080611eab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea2906157c8565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff16633edab33c3285876040518463ffffffff1660e01b8152600401611eea93929190614823565b6020604051808303816000875af1158015611f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2d91906150b7565b50505050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895323460016040518463ffffffff1660e01b8152600401611f78939291906146e4565b6020604051808303816000875af1158015611f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbb9190613c9b565b905080611ffd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff490614ef2565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb308460013461202a91906148fc565b6040518463ffffffff1660e01b815260040161204893929190614823565b6020604051808303816000875af1158015612067573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208b9190613c9b565b505050565b600061080073ffffffffffffffffffffffffffffffffffffffff166361dc5c3b8585856040518463ffffffff1660e01b81526004016120d1939291906157e8565b6020604051808303816000875af11580156120f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121149190613c9b565b905080612156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214d9061588c565b60405180910390fd5b50505050565b60606121666122d1565b61080073ffffffffffffffffffffffffffffffffffffffff166310a2851c878787876040518563ffffffff1660e01b81526004016121a79493929190615922565b600060405180830381865afa1580156121c4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906121ed9190615ce0565b9150915094509492505050565b6040518061016001604052806060815260200160608152602001600015158152602001600060038111156122315761223061254e565b5b8152602001600081526020016000815260200160608152602001600060070b8152602001600060070b815260200160008152602001600081525090565b604051806040016040528060608152602001600081525090565b60405180606001604052806060815260200160608152602001606081525090565b6040518060800160405280606081526020016060815260200160608152602001606081525090565b604051806040016040528060608152602001600067ffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061233482612309565b9050919050565b61234481612329565b811461234f57600080fd5b50565b6000813590506123618161233b565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261238c5761238b612367565b5b8235905067ffffffffffffffff8111156123a9576123a861236c565b5b6020830191508360208202830111156123c5576123c4612371565b5b9250929050565b6000819050919050565b6123df816123cc565b81146123ea57600080fd5b50565b6000813590506123fc816123d6565b92915050565b6000806000806060858703121561241c5761241b6122ff565b5b600061242a87828801612352565b945050602085013567ffffffffffffffff81111561244b5761244a612304565b5b61245787828801612376565b9350935050604061246a878288016123ed565b91505092959194509250565b60006020828403121561248c5761248b6122ff565b5b600061249a84828501612352565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156124dd5780820151818401526020810190506124c2565b60008484015250505050565b6000601f19601f8301169050919050565b6000612505826124a3565b61250f81856124ae565b935061251f8185602086016124bf565b612528816124e9565b840191505092915050565b60008115159050919050565b61254881612533565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061258e5761258d61254e565b5b50565b600081905061259f8261257d565b919050565b60006125af82612591565b9050919050565b6125bf816125a4565b82525050565b6125ce816123cc565b82525050565b60008160070b9050919050565b6125ea816125d4565b82525050565b600061016083016000830151848203600086015261260e82826124fa565b9150506020830151848203602086015261262882826124fa565b915050604083015161263d604086018261253f565b50606083015161265060608601826125b6565b50608083015161266360808601826125c5565b5060a083015161267660a08601826125c5565b5060c083015184820360c086015261268e82826124fa565b91505060e08301516126a360e08601826125e1565b506101008301516126b86101008601826125e1565b506101208301516126cd6101208601826125c5565b506101408301516126e26101408601826125c5565b508091505092915050565b6000602082019050818103600083015261270781846125f0565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61274c826124e9565b810181811067ffffffffffffffff8211171561276b5761276a612714565b5b80604052505050565b600061277e6122f5565b905061278a8282612743565b919050565b600067ffffffffffffffff8211156127aa576127a9612714565b5b6127b3826124e9565b9050602081019050919050565b82818337600083830152505050565b60006127e26127dd8461278f565b612774565b9050828152602081018484840111156127fe576127fd61270f565b5b6128098482856127c0565b509392505050565b600082601f83011261282657612825612367565b5b81356128368482602086016127cf565b91505092915050565b600080600060608486031215612858576128576122ff565b5b600061286686828701612352565b935050602084013567ffffffffffffffff81111561288757612886612304565b5b61289386828701612811565b925050604084013567ffffffffffffffff8111156128b4576128b3612304565b5b6128c086828701612811565b9150509250925092565b6128d3816123cc565b82525050565b600060408301600083015184820360008601526128f682826124fa565b915050602083015161290b60208601826125c5565b508091505092915050565b600060408201905061292b60008301856128ca565b818103602083015261293d81846128d9565b90509392505050565b60008060006060848603121561295f5761295e6122ff565b5b600061296d86828701612352565b935050602084013567ffffffffffffffff81111561298e5761298d612304565b5b61299a86828701612811565b92505060406129ab868287016123ed565b9150509250925092565b600080604083850312156129cc576129cb6122ff565b5b600083013567ffffffffffffffff8111156129ea576129e9612304565b5b6129f685828601612811565b9250506020612a07858286016123ed565b9150509250929050565b60008060408385031215612a2857612a276122ff565b5b6000612a3685828601612352565b925050602083013567ffffffffffffffff811115612a5757612a56612304565b5b612a6385828601612811565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600067ffffffffffffffff82169050919050565b612ab681612a99565b82525050565b60c082016000820151612ad260008501826125e1565b506020820151612ae560208501826125e1565b506040820151612af860408501826125c5565b506060820151612b0b60608501826125c5565b506080820151612b1e6080850182612aad565b5060a0820151612b3160a08501826125e1565b50505050565b6000612b438383612abc565b60c08301905092915050565b6000602082019050919050565b6000612b6782612a6d565b612b718185612a78565b9350612b7c83612a89565b8060005b83811015612bad578151612b948882612b37565b9750612b9f83612b4f565b925050600181019050612b80565b5085935050505092915050565b60006060830160008301518482036000860152612bd782826124fa565b91505060208301518482036020860152612bf182826124fa565b91505060408301518482036040860152612c0b8282612b5c565b9150508091505092915050565b60006020820190508181036000830152612c328184612bba565b905092915050565b60008060008060808587031215612c5457612c536122ff565b5b6000612c6287828801612352565b945050602085013567ffffffffffffffff811115612c8357612c82612304565b5b612c8f87828801612811565b9350506040612ca0878288016123ed565b925050606085013567ffffffffffffffff811115612cc157612cc0612304565b5b612ccd87828801612811565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b608082016000820151612d1b60008501826125e1565b506020820151612d2e60208501826125e1565b506040820151612d4160408501826125c5565b506060820151612d5460608501826125c5565b50505050565b6000612d668383612d05565b60808301905092915050565b6000602082019050919050565b6000612d8a82612cd9565b612d948185612ce4565b9350612d9f83612cf5565b8060005b83811015612dd0578151612db78882612d5a565b9750612dc283612d72565b925050600181019050612da3565b5085935050505092915050565b60006080830160008301518482036000860152612dfa82826124fa565b91505060208301518482036020860152612e1482826124fa565b91505060408301518482036040860152612e2e82826124fa565b91505060608301518482036060860152612e488282612d7f565b9150508091505092915050565b60006020820190508181036000830152612e6f8184612ddd565b905092915050565b60008060008060808587031215612e9157612e906122ff565b5b6000612e9f87828801612352565b945050602085013567ffffffffffffffff811115612ec057612ebf612304565b5b612ecc87828801612811565b9350506040612edd878288016123ed565b9250506060612eee878288016123ed565b91505092959194509250565b600060208284031215612f1057612f0f6122ff565b5b600082013567ffffffffffffffff811115612f2e57612f2d612304565b5b612f3a84828501612811565b91505092915050565b6000602082019050612f5860008301846128ca565b92915050565b600080fd5b600060a08284031215612f7957612f78612f5e565b5b81905092915050565b600060608284031215612f9857612f97612f5e565b5b81905092915050565b6000806000806000806101008789031215612fbf57612fbe6122ff565b5b600087013567ffffffffffffffff811115612fdd57612fdc612304565b5b612fe989828a01612f63565b9650506020612ffa89828a01612f82565b955050608061300b89828a016123ed565b94505060a061301c89828a01612352565b93505060c087013567ffffffffffffffff81111561303d5761303c612304565b5b61304989828a01612811565b92505060e061305a89828a016123ed565b9150509295509295509295565b61307081612533565b82525050565b600060208201905061308b6000830184613067565b92915050565b600080600080608085870312156130ab576130aa6122ff565b5b60006130b987828801612352565b945050602085013567ffffffffffffffff8111156130da576130d9612304565b5b6130e687828801612811565b935050604085013567ffffffffffffffff81111561310757613106612304565b5b61311387828801612811565b9250506060613124878288016123ed565b91505092959194509250565b6000819050919050565b61314381613130565b811461314e57600080fd5b50565b6000813590506131608161313a565b92915050565b600080600080608085870312156131805761317f6122ff565b5b600085013567ffffffffffffffff81111561319e5761319d612304565b5b6131aa87828801612f63565b94505060206131bb87828801612352565b93505060406131cc87828801613151565b92505060606131dd87828801613151565b91505092959194509250565b600060a082840312156131ff576131fe612f5e565b5b81905092915050565b6000806040838503121561321f5761321e6122ff565b5b600083013567ffffffffffffffff81111561323d5761323c612304565b5b61324985828601612811565b925050602083013567ffffffffffffffff81111561326a57613269612304565b5b613276858286016131e9565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006101608301600083015184820360008601526132ca82826124fa565b915050602083015184820360208601526132e482826124fa565b91505060408301516132f9604086018261253f565b50606083015161330c60608601826125b6565b50608083015161331f60808601826125c5565b5060a083015161333260a08601826125c5565b5060c083015184820360c086015261334a82826124fa565b91505060e083015161335f60e08601826125e1565b506101008301516133746101008601826125e1565b506101208301516133896101208601826125c5565b5061014083015161339e6101408601826125c5565b508091505092915050565b60006133b583836132ac565b905092915050565b6000602082019050919050565b60006133d582613280565b6133df818561328b565b9350836020820285016133f18561329c565b8060005b8581101561342d578484038952815161340e85826133a9565b9450613419836133bd565b925060208a019950506001810190506133f5565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b60006134668261343f565b613470818561344a565b93506134808185602086016124bf565b613489816124e9565b840191505092915050565b600060408301600083015184820360008601526134b1828261345b565b91505060208301516134c66020860182612aad565b508091505092915050565b600060408201905081810360008301526134eb81856133ca565b905081810360208301526134ff8184613494565b90509392505050565b60008060008060808587031215613522576135216122ff565b5b600061353087828801612352565b9450506020613541878288016123ed565b9350506040613552878288016123ed565b925050606085013567ffffffffffffffff81111561357357613572612304565b5b61357f87828801612811565b91505092959194509250565b6000806000604084860312156135a4576135a36122ff565b5b60006135b286828701612352565b935050602084013567ffffffffffffffff8111156135d3576135d2612304565b5b6135df86828701612376565b92509250509250925092565b600080fd5b600080fd5b600067ffffffffffffffff8211156136105761360f612714565b5b613619826124e9565b9050602081019050919050565b6000613639613634846135f5565b612774565b9050828152602081018484840111156136555761365461270f565b5b6136608482856127c0565b509392505050565b600082601f83011261367d5761367c612367565b5b813561368d848260208601613626565b91505092915050565b61369f81612a99565b81146136aa57600080fd5b50565b6000813590506136bc81613696565b92915050565b6136cb81612533565b81146136d657600080fd5b50565b6000813590506136e8816136c2565b92915050565b600060a08284031215613704576137036135eb565b5b61370e60a0612774565b9050600082013567ffffffffffffffff81111561372e5761372d6135f0565b5b61373a84828501613668565b600083015250602061374e848285016136ad565b6020830152506040613762848285016136ad565b6040830152506060613776848285016136d9565b606083015250608061378a848285016136d9565b60808301525092915050565b600080600080608085870312156137b0576137af6122ff565b5b60006137be87828801612352565b945050602085013567ffffffffffffffff8111156137df576137de612304565b5b6137eb87828801612811565b935050604085013567ffffffffffffffff81111561380c5761380b612304565b5b61381887828801612811565b925050606085013567ffffffffffffffff81111561383957613838612304565b5b613845878288016136ee565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000608083016000830151848203600086015261389a82826124fa565b915050602083015184820360208601526138b482826124fa565b915050604083015184820360408601526138ce82826124fa565b915050606083015184820360608601526138e88282612d7f565b9150508091505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60a0820160008201516139376000850182612d05565b50602082015161394a60808501826125c5565b50505050565b600061395c8383613921565b60a08301905092915050565b6000602082019050919050565b6000613980826138f5565b61398a8185613900565b935061399583613911565b8060005b838110156139c65781516139ad8882613950565b97506139b883613968565b925050600181019050613999565b5085935050505092915050565b600060408301600083015184820360008601526139f0828261387d565b91505060208301518482036020860152613a0a8282613975565b9150508091505092915050565b6000613a2383836139d3565b905092915050565b6000602082019050919050565b6000613a4382613851565b613a4d818561385c565b935083602082028501613a5f8561386d565b8060005b85811015613a9b5784840389528151613a7c8582613a17565b9450613a8783613a2b565b925060208a01995050600181019050613a63565b50829750879550505050505092915050565b60006040820190508181036000830152613ac78185613a38565b90508181036020830152613adb8184613494565b90509392505050565b613aed81612329565b82525050565b600082825260208201905092915050565b6000819050919050565b6000613b1a83856124ae565b9350613b278385846127c0565b613b30836124e9565b840190509392505050565b6000613b48848484613b0e565b90509392505050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613b7d57613b7c613b5b565b5b83810192508235915060208301925067ffffffffffffffff821115613ba557613ba4613b51565b5b600182023603831315613bbb57613bba613b56565b5b509250929050565b6000602082019050919050565b6000613bdc8385613af3565b935083602084028501613bee84613b04565b8060005b87811015613c34578484038952613c098284613b60565b613c14868284613b3b565b9550613c1f84613bc3565b935060208b019a505050600181019050613bf2565b50829750879450505050509392505050565b6000606082019050613c5b6000830187613ae4565b613c6860208301866128ca565b8181036040830152613c7b818486613bd0565b905095945050505050565b600081519050613c95816136c2565b92915050565b600060208284031215613cb157613cb06122ff565b5b6000613cbf84828501613c86565b91505092915050565b600082825260208201905092915050565b7f4661696c656420746f20617070726f7665207374616b696e67206d6574686f6460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d35602183613cc8565b9150613d4082613cd9565b604082019050919050565b60006020820190508181036000830152613d6481613d28565b9050919050565b6000602082019050613d806000830184613ae4565b92915050565b6000613d99613d948461278f565b612774565b905082815260208101848484011115613db557613db461270f565b5b613dc08482856124bf565b509392505050565b600082601f830112613ddd57613ddc612367565b5b8151613ded848260208601613d86565b91505092915050565b60048110613e0357600080fd5b50565b600081519050613e1581613df6565b92915050565b600081519050613e2a816123d6565b92915050565b613e39816125d4565b8114613e4457600080fd5b50565b600081519050613e5681613e30565b92915050565b60006101608284031215613e7357613e726135eb565b5b613e7e610160612774565b9050600082015167ffffffffffffffff811115613e9e57613e9d6135f0565b5b613eaa84828501613dc8565b600083015250602082015167ffffffffffffffff811115613ece57613ecd6135f0565b5b613eda84828501613dc8565b6020830152506040613eee84828501613c86565b6040830152506060613f0284828501613e06565b6060830152506080613f1684828501613e1b565b60808301525060a0613f2a84828501613e1b565b60a08301525060c082015167ffffffffffffffff811115613f4e57613f4d6135f0565b5b613f5a84828501613dc8565b60c08301525060e0613f6e84828501613e47565b60e083015250610100613f8384828501613e47565b61010083015250610120613f9984828501613e1b565b61012083015250610140613faf84828501613e1b565b6101408301525092915050565b600060208284031215613fd257613fd16122ff565b5b600082015167ffffffffffffffff811115613ff057613fef612304565b5b613ffc84828501613e5c565b91505092915050565b6000614010826124a3565b61401a8185613cc8565b935061402a8185602086016124bf565b614033816124e9565b840191505092915050565b60006040820190506140536000830185613ae4565b81810360208301526140658184614005565b90509392505050565b600081905092915050565b6000614084826124a3565b61408e818561406e565b935061409e8185602086016124bf565b80840191505092915050565b60006140b68284614079565b915081905092915050565b7f64656c656761746563616c6c0000000000000000000000000000000000000000600082015250565b60006140f7600c8361406e565b9150614102826140c1565b600c82019050919050565b6000614118826140ea565b9150819050919050565b600081905092915050565b60006141388261343f565b6141428185614122565b93506141528185602086016124bf565b80840191505092915050565b600061416a828461412d565b915081905092915050565b7f6661696c65642064656c656761746563616c6c20746f20707265636f6d70696c60008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b60006141d1602183613cc8565b91506141dc82614175565b604082019050919050565b60006020820190508181036000830152614200816141c4565b9050919050565b60006040828403121561421d5761421c6135eb565b5b6142276040612774565b9050600082015167ffffffffffffffff811115614247576142466135f0565b5b61425384828501613dc8565b600083015250602061426784828501613e1b565b60208301525092915050565b6000806040838503121561428a576142896122ff565b5b600061429885828601613e1b565b925050602083015167ffffffffffffffff8111156142b9576142b8612304565b5b6142c585828601614207565b9150509250929050565b7f73746174696363616c6c00000000000000000000000000000000000000000000600082015250565b6000614305600a8361406e565b9150614310826142cf565b600a82019050919050565b6000614326826142f8565b9150819050919050565b7f6661696c65642073746174696363616c6c20746f20707265636f6d70696c6500600082015250565b6000614366601f83613cc8565b915061437182614330565b602082019050919050565b6000602082019050818103600083015261439581614359565b9050919050565b7f63616c6c00000000000000000000000000000000000000000000000000000000600082015250565b60006143d260048361406e565b91506143dd8261439c565b600482019050919050565b60006143f3826143c5565b9150819050919050565b7f6661696c65642063616c6c20746f20707265636f6d70696c6500000000000000600082015250565b6000614433601983613cc8565b915061443e826143fd565b602082019050919050565b6000602082019050818103600083015261446281614426565b9050919050565b7f63616c6c636f6465000000000000000000000000000000000000000000000000600082015250565b600061449f60088361406e565b91506144aa82614469565b600882019050919050565b60006144c082614492565b9150819050919050565b7f696e76616c69642063616c6c7479706500000000000000000000000000000000600082015250565b6000614500601083613cc8565b915061450b826144ca565b602082019050919050565b6000602082019050818103600083015261452f816144f3565b9050919050565b600081549050919050565b60008190508160005260206000209050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061459d57607f821691505b6020821081036145b0576145af614556565b5b50919050565b60008190508160005260206000209050919050565b600081546145d881614585565b6145e281866124ae565b945060018216600081146145fd576001811461461357614646565b60ff198316865281151560200286019350614646565b61461c856145b6565b60005b8381101561463e5781548189015260018201915060208101905061461f565b808801955050505b50505092915050565b600061465b83836145cb565b905092915050565b6000600182019050919050565b600061467b82614536565b6146858185613af3565b93508360208202850161469785614541565b8060005b858110156146d2578484038952816146b3858261464f565b94506146be83614663565b925060208a0199505060018101905061469b565b50829750879550505050505092915050565b60006060820190506146f96000830186613ae4565b61470660208301856128ca565b81810360408301526147188184614670565b9050949350505050565b7f64656c65676174696f6e20617070726f76616c206661696c6564000000000000600082015250565b6000614758601a83613cc8565b915061476382614722565b602082019050919050565b600060208201905081810360008301526147878161474b565b9050919050565b60006040820190506147a36000830185613ae4565b6147b060208301846128ca565b9392505050565b7f7472616e73666572206661696c65640000000000000000000000000000000000600082015250565b60006147ed600f83613cc8565b91506147f8826147b7565b602082019050919050565b6000602082019050818103600083015261481c816147e0565b9050919050565b60006060820190506148386000830186613ae4565b818103602083015261484a8185614005565b905061485960408301846128ca565b949350505050565b7f5374616b696e6720417070726f7665206661696c656400000000000000000000600082015250565b6000614897601683613cc8565b91506148a282614861565b602082019050919050565b600060208201905081810360008301526148c68161488a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614907826123cc565b9150614912836123cc565b925082820190508082111561492a576149296148cd565b5b92915050565b600067ffffffffffffffff82111561494b5761494a612714565b5b602082029050602081019050919050565b60008151905061496b81613696565b92915050565b600060c08284031215614987576149866135eb565b5b61499160c0612774565b905060006149a184828501613e47565b60008301525060206149b584828501613e47565b60208301525060406149c984828501613e1b565b60408301525060606149dd84828501613e1b565b60608301525060806149f18482850161495c565b60808301525060a0614a0584828501613e47565b60a08301525092915050565b6000614a24614a1f84614930565b612774565b90508083825260208201905060c08402830185811115614a4757614a46612371565b5b835b81811015614a705780614a5c8882614971565b84526020840193505060c081019050614a49565b5050509392505050565b600082601f830112614a8f57614a8e612367565b5b8151614a9f848260208601614a11565b91505092915050565b600060608284031215614abe57614abd6135eb565b5b614ac86060612774565b9050600082015167ffffffffffffffff811115614ae857614ae76135f0565b5b614af484828501613dc8565b600083015250602082015167ffffffffffffffff811115614b1857614b176135f0565b5b614b2484828501613dc8565b602083015250604082015167ffffffffffffffff811115614b4857614b476135f0565b5b614b5484828501614a7a565b60408301525092915050565b600060208284031215614b7657614b756122ff565b5b600082015167ffffffffffffffff811115614b9457614b93612304565b5b614ba084828501614aa8565b91505092915050565b6000606082019050614bbe6000830186613ae4565b8181036020830152614bd08185614005565b90508181036040830152614be48184614005565b9050949350505050565b600067ffffffffffffffff821115614c0957614c08612714565b5b602082029050602081019050919050565b600060808284031215614c3057614c2f6135eb565b5b614c3a6080612774565b90506000614c4a84828501613e47565b6000830152506020614c5e84828501613e47565b6020830152506040614c7284828501613e1b565b6040830152506060614c8684828501613e1b565b60608301525092915050565b6000614ca5614ca084614bee565b612774565b90508083825260208201905060808402830185811115614cc857614cc7612371565b5b835b81811015614cf15780614cdd8882614c1a565b845260208401935050608081019050614cca565b5050509392505050565b600082601f830112614d1057614d0f612367565b5b8151614d20848260208601614c92565b91505092915050565b600060808284031215614d3f57614d3e6135eb565b5b614d496080612774565b9050600082015167ffffffffffffffff811115614d6957614d686135f0565b5b614d7584828501613dc8565b600083015250602082015167ffffffffffffffff811115614d9957614d986135f0565b5b614da584828501613dc8565b602083015250604082015167ffffffffffffffff811115614dc957614dc86135f0565b5b614dd584828501613dc8565b604083015250606082015167ffffffffffffffff811115614df957614df86135f0565b5b614e0584828501614cfb565b60608301525092915050565b600060208284031215614e2757614e266122ff565b5b600082015167ffffffffffffffff811115614e4557614e44612304565b5b614e5184828501614d29565b91505092915050565b6000608082019050614e6f6000830187613ae4565b8181036020830152614e818186614005565b9050614e9060408301856128ca565b614e9d60608301846128ca565b95945050505050565b7f44656c656761746520417070726f7665206661696c6564000000000000000000600082015250565b6000614edc601783613cc8565b9150614ee782614ea6565b602082019050919050565b60006020820190508181036000830152614f0b81614ecf565b9050919050565b600060a08301614f256000840184613b60565b8583036000870152614f38838284613b0e565b92505050614f496020840184613b60565b8583036020870152614f5c838284613b0e565b92505050614f6d6040840184613b60565b8583036040870152614f80838284613b0e565b92505050614f916060840184613b60565b8583036060870152614fa4838284613b0e565b92505050614fb56080840184613b60565b8583036080870152614fc8838284613b0e565b925050508091505092915050565b6000614fe560208401846123ed565b905092915050565b60608201614ffe6000830183614fd6565b61500b60008501826125c5565b506150196020830183614fd6565b61502660208501826125c5565b506150346040830183614fd6565b61504160408501826125c5565b50505050565b60006101008201905081810360008301526150628189614f12565b90506150716020830188614fed565b61507e60808301876128ca565b61508b60a0830186613ae4565b81810360c083015261509d8185614005565b90506150ac60e08301846128ca565b979650505050505050565b6000602082840312156150cd576150cc6122ff565b5b60006150db84828501613e47565b91505092915050565b60006150ef826123cc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615121576151206148cd565b5b600182019050919050565b6000615137826123cc565b91506000820361514a576151496148cd565b5b600182039050919050565b600060808201905061516a6000830187613ae4565b818103602083015261517c8186614005565b905081810360408301526151908185614005565b905061519f60608301846128ca565b95945050505050565b6151b181613130565b82525050565b600060808201905081810360008301526151d18187614f12565b90506151e06020830186613ae4565b6151ed60408301856151a8565b6151fa60608301846151a8565b95945050505050565b600080833560016020038436030381126152205761521f613b5b565b5b83810192508235915060208301925067ffffffffffffffff82111561524857615247613b51565b5b60018202360383131561525e5761525d613b56565b5b509250929050565b6000615272838561344a565b935061527f8385846127c0565b615288836124e9565b840190509392505050565b60006152a260208401846136ad565b905092915050565b60006152b960208401846136d9565b905092915050565b600060a083016152d46000840184615203565b85830360008701526152e7838284615266565b925050506152f86020840184615293565b6153056020860182612aad565b506153136040840184615293565b6153206040860182612aad565b5061532e60608401846152aa565b61533b606086018261253f565b5061534960808401846152aa565b615356608086018261253f565b508091505092915050565b6000604082019050818103600083015261537b8185614005565b9050818103602083015261538f81846152c1565b90509392505050565b600067ffffffffffffffff8211156153b3576153b2612714565b5b602082029050602081019050919050565b60006153d76153d284615398565b612774565b905080838252602082019050602084028301858111156153fa576153f9612371565b5b835b8181101561544157805167ffffffffffffffff81111561541f5761541e612367565b5b80860161542c8982613e5c565b855260208501945050506020810190506153fc565b5050509392505050565b600082601f8301126154605761545f612367565b5b81516154708482602086016153c4565b91505092915050565b600061548c615487846135f5565b612774565b9050828152602081018484840111156154a8576154a761270f565b5b6154b38482856124bf565b509392505050565b600082601f8301126154d0576154cf612367565b5b81516154e0848260208601615479565b91505092915050565b6000604082840312156154ff576154fe6135eb565b5b6155096040612774565b9050600082015167ffffffffffffffff811115615529576155286135f0565b5b615535848285016154bb565b60008301525060206155498482850161495c565b60208301525092915050565b6000806040838503121561556c5761556b6122ff565b5b600083015167ffffffffffffffff81111561558a57615589612304565b5b6155968582860161544b565b925050602083015167ffffffffffffffff8111156155b7576155b6612304565b5b6155c3858286016154e9565b9150509250929050565b60006060820190506155e26000830186613ae4565b6155ef6020830185613ae4565b81810360408301526156018184614005565b9050949350505050565b600060208284031215615621576156206122ff565b5b600061562f84828501613e1b565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b6000819050602082019050919050565b600061568e83836124fa565b905092915050565b6000602082019050919050565b60006156ae82615667565b6156b88185613af3565b9350836020820285016156ca85615672565b8060005b8581101561570657848403895281516156e78582615682565b94506156f283615696565b925060208a019950506001810190506156ce565b50829750879550505050505092915050565b600060608201905061572d6000830186613ae4565b61573a60208301856128ca565b818103604083015261574c81846156a3565b9050949350505050565b7f6661696c656420746f20617070726f766520756e64656c65676174696f6e206d60008201527f6574686f64000000000000000000000000000000000000000000000000000000602082015250565b60006157b2602583613cc8565b91506157bd82615756565b604082019050919050565b600060208201905081810360008301526157e1816157a5565b9050919050565b60006040820190506157fd6000830186613ae4565b8181036020830152615810818486613bd0565b9050949350505050565b7f4661696c656420746f207265766f6b6520617070726f76616c20666f7220737460008201527f616b696e67206d6574686f647300000000000000000000000000000000000000602082015250565b6000615876602d83613cc8565b91506158818261581a565b604082019050919050565b600060208201905081810360008301526158a581615869565b9050919050565b600060a08301600083015184820360008601526158c9828261345b565b91505060208301516158de6020860182612aad565b5060408301516158f16040860182612aad565b506060830151615904606086018261253f565b506080830151615917608086018261253f565b508091505092915050565b60006080820190506159376000830187613ae4565b81810360208301526159498186614005565b9050818103604083015261595d8185614005565b9050818103606083015261597181846158ac565b905095945050505050565b600067ffffffffffffffff82111561599757615996612714565b5b602082029050602081019050919050565b6000608082840312156159be576159bd6135eb565b5b6159c86080612774565b9050600082015167ffffffffffffffff8111156159e8576159e76135f0565b5b6159f484828501613dc8565b600083015250602082015167ffffffffffffffff811115615a1857615a176135f0565b5b615a2484828501613dc8565b602083015250604082015167ffffffffffffffff811115615a4857615a476135f0565b5b615a5484828501613dc8565b604083015250606082015167ffffffffffffffff811115615a7857615a776135f0565b5b615a8484828501614cfb565b60608301525092915050565b600067ffffffffffffffff821115615aab57615aaa612714565b5b602082029050602081019050919050565b600060a08284031215615ad257615ad16135eb565b5b615adc6040612774565b90506000615aec84828501614c1a565b6000830152506080615b0084828501613e1b565b60208301525092915050565b6000615b1f615b1a84615a90565b612774565b90508083825260208201905060a08402830185811115615b4257615b41612371565b5b835b81811015615b6b5780615b578882615abc565b84526020840193505060a081019050615b44565b5050509392505050565b600082601f830112615b8a57615b89612367565b5b8151615b9a848260208601615b0c565b91505092915050565b600060408284031215615bb957615bb86135eb565b5b615bc36040612774565b9050600082015167ffffffffffffffff811115615be357615be26135f0565b5b615bef848285016159a8565b600083015250602082015167ffffffffffffffff811115615c1357615c126135f0565b5b615c1f84828501615b75565b60208301525092915050565b6000615c3e615c398461597c565b612774565b90508083825260208201905060208402830185811115615c6157615c60612371565b5b835b81811015615ca857805167ffffffffffffffff811115615c8657615c85612367565b5b808601615c938982615ba3565b85526020850194505050602081019050615c63565b5050509392505050565b600082601f830112615cc757615cc6612367565b5b8151615cd7848260208601615c2b565b91505092915050565b60008060408385031215615cf757615cf66122ff565b5b600083015167ffffffffffffffff811115615d1557615d14612304565b5b615d2185828601615cb2565b925050602083015167ffffffffffffffff811115615d4257615d41612304565b5b615d4e858286016154e9565b915050925092905056fe2f636f736d6f732e7374616b696e672e763162657461312e4d7367556e64656c6567617465a2646970667358221220f92a75ffec39902abe6f6a0566a81b72b06b4230532e3de5581b108d1039964c64736f6c634300081400332f636f736d6f732e7374616b696e672e763162657461312e4d736744656c6567617465", + "deployedBytecode": "0x60806040526004361061014b5760003560e01c80637e51b811116100b6578063cf2753cf1161006f578063cf2753cf146104a8578063ec9485df146104e6578063f40a214614610523578063f5714e641461054c578063f700dbd214610568578063f732b065146105915761014b565b80637e51b811146103965780638939e783146103bf5780638edb3f8b146103e85780639eab671114610404578063af9a90b21461042d578063b13d42421461046a5761014b565b806355dc4b221161010857806355dc4b2214610283578063570467ac146102ac5780635e269bfe146102e957806360deaa2a1461031257806361bc221a1461032e57806368ac3df3146103595761014b565b80630a4433e2146101505780631904bb2e1461017957806319b16c4c146101b657806331bcbcb3146101f45780633566cb951461021d578063455b855114610246575b600080fd5b34801561015c57600080fd5b5061017760048036038101906101729190612402565b6105cf565b005b34801561018557600080fd5b506101a0600480360381019061019b9190612476565b61069e565b6040516101ad91906126ed565b60405180910390f35b3480156101c257600080fd5b506101dd60048036038101906101d8919061283f565b61072e565b6040516101eb929190612916565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612946565b610c2d565b005b34801561022957600080fd5b50610244600480360381019061023f91906129b5565b610eba565b005b34801561025257600080fd5b5061026d60048036038101906102689190612a11565b611022565b60405161027a9190612c18565b60405180910390f35b34801561028f57600080fd5b506102aa60048036038101906102a59190612c3a565b6110b5565b005b3480156102b857600080fd5b506102d360048036038101906102ce919061283f565b6114a7565b6040516102e09190612e55565b60405180910390f35b3480156102f557600080fd5b50610310600480360381019061030b9190612e77565b61153d565b005b61032c60048036038101906103279190612efa565b6115c8565b005b34801561033a57600080fd5b50610343611716565b6040516103509190612f43565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b9190612fa1565b61171c565b60405161038d9190613076565b60405180910390f35b3480156103a257600080fd5b506103bd60048036038101906103b89190612946565b6117b2565b005b3480156103cb57600080fd5b506103e660048036038101906103e19190612946565b61183a565b005b61040260048036038101906103fd9190612efa565b6118f0565b005b34801561041057600080fd5b5061042b60048036038101906104269190613091565b611a85565b005b34801561043957600080fd5b50610454600480360381019061044f9190613166565b611b10565b6040516104619190613076565b60405180910390f35b34801561047657600080fd5b50610491600480360381019061048c9190613208565b611ba0565b60405161049f9291906134d1565b60405180910390f35b3480156104b457600080fd5b506104cf60048036038101906104ca9190612a11565b611c38565b6040516104dd929190612916565b60405180910390f35b3480156104f257600080fd5b5061050d60048036038101906105089190612a11565b611cd0565b60405161051a9190612f43565b60405180910390f35b34801561052f57600080fd5b5061054a60048036038101906105459190613508565b611d5a565b005b61056660048036038101906105619190612efa565b611f36565b005b34801561057457600080fd5b5061058f600480360381019061058a919061358b565b612090565b005b34801561059d57600080fd5b506105b860048036038101906105b39190613796565b61215c565b6040516105c6929190613aad565b60405180910390f35b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895868487876040518563ffffffff1660e01b81526004016106129493929190613c46565b6020604051808303816000875af1158015610631573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106559190613c9b565b905080610697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068e90613d4b565b60405180910390fd5b5050505050565b6106a66121fa565b61080073ffffffffffffffffffffffffffffffffffffffff1663223b3b7a836040518263ffffffff1660e01b81526004016106e19190613d6b565b600060405180830381865afa1580156106fe573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906107279190613fbc565b9050919050565b600061073861226e565b600061080090506000868660405160240161075492919061403e565b6040516020818303038152906040527f241774e6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000856040516020016107e691906140aa565b60405160208183030381529060405280519060200120905060405160200161080d9061410d565b6040516020818303038152906040528051906020012081036108f9576000808473ffffffffffffffffffffffffffffffffffffffff1684604051610851919061415e565b600060405180830381855af49150503d806000811461088c576040519150601f19603f3d011682016040523d82523d6000602084013e610891565b606091505b5091509150816108d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cd906141e7565b60405180910390fd5b808060200190518101906108ea9190614273565b80975081985050505050610c22565b6040516020016109089061431b565b6040516020818303038152906040528051906020012081036109f4576000808473ffffffffffffffffffffffffffffffffffffffff168460405161094c919061415e565b600060405180830381855afa9150503d8060008114610987576040519150601f19603f3d011682016040523d82523d6000602084013e61098c565b606091505b5091509150816109d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c89061437c565b60405180910390fd5b808060200190518101906109e59190614273565b80975081985050505050610c21565b604051602001610a03906143e8565b604051602081830303815290604052805190602001208103610af1576000808473ffffffffffffffffffffffffffffffffffffffff1684604051610a47919061415e565b6000604051808303816000865af19150503d8060008114610a84576040519150601f19603f3d011682016040523d82523d6000602084013e610a89565b606091505b509150915081610ace576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac590614449565b60405180910390fd5b80806020019051810190610ae29190614273565b80975081985050505050610c20565b604051602001610b00906144b5565b604051602081830303815290604052805190602001208103610be45760006040518060400160405280601a81526020017f64656c65676174696f6e28616464726573732c737472696e6729000000000000815250805190602001209050600060a490506060600060208b01516020808d0101516040518681528e6004820152604060248201526033604482015282606482015281608482015260c081878360008e5af281519c5060608201519450610100820160405280610bc057600080fd5b50505050604051806040016040528083815260200182815250975050505050610c1f565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1690614516565b60405180910390fd5b5b5b5b505050935093915050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895308460016040518463ffffffff1660e01b8152600401610c6f939291906146e4565b6020604051808303816000875af1158015610c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb29190613c9b565b905080610cf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ceb9061476e565b60405180910390fd5b60008473ffffffffffffffffffffffffffffffffffffffff163384604051602401610d2092919061478e565b6040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610daa919061415e565b6000604051808303816000865af19150503d8060008114610de7576040519150601f19603f3d011682016040523d82523d6000602084013e610dec565b606091505b5050905080610e30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2790614803565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3386866040518463ffffffff1660e01b8152600401610e6f93929190614823565b6020604051808303816000875af1158015610e8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb29190613c9b565b505050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895308460016040518463ffffffff1660e01b8152600401610efc939291906146e4565b6020604051808303816000875af1158015610f1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3f9190613c9b565b905080610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f78906148ad565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3085856040518463ffffffff1660e01b8152600401610fc093929190614823565b6020604051808303816000875af1158015610fdf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110039190613c9b565b50600160008082825461101691906148fc565b92505081905550505050565b61102a612288565b61080073ffffffffffffffffffffffffffffffffffffffff1663a03ffee184846040518363ffffffff1660e01b815260040161106792919061403e565b600060405180830381865afa158015611084573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906110ad9190614b60565b905092915050565b6000610800905060008585856040516024016110d393929190614823565b6040516020818303038152906040527f3edab33c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905060008360405160200161116591906140aa565b60405160208183030381529060405280519060200120905060405160200161118c9061410d565b6040516020818303038152906040528051906020012081036112595760008373ffffffffffffffffffffffffffffffffffffffff16836040516111cf919061415e565b600060405180830381855af49150503d806000811461120a576040519150601f19603f3d011682016040523d82523d6000602084013e61120f565b606091505b5050905080611253576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124a906141e7565b60405180910390fd5b5061149e565b6040516020016112689061431b565b6040516020818303038152906040528051906020012081036113355760008373ffffffffffffffffffffffffffffffffffffffff16836040516112ab919061415e565b600060405180830381855afa9150503d80600081146112e6576040519150601f19603f3d011682016040523d82523d6000602084013e6112eb565b606091505b505090508061132f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113269061437c565b60405180910390fd5b5061149d565b604051602001611344906143e8565b6040516020818303038152906040528051906020012081036114135760008373ffffffffffffffffffffffffffffffffffffffff1683604051611387919061415e565b6000604051808303816000865af19150503d80600081146113c4576040519150601f19603f3d011682016040523d82523d6000602084013e6113c9565b606091505b505090508061140d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140490614449565b60405180910390fd5b5061149c565b604051602001611422906144b5565b6040516020818303038152906040528051906020012081036114605760208201825160008082846000895af28061145857600080fd5b50505061149b565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149290614516565b60405180910390fd5b5b5b5b50505050505050565b6114af6122a9565b61080073ffffffffffffffffffffffffffffffffffffffff16637d9f939c8585856040518463ffffffff1660e01b81526004016114ee93929190614ba9565b600060405180830381865afa15801561150b573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906115349190614e11565b90509392505050565b61080073ffffffffffffffffffffffffffffffffffffffff166312d58dfe858585856040518563ffffffff1660e01b815260040161157e9493929190614e5a565b6020604051808303816000875af115801561159d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c19190613c9b565b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895303460016040518463ffffffff1660e01b815260040161160a939291906146e4565b6020604051808303816000875af1158015611629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164d9190613c9b565b90508061168f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168690614ef2565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3084346040518463ffffffff1660e01b81526004016116ce93929190614823565b6020604051808303816000875af11580156116ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117119190613c9b565b505050565b60005481565b600061080073ffffffffffffffffffffffffffffffffffffffff1663f7cd55168888888888886040518763ffffffff1660e01b815260040161176396959493929190615047565b6020604051808303816000875af1158015611782573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a69190613c9b565b90509695505050505050565b61080073ffffffffffffffffffffffffffffffffffffffff16633edab33c8484846040518463ffffffff1660e01b81526004016117f193929190614823565b6020604051808303816000875af1158015611810573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061183491906150b7565b50505050565b60008081548092919061184c906150e4565b919050555061080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8484846040518463ffffffff1660e01b815260040161189093929190614823565b6020604051808303816000875af11580156118af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d39190613c9b565b506000808154809291906118e69061512c565b9190505550505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895323460016040518463ffffffff1660e01b8152600401611932939291906146e4565b6020604051808303816000875af1158015611951573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119759190613c9b565b9050806119b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ae90614ef2565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3084346040518463ffffffff1660e01b81526004016119f693929190614823565b6020604051808303816000875af1158015611a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a399190613c9b565b503373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015611a80573d6000803e3d6000fd5b505050565b61080073ffffffffffffffffffffffffffffffffffffffff166354b826f5858585856040518563ffffffff1660e01b8152600401611ac69493929190615155565b6020604051808303816000875af1158015611ae5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0991906150b7565b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663a50f05ac868686866040518563ffffffff1660e01b8152600401611b5394939291906151b7565b6020604051808303816000875af1158015611b72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b969190613c9b565b9050949350505050565b6060611baa6122d1565b61080073ffffffffffffffffffffffffffffffffffffffff1663186b216785856040518363ffffffff1660e01b8152600401611be7929190615361565b600060405180830381865afa158015611c04573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611c2d9190615555565b915091509250929050565b6000611c4261226e565b61080073ffffffffffffffffffffffffffffffffffffffff1663241774e685856040518363ffffffff1660e01b8152600401611c7f92919061403e565b600060405180830381865afa158015611c9c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611cc59190614273565b915091509250929050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663fc08930c8433856040518463ffffffff1660e01b8152600401611d11939291906155cd565b602060405180830381865afa158015611d2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d52919061560b565b905092915050565b6000600167ffffffffffffffff811115611d7757611d76612714565b5b604051908082528060200260200182016040528015611daa57816020015b6060815260200190600190039081611d955790505b509050604051806060016040528060258152602001615d596025913981600081518110611dda57611dd9615638565b5b6020026020010181905250600061080073ffffffffffffffffffffffffffffffffffffffff1663b60398958787856040518463ffffffff1660e01b8152600401611e2693929190615718565b6020604051808303816000875af1158015611e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e699190613c9b565b905080611eab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea2906157c8565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff16633edab33c3285876040518463ffffffff1660e01b8152600401611eea93929190614823565b6020604051808303816000875af1158015611f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2d91906150b7565b50505050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895323460016040518463ffffffff1660e01b8152600401611f78939291906146e4565b6020604051808303816000875af1158015611f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbb9190613c9b565b905080611ffd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff490614ef2565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb308460013461202a91906148fc565b6040518463ffffffff1660e01b815260040161204893929190614823565b6020604051808303816000875af1158015612067573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208b9190613c9b565b505050565b600061080073ffffffffffffffffffffffffffffffffffffffff166361dc5c3b8585856040518463ffffffff1660e01b81526004016120d1939291906157e8565b6020604051808303816000875af11580156120f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121149190613c9b565b905080612156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214d9061588c565b60405180910390fd5b50505050565b60606121666122d1565b61080073ffffffffffffffffffffffffffffffffffffffff166310a2851c878787876040518563ffffffff1660e01b81526004016121a79493929190615922565b600060405180830381865afa1580156121c4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906121ed9190615ce0565b9150915094509492505050565b6040518061016001604052806060815260200160608152602001600015158152602001600060038111156122315761223061254e565b5b8152602001600081526020016000815260200160608152602001600060070b8152602001600060070b815260200160008152602001600081525090565b604051806040016040528060608152602001600081525090565b60405180606001604052806060815260200160608152602001606081525090565b6040518060800160405280606081526020016060815260200160608152602001606081525090565b604051806040016040528060608152602001600067ffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061233482612309565b9050919050565b61234481612329565b811461234f57600080fd5b50565b6000813590506123618161233b565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261238c5761238b612367565b5b8235905067ffffffffffffffff8111156123a9576123a861236c565b5b6020830191508360208202830111156123c5576123c4612371565b5b9250929050565b6000819050919050565b6123df816123cc565b81146123ea57600080fd5b50565b6000813590506123fc816123d6565b92915050565b6000806000806060858703121561241c5761241b6122ff565b5b600061242a87828801612352565b945050602085013567ffffffffffffffff81111561244b5761244a612304565b5b61245787828801612376565b9350935050604061246a878288016123ed565b91505092959194509250565b60006020828403121561248c5761248b6122ff565b5b600061249a84828501612352565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156124dd5780820151818401526020810190506124c2565b60008484015250505050565b6000601f19601f8301169050919050565b6000612505826124a3565b61250f81856124ae565b935061251f8185602086016124bf565b612528816124e9565b840191505092915050565b60008115159050919050565b61254881612533565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061258e5761258d61254e565b5b50565b600081905061259f8261257d565b919050565b60006125af82612591565b9050919050565b6125bf816125a4565b82525050565b6125ce816123cc565b82525050565b60008160070b9050919050565b6125ea816125d4565b82525050565b600061016083016000830151848203600086015261260e82826124fa565b9150506020830151848203602086015261262882826124fa565b915050604083015161263d604086018261253f565b50606083015161265060608601826125b6565b50608083015161266360808601826125c5565b5060a083015161267660a08601826125c5565b5060c083015184820360c086015261268e82826124fa565b91505060e08301516126a360e08601826125e1565b506101008301516126b86101008601826125e1565b506101208301516126cd6101208601826125c5565b506101408301516126e26101408601826125c5565b508091505092915050565b6000602082019050818103600083015261270781846125f0565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61274c826124e9565b810181811067ffffffffffffffff8211171561276b5761276a612714565b5b80604052505050565b600061277e6122f5565b905061278a8282612743565b919050565b600067ffffffffffffffff8211156127aa576127a9612714565b5b6127b3826124e9565b9050602081019050919050565b82818337600083830152505050565b60006127e26127dd8461278f565b612774565b9050828152602081018484840111156127fe576127fd61270f565b5b6128098482856127c0565b509392505050565b600082601f83011261282657612825612367565b5b81356128368482602086016127cf565b91505092915050565b600080600060608486031215612858576128576122ff565b5b600061286686828701612352565b935050602084013567ffffffffffffffff81111561288757612886612304565b5b61289386828701612811565b925050604084013567ffffffffffffffff8111156128b4576128b3612304565b5b6128c086828701612811565b9150509250925092565b6128d3816123cc565b82525050565b600060408301600083015184820360008601526128f682826124fa565b915050602083015161290b60208601826125c5565b508091505092915050565b600060408201905061292b60008301856128ca565b818103602083015261293d81846128d9565b90509392505050565b60008060006060848603121561295f5761295e6122ff565b5b600061296d86828701612352565b935050602084013567ffffffffffffffff81111561298e5761298d612304565b5b61299a86828701612811565b92505060406129ab868287016123ed565b9150509250925092565b600080604083850312156129cc576129cb6122ff565b5b600083013567ffffffffffffffff8111156129ea576129e9612304565b5b6129f685828601612811565b9250506020612a07858286016123ed565b9150509250929050565b60008060408385031215612a2857612a276122ff565b5b6000612a3685828601612352565b925050602083013567ffffffffffffffff811115612a5757612a56612304565b5b612a6385828601612811565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600067ffffffffffffffff82169050919050565b612ab681612a99565b82525050565b60c082016000820151612ad260008501826125e1565b506020820151612ae560208501826125e1565b506040820151612af860408501826125c5565b506060820151612b0b60608501826125c5565b506080820151612b1e6080850182612aad565b5060a0820151612b3160a08501826125e1565b50505050565b6000612b438383612abc565b60c08301905092915050565b6000602082019050919050565b6000612b6782612a6d565b612b718185612a78565b9350612b7c83612a89565b8060005b83811015612bad578151612b948882612b37565b9750612b9f83612b4f565b925050600181019050612b80565b5085935050505092915050565b60006060830160008301518482036000860152612bd782826124fa565b91505060208301518482036020860152612bf182826124fa565b91505060408301518482036040860152612c0b8282612b5c565b9150508091505092915050565b60006020820190508181036000830152612c328184612bba565b905092915050565b60008060008060808587031215612c5457612c536122ff565b5b6000612c6287828801612352565b945050602085013567ffffffffffffffff811115612c8357612c82612304565b5b612c8f87828801612811565b9350506040612ca0878288016123ed565b925050606085013567ffffffffffffffff811115612cc157612cc0612304565b5b612ccd87828801612811565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b608082016000820151612d1b60008501826125e1565b506020820151612d2e60208501826125e1565b506040820151612d4160408501826125c5565b506060820151612d5460608501826125c5565b50505050565b6000612d668383612d05565b60808301905092915050565b6000602082019050919050565b6000612d8a82612cd9565b612d948185612ce4565b9350612d9f83612cf5565b8060005b83811015612dd0578151612db78882612d5a565b9750612dc283612d72565b925050600181019050612da3565b5085935050505092915050565b60006080830160008301518482036000860152612dfa82826124fa565b91505060208301518482036020860152612e1482826124fa565b91505060408301518482036040860152612e2e82826124fa565b91505060608301518482036060860152612e488282612d7f565b9150508091505092915050565b60006020820190508181036000830152612e6f8184612ddd565b905092915050565b60008060008060808587031215612e9157612e906122ff565b5b6000612e9f87828801612352565b945050602085013567ffffffffffffffff811115612ec057612ebf612304565b5b612ecc87828801612811565b9350506040612edd878288016123ed565b9250506060612eee878288016123ed565b91505092959194509250565b600060208284031215612f1057612f0f6122ff565b5b600082013567ffffffffffffffff811115612f2e57612f2d612304565b5b612f3a84828501612811565b91505092915050565b6000602082019050612f5860008301846128ca565b92915050565b600080fd5b600060a08284031215612f7957612f78612f5e565b5b81905092915050565b600060608284031215612f9857612f97612f5e565b5b81905092915050565b6000806000806000806101008789031215612fbf57612fbe6122ff565b5b600087013567ffffffffffffffff811115612fdd57612fdc612304565b5b612fe989828a01612f63565b9650506020612ffa89828a01612f82565b955050608061300b89828a016123ed565b94505060a061301c89828a01612352565b93505060c087013567ffffffffffffffff81111561303d5761303c612304565b5b61304989828a01612811565b92505060e061305a89828a016123ed565b9150509295509295509295565b61307081612533565b82525050565b600060208201905061308b6000830184613067565b92915050565b600080600080608085870312156130ab576130aa6122ff565b5b60006130b987828801612352565b945050602085013567ffffffffffffffff8111156130da576130d9612304565b5b6130e687828801612811565b935050604085013567ffffffffffffffff81111561310757613106612304565b5b61311387828801612811565b9250506060613124878288016123ed565b91505092959194509250565b6000819050919050565b61314381613130565b811461314e57600080fd5b50565b6000813590506131608161313a565b92915050565b600080600080608085870312156131805761317f6122ff565b5b600085013567ffffffffffffffff81111561319e5761319d612304565b5b6131aa87828801612f63565b94505060206131bb87828801612352565b93505060406131cc87828801613151565b92505060606131dd87828801613151565b91505092959194509250565b600060a082840312156131ff576131fe612f5e565b5b81905092915050565b6000806040838503121561321f5761321e6122ff565b5b600083013567ffffffffffffffff81111561323d5761323c612304565b5b61324985828601612811565b925050602083013567ffffffffffffffff81111561326a57613269612304565b5b613276858286016131e9565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006101608301600083015184820360008601526132ca82826124fa565b915050602083015184820360208601526132e482826124fa565b91505060408301516132f9604086018261253f565b50606083015161330c60608601826125b6565b50608083015161331f60808601826125c5565b5060a083015161333260a08601826125c5565b5060c083015184820360c086015261334a82826124fa565b91505060e083015161335f60e08601826125e1565b506101008301516133746101008601826125e1565b506101208301516133896101208601826125c5565b5061014083015161339e6101408601826125c5565b508091505092915050565b60006133b583836132ac565b905092915050565b6000602082019050919050565b60006133d582613280565b6133df818561328b565b9350836020820285016133f18561329c565b8060005b8581101561342d578484038952815161340e85826133a9565b9450613419836133bd565b925060208a019950506001810190506133f5565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b60006134668261343f565b613470818561344a565b93506134808185602086016124bf565b613489816124e9565b840191505092915050565b600060408301600083015184820360008601526134b1828261345b565b91505060208301516134c66020860182612aad565b508091505092915050565b600060408201905081810360008301526134eb81856133ca565b905081810360208301526134ff8184613494565b90509392505050565b60008060008060808587031215613522576135216122ff565b5b600061353087828801612352565b9450506020613541878288016123ed565b9350506040613552878288016123ed565b925050606085013567ffffffffffffffff81111561357357613572612304565b5b61357f87828801612811565b91505092959194509250565b6000806000604084860312156135a4576135a36122ff565b5b60006135b286828701612352565b935050602084013567ffffffffffffffff8111156135d3576135d2612304565b5b6135df86828701612376565b92509250509250925092565b600080fd5b600080fd5b600067ffffffffffffffff8211156136105761360f612714565b5b613619826124e9565b9050602081019050919050565b6000613639613634846135f5565b612774565b9050828152602081018484840111156136555761365461270f565b5b6136608482856127c0565b509392505050565b600082601f83011261367d5761367c612367565b5b813561368d848260208601613626565b91505092915050565b61369f81612a99565b81146136aa57600080fd5b50565b6000813590506136bc81613696565b92915050565b6136cb81612533565b81146136d657600080fd5b50565b6000813590506136e8816136c2565b92915050565b600060a08284031215613704576137036135eb565b5b61370e60a0612774565b9050600082013567ffffffffffffffff81111561372e5761372d6135f0565b5b61373a84828501613668565b600083015250602061374e848285016136ad565b6020830152506040613762848285016136ad565b6040830152506060613776848285016136d9565b606083015250608061378a848285016136d9565b60808301525092915050565b600080600080608085870312156137b0576137af6122ff565b5b60006137be87828801612352565b945050602085013567ffffffffffffffff8111156137df576137de612304565b5b6137eb87828801612811565b935050604085013567ffffffffffffffff81111561380c5761380b612304565b5b61381887828801612811565b925050606085013567ffffffffffffffff81111561383957613838612304565b5b613845878288016136ee565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000608083016000830151848203600086015261389a82826124fa565b915050602083015184820360208601526138b482826124fa565b915050604083015184820360408601526138ce82826124fa565b915050606083015184820360608601526138e88282612d7f565b9150508091505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60a0820160008201516139376000850182612d05565b50602082015161394a60808501826125c5565b50505050565b600061395c8383613921565b60a08301905092915050565b6000602082019050919050565b6000613980826138f5565b61398a8185613900565b935061399583613911565b8060005b838110156139c65781516139ad8882613950565b97506139b883613968565b925050600181019050613999565b5085935050505092915050565b600060408301600083015184820360008601526139f0828261387d565b91505060208301518482036020860152613a0a8282613975565b9150508091505092915050565b6000613a2383836139d3565b905092915050565b6000602082019050919050565b6000613a4382613851565b613a4d818561385c565b935083602082028501613a5f8561386d565b8060005b85811015613a9b5784840389528151613a7c8582613a17565b9450613a8783613a2b565b925060208a01995050600181019050613a63565b50829750879550505050505092915050565b60006040820190508181036000830152613ac78185613a38565b90508181036020830152613adb8184613494565b90509392505050565b613aed81612329565b82525050565b600082825260208201905092915050565b6000819050919050565b6000613b1a83856124ae565b9350613b278385846127c0565b613b30836124e9565b840190509392505050565b6000613b48848484613b0e565b90509392505050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613b7d57613b7c613b5b565b5b83810192508235915060208301925067ffffffffffffffff821115613ba557613ba4613b51565b5b600182023603831315613bbb57613bba613b56565b5b509250929050565b6000602082019050919050565b6000613bdc8385613af3565b935083602084028501613bee84613b04565b8060005b87811015613c34578484038952613c098284613b60565b613c14868284613b3b565b9550613c1f84613bc3565b935060208b019a505050600181019050613bf2565b50829750879450505050509392505050565b6000606082019050613c5b6000830187613ae4565b613c6860208301866128ca565b8181036040830152613c7b818486613bd0565b905095945050505050565b600081519050613c95816136c2565b92915050565b600060208284031215613cb157613cb06122ff565b5b6000613cbf84828501613c86565b91505092915050565b600082825260208201905092915050565b7f4661696c656420746f20617070726f7665207374616b696e67206d6574686f6460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d35602183613cc8565b9150613d4082613cd9565b604082019050919050565b60006020820190508181036000830152613d6481613d28565b9050919050565b6000602082019050613d806000830184613ae4565b92915050565b6000613d99613d948461278f565b612774565b905082815260208101848484011115613db557613db461270f565b5b613dc08482856124bf565b509392505050565b600082601f830112613ddd57613ddc612367565b5b8151613ded848260208601613d86565b91505092915050565b60048110613e0357600080fd5b50565b600081519050613e1581613df6565b92915050565b600081519050613e2a816123d6565b92915050565b613e39816125d4565b8114613e4457600080fd5b50565b600081519050613e5681613e30565b92915050565b60006101608284031215613e7357613e726135eb565b5b613e7e610160612774565b9050600082015167ffffffffffffffff811115613e9e57613e9d6135f0565b5b613eaa84828501613dc8565b600083015250602082015167ffffffffffffffff811115613ece57613ecd6135f0565b5b613eda84828501613dc8565b6020830152506040613eee84828501613c86565b6040830152506060613f0284828501613e06565b6060830152506080613f1684828501613e1b565b60808301525060a0613f2a84828501613e1b565b60a08301525060c082015167ffffffffffffffff811115613f4e57613f4d6135f0565b5b613f5a84828501613dc8565b60c08301525060e0613f6e84828501613e47565b60e083015250610100613f8384828501613e47565b61010083015250610120613f9984828501613e1b565b61012083015250610140613faf84828501613e1b565b6101408301525092915050565b600060208284031215613fd257613fd16122ff565b5b600082015167ffffffffffffffff811115613ff057613fef612304565b5b613ffc84828501613e5c565b91505092915050565b6000614010826124a3565b61401a8185613cc8565b935061402a8185602086016124bf565b614033816124e9565b840191505092915050565b60006040820190506140536000830185613ae4565b81810360208301526140658184614005565b90509392505050565b600081905092915050565b6000614084826124a3565b61408e818561406e565b935061409e8185602086016124bf565b80840191505092915050565b60006140b68284614079565b915081905092915050565b7f64656c656761746563616c6c0000000000000000000000000000000000000000600082015250565b60006140f7600c8361406e565b9150614102826140c1565b600c82019050919050565b6000614118826140ea565b9150819050919050565b600081905092915050565b60006141388261343f565b6141428185614122565b93506141528185602086016124bf565b80840191505092915050565b600061416a828461412d565b915081905092915050565b7f6661696c65642064656c656761746563616c6c20746f20707265636f6d70696c60008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b60006141d1602183613cc8565b91506141dc82614175565b604082019050919050565b60006020820190508181036000830152614200816141c4565b9050919050565b60006040828403121561421d5761421c6135eb565b5b6142276040612774565b9050600082015167ffffffffffffffff811115614247576142466135f0565b5b61425384828501613dc8565b600083015250602061426784828501613e1b565b60208301525092915050565b6000806040838503121561428a576142896122ff565b5b600061429885828601613e1b565b925050602083015167ffffffffffffffff8111156142b9576142b8612304565b5b6142c585828601614207565b9150509250929050565b7f73746174696363616c6c00000000000000000000000000000000000000000000600082015250565b6000614305600a8361406e565b9150614310826142cf565b600a82019050919050565b6000614326826142f8565b9150819050919050565b7f6661696c65642073746174696363616c6c20746f20707265636f6d70696c6500600082015250565b6000614366601f83613cc8565b915061437182614330565b602082019050919050565b6000602082019050818103600083015261439581614359565b9050919050565b7f63616c6c00000000000000000000000000000000000000000000000000000000600082015250565b60006143d260048361406e565b91506143dd8261439c565b600482019050919050565b60006143f3826143c5565b9150819050919050565b7f6661696c65642063616c6c20746f20707265636f6d70696c6500000000000000600082015250565b6000614433601983613cc8565b915061443e826143fd565b602082019050919050565b6000602082019050818103600083015261446281614426565b9050919050565b7f63616c6c636f6465000000000000000000000000000000000000000000000000600082015250565b600061449f60088361406e565b91506144aa82614469565b600882019050919050565b60006144c082614492565b9150819050919050565b7f696e76616c69642063616c6c7479706500000000000000000000000000000000600082015250565b6000614500601083613cc8565b915061450b826144ca565b602082019050919050565b6000602082019050818103600083015261452f816144f3565b9050919050565b600081549050919050565b60008190508160005260206000209050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061459d57607f821691505b6020821081036145b0576145af614556565b5b50919050565b60008190508160005260206000209050919050565b600081546145d881614585565b6145e281866124ae565b945060018216600081146145fd576001811461461357614646565b60ff198316865281151560200286019350614646565b61461c856145b6565b60005b8381101561463e5781548189015260018201915060208101905061461f565b808801955050505b50505092915050565b600061465b83836145cb565b905092915050565b6000600182019050919050565b600061467b82614536565b6146858185613af3565b93508360208202850161469785614541565b8060005b858110156146d2578484038952816146b3858261464f565b94506146be83614663565b925060208a0199505060018101905061469b565b50829750879550505050505092915050565b60006060820190506146f96000830186613ae4565b61470660208301856128ca565b81810360408301526147188184614670565b9050949350505050565b7f64656c65676174696f6e20617070726f76616c206661696c6564000000000000600082015250565b6000614758601a83613cc8565b915061476382614722565b602082019050919050565b600060208201905081810360008301526147878161474b565b9050919050565b60006040820190506147a36000830185613ae4565b6147b060208301846128ca565b9392505050565b7f7472616e73666572206661696c65640000000000000000000000000000000000600082015250565b60006147ed600f83613cc8565b91506147f8826147b7565b602082019050919050565b6000602082019050818103600083015261481c816147e0565b9050919050565b60006060820190506148386000830186613ae4565b818103602083015261484a8185614005565b905061485960408301846128ca565b949350505050565b7f5374616b696e6720417070726f7665206661696c656400000000000000000000600082015250565b6000614897601683613cc8565b91506148a282614861565b602082019050919050565b600060208201905081810360008301526148c68161488a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614907826123cc565b9150614912836123cc565b925082820190508082111561492a576149296148cd565b5b92915050565b600067ffffffffffffffff82111561494b5761494a612714565b5b602082029050602081019050919050565b60008151905061496b81613696565b92915050565b600060c08284031215614987576149866135eb565b5b61499160c0612774565b905060006149a184828501613e47565b60008301525060206149b584828501613e47565b60208301525060406149c984828501613e1b565b60408301525060606149dd84828501613e1b565b60608301525060806149f18482850161495c565b60808301525060a0614a0584828501613e47565b60a08301525092915050565b6000614a24614a1f84614930565b612774565b90508083825260208201905060c08402830185811115614a4757614a46612371565b5b835b81811015614a705780614a5c8882614971565b84526020840193505060c081019050614a49565b5050509392505050565b600082601f830112614a8f57614a8e612367565b5b8151614a9f848260208601614a11565b91505092915050565b600060608284031215614abe57614abd6135eb565b5b614ac86060612774565b9050600082015167ffffffffffffffff811115614ae857614ae76135f0565b5b614af484828501613dc8565b600083015250602082015167ffffffffffffffff811115614b1857614b176135f0565b5b614b2484828501613dc8565b602083015250604082015167ffffffffffffffff811115614b4857614b476135f0565b5b614b5484828501614a7a565b60408301525092915050565b600060208284031215614b7657614b756122ff565b5b600082015167ffffffffffffffff811115614b9457614b93612304565b5b614ba084828501614aa8565b91505092915050565b6000606082019050614bbe6000830186613ae4565b8181036020830152614bd08185614005565b90508181036040830152614be48184614005565b9050949350505050565b600067ffffffffffffffff821115614c0957614c08612714565b5b602082029050602081019050919050565b600060808284031215614c3057614c2f6135eb565b5b614c3a6080612774565b90506000614c4a84828501613e47565b6000830152506020614c5e84828501613e47565b6020830152506040614c7284828501613e1b565b6040830152506060614c8684828501613e1b565b60608301525092915050565b6000614ca5614ca084614bee565b612774565b90508083825260208201905060808402830185811115614cc857614cc7612371565b5b835b81811015614cf15780614cdd8882614c1a565b845260208401935050608081019050614cca565b5050509392505050565b600082601f830112614d1057614d0f612367565b5b8151614d20848260208601614c92565b91505092915050565b600060808284031215614d3f57614d3e6135eb565b5b614d496080612774565b9050600082015167ffffffffffffffff811115614d6957614d686135f0565b5b614d7584828501613dc8565b600083015250602082015167ffffffffffffffff811115614d9957614d986135f0565b5b614da584828501613dc8565b602083015250604082015167ffffffffffffffff811115614dc957614dc86135f0565b5b614dd584828501613dc8565b604083015250606082015167ffffffffffffffff811115614df957614df86135f0565b5b614e0584828501614cfb565b60608301525092915050565b600060208284031215614e2757614e266122ff565b5b600082015167ffffffffffffffff811115614e4557614e44612304565b5b614e5184828501614d29565b91505092915050565b6000608082019050614e6f6000830187613ae4565b8181036020830152614e818186614005565b9050614e9060408301856128ca565b614e9d60608301846128ca565b95945050505050565b7f44656c656761746520417070726f7665206661696c6564000000000000000000600082015250565b6000614edc601783613cc8565b9150614ee782614ea6565b602082019050919050565b60006020820190508181036000830152614f0b81614ecf565b9050919050565b600060a08301614f256000840184613b60565b8583036000870152614f38838284613b0e565b92505050614f496020840184613b60565b8583036020870152614f5c838284613b0e565b92505050614f6d6040840184613b60565b8583036040870152614f80838284613b0e565b92505050614f916060840184613b60565b8583036060870152614fa4838284613b0e565b92505050614fb56080840184613b60565b8583036080870152614fc8838284613b0e565b925050508091505092915050565b6000614fe560208401846123ed565b905092915050565b60608201614ffe6000830183614fd6565b61500b60008501826125c5565b506150196020830183614fd6565b61502660208501826125c5565b506150346040830183614fd6565b61504160408501826125c5565b50505050565b60006101008201905081810360008301526150628189614f12565b90506150716020830188614fed565b61507e60808301876128ca565b61508b60a0830186613ae4565b81810360c083015261509d8185614005565b90506150ac60e08301846128ca565b979650505050505050565b6000602082840312156150cd576150cc6122ff565b5b60006150db84828501613e47565b91505092915050565b60006150ef826123cc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615121576151206148cd565b5b600182019050919050565b6000615137826123cc565b91506000820361514a576151496148cd565b5b600182039050919050565b600060808201905061516a6000830187613ae4565b818103602083015261517c8186614005565b905081810360408301526151908185614005565b905061519f60608301846128ca565b95945050505050565b6151b181613130565b82525050565b600060808201905081810360008301526151d18187614f12565b90506151e06020830186613ae4565b6151ed60408301856151a8565b6151fa60608301846151a8565b95945050505050565b600080833560016020038436030381126152205761521f613b5b565b5b83810192508235915060208301925067ffffffffffffffff82111561524857615247613b51565b5b60018202360383131561525e5761525d613b56565b5b509250929050565b6000615272838561344a565b935061527f8385846127c0565b615288836124e9565b840190509392505050565b60006152a260208401846136ad565b905092915050565b60006152b960208401846136d9565b905092915050565b600060a083016152d46000840184615203565b85830360008701526152e7838284615266565b925050506152f86020840184615293565b6153056020860182612aad565b506153136040840184615293565b6153206040860182612aad565b5061532e60608401846152aa565b61533b606086018261253f565b5061534960808401846152aa565b615356608086018261253f565b508091505092915050565b6000604082019050818103600083015261537b8185614005565b9050818103602083015261538f81846152c1565b90509392505050565b600067ffffffffffffffff8211156153b3576153b2612714565b5b602082029050602081019050919050565b60006153d76153d284615398565b612774565b905080838252602082019050602084028301858111156153fa576153f9612371565b5b835b8181101561544157805167ffffffffffffffff81111561541f5761541e612367565b5b80860161542c8982613e5c565b855260208501945050506020810190506153fc565b5050509392505050565b600082601f8301126154605761545f612367565b5b81516154708482602086016153c4565b91505092915050565b600061548c615487846135f5565b612774565b9050828152602081018484840111156154a8576154a761270f565b5b6154b38482856124bf565b509392505050565b600082601f8301126154d0576154cf612367565b5b81516154e0848260208601615479565b91505092915050565b6000604082840312156154ff576154fe6135eb565b5b6155096040612774565b9050600082015167ffffffffffffffff811115615529576155286135f0565b5b615535848285016154bb565b60008301525060206155498482850161495c565b60208301525092915050565b6000806040838503121561556c5761556b6122ff565b5b600083015167ffffffffffffffff81111561558a57615589612304565b5b6155968582860161544b565b925050602083015167ffffffffffffffff8111156155b7576155b6612304565b5b6155c3858286016154e9565b9150509250929050565b60006060820190506155e26000830186613ae4565b6155ef6020830185613ae4565b81810360408301526156018184614005565b9050949350505050565b600060208284031215615621576156206122ff565b5b600061562f84828501613e1b565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b6000819050602082019050919050565b600061568e83836124fa565b905092915050565b6000602082019050919050565b60006156ae82615667565b6156b88185613af3565b9350836020820285016156ca85615672565b8060005b8581101561570657848403895281516156e78582615682565b94506156f283615696565b925060208a019950506001810190506156ce565b50829750879550505050505092915050565b600060608201905061572d6000830186613ae4565b61573a60208301856128ca565b818103604083015261574c81846156a3565b9050949350505050565b7f6661696c656420746f20617070726f766520756e64656c65676174696f6e206d60008201527f6574686f64000000000000000000000000000000000000000000000000000000602082015250565b60006157b2602583613cc8565b91506157bd82615756565b604082019050919050565b600060208201905081810360008301526157e1816157a5565b9050919050565b60006040820190506157fd6000830186613ae4565b8181036020830152615810818486613bd0565b9050949350505050565b7f4661696c656420746f207265766f6b6520617070726f76616c20666f7220737460008201527f616b696e67206d6574686f647300000000000000000000000000000000000000602082015250565b6000615876602d83613cc8565b91506158818261581a565b604082019050919050565b600060208201905081810360008301526158a581615869565b9050919050565b600060a08301600083015184820360008601526158c9828261345b565b91505060208301516158de6020860182612aad565b5060408301516158f16040860182612aad565b506060830151615904606086018261253f565b506080830151615917608086018261253f565b508091505092915050565b60006080820190506159376000830187613ae4565b81810360208301526159498186614005565b9050818103604083015261595d8185614005565b9050818103606083015261597181846158ac565b905095945050505050565b600067ffffffffffffffff82111561599757615996612714565b5b602082029050602081019050919050565b6000608082840312156159be576159bd6135eb565b5b6159c86080612774565b9050600082015167ffffffffffffffff8111156159e8576159e76135f0565b5b6159f484828501613dc8565b600083015250602082015167ffffffffffffffff811115615a1857615a176135f0565b5b615a2484828501613dc8565b602083015250604082015167ffffffffffffffff811115615a4857615a476135f0565b5b615a5484828501613dc8565b604083015250606082015167ffffffffffffffff811115615a7857615a776135f0565b5b615a8484828501614cfb565b60608301525092915050565b600067ffffffffffffffff821115615aab57615aaa612714565b5b602082029050602081019050919050565b600060a08284031215615ad257615ad16135eb565b5b615adc6040612774565b90506000615aec84828501614c1a565b6000830152506080615b0084828501613e1b565b60208301525092915050565b6000615b1f615b1a84615a90565b612774565b90508083825260208201905060a08402830185811115615b4257615b41612371565b5b835b81811015615b6b5780615b578882615abc565b84526020840193505060a081019050615b44565b5050509392505050565b600082601f830112615b8a57615b89612367565b5b8151615b9a848260208601615b0c565b91505092915050565b600060408284031215615bb957615bb86135eb565b5b615bc36040612774565b9050600082015167ffffffffffffffff811115615be357615be26135f0565b5b615bef848285016159a8565b600083015250602082015167ffffffffffffffff811115615c1357615c126135f0565b5b615c1f84828501615b75565b60208301525092915050565b6000615c3e615c398461597c565b612774565b90508083825260208201905060208402830185811115615c6157615c60612371565b5b835b81811015615ca857805167ffffffffffffffff811115615c8657615c85612367565b5b808601615c938982615ba3565b85526020850194505050602081019050615c63565b5050509392505050565b600082601f830112615cc757615cc6612367565b5b8151615cd7848260208601615c2b565b91505092915050565b60008060408385031215615cf757615cf66122ff565b5b600083015167ffffffffffffffff811115615d1557615d14612304565b5b615d2185828601615cb2565b925050602083015167ffffffffffffffff811115615d4257615d41612304565b5b615d4e858286016154e9565b915050925092905056fe2f636f736d6f732e7374616b696e672e763162657461312e4d7367556e64656c6567617465a2646970667358221220f92a75ffec39902abe6f6a0566a81b72b06b4230532e3de5581b108d1039964c64736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/staking/testdata/StakingCaller.sol b/precompiles/staking/testdata/StakingCaller.sol index 9d87ee9f..1c974ac5 100644 --- a/precompiles/staking/testdata/StakingCaller.sol +++ b/precompiles/staking/testdata/StakingCaller.sol @@ -567,4 +567,4 @@ contract StakingCaller { staking.STAKING_CONTRACT.delegate(msg.sender, _validatorAddr, _amount); } -} \ No newline at end of file +} diff --git a/precompiles/staking/testdata/StakingCallerTwo.json b/precompiles/staking/testdata/StakingCallerTwo.json index 23e8173e..ec373b8b 100644 --- a/precompiles/staking/testdata/StakingCallerTwo.json +++ b/precompiles/staking/testdata/StakingCallerTwo.json @@ -203,8 +203,8 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b50611590806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80630a4433e21461005c578063365465a814610078578063405da99f1461009457806361bc221a146100b057806389493f41146100ce575b600080fd5b61007660048036038101906100719190610980565b6100ea565b005b610092600480360381019061008d9190610bb0565b6101b9565b005b6100ae60048036038101906100a99190610cde565b610428565b005b6100b861064a565b6040516100c59190610d84565b60405180910390f35b6100e860048036038101906100e39190610d9f565b610650565b005b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895868487876040518563ffffffff1660e01b815260040161012d9493929190610fbb565b6020604051808303816000875af115801561014c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101709190611010565b9050806101b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101a9906110c0565b60405180910390fd5b5050505050565b8115610285576000808154809291906101d19061110f565b919050555060008573ffffffffffffffffffffffffffffffffffffffff16600f6040516101fd90611188565b60006040518083038185875af1925050503d806000811461023a576040519150601f19603f3d011682016040523d82523d6000602084013e61023f565b606091505b5050905080610283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027a9061120f565b60405180910390fd5b505b600061080073ffffffffffffffffffffffffffffffffffffffff1663f7cd55168a8a8a8a8a8a6040518763ffffffff1660e01b81526004016102cc969594939291906113e1565b6020604051808303816000875af11580156102eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030f9190611010565b905080610351576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103489061149d565b60405180910390fd5b811561041d576000808154809291906103699061110f565b919050555060008673ffffffffffffffffffffffffffffffffffffffff16600f60405161039590611188565b60006040518083038185875af1925050503d80600081146103d2576040519150601f19603f3d011682016040523d82523d6000602084013e6103d7565b606091505b505090508061041b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104129061120f565b60405180910390fd5b505b505050505050505050565b81156104f4576000808154809291906104409061110f565b919050555060008573ffffffffffffffffffffffffffffffffffffffff16600f60405161046c90611188565b60006040518083038185875af1925050503d80600081146104a9576040519150601f19603f3d011682016040523d82523d6000602084013e6104ae565b606091505b50509050806104f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e99061120f565b60405180910390fd5b505b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8686866040518463ffffffff1660e01b81526004016105339392919061151c565b6020604051808303816000875af1158015610552573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105769190611010565b5080156106435760008081548092919061058f9061110f565b919050555060008573ffffffffffffffffffffffffffffffffffffffff16600f6040516105bb90611188565b60006040518083038185875af1925050503d80600081146105f8576040519150601f19603f3d011682016040523d82523d6000602084013e6105fd565b606091505b5050905080610641576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106389061120f565b60405180910390fd5b505b5050505050565b60005481565b811561071c576000808154809291906106689061110f565b919050555060008673ffffffffffffffffffffffffffffffffffffffff16600f60405161069490611188565b60006040518083038185875af1925050503d80600081146106d1576040519150601f19603f3d011682016040523d82523d6000602084013e6106d6565b606091505b505090508061071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107119061120f565b60405180910390fd5b505b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8686866040518463ffffffff1660e01b815260040161075b9392919061151c565b6020604051808303816000875af115801561077a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079e9190611010565b50801561086b576000808154809291906107b79061110f565b919050555060008673ffffffffffffffffffffffffffffffffffffffff16600f6040516107e390611188565b60006040518083038185875af1925050503d8060008114610820576040519150601f19603f3d011682016040523d82523d6000602084013e610825565b606091505b5050905080610869576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108609061120f565b60405180910390fd5b505b505050505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108b282610887565b9050919050565b6108c2816108a7565b81146108cd57600080fd5b50565b6000813590506108df816108b9565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261090a576109096108e5565b5b8235905067ffffffffffffffff811115610927576109266108ea565b5b602083019150836020820283011115610943576109426108ef565b5b9250929050565b6000819050919050565b61095d8161094a565b811461096857600080fd5b50565b60008135905061097a81610954565b92915050565b6000806000806060858703121561099a5761099961087d565b5b60006109a8878288016108d0565b945050602085013567ffffffffffffffff8111156109c9576109c8610882565b5b6109d5878288016108f4565b935093505060406109e88782880161096b565b91505092959194509250565b600080fd5b600060a08284031215610a0f57610a0e6109f4565b5b81905092915050565b600060608284031215610a2e57610a2d6109f4565b5b81905092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a8582610a3c565b810181811067ffffffffffffffff82111715610aa457610aa3610a4d565b5b80604052505050565b6000610ab7610873565b9050610ac38282610a7c565b919050565b600067ffffffffffffffff821115610ae357610ae2610a4d565b5b610aec82610a3c565b9050602081019050919050565b82818337600083830152505050565b6000610b1b610b1684610ac8565b610aad565b905082815260208101848484011115610b3757610b36610a37565b5b610b42848285610af9565b509392505050565b600082601f830112610b5f57610b5e6108e5565b5b8135610b6f848260208601610b08565b91505092915050565b60008115159050919050565b610b8d81610b78565b8114610b9857600080fd5b50565b600081359050610baa81610b84565b92915050565b600080600080600080600080610140898b031215610bd157610bd061087d565b5b600089013567ffffffffffffffff811115610bef57610bee610882565b5b610bfb8b828c016109f9565b9850506020610c0c8b828c01610a18565b9750506080610c1d8b828c0161096b565b96505060a0610c2e8b828c016108d0565b95505060c089013567ffffffffffffffff811115610c4f57610c4e610882565b5b610c5b8b828c01610b4a565b94505060e0610c6c8b828c0161096b565b935050610100610c7e8b828c01610b9b565b925050610120610c908b828c01610b9b565b9150509295985092959890939650565b6000610cab82610887565b9050919050565b610cbb81610ca0565b8114610cc657600080fd5b50565b600081359050610cd881610cb2565b92915050565b600080600080600060a08688031215610cfa57610cf961087d565b5b6000610d0888828901610cc9565b955050602086013567ffffffffffffffff811115610d2957610d28610882565b5b610d3588828901610b4a565b9450506040610d468882890161096b565b9350506060610d5788828901610b9b565b9250506080610d6888828901610b9b565b9150509295509295909350565b610d7e8161094a565b82525050565b6000602082019050610d996000830184610d75565b92915050565b60008060008060008060c08789031215610dbc57610dbb61087d565b5b6000610dca89828a01610cc9565b9650506020610ddb89828a01610cc9565b955050604087013567ffffffffffffffff811115610dfc57610dfb610882565b5b610e0889828a01610b4a565b9450506060610e1989828a0161096b565b9350506080610e2a89828a01610b9b565b92505060a0610e3b89828a01610b9b565b9150509295509295509295565b610e51816108a7565b82525050565b600082825260208201905092915050565b6000819050919050565b600082825260208201905092915050565b6000610e8f8385610e72565b9350610e9c838584610af9565b610ea583610a3c565b840190509392505050565b6000610ebd848484610e83565b90509392505050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112610ef257610ef1610ed0565b5b83810192508235915060208301925067ffffffffffffffff821115610f1a57610f19610ec6565b5b600182023603831315610f3057610f2f610ecb565b5b509250929050565b6000602082019050919050565b6000610f518385610e57565b935083602084028501610f6384610e68565b8060005b87811015610fa9578484038952610f7e8284610ed5565b610f89868284610eb0565b9550610f9484610f38565b935060208b019a505050600181019050610f67565b50829750879450505050509392505050565b6000606082019050610fd06000830187610e48565b610fdd6020830186610d75565b8181036040830152610ff0818486610f45565b905095945050505050565b60008151905061100a81610b84565b92915050565b6000602082840312156110265761102561087d565b5b600061103484828501610ffb565b91505092915050565b600082825260208201905092915050565b7f4661696c656420746f20617070726f7665207374616b696e67206d6574686f6460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b60006110aa60218361103d565b91506110b58261104e565b604082019050919050565b600060208201905081810360008301526110d98161109d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061111a8261094a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361114c5761114b6110e0565b5b600182019050919050565b600081905092915050565b50565b6000611172600083611157565b915061117d82611162565b600082019050919050565b600061119382611165565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b60006111f960218361103d565b91506112048261119d565b604082019050919050565b60006020820190508181036000830152611228816111ec565b9050919050565b600060a083016112426000840184610ed5565b8583036000870152611255838284610e83565b925050506112666020840184610ed5565b8583036020870152611279838284610e83565b9250505061128a6040840184610ed5565b858303604087015261129d838284610e83565b925050506112ae6060840184610ed5565b85830360608701526112c1838284610e83565b925050506112d26080840184610ed5565b85830360808701526112e5838284610e83565b925050508091505092915050565b6000611302602084018461096b565b905092915050565b6113138161094a565b82525050565b6060820161132a60008301836112f3565b611337600085018261130a565b5061134560208301836112f3565b611352602085018261130a565b5061136060408301836112f3565b61136d604085018261130a565b50505050565b600081519050919050565b60005b8381101561139c578082015181840152602081019050611381565b60008484015250505050565b60006113b382611373565b6113bd818561103d565b93506113cd81856020860161137e565b6113d681610a3c565b840191505092915050565b60006101008201905081810360008301526113fc818961122f565b905061140b6020830188611319565b6114186080830187610d75565b61142560a0830186610e48565b81810360c083015261143781856113a8565b905061144660e0830184610d75565b979650505050505050565b7f4661696c656420746f20637265617465207468652076616c696461746f720000600082015250565b6000611487601e8361103d565b915061149282611451565b602082019050919050565b600060208201905081810360008301526114b68161147a565b9050919050565b6000819050919050565b60006114e26114dd6114d884610887565b6114bd565b610887565b9050919050565b60006114f4826114c7565b9050919050565b6000611506826114e9565b9050919050565b611516816114fb565b82525050565b6000606082019050611531600083018661150d565b818103602083015261154381856113a8565b90506115526040830184610d75565b94935050505056fea264697066735822122003832ab382861d2894e6822f69b8ae70f7e7900365e9a257288a1c0152b67c2364736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c80630a4433e21461005c578063365465a814610078578063405da99f1461009457806361bc221a146100b057806389493f41146100ce575b600080fd5b61007660048036038101906100719190610980565b6100ea565b005b610092600480360381019061008d9190610bb0565b6101b9565b005b6100ae60048036038101906100a99190610cde565b610428565b005b6100b861064a565b6040516100c59190610d84565b60405180910390f35b6100e860048036038101906100e39190610d9f565b610650565b005b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895868487876040518563ffffffff1660e01b815260040161012d9493929190610fbb565b6020604051808303816000875af115801561014c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101709190611010565b9050806101b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101a9906110c0565b60405180910390fd5b5050505050565b8115610285576000808154809291906101d19061110f565b919050555060008573ffffffffffffffffffffffffffffffffffffffff16600f6040516101fd90611188565b60006040518083038185875af1925050503d806000811461023a576040519150601f19603f3d011682016040523d82523d6000602084013e61023f565b606091505b5050905080610283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027a9061120f565b60405180910390fd5b505b600061080073ffffffffffffffffffffffffffffffffffffffff1663f7cd55168a8a8a8a8a8a6040518763ffffffff1660e01b81526004016102cc969594939291906113e1565b6020604051808303816000875af11580156102eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030f9190611010565b905080610351576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103489061149d565b60405180910390fd5b811561041d576000808154809291906103699061110f565b919050555060008673ffffffffffffffffffffffffffffffffffffffff16600f60405161039590611188565b60006040518083038185875af1925050503d80600081146103d2576040519150601f19603f3d011682016040523d82523d6000602084013e6103d7565b606091505b505090508061041b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104129061120f565b60405180910390fd5b505b505050505050505050565b81156104f4576000808154809291906104409061110f565b919050555060008573ffffffffffffffffffffffffffffffffffffffff16600f60405161046c90611188565b60006040518083038185875af1925050503d80600081146104a9576040519150601f19603f3d011682016040523d82523d6000602084013e6104ae565b606091505b50509050806104f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e99061120f565b60405180910390fd5b505b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8686866040518463ffffffff1660e01b81526004016105339392919061151c565b6020604051808303816000875af1158015610552573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105769190611010565b5080156106435760008081548092919061058f9061110f565b919050555060008573ffffffffffffffffffffffffffffffffffffffff16600f6040516105bb90611188565b60006040518083038185875af1925050503d80600081146105f8576040519150601f19603f3d011682016040523d82523d6000602084013e6105fd565b606091505b5050905080610641576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106389061120f565b60405180910390fd5b505b5050505050565b60005481565b811561071c576000808154809291906106689061110f565b919050555060008673ffffffffffffffffffffffffffffffffffffffff16600f60405161069490611188565b60006040518083038185875af1925050503d80600081146106d1576040519150601f19603f3d011682016040523d82523d6000602084013e6106d6565b606091505b505090508061071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107119061120f565b60405180910390fd5b505b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8686866040518463ffffffff1660e01b815260040161075b9392919061151c565b6020604051808303816000875af115801561077a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079e9190611010565b50801561086b576000808154809291906107b79061110f565b919050555060008673ffffffffffffffffffffffffffffffffffffffff16600f6040516107e390611188565b60006040518083038185875af1925050503d8060008114610820576040519150601f19603f3d011682016040523d82523d6000602084013e610825565b606091505b5050905080610869576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108609061120f565b60405180910390fd5b505b505050505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108b282610887565b9050919050565b6108c2816108a7565b81146108cd57600080fd5b50565b6000813590506108df816108b9565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261090a576109096108e5565b5b8235905067ffffffffffffffff811115610927576109266108ea565b5b602083019150836020820283011115610943576109426108ef565b5b9250929050565b6000819050919050565b61095d8161094a565b811461096857600080fd5b50565b60008135905061097a81610954565b92915050565b6000806000806060858703121561099a5761099961087d565b5b60006109a8878288016108d0565b945050602085013567ffffffffffffffff8111156109c9576109c8610882565b5b6109d5878288016108f4565b935093505060406109e88782880161096b565b91505092959194509250565b600080fd5b600060a08284031215610a0f57610a0e6109f4565b5b81905092915050565b600060608284031215610a2e57610a2d6109f4565b5b81905092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a8582610a3c565b810181811067ffffffffffffffff82111715610aa457610aa3610a4d565b5b80604052505050565b6000610ab7610873565b9050610ac38282610a7c565b919050565b600067ffffffffffffffff821115610ae357610ae2610a4d565b5b610aec82610a3c565b9050602081019050919050565b82818337600083830152505050565b6000610b1b610b1684610ac8565b610aad565b905082815260208101848484011115610b3757610b36610a37565b5b610b42848285610af9565b509392505050565b600082601f830112610b5f57610b5e6108e5565b5b8135610b6f848260208601610b08565b91505092915050565b60008115159050919050565b610b8d81610b78565b8114610b9857600080fd5b50565b600081359050610baa81610b84565b92915050565b600080600080600080600080610140898b031215610bd157610bd061087d565b5b600089013567ffffffffffffffff811115610bef57610bee610882565b5b610bfb8b828c016109f9565b9850506020610c0c8b828c01610a18565b9750506080610c1d8b828c0161096b565b96505060a0610c2e8b828c016108d0565b95505060c089013567ffffffffffffffff811115610c4f57610c4e610882565b5b610c5b8b828c01610b4a565b94505060e0610c6c8b828c0161096b565b935050610100610c7e8b828c01610b9b565b925050610120610c908b828c01610b9b565b9150509295985092959890939650565b6000610cab82610887565b9050919050565b610cbb81610ca0565b8114610cc657600080fd5b50565b600081359050610cd881610cb2565b92915050565b600080600080600060a08688031215610cfa57610cf961087d565b5b6000610d0888828901610cc9565b955050602086013567ffffffffffffffff811115610d2957610d28610882565b5b610d3588828901610b4a565b9450506040610d468882890161096b565b9350506060610d5788828901610b9b565b9250506080610d6888828901610b9b565b9150509295509295909350565b610d7e8161094a565b82525050565b6000602082019050610d996000830184610d75565b92915050565b60008060008060008060c08789031215610dbc57610dbb61087d565b5b6000610dca89828a01610cc9565b9650506020610ddb89828a01610cc9565b955050604087013567ffffffffffffffff811115610dfc57610dfb610882565b5b610e0889828a01610b4a565b9450506060610e1989828a0161096b565b9350506080610e2a89828a01610b9b565b92505060a0610e3b89828a01610b9b565b9150509295509295509295565b610e51816108a7565b82525050565b600082825260208201905092915050565b6000819050919050565b600082825260208201905092915050565b6000610e8f8385610e72565b9350610e9c838584610af9565b610ea583610a3c565b840190509392505050565b6000610ebd848484610e83565b90509392505050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112610ef257610ef1610ed0565b5b83810192508235915060208301925067ffffffffffffffff821115610f1a57610f19610ec6565b5b600182023603831315610f3057610f2f610ecb565b5b509250929050565b6000602082019050919050565b6000610f518385610e57565b935083602084028501610f6384610e68565b8060005b87811015610fa9578484038952610f7e8284610ed5565b610f89868284610eb0565b9550610f9484610f38565b935060208b019a505050600181019050610f67565b50829750879450505050509392505050565b6000606082019050610fd06000830187610e48565b610fdd6020830186610d75565b8181036040830152610ff0818486610f45565b905095945050505050565b60008151905061100a81610b84565b92915050565b6000602082840312156110265761102561087d565b5b600061103484828501610ffb565b91505092915050565b600082825260208201905092915050565b7f4661696c656420746f20617070726f7665207374616b696e67206d6574686f6460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b60006110aa60218361103d565b91506110b58261104e565b604082019050919050565b600060208201905081810360008301526110d98161109d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061111a8261094a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361114c5761114b6110e0565b5b600182019050919050565b600081905092915050565b50565b6000611172600083611157565b915061117d82611162565b600082019050919050565b600061119382611165565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b60006111f960218361103d565b91506112048261119d565b604082019050919050565b60006020820190508181036000830152611228816111ec565b9050919050565b600060a083016112426000840184610ed5565b8583036000870152611255838284610e83565b925050506112666020840184610ed5565b8583036020870152611279838284610e83565b9250505061128a6040840184610ed5565b858303604087015261129d838284610e83565b925050506112ae6060840184610ed5565b85830360608701526112c1838284610e83565b925050506112d26080840184610ed5565b85830360808701526112e5838284610e83565b925050508091505092915050565b6000611302602084018461096b565b905092915050565b6113138161094a565b82525050565b6060820161132a60008301836112f3565b611337600085018261130a565b5061134560208301836112f3565b611352602085018261130a565b5061136060408301836112f3565b61136d604085018261130a565b50505050565b600081519050919050565b60005b8381101561139c578082015181840152602081019050611381565b60008484015250505050565b60006113b382611373565b6113bd818561103d565b93506113cd81856020860161137e565b6113d681610a3c565b840191505092915050565b60006101008201905081810360008301526113fc818961122f565b905061140b6020830188611319565b6114186080830187610d75565b61142560a0830186610e48565b81810360c083015261143781856113a8565b905061144660e0830184610d75565b979650505050505050565b7f4661696c656420746f20637265617465207468652076616c696461746f720000600082015250565b6000611487601e8361103d565b915061149282611451565b602082019050919050565b600060208201905081810360008301526114b68161147a565b9050919050565b6000819050919050565b60006114e26114dd6114d884610887565b6114bd565b610887565b9050919050565b60006114f4826114c7565b9050919050565b6000611506826114e9565b9050919050565b611516816114fb565b82525050565b6000606082019050611531600083018661150d565b818103602083015261154381856113a8565b90506115526040830184610d75565b94935050505056fea264697066735822122003832ab382861d2894e6822f69b8ae70f7e7900365e9a257288a1c0152b67c2364736f6c63430008130033", + "bytecode": "0x608060405234801561001057600080fd5b50611590806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80630a4433e21461005c578063365465a814610078578063405da99f1461009457806361bc221a146100b057806389493f41146100ce575b600080fd5b61007660048036038101906100719190610980565b6100ea565b005b610092600480360381019061008d9190610bb0565b6101b9565b005b6100ae60048036038101906100a99190610cde565b610428565b005b6100b861064a565b6040516100c59190610d84565b60405180910390f35b6100e860048036038101906100e39190610d9f565b610650565b005b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895868487876040518563ffffffff1660e01b815260040161012d9493929190610fbb565b6020604051808303816000875af115801561014c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101709190611010565b9050806101b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101a9906110c0565b60405180910390fd5b5050505050565b8115610285576000808154809291906101d19061110f565b919050555060008573ffffffffffffffffffffffffffffffffffffffff16600f6040516101fd90611188565b60006040518083038185875af1925050503d806000811461023a576040519150601f19603f3d011682016040523d82523d6000602084013e61023f565b606091505b5050905080610283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027a9061120f565b60405180910390fd5b505b600061080073ffffffffffffffffffffffffffffffffffffffff1663f7cd55168a8a8a8a8a8a6040518763ffffffff1660e01b81526004016102cc969594939291906113e1565b6020604051808303816000875af11580156102eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030f9190611010565b905080610351576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103489061149d565b60405180910390fd5b811561041d576000808154809291906103699061110f565b919050555060008673ffffffffffffffffffffffffffffffffffffffff16600f60405161039590611188565b60006040518083038185875af1925050503d80600081146103d2576040519150601f19603f3d011682016040523d82523d6000602084013e6103d7565b606091505b505090508061041b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104129061120f565b60405180910390fd5b505b505050505050505050565b81156104f4576000808154809291906104409061110f565b919050555060008573ffffffffffffffffffffffffffffffffffffffff16600f60405161046c90611188565b60006040518083038185875af1925050503d80600081146104a9576040519150601f19603f3d011682016040523d82523d6000602084013e6104ae565b606091505b50509050806104f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e99061120f565b60405180910390fd5b505b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8686866040518463ffffffff1660e01b81526004016105339392919061151c565b6020604051808303816000875af1158015610552573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105769190611010565b5080156106435760008081548092919061058f9061110f565b919050555060008573ffffffffffffffffffffffffffffffffffffffff16600f6040516105bb90611188565b60006040518083038185875af1925050503d80600081146105f8576040519150601f19603f3d011682016040523d82523d6000602084013e6105fd565b606091505b5050905080610641576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106389061120f565b60405180910390fd5b505b5050505050565b60005481565b811561071c576000808154809291906106689061110f565b919050555060008673ffffffffffffffffffffffffffffffffffffffff16600f60405161069490611188565b60006040518083038185875af1925050503d80600081146106d1576040519150601f19603f3d011682016040523d82523d6000602084013e6106d6565b606091505b505090508061071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107119061120f565b60405180910390fd5b505b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8686866040518463ffffffff1660e01b815260040161075b9392919061151c565b6020604051808303816000875af115801561077a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079e9190611010565b50801561086b576000808154809291906107b79061110f565b919050555060008673ffffffffffffffffffffffffffffffffffffffff16600f6040516107e390611188565b60006040518083038185875af1925050503d8060008114610820576040519150601f19603f3d011682016040523d82523d6000602084013e610825565b606091505b5050905080610869576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108609061120f565b60405180910390fd5b505b505050505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108b282610887565b9050919050565b6108c2816108a7565b81146108cd57600080fd5b50565b6000813590506108df816108b9565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261090a576109096108e5565b5b8235905067ffffffffffffffff811115610927576109266108ea565b5b602083019150836020820283011115610943576109426108ef565b5b9250929050565b6000819050919050565b61095d8161094a565b811461096857600080fd5b50565b60008135905061097a81610954565b92915050565b6000806000806060858703121561099a5761099961087d565b5b60006109a8878288016108d0565b945050602085013567ffffffffffffffff8111156109c9576109c8610882565b5b6109d5878288016108f4565b935093505060406109e88782880161096b565b91505092959194509250565b600080fd5b600060a08284031215610a0f57610a0e6109f4565b5b81905092915050565b600060608284031215610a2e57610a2d6109f4565b5b81905092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a8582610a3c565b810181811067ffffffffffffffff82111715610aa457610aa3610a4d565b5b80604052505050565b6000610ab7610873565b9050610ac38282610a7c565b919050565b600067ffffffffffffffff821115610ae357610ae2610a4d565b5b610aec82610a3c565b9050602081019050919050565b82818337600083830152505050565b6000610b1b610b1684610ac8565b610aad565b905082815260208101848484011115610b3757610b36610a37565b5b610b42848285610af9565b509392505050565b600082601f830112610b5f57610b5e6108e5565b5b8135610b6f848260208601610b08565b91505092915050565b60008115159050919050565b610b8d81610b78565b8114610b9857600080fd5b50565b600081359050610baa81610b84565b92915050565b600080600080600080600080610140898b031215610bd157610bd061087d565b5b600089013567ffffffffffffffff811115610bef57610bee610882565b5b610bfb8b828c016109f9565b9850506020610c0c8b828c01610a18565b9750506080610c1d8b828c0161096b565b96505060a0610c2e8b828c016108d0565b95505060c089013567ffffffffffffffff811115610c4f57610c4e610882565b5b610c5b8b828c01610b4a565b94505060e0610c6c8b828c0161096b565b935050610100610c7e8b828c01610b9b565b925050610120610c908b828c01610b9b565b9150509295985092959890939650565b6000610cab82610887565b9050919050565b610cbb81610ca0565b8114610cc657600080fd5b50565b600081359050610cd881610cb2565b92915050565b600080600080600060a08688031215610cfa57610cf961087d565b5b6000610d0888828901610cc9565b955050602086013567ffffffffffffffff811115610d2957610d28610882565b5b610d3588828901610b4a565b9450506040610d468882890161096b565b9350506060610d5788828901610b9b565b9250506080610d6888828901610b9b565b9150509295509295909350565b610d7e8161094a565b82525050565b6000602082019050610d996000830184610d75565b92915050565b60008060008060008060c08789031215610dbc57610dbb61087d565b5b6000610dca89828a01610cc9565b9650506020610ddb89828a01610cc9565b955050604087013567ffffffffffffffff811115610dfc57610dfb610882565b5b610e0889828a01610b4a565b9450506060610e1989828a0161096b565b9350506080610e2a89828a01610b9b565b92505060a0610e3b89828a01610b9b565b9150509295509295509295565b610e51816108a7565b82525050565b600082825260208201905092915050565b6000819050919050565b600082825260208201905092915050565b6000610e8f8385610e72565b9350610e9c838584610af9565b610ea583610a3c565b840190509392505050565b6000610ebd848484610e83565b90509392505050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112610ef257610ef1610ed0565b5b83810192508235915060208301925067ffffffffffffffff821115610f1a57610f19610ec6565b5b600182023603831315610f3057610f2f610ecb565b5b509250929050565b6000602082019050919050565b6000610f518385610e57565b935083602084028501610f6384610e68565b8060005b87811015610fa9578484038952610f7e8284610ed5565b610f89868284610eb0565b9550610f9484610f38565b935060208b019a505050600181019050610f67565b50829750879450505050509392505050565b6000606082019050610fd06000830187610e48565b610fdd6020830186610d75565b8181036040830152610ff0818486610f45565b905095945050505050565b60008151905061100a81610b84565b92915050565b6000602082840312156110265761102561087d565b5b600061103484828501610ffb565b91505092915050565b600082825260208201905092915050565b7f4661696c656420746f20617070726f7665207374616b696e67206d6574686f6460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b60006110aa60218361103d565b91506110b58261104e565b604082019050919050565b600060208201905081810360008301526110d98161109d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061111a8261094a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361114c5761114b6110e0565b5b600182019050919050565b600081905092915050565b50565b6000611172600083611157565b915061117d82611162565b600082019050919050565b600061119382611165565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b60006111f960218361103d565b91506112048261119d565b604082019050919050565b60006020820190508181036000830152611228816111ec565b9050919050565b600060a083016112426000840184610ed5565b8583036000870152611255838284610e83565b925050506112666020840184610ed5565b8583036020870152611279838284610e83565b9250505061128a6040840184610ed5565b858303604087015261129d838284610e83565b925050506112ae6060840184610ed5565b85830360608701526112c1838284610e83565b925050506112d26080840184610ed5565b85830360808701526112e5838284610e83565b925050508091505092915050565b6000611302602084018461096b565b905092915050565b6113138161094a565b82525050565b6060820161132a60008301836112f3565b611337600085018261130a565b5061134560208301836112f3565b611352602085018261130a565b5061136060408301836112f3565b61136d604085018261130a565b50505050565b600081519050919050565b60005b8381101561139c578082015181840152602081019050611381565b60008484015250505050565b60006113b382611373565b6113bd818561103d565b93506113cd81856020860161137e565b6113d681610a3c565b840191505092915050565b60006101008201905081810360008301526113fc818961122f565b905061140b6020830188611319565b6114186080830187610d75565b61142560a0830186610e48565b81810360c083015261143781856113a8565b905061144660e0830184610d75565b979650505050505050565b7f4661696c656420746f20637265617465207468652076616c696461746f720000600082015250565b6000611487601e8361103d565b915061149282611451565b602082019050919050565b600060208201905081810360008301526114b68161147a565b9050919050565b6000819050919050565b60006114e26114dd6114d884610887565b6114bd565b610887565b9050919050565b60006114f4826114c7565b9050919050565b6000611506826114e9565b9050919050565b611516816114fb565b82525050565b6000606082019050611531600083018661150d565b818103602083015261154381856113a8565b90506115526040830184610d75565b94935050505056fea264697066735822122024b262116ec7bc79e4ccf0d78352a986ed01321679cd2f1801910863cf398c4464736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c80630a4433e21461005c578063365465a814610078578063405da99f1461009457806361bc221a146100b057806389493f41146100ce575b600080fd5b61007660048036038101906100719190610980565b6100ea565b005b610092600480360381019061008d9190610bb0565b6101b9565b005b6100ae60048036038101906100a99190610cde565b610428565b005b6100b861064a565b6040516100c59190610d84565b60405180910390f35b6100e860048036038101906100e39190610d9f565b610650565b005b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895868487876040518563ffffffff1660e01b815260040161012d9493929190610fbb565b6020604051808303816000875af115801561014c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101709190611010565b9050806101b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101a9906110c0565b60405180910390fd5b5050505050565b8115610285576000808154809291906101d19061110f565b919050555060008573ffffffffffffffffffffffffffffffffffffffff16600f6040516101fd90611188565b60006040518083038185875af1925050503d806000811461023a576040519150601f19603f3d011682016040523d82523d6000602084013e61023f565b606091505b5050905080610283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027a9061120f565b60405180910390fd5b505b600061080073ffffffffffffffffffffffffffffffffffffffff1663f7cd55168a8a8a8a8a8a6040518763ffffffff1660e01b81526004016102cc969594939291906113e1565b6020604051808303816000875af11580156102eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030f9190611010565b905080610351576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103489061149d565b60405180910390fd5b811561041d576000808154809291906103699061110f565b919050555060008673ffffffffffffffffffffffffffffffffffffffff16600f60405161039590611188565b60006040518083038185875af1925050503d80600081146103d2576040519150601f19603f3d011682016040523d82523d6000602084013e6103d7565b606091505b505090508061041b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104129061120f565b60405180910390fd5b505b505050505050505050565b81156104f4576000808154809291906104409061110f565b919050555060008573ffffffffffffffffffffffffffffffffffffffff16600f60405161046c90611188565b60006040518083038185875af1925050503d80600081146104a9576040519150601f19603f3d011682016040523d82523d6000602084013e6104ae565b606091505b50509050806104f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e99061120f565b60405180910390fd5b505b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8686866040518463ffffffff1660e01b81526004016105339392919061151c565b6020604051808303816000875af1158015610552573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105769190611010565b5080156106435760008081548092919061058f9061110f565b919050555060008573ffffffffffffffffffffffffffffffffffffffff16600f6040516105bb90611188565b60006040518083038185875af1925050503d80600081146105f8576040519150601f19603f3d011682016040523d82523d6000602084013e6105fd565b606091505b5050905080610641576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106389061120f565b60405180910390fd5b505b5050505050565b60005481565b811561071c576000808154809291906106689061110f565b919050555060008673ffffffffffffffffffffffffffffffffffffffff16600f60405161069490611188565b60006040518083038185875af1925050503d80600081146106d1576040519150601f19603f3d011682016040523d82523d6000602084013e6106d6565b606091505b505090508061071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107119061120f565b60405180910390fd5b505b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8686866040518463ffffffff1660e01b815260040161075b9392919061151c565b6020604051808303816000875af115801561077a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079e9190611010565b50801561086b576000808154809291906107b79061110f565b919050555060008673ffffffffffffffffffffffffffffffffffffffff16600f6040516107e390611188565b60006040518083038185875af1925050503d8060008114610820576040519150601f19603f3d011682016040523d82523d6000602084013e610825565b606091505b5050905080610869576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108609061120f565b60405180910390fd5b505b505050505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108b282610887565b9050919050565b6108c2816108a7565b81146108cd57600080fd5b50565b6000813590506108df816108b9565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261090a576109096108e5565b5b8235905067ffffffffffffffff811115610927576109266108ea565b5b602083019150836020820283011115610943576109426108ef565b5b9250929050565b6000819050919050565b61095d8161094a565b811461096857600080fd5b50565b60008135905061097a81610954565b92915050565b6000806000806060858703121561099a5761099961087d565b5b60006109a8878288016108d0565b945050602085013567ffffffffffffffff8111156109c9576109c8610882565b5b6109d5878288016108f4565b935093505060406109e88782880161096b565b91505092959194509250565b600080fd5b600060a08284031215610a0f57610a0e6109f4565b5b81905092915050565b600060608284031215610a2e57610a2d6109f4565b5b81905092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a8582610a3c565b810181811067ffffffffffffffff82111715610aa457610aa3610a4d565b5b80604052505050565b6000610ab7610873565b9050610ac38282610a7c565b919050565b600067ffffffffffffffff821115610ae357610ae2610a4d565b5b610aec82610a3c565b9050602081019050919050565b82818337600083830152505050565b6000610b1b610b1684610ac8565b610aad565b905082815260208101848484011115610b3757610b36610a37565b5b610b42848285610af9565b509392505050565b600082601f830112610b5f57610b5e6108e5565b5b8135610b6f848260208601610b08565b91505092915050565b60008115159050919050565b610b8d81610b78565b8114610b9857600080fd5b50565b600081359050610baa81610b84565b92915050565b600080600080600080600080610140898b031215610bd157610bd061087d565b5b600089013567ffffffffffffffff811115610bef57610bee610882565b5b610bfb8b828c016109f9565b9850506020610c0c8b828c01610a18565b9750506080610c1d8b828c0161096b565b96505060a0610c2e8b828c016108d0565b95505060c089013567ffffffffffffffff811115610c4f57610c4e610882565b5b610c5b8b828c01610b4a565b94505060e0610c6c8b828c0161096b565b935050610100610c7e8b828c01610b9b565b925050610120610c908b828c01610b9b565b9150509295985092959890939650565b6000610cab82610887565b9050919050565b610cbb81610ca0565b8114610cc657600080fd5b50565b600081359050610cd881610cb2565b92915050565b600080600080600060a08688031215610cfa57610cf961087d565b5b6000610d0888828901610cc9565b955050602086013567ffffffffffffffff811115610d2957610d28610882565b5b610d3588828901610b4a565b9450506040610d468882890161096b565b9350506060610d5788828901610b9b565b9250506080610d6888828901610b9b565b9150509295509295909350565b610d7e8161094a565b82525050565b6000602082019050610d996000830184610d75565b92915050565b60008060008060008060c08789031215610dbc57610dbb61087d565b5b6000610dca89828a01610cc9565b9650506020610ddb89828a01610cc9565b955050604087013567ffffffffffffffff811115610dfc57610dfb610882565b5b610e0889828a01610b4a565b9450506060610e1989828a0161096b565b9350506080610e2a89828a01610b9b565b92505060a0610e3b89828a01610b9b565b9150509295509295509295565b610e51816108a7565b82525050565b600082825260208201905092915050565b6000819050919050565b600082825260208201905092915050565b6000610e8f8385610e72565b9350610e9c838584610af9565b610ea583610a3c565b840190509392505050565b6000610ebd848484610e83565b90509392505050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112610ef257610ef1610ed0565b5b83810192508235915060208301925067ffffffffffffffff821115610f1a57610f19610ec6565b5b600182023603831315610f3057610f2f610ecb565b5b509250929050565b6000602082019050919050565b6000610f518385610e57565b935083602084028501610f6384610e68565b8060005b87811015610fa9578484038952610f7e8284610ed5565b610f89868284610eb0565b9550610f9484610f38565b935060208b019a505050600181019050610f67565b50829750879450505050509392505050565b6000606082019050610fd06000830187610e48565b610fdd6020830186610d75565b8181036040830152610ff0818486610f45565b905095945050505050565b60008151905061100a81610b84565b92915050565b6000602082840312156110265761102561087d565b5b600061103484828501610ffb565b91505092915050565b600082825260208201905092915050565b7f4661696c656420746f20617070726f7665207374616b696e67206d6574686f6460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b60006110aa60218361103d565b91506110b58261104e565b604082019050919050565b600060208201905081810360008301526110d98161109d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061111a8261094a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361114c5761114b6110e0565b5b600182019050919050565b600081905092915050565b50565b6000611172600083611157565b915061117d82611162565b600082019050919050565b600061119382611165565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b60006111f960218361103d565b91506112048261119d565b604082019050919050565b60006020820190508181036000830152611228816111ec565b9050919050565b600060a083016112426000840184610ed5565b8583036000870152611255838284610e83565b925050506112666020840184610ed5565b8583036020870152611279838284610e83565b9250505061128a6040840184610ed5565b858303604087015261129d838284610e83565b925050506112ae6060840184610ed5565b85830360608701526112c1838284610e83565b925050506112d26080840184610ed5565b85830360808701526112e5838284610e83565b925050508091505092915050565b6000611302602084018461096b565b905092915050565b6113138161094a565b82525050565b6060820161132a60008301836112f3565b611337600085018261130a565b5061134560208301836112f3565b611352602085018261130a565b5061136060408301836112f3565b61136d604085018261130a565b50505050565b600081519050919050565b60005b8381101561139c578082015181840152602081019050611381565b60008484015250505050565b60006113b382611373565b6113bd818561103d565b93506113cd81856020860161137e565b6113d681610a3c565b840191505092915050565b60006101008201905081810360008301526113fc818961122f565b905061140b6020830188611319565b6114186080830187610d75565b61142560a0830186610e48565b81810360c083015261143781856113a8565b905061144660e0830184610d75565b979650505050505050565b7f4661696c656420746f20637265617465207468652076616c696461746f720000600082015250565b6000611487601e8361103d565b915061149282611451565b602082019050919050565b600060208201905081810360008301526114b68161147a565b9050919050565b6000819050919050565b60006114e26114dd6114d884610887565b6114bd565b610887565b9050919050565b60006114f4826114c7565b9050919050565b6000611506826114e9565b9050919050565b611516816114fb565b82525050565b6000606082019050611531600083018661150d565b818103602083015261154381856113a8565b90506115526040830184610d75565b94935050505056fea264697066735822122024b262116ec7bc79e4ccf0d78352a986ed01321679cd2f1801910863cf398c4464736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/staking/tx.go b/precompiles/staking/tx.go index 4fa56db7..36dd3e94 100644 --- a/precompiles/staking/tx.go +++ b/precompiles/staking/tx.go @@ -58,7 +58,11 @@ func (p Precompile) CreateValidator( method *abi.Method, args []interface{}, ) ([]byte, error) { - msg, validatorHexAddr, err := NewMsgCreateValidator(args, p.stakingKeeper.BondDenom(ctx)) + bondDenom, err := p.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + msg, validatorHexAddr, err := NewMsgCreateValidator(args, bondDenom) if err != nil { return nil, err } @@ -87,7 +91,7 @@ func (p Precompile) CreateValidator( // Execute the transaction using the message server msgSrv := stakingkeeper.NewMsgServerImpl(&p.stakingKeeper) - if _, err = msgSrv.CreateValidator(sdk.WrapSDKContext(ctx), msg); err != nil { + if _, err = msgSrv.CreateValidator(ctx, msg); err != nil { return nil, err } @@ -138,7 +142,7 @@ func (p Precompile) EditValidator( // Execute the transaction using the message server msgSrv := stakingkeeper.NewMsgServerImpl(&p.stakingKeeper) - if _, err = msgSrv.EditValidator(sdk.WrapSDKContext(ctx), msg); err != nil { + if _, err = msgSrv.EditValidator(ctx, msg); err != nil { return nil, err } @@ -159,7 +163,11 @@ func (p *Precompile) Delegate( method *abi.Method, args []interface{}, ) ([]byte, error) { - msg, delegatorHexAddr, err := NewMsgDelegate(args, p.stakingKeeper.BondDenom(ctx)) + bondDenom, err := p.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + msg, delegatorHexAddr, err := NewMsgDelegate(args, bondDenom) if err != nil { return nil, err } @@ -209,7 +217,7 @@ func (p *Precompile) Delegate( // Execute the transaction using the message server msgSrv := stakingkeeper.NewMsgServerImpl(&p.stakingKeeper) - if _, err = msgSrv.Delegate(sdk.WrapSDKContext(ctx), msg); err != nil { + if _, err = msgSrv.Delegate(ctx, msg); err != nil { return nil, err } @@ -248,7 +256,11 @@ func (p Precompile) Undelegate( method *abi.Method, args []interface{}, ) ([]byte, error) { - msg, delegatorHexAddr, err := NewMsgUndelegate(args, p.stakingKeeper.BondDenom(ctx)) + bondDenom, err := p.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + msg, delegatorHexAddr, err := NewMsgUndelegate(args, bondDenom) if err != nil { return nil, err } @@ -298,7 +310,7 @@ func (p Precompile) Undelegate( // Execute the transaction using the message server msgSrv := stakingkeeper.NewMsgServerImpl(&p.stakingKeeper) - res, err := msgSrv.Undelegate(sdk.WrapSDKContext(ctx), msg) + res, err := msgSrv.Undelegate(ctx, msg) if err != nil { return nil, err } @@ -329,7 +341,11 @@ func (p Precompile) Redelegate( method *abi.Method, args []interface{}, ) ([]byte, error) { - msg, delegatorHexAddr, err := NewMsgRedelegate(args, p.stakingKeeper.BondDenom(ctx)) + bondDenom, err := p.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + msg, delegatorHexAddr, err := NewMsgRedelegate(args, bondDenom) if err != nil { return nil, err } @@ -379,7 +395,7 @@ func (p Precompile) Redelegate( } msgSrv := stakingkeeper.NewMsgServerImpl(&p.stakingKeeper) - res, err := msgSrv.BeginRedelegate(sdk.WrapSDKContext(ctx), msg) + res, err := msgSrv.BeginRedelegate(ctx, msg) if err != nil { return nil, err } @@ -409,7 +425,11 @@ func (p Precompile) CancelUnbondingDelegation( method *abi.Method, args []interface{}, ) ([]byte, error) { - msg, delegatorHexAddr, err := NewMsgCancelUnbondingDelegation(args, p.stakingKeeper.BondDenom(ctx)) + bondDenom, err := p.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + msg, delegatorHexAddr, err := NewMsgCancelUnbondingDelegation(args, bondDenom) if err != nil { return nil, err } @@ -459,7 +479,7 @@ func (p Precompile) CancelUnbondingDelegation( } msgSrv := stakingkeeper.NewMsgServerImpl(&p.stakingKeeper) - if _, err = msgSrv.CancelUnbondingDelegation(sdk.WrapSDKContext(ctx), msg); err != nil { + if _, err = msgSrv.CancelUnbondingDelegation(ctx, msg); err != nil { return nil, err } diff --git a/precompiles/staking/tx_test.go b/precompiles/staking/tx_test.go index 54b91c45..d5290972 100644 --- a/precompiles/staking/tx_test.go +++ b/precompiles/staking/tx_test.go @@ -5,20 +5,24 @@ import ( "fmt" "math/big" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" - geth "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - chainconfig "github.com/evmos/os/example_chain/osd/config" cmn "github.com/evmos/os/precompiles/common" "github.com/evmos/os/precompiles/staking" "github.com/evmos/os/precompiles/testutil" evmosutiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/evm/core/vm" + "github.com/evmos/os/x/evm/statedb" ) func (s *PrecompileTestSuite) TestCreateValidator() { var ( + stDB *statedb.StateDB method = s.precompile.Methods[staking.CreateValidatorMethod] description = staking.Description{ Moniker: "node0", @@ -33,8 +37,8 @@ func (s *PrecompileTestSuite) TestCreateValidator() { MaxChangeRate: math.LegacyOneDec().BigInt(), } minSelfDelegation = big.NewInt(1) - validatorAddress = s.address pubkey = "nfJ0axJC9dhta1MAE1EBFaVdxxkYzxYrBaHuJVjG//M=" + validatorAddress common.Address value = big.NewInt(1205000000000000000) diffAddr, _ = evmosutiltx.NewAddrKey() ) @@ -43,7 +47,7 @@ func (s *PrecompileTestSuite) TestCreateValidator() { name string malleate func() []interface{} gas uint64 - callerAddress *geth.Address + callerAddress *common.Address postCheck func(data []byte) expError bool errContains string @@ -259,19 +263,19 @@ func (s *PrecompileTestSuite) TestCreateValidator() { s.Require().NoError(err) s.Require().Equal(success[0], true) - log := s.stateDB.Logs()[0] + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[staking.EventTypeCreateValidator] - s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), geth.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) + s.Require().Equal(log.BlockNumber, uint64(s.network.GetContext().BlockHeight())) //nolint:gosec // G115 // Check the fully unpacked event matches the one emitted var createValidatorEvent staking.EventCreateValidator err = cmn.UnpackLog(s.precompile.ABI, &createValidatorEvent, staking.EventTypeCreateValidator, *log) s.Require().NoError(err) - s.Require().Equal(s.address, createValidatorEvent.ValidatorAddress) + s.Require().Equal(validatorAddress, createValidatorEvent.ValidatorAddress) s.Require().Equal(value, createValidatorEvent.Value) }, false, @@ -283,25 +287,30 @@ func (s *PrecompileTestSuite) TestCreateValidator() { s.Run(tc.name, func() { s.SetupTest() + ctx := s.network.GetContext() + stDB = s.network.GetStateDB() + // reset sender - validatorAddress = s.address + validator := s.keyring.GetKey(0) + validatorAddress = validator.Addr var contract *vm.Contract - contract, s.ctx = testutil.NewPrecompileContract(s.T(), s.ctx, s.address, s.precompile, tc.gas) + contract, ctx = testutil.NewPrecompileContract(s.T(), ctx, validatorAddress, s.precompile, tc.gas) if tc.callerAddress != nil { contract.CallerAddress = *tc.callerAddress } - bz, err := s.precompile.CreateValidator(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate()) + bz, err := s.precompile.CreateValidator(ctx, validatorAddress, contract, stDB, &method, tc.malleate()) - // query the validator in the staking keeper - validator := s.app.StakingKeeper.Validator(s.ctx, s.address.Bytes()) if tc.expError { s.Require().ErrorContains(err, tc.errContains) s.Require().Empty(bz) - s.Require().Nil(validator) } else { s.Require().NoError(err) + // query the validator in the staking keeper + validator, err := s.network.App.StakingKeeper.Validator(ctx, validator.AccAddr.Bytes()) + s.Require().NoError(err) + s.Require().NotNil(validator, "expected validator not to be nil") tc.postCheck(bz) @@ -313,7 +322,7 @@ func (s *PrecompileTestSuite) TestCreateValidator() { consPubKeyBase64 := base64.StdEncoding.EncodeToString(consPubKey.Bytes()) s.Require().Equal(pubkey, consPubKeyBase64, "expected validator pubkey to be %s; got %s", pubkey, consPubKeyBase64) - operator := validator.GetOperator().String() + operator := validator.GetOperator() s.Require().Equal(sdk.ValAddress(validatorAddress.Bytes()).String(), operator, "expected validator operator to be %s; got %s", validatorAddress, operator) commissionRate := validator.GetCommission() @@ -334,7 +343,9 @@ func (s *PrecompileTestSuite) TestCreateValidator() { func (s *PrecompileTestSuite) TestEditValidator() { var ( - validatorAddress geth.Address + stDB *statedb.StateDB + ctx sdk.Context + validatorAddress common.Address commissionRate *big.Int minSelfDelegation *big.Int method = s.precompile.Methods[staking.EditValidatorMethod] @@ -351,7 +362,7 @@ func (s *PrecompileTestSuite) TestEditValidator() { name string malleate func() []interface{} gas uint64 - callerAddress *geth.Address + callerAddress *common.Address postCheck func(data []byte) expError bool errContains string @@ -454,7 +465,7 @@ func (s *PrecompileTestSuite) TestEditValidator() { return []interface{}{ description, validatorAddress, - math.LegacyNewDecWithPrec(7, 2).BigInt(), + math.LegacyNewDecWithPrec(11, 2).BigInt(), minSelfDelegation, } }, @@ -507,7 +518,10 @@ func (s *PrecompileTestSuite) TestEditValidator() { } }, 200000, - &s.address, + func() *common.Address { + addr := s.keyring.GetAddr(0) + return &addr + }(), func([]byte) {}, true, "this method can only be called directly to the precompile", @@ -529,13 +543,13 @@ func (s *PrecompileTestSuite) TestEditValidator() { s.Require().NoError(err) s.Require().Equal(success[0], true) - log := s.stateDB.Logs()[0] + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[staking.EventTypeEditValidator] - s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), geth.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 // Check the fully unpacked event matches the one emitted var editValidatorEvent staking.EventEditValidator @@ -551,8 +565,8 @@ func (s *PrecompileTestSuite) TestEditValidator() { { "success - should not update commission rate", func() []interface{} { - // expected commission rate is the previous one (0) - commissionRate = math.LegacyZeroDec().BigInt() + // expected commission rate is the previous one (5%) + commissionRate = math.LegacyNewDecWithPrec(5, 2).BigInt() return []interface{}{ description, validatorAddress, @@ -567,13 +581,13 @@ func (s *PrecompileTestSuite) TestEditValidator() { s.Require().NoError(err) s.Require().Equal(success[0], true) - log := s.stateDB.Logs()[0] + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[staking.EventTypeEditValidator] - s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), geth.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 // Check the fully unpacked event matches the one emitted var editValidatorEvent staking.EventEditValidator @@ -603,13 +617,13 @@ func (s *PrecompileTestSuite) TestEditValidator() { s.Require().NoError(err) s.Require().Equal(success[0], true) - log := s.stateDB.Logs()[0] + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[staking.EventTypeEditValidator] - s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), geth.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) + s.Require().Equal(log.BlockNumber, uint64(ctx.BlockHeight())) //nolint:gosec // G115 // Check the fully unpacked event matches the one emitted var editValidatorEvent staking.EventEditValidator @@ -625,34 +639,43 @@ func (s *PrecompileTestSuite) TestEditValidator() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() - commissionRate = math.LegacyNewDecWithPrec(5, 2).BigInt() + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() + + commissionRate = math.LegacyNewDecWithPrec(1, 1).BigInt() minSelfDelegation = big.NewInt(11) // reset sender - validatorAddress = geth.BytesToAddress(s.validators[0].GetOperator().Bytes()) + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].OperatorAddress) + s.Require().NoError(err) + + validatorAddress = common.BytesToAddress(valAddr.Bytes()) var contract *vm.Contract - contract, s.ctx = testutil.NewPrecompileContract(s.T(), s.ctx, validatorAddress, s.precompile, tc.gas) + contract, ctx = testutil.NewPrecompileContract(s.T(), ctx, validatorAddress, s.precompile, tc.gas) if tc.callerAddress != nil { contract.CallerAddress = *tc.callerAddress } - bz, err := s.precompile.EditValidator(s.ctx, validatorAddress, contract, s.stateDB, &method, tc.malleate()) + bz, err := s.precompile.EditValidator(ctx, validatorAddress, contract, stDB, &method, tc.malleate()) - // query the validator in the staking keeper - validator := s.app.StakingKeeper.Validator(s.ctx, validatorAddress.Bytes()) if tc.expError { s.Require().ErrorContains(err, tc.errContains) s.Require().Empty(bz) } else { s.Require().NoError(err) + + // query the validator in the staking keeper + validator, err := s.network.App.StakingKeeper.Validator(ctx, valAddr.Bytes()) + s.Require().NoError(err) + s.Require().NotNil(validator, "expected validator not to be nil") tc.postCheck(bz) isBonded := validator.IsBonded() s.Require().Equal(true, isBonded, "expected validator bonded to be %t; got %t", true, isBonded) - operator := validator.GetOperator().String() + operator := validator.GetOperator() s.Require().Equal(sdk.ValAddress(validatorAddress.Bytes()).String(), operator, "expected validator operator to be %s; got %s", validatorAddress, operator) updatedCommRate := validator.GetCommission() @@ -672,11 +695,15 @@ func (s *PrecompileTestSuite) TestEditValidator() { } func (s *PrecompileTestSuite) TestDelegate() { + var ( + ctx sdk.Context + stDB *statedb.StateDB + ) method := s.precompile.Methods[staking.DelegateMethod] testCases := []struct { name string - malleate func(operatorAddress string) []interface{} + malleate func(delegator, grantee testkeyring.Key, operatorAddress string) []interface{} gas uint64 expDelegationShares *big.Int postCheck func(data []byte) @@ -685,7 +712,7 @@ func (s *PrecompileTestSuite) TestDelegate() { }{ { "fail - empty input args", - func(string) []interface{} { + func(_, _ testkeyring.Key, _ string) []interface{} { return []interface{}{} }, 200000, @@ -697,7 +724,7 @@ func (s *PrecompileTestSuite) TestDelegate() { // TODO: check case if authorization does not exist { name: "fail - different origin than delegator", - malleate: func(operatorAddress string) []interface{} { + malleate: func(_, _ testkeyring.Key, operatorAddress string) []interface{} { differentAddr := evmosutiltx.GenerateAddress() return []interface{}{ differentAddr, @@ -711,7 +738,7 @@ func (s *PrecompileTestSuite) TestDelegate() { }, { "fail - invalid delegator address", - func(operatorAddress string) []interface{} { + func(_, _ testkeyring.Key, operatorAddress string) []interface{} { return []interface{}{ "", operatorAddress, @@ -726,9 +753,9 @@ func (s *PrecompileTestSuite) TestDelegate() { }, { "fail - invalid amount", - func(operatorAddress string) []interface{} { + func(delegator, _ testkeyring.Key, operatorAddress string) []interface{} { return []interface{}{ - s.address, + delegator.Addr, operatorAddress, nil, } @@ -741,13 +768,16 @@ func (s *PrecompileTestSuite) TestDelegate() { }, { "fail - delegation failed because of insufficient funds", - func(operatorAddress string) []interface{} { - err := s.CreateAuthorization(s.address, staking.DelegateAuthz, nil) + func(delegator, grantee testkeyring.Key, operatorAddress string) []interface{} { + // TODO: why is this necessary? + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.DelegateAuthz, nil) s.Require().NoError(err) + amt, ok := math.NewIntFromString("1000000000000000000000000000") + s.Require().True(ok) return []interface{}{ - s.address, + delegator.Addr, operatorAddress, - big.NewInt(9e18), + amt.BigInt(), } }, 200000, @@ -760,15 +790,15 @@ func (s *PrecompileTestSuite) TestDelegate() { // { // "fail - delegation should not be possible to validators outside of the allow list", // func(string) []interface{} { - // err := s.CreateAuthorization(s.address, staking.DelegateAuthz, nil) + // err := s.CreateAuthorization(validatorADdress, staking.DelegateAuthz, nil) // s.Require().NoError(err) // // // Create new validator --> this is not included in the authorized allow list - // testutil.CreateValidator(s.ctx, s.T(), s.privKey.PubKey(), s.app.StakingKeeper, math.NewInt(100)) - // newValAddr := sdk.ValAddress(s.address.Bytes()) + // testutil.CreateValidator(s.network.GetContext(), s.T(), s.privKey.PubKey(), s.network.App.StakingKeeper, math.NewInt(100)) + // newValAddr := sdk.ValAddress(s.keyring.GetAccAddr(0)) // // return []interface{}{ - // s.address, + // s.keyring.GetAddr(0), // newValAddr.String(), // big.NewInt(1e18), // } @@ -781,11 +811,12 @@ func (s *PrecompileTestSuite) TestDelegate() { // }, { "success", - func(operatorAddress string) []interface{} { - err := s.CreateAuthorization(s.address, staking.DelegateAuthz, nil) + func(delegator, grantee testkeyring.Key, operatorAddress string) []interface{} { + // TODO: necessary? + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.DelegateAuthz, nil) s.Require().NoError(err) return []interface{}{ - s.address, + delegator.Addr, operatorAddress, big.NewInt(1e18), } @@ -797,12 +828,12 @@ func (s *PrecompileTestSuite) TestDelegate() { s.Require().NoError(err) s.Require().Equal(success[0], true) - log := s.stateDB.Logs()[0] + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[staking.EventTypeDelegate] - s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), geth.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(crypto.Keccak256Hash([]byte(event.Sig)), common.HexToHash(log.Topics[0].Hex())) + s.Require().Equal(log.BlockNumber, uint64(s.network.GetContext().BlockHeight())) //nolint:gosec // G115 }, false, "", @@ -811,10 +842,10 @@ func (s *PrecompileTestSuite) TestDelegate() { // { // "success - delegate and update the authorization for the delegator", // func(operatorAddress string) []interface{} { - // err := s.CreateAuthorization(s.address, staking.DelegateAuthz, &sdk.Coin{Denom: testutil.ExampleAttoDenom, Amount: math.NewInt(2e18)}) + // err := s.CreateAuthorization(s.keyring.GetAddr(0), staking.DelegateAuthz, &sdk.Coin{Denom: testconstants.ExampleAttoDenom, Amount: math.NewInt(2e18)}) // s.Require().NoError(err) // return []interface{}{ - // s.address, + // s.keyring.GetAddr(0), // operatorAddress, // big.NewInt(1e18), // } @@ -822,7 +853,7 @@ func (s *PrecompileTestSuite) TestDelegate() { // 20000, // big.NewInt(2), // func(data []byte) { - // authorization, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, s.address.Bytes(), s.address.Bytes(), staking.DelegateMsg) + // authorization, _ := s.network.App.AuthzKeeper.GetAuthorization(s.network.GetContext(), s.keyring.GetAccAddr(0), s.keyring.GetAccAddr(0), staking.DelegateMsg) // s.Require().NotNil(authorization) // stakeAuthorization := authorization.(*stakingtypes.StakeAuthorization) // s.Require().Equal(math.NewInt(1e18), stakeAuthorization.MaxTokens.Amount) @@ -833,10 +864,10 @@ func (s *PrecompileTestSuite) TestDelegate() { // { // "success - delegate and delete the authorization for the delegator", // func(operatorAddress string) []interface{} { - // err := s.CreateAuthorization(s.address, staking.DelegateAuthz, &sdk.Coin{Denom: testutil.ExampleAttoDenom, Amount: math.NewInt(1e18)}) + // err := s.CreateAuthorization(s.keyring.GetAddr(0), staking.DelegateAuthz, &sdk.Coin{Denom: testconstants.ExampleAttoDenom, Amount: math.NewInt(1e18)}) // s.Require().NoError(err) // return []interface{}{ - // s.address, + // s.keyring.GetAddr(0), // operatorAddress, // big.NewInt(1e18), // } @@ -844,7 +875,7 @@ func (s *PrecompileTestSuite) TestDelegate() { // 20000, // big.NewInt(2), // func(data []byte) { - // authorization, _ := s.app.AuthzKeeper.GetAuthorization(s.ctx, s.address.Bytes(), s.address.Bytes(), staking.DelegateMsg) + // authorization, _ := s.network.App.AuthzKeeper.GetAuthorization(s.network.GetContext(), s.keyring.GetAccAddr(0), s.keyring.GetAccAddr(0), staking.DelegateMsg) // s.Require().Nil(authorization) // }, // false, @@ -855,18 +886,30 @@ func (s *PrecompileTestSuite) TestDelegate() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() - var contract *vm.Contract - contract, s.ctx = testutil.NewPrecompileContract(s.T(), s.ctx, s.address, s.precompile, tc.gas) + delegator := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + + contract, ctx := testutil.NewPrecompileContract(s.T(), ctx, delegator.Addr, s.precompile, tc.gas) - bz, err := s.precompile.Delegate(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate(s.validators[0].OperatorAddress)) + delegateArgs := tc.malleate( + delegator, + grantee, + s.network.GetValidators()[0].OperatorAddress, + ) + bz, err := s.precompile.Delegate(ctx, delegator.Addr, contract, stDB, &method, delegateArgs) // query the delegation in the staking keeper - delegation := s.app.StakingKeeper.Delegation(s.ctx, s.address.Bytes(), s.validators[0].GetOperator()) + valAddr, valErr := sdk.ValAddressFromBech32(s.network.GetValidators()[0].OperatorAddress) + s.Require().NoError(valErr) + delegation, delErr := s.network.App.StakingKeeper.Delegation(ctx, delegator.AccAddr, valAddr) + s.Require().NoError(delErr) if tc.expError { s.Require().ErrorContains(err, tc.errContains) s.Require().Empty(bz) - s.Require().Equal(s.validators[0].DelegatorShares, delegation.GetShares()) + s.Require().Equal(s.network.GetValidators()[0].DelegatorShares, delegation.GetShares()) } else { s.Require().NoError(err) s.Require().NotNil(delegation, "expected delegation not to be nil") @@ -882,11 +925,15 @@ func (s *PrecompileTestSuite) TestDelegate() { } func (s *PrecompileTestSuite) TestUndelegate() { + var ( + ctx sdk.Context + stDB *statedb.StateDB + ) method := s.precompile.Methods[staking.UndelegateMethod] testCases := []struct { name string - malleate func(operatorAddress string) []interface{} + malleate func(delegator, grantee testkeyring.Key, operatorAddress string) []interface{} postCheck func(data []byte) gas uint64 expUndelegationShares *big.Int @@ -895,7 +942,7 @@ func (s *PrecompileTestSuite) TestUndelegate() { }{ { "fail - empty input args", - func(string) []interface{} { + func(testkeyring.Key, testkeyring.Key, string) []interface{} { return []interface{}{} }, func([]byte) {}, @@ -907,7 +954,7 @@ func (s *PrecompileTestSuite) TestUndelegate() { // TODO: check case if authorization does not exist { name: "fail - different origin than delegator", - malleate: func(operatorAddress string) []interface{} { + malleate: func(_, _ testkeyring.Key, operatorAddress string) []interface{} { differentAddr := evmosutiltx.GenerateAddress() return []interface{}{ differentAddr, @@ -921,7 +968,7 @@ func (s *PrecompileTestSuite) TestUndelegate() { }, { "fail - invalid delegator address", - func(operatorAddress string) []interface{} { + func(_, _ testkeyring.Key, operatorAddress string) []interface{} { return []interface{}{ "", operatorAddress, @@ -936,9 +983,9 @@ func (s *PrecompileTestSuite) TestUndelegate() { }, { "fail - invalid amount", - func(operatorAddress string) []interface{} { + func(delegator, _ testkeyring.Key, operatorAddress string) []interface{} { return []interface{}{ - s.address, + delegator.Addr, operatorAddress, nil, } @@ -951,11 +998,11 @@ func (s *PrecompileTestSuite) TestUndelegate() { }, { "success", - func(operatorAddress string) []interface{} { - err := s.CreateAuthorization(s.address, staking.UndelegateAuthz, nil) + func(delegator, grantee testkeyring.Key, operatorAddress string) []interface{} { + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.UndelegateAuthz, nil) s.Require().NoError(err) return []interface{}{ - s.address, + delegator.Addr, operatorAddress, big.NewInt(1000000000000000000), } @@ -966,11 +1013,12 @@ func (s *PrecompileTestSuite) TestUndelegate() { s.Require().Len(args, 1) completionTime, ok := args[0].(int64) s.Require().True(ok, "completion time type %T", args[0]) - params := s.app.StakingKeeper.GetParams(s.ctx) - expCompletionTime := s.ctx.BlockTime().Add(params.UnbondingTime).UTC().Unix() + params, err := s.network.App.StakingKeeper.GetParams(ctx) + s.Require().NoError(err) + expCompletionTime := ctx.BlockTime().Add(params.UnbondingTime).UTC().Unix() s.Require().Equal(expCompletionTime, completionTime) // Check the event emitted - log := s.stateDB.Logs()[0] + log := stDB.Logs()[0] s.Require().Equal(log.Address, s.precompile.Address()) }, 20000, @@ -983,14 +1031,20 @@ func (s *PrecompileTestSuite) TestUndelegate() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() + ctx = s.network.GetContext() + stDB = s.network.GetStateDB() + + delegator := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) var contract *vm.Contract - contract, s.ctx = testutil.NewPrecompileContract(s.T(), s.ctx, s.address, s.precompile, tc.gas) + contract, ctx = testutil.NewPrecompileContract(s.T(), ctx, delegator.Addr, s.precompile, tc.gas) - bz, err := s.precompile.Undelegate(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate(s.validators[0].OperatorAddress)) + undelegateArgs := tc.malleate(delegator, grantee, s.network.GetValidators()[0].OperatorAddress) + bz, err := s.precompile.Undelegate(ctx, delegator.Addr, contract, stDB, &method, undelegateArgs) // query the unbonding delegations in the staking keeper - undelegations := s.app.StakingKeeper.GetAllUnbondingDelegations(s.ctx, s.address.Bytes()) + undelegations, _ := s.network.App.StakingKeeper.GetAllUnbondingDelegations(ctx, delegator.AccAddr) if tc.expError { s.Require().ErrorContains(err, tc.errContains) @@ -1000,10 +1054,8 @@ func (s *PrecompileTestSuite) TestUndelegate() { s.Require().NotEmpty(bz) tc.postCheck(bz) - bech32Addr, err := sdk.Bech32ifyAddressBytes(chainconfig.Bech32Prefix, s.address.Bytes()) - s.Require().NoError(err) - s.Require().Equal(undelegations[0].DelegatorAddress, bech32Addr) - s.Require().Equal(undelegations[0].ValidatorAddress, s.validators[0].OperatorAddress) + s.Require().Equal(undelegations[0].DelegatorAddress, delegator.AccAddr.String()) + s.Require().Equal(undelegations[0].ValidatorAddress, s.network.GetValidators()[0].OperatorAddress) s.Require().Equal(undelegations[0].Entries[0].Balance, math.NewIntFromBigInt(tc.expUndelegationShares)) } }) @@ -1011,11 +1063,12 @@ func (s *PrecompileTestSuite) TestUndelegate() { } func (s *PrecompileTestSuite) TestRedelegate() { + var ctx sdk.Context method := s.precompile.Methods[staking.RedelegateMethod] testCases := []struct { name string - malleate func(srcOperatorAddr, dstOperatorAddr string) []interface{} + malleate func(delegator, grantee testkeyring.Key, srcOperatorAddr, dstOperatorAddr string) []interface{} postCheck func(data []byte) gas uint64 expRedelegationShares *big.Int @@ -1024,7 +1077,7 @@ func (s *PrecompileTestSuite) TestRedelegate() { }{ { "fail - empty input args", - func(string, string) []interface{} { + func(_, _ testkeyring.Key, _, _ string) []interface{} { return []interface{}{} }, func([]byte) {}, @@ -1036,7 +1089,7 @@ func (s *PrecompileTestSuite) TestRedelegate() { // TODO: check case if authorization does not exist { name: "fail - different origin than delegator", - malleate: func(srcOperatorAddr, dstOperatorAddr string) []interface{} { + malleate: func(_, _ testkeyring.Key, srcOperatorAddr, dstOperatorAddr string) []interface{} { differentAddr := evmosutiltx.GenerateAddress() return []interface{}{ differentAddr, @@ -1051,7 +1104,7 @@ func (s *PrecompileTestSuite) TestRedelegate() { }, { "fail - invalid delegator address", - func(srcOperatorAddr, dstOperatorAddr string) []interface{} { + func(_, _ testkeyring.Key, srcOperatorAddr, dstOperatorAddr string) []interface{} { return []interface{}{ "", srcOperatorAddr, @@ -1067,9 +1120,9 @@ func (s *PrecompileTestSuite) TestRedelegate() { }, { "fail - invalid amount", - func(srcOperatorAddr, dstOperatorAddr string) []interface{} { + func(delegator, _ testkeyring.Key, srcOperatorAddr, dstOperatorAddr string) []interface{} { return []interface{}{ - s.address, + delegator.Addr, srcOperatorAddr, dstOperatorAddr, nil, @@ -1083,9 +1136,9 @@ func (s *PrecompileTestSuite) TestRedelegate() { }, { "fail - invalid shares amount", - func(srcOperatorAddr, dstOperatorAddr string) []interface{} { + func(delegator, _ testkeyring.Key, srcOperatorAddr, dstOperatorAddr string) []interface{} { return []interface{}{ - s.address, + delegator.Addr, srcOperatorAddr, dstOperatorAddr, big.NewInt(-1), @@ -1099,11 +1152,12 @@ func (s *PrecompileTestSuite) TestRedelegate() { }, { "success", - func(srcOperatorAddr, dstOperatorAddr string) []interface{} { - err := s.CreateAuthorization(s.address, staking.RedelegateAuthz, nil) + func(delegator, grantee testkeyring.Key, srcOperatorAddr, dstOperatorAddr string) []interface{} { + // TODO: necessary? + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.RedelegateAuthz, nil) s.Require().NoError(err) return []interface{}{ - s.address, + delegator.Addr, srcOperatorAddr, dstOperatorAddr, big.NewInt(1000000000000000000), @@ -1115,8 +1169,9 @@ func (s *PrecompileTestSuite) TestRedelegate() { s.Require().Len(args, 1) completionTime, ok := args[0].(int64) s.Require().True(ok, "completion time type %T", args[0]) - params := s.app.StakingKeeper.GetParams(s.ctx) - expCompletionTime := s.ctx.BlockTime().Add(params.UnbondingTime).UTC().Unix() + params, err := s.network.App.StakingKeeper.GetParams(ctx) + s.Require().NoError(err) + expCompletionTime := ctx.BlockTime().Add(params.UnbondingTime).UTC().Unix() s.Require().Equal(expCompletionTime, completionTime) }, 200000, @@ -1129,14 +1184,24 @@ func (s *PrecompileTestSuite) TestRedelegate() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() + ctx = s.network.GetContext() + delegator := s.keyring.GetKey(0) + // TODO: even necessary?? + grantee := s.keyring.GetKey(1) - var contract *vm.Contract - contract, s.ctx = testutil.NewPrecompileContract(s.T(), s.ctx, s.address, s.precompile, tc.gas) + contract, ctx := testutil.NewPrecompileContract(s.T(), ctx, delegator.Addr, s.precompile, tc.gas) - bz, err := s.precompile.Redelegate(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate(s.validators[0].OperatorAddress, s.validators[1].OperatorAddress)) + redelegateArgs := tc.malleate( + delegator, + grantee, + s.network.GetValidators()[0].OperatorAddress, + s.network.GetValidators()[1].OperatorAddress, + ) + bz, err := s.precompile.Redelegate(ctx, delegator.Addr, contract, s.network.GetStateDB(), &method, redelegateArgs) // query the redelegations in the staking keeper - redelegations := s.app.StakingKeeper.GetRedelegations(s.ctx, s.address.Bytes(), 5) + redelegations, redelErr := s.network.App.StakingKeeper.GetRedelegations(ctx, delegator.AccAddr, 5) + s.Require().NoError(redelErr) if tc.expError { s.Require().ErrorContains(err, tc.errContains) @@ -1145,11 +1210,9 @@ func (s *PrecompileTestSuite) TestRedelegate() { s.Require().NoError(err) s.Require().NotEmpty(bz) - bech32Addr, err := sdk.Bech32ifyAddressBytes(chainconfig.Bech32Prefix, s.address.Bytes()) - s.Require().NoError(err) - s.Require().Equal(redelegations[0].DelegatorAddress, bech32Addr) - s.Require().Equal(redelegations[0].ValidatorSrcAddress, s.validators[0].OperatorAddress) - s.Require().Equal(redelegations[0].ValidatorDstAddress, s.validators[1].OperatorAddress) + s.Require().Equal(redelegations[0].DelegatorAddress, delegator.AccAddr.String()) + s.Require().Equal(redelegations[0].ValidatorSrcAddress, s.network.GetValidators()[0].OperatorAddress) + s.Require().Equal(redelegations[0].ValidatorDstAddress, s.network.GetValidators()[1].OperatorAddress) s.Require().Equal(redelegations[0].Entries[0].SharesDst, math.LegacyNewDecFromBigInt(tc.expRedelegationShares)) } }) @@ -1157,12 +1220,13 @@ func (s *PrecompileTestSuite) TestRedelegate() { } func (s *PrecompileTestSuite) TestCancelUnbondingDelegation() { + var ctx sdk.Context method := s.precompile.Methods[staking.CancelUnbondingDelegationMethod] undelegateMethod := s.precompile.Methods[staking.UndelegateMethod] testCases := []struct { name string - malleate func(operatorAddress string) []interface{} + malleate func(delegator, grantee testkeyring.Key, operatorAddress string) []interface{} postCheck func(data []byte) gas uint64 expDelegatedShares *big.Int @@ -1171,7 +1235,7 @@ func (s *PrecompileTestSuite) TestCancelUnbondingDelegation() { }{ { "fail - empty input args", - func(string) []interface{} { + func(_, _ testkeyring.Key, _ string) []interface{} { return []interface{}{} }, func([]byte) {}, @@ -1182,7 +1246,7 @@ func (s *PrecompileTestSuite) TestCancelUnbondingDelegation() { }, { "fail - invalid delegator address", - func(operatorAddress string) []interface{} { + func(_, _ testkeyring.Key, operatorAddress string) []interface{} { return []interface{}{ "", operatorAddress, @@ -1198,9 +1262,9 @@ func (s *PrecompileTestSuite) TestCancelUnbondingDelegation() { }, { "fail - creation height", - func(operatorAddress string) []interface{} { + func(delegator, _ testkeyring.Key, operatorAddress string) []interface{} { return []interface{}{ - s.address, + delegator.Addr, operatorAddress, big.NewInt(1), nil, @@ -1214,9 +1278,9 @@ func (s *PrecompileTestSuite) TestCancelUnbondingDelegation() { }, { "fail - invalid amount", - func(operatorAddress string) []interface{} { + func(delegator, _ testkeyring.Key, operatorAddress string) []interface{} { return []interface{}{ - s.address, + delegator.Addr, operatorAddress, nil, big.NewInt(1), @@ -1230,9 +1294,9 @@ func (s *PrecompileTestSuite) TestCancelUnbondingDelegation() { }, { "fail - invalid amount", - func(operatorAddress string) []interface{} { + func(delegator, _ testkeyring.Key, operatorAddress string) []interface{} { return []interface{}{ - s.address, + delegator.Addr, operatorAddress, nil, big.NewInt(1), @@ -1246,9 +1310,9 @@ func (s *PrecompileTestSuite) TestCancelUnbondingDelegation() { }, { "fail - invalid shares amount", - func(operatorAddress string) []interface{} { + func(delegator, _ testkeyring.Key, operatorAddress string) []interface{} { return []interface{}{ - s.address, + delegator.Addr, operatorAddress, big.NewInt(-1), big.NewInt(1), @@ -1262,14 +1326,16 @@ func (s *PrecompileTestSuite) TestCancelUnbondingDelegation() { }, { "success", - func(operatorAddress string) []interface{} { - err := s.CreateAuthorization(s.address, staking.DelegateAuthz, nil) + func(delegator, grantee testkeyring.Key, operatorAddress string) []interface{} { + // TODO: why is this necessary + // TODO: remove also grantee from malleate + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.DelegateAuthz, nil) s.Require().NoError(err) return []interface{}{ - s.address, + delegator.Addr, operatorAddress, big.NewInt(1), - big.NewInt(2), + big.NewInt(1), } }, func(data []byte) { @@ -1287,44 +1353,52 @@ func (s *PrecompileTestSuite) TestCancelUnbondingDelegation() { for _, tc := range testCases { s.Run(tc.name, func() { s.SetupTest() + ctx = s.network.GetContext() + stDB := s.network.GetStateDB() - var contract *vm.Contract - contract, s.ctx = testutil.NewPrecompileContract(s.T(), s.ctx, s.address, s.precompile, tc.gas) + delegator := s.keyring.GetKey(0) + grantee := s.keyring.GetKey(1) + + contract, ctx := testutil.NewPrecompileContract(s.T(), ctx, delegator.Addr, s.precompile, tc.gas) + cancelArgs := tc.malleate(delegator, grantee, s.network.GetValidators()[0].OperatorAddress) if tc.expError { - bz, err := s.precompile.CancelUnbondingDelegation(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate(s.validators[0].OperatorAddress)) + bz, err := s.precompile.CancelUnbondingDelegation(ctx, delegator.Addr, contract, stDB, &method, cancelArgs) s.Require().ErrorContains(err, tc.errContains) s.Require().Empty(bz) } else { undelegateArgs := []interface{}{ - s.address, - s.validators[0].OperatorAddress, + delegator.Addr, + s.network.GetValidators()[0].OperatorAddress, big.NewInt(1000000000000000000), } - err := s.CreateAuthorization(s.address, staking.UndelegateAuthz, nil) + // TODO: is this even necessary? + err := s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.UndelegateAuthz, nil) s.Require().NoError(err) - _, err = s.precompile.Undelegate(s.ctx, s.address, contract, s.stateDB, &undelegateMethod, undelegateArgs) + _, err = s.precompile.Undelegate(ctx, delegator.Addr, contract, stDB, &undelegateMethod, undelegateArgs) s.Require().NoError(err) - _, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), s.validators[0].GetOperator()) - s.Require().False(found) + valAddr, err := sdk.ValAddressFromBech32(s.network.GetValidators()[0].GetOperator()) + s.Require().NoError(err) - err = s.CreateAuthorization(s.address, staking.CancelUnbondingDelegationAuthz, nil) + _, err = s.network.App.StakingKeeper.GetDelegation(ctx, delegator.AccAddr, valAddr) + s.Require().Error(err) + s.Require().Contains("no delegation for (address, validator) tuple", err.Error()) + + err = s.CreateAuthorization(ctx, delegator.AccAddr, grantee.AccAddr, staking.CancelUnbondingDelegationAuthz, nil) s.Require().NoError(err) - bz, err := s.precompile.CancelUnbondingDelegation(s.ctx, s.address, contract, s.stateDB, &method, tc.malleate(s.validators[0].OperatorAddress)) + bz, err := s.precompile.CancelUnbondingDelegation(ctx, delegator.Addr, contract, stDB, &method, cancelArgs) s.Require().NoError(err) tc.postCheck(bz) - delegation, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), s.validators[0].GetOperator()) - s.Require().True(found) - - bech32Addr, err := sdk.Bech32ifyAddressBytes(chainconfig.Bech32Prefix, s.address.Bytes()) + delegation, err := s.network.App.StakingKeeper.GetDelegation(ctx, delegator.AccAddr, valAddr) s.Require().NoError(err) - s.Require().Equal(delegation.DelegatorAddress, bech32Addr) - s.Require().Equal(delegation.ValidatorAddress, s.validators[0].OperatorAddress) + + s.Require().Equal(delegation.DelegatorAddress, delegator.AccAddr.String()) + s.Require().Equal(delegation.ValidatorAddress, s.network.GetValidators()[0].OperatorAddress) s.Require().Equal(delegation.Shares, math.LegacyNewDecFromBigInt(tc.expDelegatedShares)) } diff --git a/precompiles/staking/types.go b/precompiles/staking/types.go index 8e3190ae..06cb340f 100644 --- a/precompiles/staking/types.go +++ b/precompiles/staking/types.go @@ -154,21 +154,17 @@ func NewMsgCreateValidator(args []interface{}, denom string) (*stakingtypes.MsgC Details: description.Details, }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.NewDecFromBigIntWithPrec(commission.Rate, sdk.Precision), - MaxRate: sdk.NewDecFromBigIntWithPrec(commission.Rate, sdk.Precision), - MaxChangeRate: sdk.NewDecFromBigIntWithPrec(commission.Rate, sdk.Precision), + Rate: math.LegacyNewDecFromBigIntWithPrec(commission.Rate, math.LegacyPrecision), + MaxRate: math.LegacyNewDecFromBigIntWithPrec(commission.Rate, math.LegacyPrecision), + MaxChangeRate: math.LegacyNewDecFromBigIntWithPrec(commission.Rate, math.LegacyPrecision), }, - MinSelfDelegation: sdk.NewIntFromBigInt(minSelfDelegation), + MinSelfDelegation: math.NewIntFromBigInt(minSelfDelegation), DelegatorAddress: sdk.AccAddress(validatorAddress.Bytes()).String(), ValidatorAddress: sdk.ValAddress(validatorAddress.Bytes()).String(), Pubkey: pubkey, Value: sdk.Coin{Denom: denom, Amount: math.NewIntFromBigInt(value)}, } - if err := msg.ValidateBasic(); err != nil { - return nil, common.Address{}, err - } - return msg, validatorAddress, nil } @@ -198,7 +194,7 @@ func NewMsgEditValidator(args []interface{}) (*stakingtypes.MsgEditValidator, co // If the value passed in by the user is not DoNotModifyCommissionRate, which is -1, it means that the user wants to modify its value. var commissionRate *math.LegacyDec if commissionRateBigInt.Cmp(big.NewInt(DoNotModifyCommissionRate)) != 0 { - cr := sdk.NewDecFromBigIntWithPrec(commissionRateBigInt, sdk.Precision) + cr := math.LegacyNewDecFromBigIntWithPrec(commissionRateBigInt, math.LegacyPrecision) commissionRate = &cr } @@ -226,10 +222,6 @@ func NewMsgEditValidator(args []interface{}) (*stakingtypes.MsgEditValidator, co MinSelfDelegation: minSelfDelegation, } - if err := msg.ValidateBasic(); err != nil { - return nil, common.Address{}, err - } - return msg, validatorHexAddr, nil } @@ -250,10 +242,6 @@ func NewMsgDelegate(args []interface{}, denom string) (*stakingtypes.MsgDelegate }, } - if err = msg.ValidateBasic(); err != nil { - return nil, common.Address{}, err - } - return msg, delegatorAddr, nil } @@ -274,10 +262,6 @@ func NewMsgUndelegate(args []interface{}, denom string) (*stakingtypes.MsgUndele }, } - if err = msg.ValidateBasic(); err != nil { - return nil, common.Address{}, err - } - return msg, delegatorAddr, nil } @@ -318,10 +302,6 @@ func NewMsgRedelegate(args []interface{}, denom string) (*stakingtypes.MsgBeginR }, } - if err := msg.ValidateBasic(); err != nil { - return nil, common.Address{}, err - } - return msg, delegatorAddr, nil } @@ -362,10 +342,6 @@ func NewMsgCancelUnbondingDelegation(args []interface{}, denom string) (*staking CreationHeight: creationHeight.Int64(), } - if err := msg.ValidateBasic(); err != nil { - return nil, common.Address{}, err - } - return msg, delegatorAddr, nil } diff --git a/precompiles/staking/utils_test.go b/precompiles/staking/utils_test.go index 9397ad2b..b66ebfad 100644 --- a/precompiles/staking/utils_test.go +++ b/precompiles/staking/utils_test.go @@ -2,232 +2,61 @@ package staking_test import ( "encoding/base64" - "encoding/json" "fmt" "math/big" "slices" "time" + "github.com/evmos/os/testutil/integration/os/factory" + "github.com/evmos/os/testutil/integration/os/grpc" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" + //nolint:revive // dot imports are fine for Ginkgo . "github.com/onsi/gomega" "cosmossdk.io/math" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/crypto/tmhash" - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/baseapp" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/testutil/mock" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/authz" + authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/evmos/os/crypto/ethsecp256k1" - exampleapp "github.com/evmos/os/example_chain" - chainutil "github.com/evmos/os/example_chain/testutil" + + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/evmos/os/precompiles/authorization" cmn "github.com/evmos/os/precompiles/common" "github.com/evmos/os/precompiles/staking" "github.com/evmos/os/precompiles/testutil" - "github.com/evmos/os/precompiles/testutil/contracts" - evmosutil "github.com/evmos/os/testutil" - testutiltx "github.com/evmos/os/testutil/tx" - evmostypes "github.com/evmos/os/types" - "github.com/evmos/os/x/evm/statedb" evmtypes "github.com/evmos/os/x/evm/types" ) -// SetupWithGenesisValSet initializes a new evmOS app with a validator set and genesis accounts -// that also act as delegators. For simplicity, each validator is bonded with a delegation -// of one consensus engine unit (10^6) in the default token of the simapp from first genesis -// account. A Nop logger is set in SimApp. -func (s *PrecompileTestSuite) SetupWithGenesisValSet(valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) { - appI, genesisState := exampleapp.SetupTestingApp(evmosutil.ExampleChainID)() - app, ok := appI.(*exampleapp.ExampleChain) - s.Require().True(ok) - - // set genesis accounts - authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) - genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis) - - validators := make([]stakingtypes.Validator, 0, len(valSet.Validators)) - delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators)) - - bondAmt := sdk.TokensFromConsensusPower(1, evmostypes.AttoPowerReduction) - - for _, val := range valSet.Validators { - pk, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) - s.Require().NoError(err) - pkAny, err := codectypes.NewAnyWithValue(pk) - s.Require().NoError(err) - validator := stakingtypes.Validator{ - OperatorAddress: sdk.ValAddress(val.Address).String(), - ConsensusPubkey: pkAny, - Jailed: false, - Status: stakingtypes.Bonded, - Tokens: bondAmt, - DelegatorShares: math.LegacyOneDec(), - Description: stakingtypes.Description{}, - UnbondingHeight: int64(0), - UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(math.LegacyZeroDec(), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 2)), - MinSelfDelegation: math.ZeroInt(), - } - validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), math.LegacyOneDec())) - } - s.validators = validators - - // set validators and delegations - stakingParams := stakingtypes.DefaultParams() - // set bond demon to be aevmos - stakingParams.BondDenom = evmosutil.ExampleAttoDenom - stakingGenesis := stakingtypes.NewGenesisState(stakingParams, validators, delegations) - genesisState[stakingtypes.ModuleName] = app.AppCodec().MustMarshalJSON(stakingGenesis) - - totalBondAmt := math.ZeroInt() - for range validators { - totalBondAmt = totalBondAmt.Add(bondAmt) - } - totalSupply := sdk.NewCoins() - for _, b := range balances { - // add genesis acc tokens and delegated tokens to total supply - totalSupply = totalSupply.Add(b.Coins.Add(sdk.NewCoin(evmosutil.ExampleAttoDenom, totalBondAmt))...) - } - - // add bonded amount to bonded pool module account - balances = append(balances, banktypes.Balance{ - Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), - Coins: sdk.Coins{sdk.NewCoin(evmosutil.ExampleAttoDenom, totalBondAmt)}, - }) - - // update total supply - bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{}, []banktypes.SendEnabled{}) - genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) - - stateBytes, err := json.MarshalIndent(genesisState, "", " ") - s.Require().NoError(err) - - header := evmosutil.NewHeader( - 2, - time.Now().UTC(), - evmosutil.ExampleChainID, - sdk.ConsAddress(validators[0].GetOperator()), - tmhash.Sum([]byte("app")), - tmhash.Sum([]byte("validators")), - ) - - // init chain will set the validator set and initialize the genesis accounts - app.InitChain( - abci.RequestInitChain{ - ChainId: evmosutil.ExampleChainID, - Validators: []abci.ValidatorUpdate{}, - ConsensusParams: chainutil.DefaultConsensusParams, - AppStateBytes: stateBytes, - }, - ) - - // create Context - s.ctx = app.BaseApp.NewContext(false, header) - - // commit genesis changes - app.Commit() - app.BeginBlock(abci.RequestBeginBlock{Header: header}) - - s.app = app -} - -func (s *PrecompileTestSuite) DoSetupTest() { - nValidators := 3 - signers := make(map[string]tmtypes.PrivValidator, nValidators) - validators := make([]*tmtypes.Validator, 0, nValidators) - - for i := 0; i < nValidators; i++ { - privVal := mock.NewPV() - pubKey, err := privVal.GetPubKey() - s.Require().NoError(err) - signers[pubKey.Address().String()] = privVal - validator := tmtypes.NewValidator(pubKey, 1) - validators = append(validators, validator) - } - - valSet := tmtypes.NewValidatorSet(validators) - - // generate genesis account - addr, priv := testutiltx.NewAddrKey() - s.privKey = priv - s.address = addr - s.signer = testutiltx.NewSigner(priv) - - baseAcc := authtypes.NewBaseAccount(priv.PubKey().Address().Bytes(), priv.PubKey(), 0, 0) - - amount := sdk.TokensFromConsensusPower(5, evmostypes.AttoPowerReduction) - - balance := banktypes.Balance{ - Address: baseAcc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, amount)), - } - - s.SetupWithGenesisValSet(valSet, []authtypes.GenesisAccount{baseAcc}, balance) - - // Create StateDB - s.stateDB = statedb.New(s.ctx, s.app.EVMKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(s.ctx.HeaderHash().Bytes()))) - - // bond denom - stakingParams := s.app.StakingKeeper.GetParams(s.ctx) - stakingParams.BondDenom = evmosutil.ExampleAttoDenom - s.bondDenom = stakingParams.BondDenom - err := s.app.StakingKeeper.SetParams(s.ctx, stakingParams) - s.Require().NoError(err) - - s.ethSigner = ethtypes.LatestSignerForChainID(s.app.EVMKeeper.ChainID()) - - precompile, err := staking.NewPrecompile(*s.app.StakingKeeper, s.app.AuthzKeeper) - s.Require().NoError(err) - s.precompile = precompile - - coins := sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, math.NewInt(5000000000000000000))) - distrCoins := sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, math.NewInt(2000000000000000000))) - err = s.app.BankKeeper.MintCoins(s.ctx, minttypes.ModuleName, coins) - s.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, minttypes.ModuleName, authtypes.FeeCollectorName, distrCoins) - s.Require().NoError(err) - - queryHelperEvm := baseapp.NewQueryServerTestHelper(s.ctx, s.app.InterfaceRegistry()) - evmtypes.RegisterQueryServer(queryHelperEvm, s.app.EVMKeeper) - s.queryClientEVM = evmtypes.NewQueryClient(queryHelperEvm) -} - // ApproveAndCheckAuthz is a helper function to approve a given authorization method and check if the authorization was created. -func (s *PrecompileTestSuite) ApproveAndCheckAuthz(method abi.Method, msgType string, amount *big.Int) { +func (s *PrecompileTestSuite) ApproveAndCheckAuthz(method abi.Method, granter, grantee testkeyring.Key, msgType string, amount *big.Int) { approveArgs := []interface{}{ - s.address, + grantee.Addr, amount, []string{msgType}, } - resp, err := s.precompile.Approve(s.ctx, s.address, s.stateDB, &method, approveArgs) + resp, err := s.precompile.Approve(s.network.GetContext(), granter.Addr, s.network.GetStateDB(), &method, approveArgs) s.Require().NoError(err) s.Require().Equal(resp, cmn.TrueValue) - auth, _ := s.CheckAuthorization(staking.DelegateAuthz, s.address, s.address) + auth, _ := CheckAuthorizationWithContext(s.network.GetContext(), s.network.App.AuthzKeeper, staking.DelegateAuthz, grantee.Addr, granter.Addr) s.Require().NotNil(auth) s.Require().Equal(auth.AuthorizationType, staking.DelegateAuthz) s.Require().Equal(auth.MaxTokens, &sdk.Coin{Denom: s.bondDenom, Amount: math.NewIntFromBigInt(amount)}) } -// CheckAuthorization is a helper function to check if the authorization is set and if it is the correct type. -func (s *PrecompileTestSuite) CheckAuthorization(authorizationType stakingtypes.AuthorizationType, grantee, granter common.Address) (*stakingtypes.StakeAuthorization, *time.Time) { +// CheckAuthorizationWithContext is a helper function to check if the authorization is set and if it is the correct type. +// Useful only for unit tests +func CheckAuthorizationWithContext(ctx sdk.Context, ak authzkeeper.Keeper, authorizationType stakingtypes.AuthorizationType, grantee, granter common.Address) (*stakingtypes.StakeAuthorization, *time.Time) { stakingAuthz := stakingtypes.StakeAuthorization{AuthorizationType: authorizationType} - auth, expirationTime := s.app.AuthzKeeper.GetAuthorization(s.ctx, grantee.Bytes(), granter.Bytes(), stakingAuthz.MsgTypeURL()) + auth, expirationTime := ak.GetAuthorization(ctx, grantee.Bytes(), granter.Bytes(), stakingAuthz.MsgTypeURL()) stakeAuthorization, ok := auth.(*stakingtypes.StakeAuthorization) if !ok { @@ -237,23 +66,66 @@ func (s *PrecompileTestSuite) CheckAuthorization(authorizationType stakingtypes. return stakeAuthorization, expirationTime } +// CheckAuthorization is a helper function to check if the authorization is set and if it is the correct type. +func CheckAuthorization(gh grpc.Handler, ir cdctypes.InterfaceRegistry, authorizationType stakingtypes.AuthorizationType, grantee, granter common.Address) (*stakingtypes.StakeAuthorization, *time.Time, error) { + grants, err := gh.GetGrants(sdk.AccAddress(grantee.Bytes()).String(), sdk.AccAddress(granter.Bytes()).String()) + if err != nil { + return nil, nil, err + } + + if len(grants) == 0 { + return nil, nil, fmt.Errorf("no authorizations found for grantee %s and granter %s", grantee, granter) + } + + var ( + expGrant *authz.Grant + stakeAuthorization *stakingtypes.StakeAuthorization + ) + for _, g := range grants { + var ( + ok bool + auth authz.Authorization + ) + if err = ir.UnpackAny(g.Authorization, &auth); err != nil { + return nil, nil, err + } + stakeAuthorization, ok = auth.(*stakingtypes.StakeAuthorization) + if !ok { + return nil, nil, fmt.Errorf("invalid authorization type. Expected: stakingtypes.StakeAuthorization, got: %T", auth) + } + if stakeAuthorization.AuthorizationType == authorizationType { + expGrant = g + break + } + } + + if expGrant == nil { + return nil, nil, fmt.Errorf("invalid authorization type. Expected: %d, got: %d", authorizationType, stakeAuthorization.AuthorizationType) + } + + return stakeAuthorization, expGrant.Expiration, nil +} + // CreateAuthorization is a helper function to create a new authorization of the given type for a spender address // (=grantee). // The authorization will be created to spend the given Coin. // For testing purposes, this function will create a new authorization for all available validators, // that are not jailed. -func (s *PrecompileTestSuite) CreateAuthorization(grantee common.Address, authzType stakingtypes.AuthorizationType, coin *sdk.Coin) error { +func (s *PrecompileTestSuite) CreateAuthorization(ctx sdk.Context, granter, grantee sdk.AccAddress, authzType stakingtypes.AuthorizationType, coin *sdk.Coin) error { // Get all available validators and filter out jailed validators validators := make([]sdk.ValAddress, 0) - s.app.StakingKeeper.IterateValidators( - s.ctx, func(_ int64, validator stakingtypes.ValidatorI) (stop bool) { + err := s.network.App.StakingKeeper.IterateValidators( + ctx, func(_ int64, validator stakingtypes.ValidatorI) (stop bool) { if validator.IsJailed() { return } - validators = append(validators, validator.GetOperator()) + validators = append(validators, sdk.ValAddress(validator.GetOperator())) return }, ) + if err != nil { + return err + } stakingAuthz, err := stakingtypes.NewStakeAuthorization(validators, nil, authzType, coin) if err != nil { @@ -261,7 +133,7 @@ func (s *PrecompileTestSuite) CreateAuthorization(grantee common.Address, authzT } expiration := time.Now().Add(cmn.DefaultExpirationDuration).UTC() - err = s.app.AuthzKeeper.SaveGrant(s.ctx, grantee.Bytes(), s.address.Bytes(), stakingAuthz, &expiration) + err = s.network.App.AuthzKeeper.SaveGrant(ctx, grantee, granter, stakingAuthz, &expiration) if err != nil { return err } @@ -277,11 +149,13 @@ func (s *PrecompileTestSuite) SetupApproval( amount *big.Int, msgTypes []string, ) { - approveArgs := contracts.CallArgs{ - ContractAddr: s.precompile.Address(), - ContractABI: s.precompile.ABI, - PrivKey: granterPriv, - MethodName: authorization.ApproveMethod, + precompileAddr := s.precompile.Address() + txArgs := evmtypes.EvmTxArgs{ + To: &precompileAddr, + } + approveArgs := factory.CallArgs{ + ContractABI: s.precompile.ABI, + MethodName: authorization.ApproveMethod, Args: []interface{}{ grantee, amount, msgTypes, }, @@ -293,10 +167,13 @@ func (s *PrecompileTestSuite) SetupApproval( ExpPass: true, } - res, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, approveArgs, logCheckArgs) + res, _, err := s.factory.CallContractAndCheckLogs( + granterPriv, + txArgs, approveArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while calling the contract to approve") - - s.NextBlock() + Expect(s.network.NextBlock()).To(BeNil()) // Check if the approval event is emitted granterAddr := common.BytesToAddress(granterPriv.PubKey().Address().Bytes()) @@ -306,14 +183,18 @@ func (s *PrecompileTestSuite) SetupApproval( granterAddr, grantee, res, - s.ctx.BlockHeight()-1, + s.network.GetContext().BlockHeight(), msgTypes, amount, ) } // SetupApprovalWithContractCalls is a helper function used to setup the allowance for the given spender. -func (s *PrecompileTestSuite) SetupApprovalWithContractCalls(approvalArgs contracts.CallArgs) { +func (s *PrecompileTestSuite) SetupApprovalWithContractCalls( + granter testkeyring.Key, + txArgs evmtypes.EvmTxArgs, + approvalArgs factory.CallArgs, +) { msgTypes, ok := approvalArgs.Args[1].([]string) Expect(ok).To(BeTrue(), "failed to convert msgTypes to []string") expAmount, ok := approvalArgs.Args[2].(*big.Int) @@ -325,15 +206,14 @@ func (s *PrecompileTestSuite) SetupApprovalWithContractCalls(approvalArgs contra ExpPass: true, } - _, _, err := contracts.CallContractAndCheckLogs(s.ctx, s.app, approvalArgs, logCheckArgs) + _, _, err := s.factory.CallContractAndCheckLogs( + granter.Priv, + txArgs, + approvalArgs, + logCheckArgs, + ) Expect(err).To(BeNil(), "error while approving: %v", err) - - // get granter address from private key provided - pk, ok := approvalArgs.PrivKey.(*ethsecp256k1.PrivKey) - Expect(ok).To(BeTrue(), fmt.Sprintf("expected a ethsecp256k1.PrivKey, but got %T", approvalArgs.PrivKey)) - key, err := pk.ToECDSA() - Expect(err).To(BeNil()) - granter := crypto.PubkeyToAddress(key.PublicKey) + Expect(s.network.NextBlock()).To(BeNil()) // iterate over args var expectedAuthz stakingtypes.AuthorizationType @@ -348,7 +228,8 @@ func (s *PrecompileTestSuite) SetupApprovalWithContractCalls(approvalArgs contra case staking.CancelUnbondingDelegationMsg: expectedAuthz = staking.CancelUnbondingDelegationAuthz } - authz, expirationTime := s.CheckAuthorization(expectedAuthz, approvalArgs.ContractAddr, granter) + authz, expirationTime, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, expectedAuthz, *txArgs.To, granter.Addr) + Expect(err).To(BeNil()) Expect(authz).ToNot(BeNil(), "expected authorization to be set") Expect(authz.MaxTokens.Amount).To(Equal(math.NewInt(expAmount.Int64())), "expected different allowance") Expect(authz.MsgTypeURL()).To(Equal(msgType), "expected different message type") @@ -356,43 +237,21 @@ func (s *PrecompileTestSuite) SetupApprovalWithContractCalls(approvalArgs contra } } -// DeployContract deploys a contract that calls the staking precompile's methods for testing purposes. -func (s *PrecompileTestSuite) DeployContract(contract evmtypes.CompiledContract) (addr common.Address, err error) { - addr, err = chainutil.DeployContract( - s.ctx, - s.app, - s.privKey, - s.queryClientEVM, - contract, - ) - return -} - -// NextBlock commits the current block and sets up the next block. -func (s *PrecompileTestSuite) NextBlock() { - s.NextBlockAfter(time.Second) -} - -// NextBlock commits the current block and sets up the next block. -func (s *PrecompileTestSuite) NextBlockAfter(t time.Duration) { - var err error - s.ctx, err = chainutil.CommitAndCreateNewCtx(s.ctx, s.app, t, nil) - Expect(err).To(BeNil(), "failed to commit block") -} - // CheckAllowanceChangeEvent is a helper function used to check the allowance change event arguments. -func (s *PrecompileTestSuite) CheckAllowanceChangeEvent(log *ethtypes.Log, methods []string, amounts []*big.Int) { +func (s *PrecompileTestSuite) CheckAllowanceChangeEvent( + log *ethtypes.Log, methods []string, amounts []*big.Int, granter, grantee common.Address, +) { s.Require().Equal(log.Address, s.precompile.Address()) // Check event signature matches the one emitted event := s.precompile.ABI.Events[authorization.EventTypeAllowanceChange] s.Require().Equal(event.ID, common.HexToHash(log.Topics[0].Hex())) - s.Require().Equal(log.BlockNumber, uint64(s.ctx.BlockHeight())) + s.Require().Equal(log.BlockNumber, uint64(s.network.GetContext().BlockHeight())) //nolint:gosec // G115 var approvalEvent authorization.EventAllowanceChange err := cmn.UnpackLog(s.precompile.ABI, &approvalEvent, authorization.EventTypeAllowanceChange, *log) s.Require().NoError(err) - s.Require().Equal(s.address, approvalEvent.Grantee) - s.Require().Equal(s.address, approvalEvent.Granter) + s.Require().Equal(grantee, approvalEvent.Grantee) + s.Require().Equal(granter, approvalEvent.Granter) s.Require().Equal(len(methods), len(approvalEvent.Methods)) for i, method := range methods { @@ -404,7 +263,8 @@ func (s *PrecompileTestSuite) CheckAllowanceChangeEvent(log *ethtypes.Log, metho // ExpectAuthorization is a helper function for tests using the Ginkgo BDD style tests, to check that the // authorization is correctly set. func (s *PrecompileTestSuite) ExpectAuthorization(authorizationType stakingtypes.AuthorizationType, grantee, granter common.Address, maxTokens *sdk.Coin) { - authz, expirationTime := s.CheckAuthorization(authorizationType, grantee, granter) + authz, expirationTime, err := CheckAuthorization(s.grpcHandler, s.network.GetEncodingConfig().InterfaceRegistry, authorizationType, grantee, granter) + Expect(err).To(BeNil()) Expect(authz).ToNot(BeNil(), "expected authorization to be set") Expect(authz.AuthorizationType).To(Equal(authorizationType), "expected different authorization type") Expect(authz.MaxTokens).To(Equal(maxTokens), "expected different max tokens") @@ -416,22 +276,25 @@ func (s *PrecompileTestSuite) assertValidatorsResponse(validators []staking.Vali // returning order can change valOrder := []int{0, 1} varAddr := sdk.ValAddress(common.HexToAddress(validators[0].OperatorAddress).Bytes()).String() - if varAddr != s.validators[0].OperatorAddress { + vals := s.network.GetValidators() + + if varAddr != vals[0].OperatorAddress { valOrder = []int{1, 0} } for i := 0; i < expLen; i++ { j := valOrder[i] - s.Require().Equal(s.validators[j].OperatorAddress, sdk.ValAddress(common.HexToAddress(validators[i].OperatorAddress).Bytes()).String()) - s.Require().Equal(uint8(s.validators[j].Status), validators[i].Status) //#nosec G115 // enum is safe - s.Require().Equal(s.validators[j].Tokens.Uint64(), validators[i].Tokens.Uint64()) - s.Require().Equal(s.validators[j].DelegatorShares.BigInt(), validators[i].DelegatorShares) - s.Require().Equal(s.validators[j].Jailed, validators[i].Jailed) - s.Require().Equal(s.validators[j].UnbondingHeight, validators[i].UnbondingHeight) + val := s.network.GetValidators()[j] + s.Require().Equal(val.OperatorAddress, sdk.ValAddress(common.HexToAddress(validators[i].OperatorAddress).Bytes()).String()) + s.Require().Equal(uint8(val.Status), validators[i].Status) //#nosec G115 + s.Require().Equal(val.Tokens.Uint64(), validators[i].Tokens.Uint64()) + s.Require().Equal(val.DelegatorShares.BigInt(), validators[i].DelegatorShares) + s.Require().Equal(val.Jailed, validators[i].Jailed) + s.Require().Equal(val.UnbondingHeight, validators[i].UnbondingHeight) s.Require().Equal(int64(0), validators[i].UnbondingTime) - s.Require().Equal(int64(0), validators[i].Commission.Int64()) + s.Require().Equal(math.LegacyNewDecWithPrec(5, 2).BigInt(), validators[i].Commission) s.Require().Equal(int64(0), validators[i].MinSelfDelegation.Int64()) - s.Require().Equal(validators[i].ConsensusPubkey, staking.FormatConsensusPubkey(s.validators[j].ConsensusPubkey)) + s.Require().Equal(validators[i].ConsensusPubkey, staking.FormatConsensusPubkey(val.ConsensusPubkey)) } } @@ -455,16 +318,16 @@ func (s *PrecompileTestSuite) assertRedelegationsOutput(data []byte, redelTotalC if len(redOut.Response[0].Entries) == 2 { s.assertRedelegation(redOut.Response[0], 2, - s.validators[0].OperatorAddress, - s.validators[1].OperatorAddress, + s.network.GetValidators()[0].OperatorAddress, + s.network.GetValidators()[1].OperatorAddress, expAmt, expCreationHeight, ) } else { s.assertRedelegation(redOut.Response[0], 1, - s.validators[0].OperatorAddress, - sdk.ValAddress(s.address.Bytes()).String(), + s.network.GetValidators()[0].OperatorAddress, + s.network.GetValidators()[2].OperatorAddress, expAmt, expCreationHeight, ) @@ -476,7 +339,7 @@ func (s *PrecompileTestSuite) assertRedelegationsOutput(data []byte, redelTotalC // the same amount is considered for all entries func (s *PrecompileTestSuite) assertRedelegation(res staking.RedelegationResponse, entriesCount int, expValSrcAddr, expValDstAddr string, expAmt *big.Int, expCreationHeight int64) { // check response - s.Require().Equal(res.Redelegation.DelegatorAddress, sdk.AccAddress(s.address.Bytes()).String()) + s.Require().Equal(res.Redelegation.DelegatorAddress, s.keyring.GetAccAddr(0).String()) s.Require().Equal(res.Redelegation.ValidatorSrcAddress, expValSrcAddr) s.Require().Equal(res.Redelegation.ValidatorDstAddress, expValDstAddr) // check redelegation entries - should be empty @@ -493,36 +356,37 @@ func (s *PrecompileTestSuite) assertRedelegation(res staking.RedelegationRespons } // setupRedelegations setups 2 entries for redelegation from validator[0] -// to validator[1], creates a validator using s.address -// and creates a redelegation from validator[0] to the new validator -func (s *PrecompileTestSuite) setupRedelegations(redelAmt *big.Int) error { +// to validator[1], and a redelegation from validator[0] to validator[2] +func (s *PrecompileTestSuite) setupRedelegations(ctx sdk.Context, redelAmt *big.Int) error { + ctx = ctx.WithBlockTime(time.Now()) + vals := s.network.GetValidators() + msg := stakingtypes.MsgBeginRedelegate{ - DelegatorAddress: sdk.AccAddress(s.address.Bytes()).String(), - ValidatorSrcAddress: s.validators[0].OperatorAddress, - ValidatorDstAddress: s.validators[1].OperatorAddress, + DelegatorAddress: s.keyring.GetAccAddr(0).String(), + ValidatorSrcAddress: vals[0].OperatorAddress, + ValidatorDstAddress: vals[1].OperatorAddress, Amount: sdk.NewCoin(s.bondDenom, math.NewIntFromBigInt(redelAmt)), } - msgSrv := stakingkeeper.NewMsgServerImpl(s.app.StakingKeeper) + msgSrv := stakingkeeper.NewMsgServerImpl(s.network.App.StakingKeeper) // create 2 entries for same redelegation for i := 0; i < 2; i++ { - if _, err := msgSrv.BeginRedelegate(s.ctx, &msg); err != nil { + if _, err := msgSrv.BeginRedelegate(ctx, &msg); err != nil { return err } } - // create a validator with s.address and s.privKey - // then create a redelegation from validator[0] to this new validator - testutil.CreateValidator(s.ctx, s.T(), s.privKey.PubKey(), *s.app.StakingKeeper, math.NewInt(100)) - msg.ValidatorDstAddress = sdk.ValAddress(s.address.Bytes()).String() - _, err := msgSrv.BeginRedelegate(s.ctx, &msg) + // create a redelegation from validator[0] to validator[2] + msg.ValidatorDstAddress = vals[2].OperatorAddress + _, err := msgSrv.BeginRedelegate(ctx, &msg) return err } // CheckValidatorOutput checks that the given validator output func (s *PrecompileTestSuite) CheckValidatorOutput(valOut staking.ValidatorInfo) { - validatorAddrs := make([]string, len(s.validators)) - for i, v := range s.validators { + vals := s.network.GetValidators() + validatorAddrs := make([]string, len(vals)) + for i, v := range vals { validatorAddrs[i] = v.OperatorAddress } diff --git a/precompiles/testutil/contracts/Counter.json b/precompiles/testutil/contracts/Counter.json index 597e282a..b2d5ff5e 100644 --- a/precompiles/testutil/contracts/Counter.json +++ b/precompiles/testutil/contracts/Counter.json @@ -57,8 +57,8 @@ "type": "function" } ], - "bytecode": "0x60806040526000805534801561001457600080fd5b50610397806100246000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80634f2be91f146100465780636deebae3146100505780638ada066e1461005a575b600080fd5b61004e610078565b005b610058610103565b005b6100626101d2565b60405161006f91906101f4565b60405180910390f35b60008081548092919061008a9061023e565b91905055507f64a55044d1f2eddebe1b90e8e2853e8e96931cefadbfa0b2ceb34bee360619416000546040516100c091906101f4565b60405180910390a17f938d2ee5be9cfb0f7270ee2eff90507e94b37625d9d2b3a61c97d30a4560b8296000546040516100f991906101f4565b60405180910390a1565b60008054116040518060400160405280600f81526020017f434f554e5445525f544f4f5f4c4f5700000000000000000000000000000000008152509061017f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101769190610316565b60405180910390fd5b5060008081548092919061019290610338565b91905055507f938d2ee5be9cfb0f7270ee2eff90507e94b37625d9d2b3a61c97d30a4560b8296000546040516101c891906101f4565b60405180910390a1565b60008054905090565b6000819050919050565b6101ee816101db565b82525050565b600060208201905061020960008301846101e5565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610249826101db565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361027b5761027a61020f565b5b600182019050919050565b600081519050919050565b600082825260208201905092915050565b60005b838110156102c05780820151818401526020810190506102a5565b60008484015250505050565b6000601f19601f8301169050919050565b60006102e882610286565b6102f28185610291565b93506103028185602086016102a2565b61030b816102cc565b840191505092915050565b6000602082019050818103600083015261033081846102dd565b905092915050565b6000610343826101db565b9150600082036103565761035561020f565b5b60018203905091905056fea26469706673582212202870b2d78304eb0ec6b95f72bacf96e449481ecaa4d58a3ce786c1cba532075d64736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80634f2be91f146100465780636deebae3146100505780638ada066e1461005a575b600080fd5b61004e610078565b005b610058610103565b005b6100626101d2565b60405161006f91906101f4565b60405180910390f35b60008081548092919061008a9061023e565b91905055507f64a55044d1f2eddebe1b90e8e2853e8e96931cefadbfa0b2ceb34bee360619416000546040516100c091906101f4565b60405180910390a17f938d2ee5be9cfb0f7270ee2eff90507e94b37625d9d2b3a61c97d30a4560b8296000546040516100f991906101f4565b60405180910390a1565b60008054116040518060400160405280600f81526020017f434f554e5445525f544f4f5f4c4f5700000000000000000000000000000000008152509061017f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101769190610316565b60405180910390fd5b5060008081548092919061019290610338565b91905055507f938d2ee5be9cfb0f7270ee2eff90507e94b37625d9d2b3a61c97d30a4560b8296000546040516101c891906101f4565b60405180910390a1565b60008054905090565b6000819050919050565b6101ee816101db565b82525050565b600060208201905061020960008301846101e5565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610249826101db565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361027b5761027a61020f565b5b600182019050919050565b600081519050919050565b600082825260208201905092915050565b60005b838110156102c05780820151818401526020810190506102a5565b60008484015250505050565b6000601f19601f8301169050919050565b60006102e882610286565b6102f28185610291565b93506103028185602086016102a2565b61030b816102cc565b840191505092915050565b6000602082019050818103600083015261033081846102dd565b905092915050565b6000610343826101db565b9150600082036103565761035561020f565b5b60018203905091905056fea26469706673582212202870b2d78304eb0ec6b95f72bacf96e449481ecaa4d58a3ce786c1cba532075d64736f6c63430008130033", + "bytecode": "0x60806040526000805534801561001457600080fd5b50610397806100246000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80634f2be91f146100465780636deebae3146100505780638ada066e1461005a575b600080fd5b61004e610078565b005b610058610103565b005b6100626101d2565b60405161006f91906101f4565b60405180910390f35b60008081548092919061008a9061023e565b91905055507f64a55044d1f2eddebe1b90e8e2853e8e96931cefadbfa0b2ceb34bee360619416000546040516100c091906101f4565b60405180910390a17f938d2ee5be9cfb0f7270ee2eff90507e94b37625d9d2b3a61c97d30a4560b8296000546040516100f991906101f4565b60405180910390a1565b60008054116040518060400160405280600f81526020017f434f554e5445525f544f4f5f4c4f5700000000000000000000000000000000008152509061017f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101769190610316565b60405180910390fd5b5060008081548092919061019290610338565b91905055507f938d2ee5be9cfb0f7270ee2eff90507e94b37625d9d2b3a61c97d30a4560b8296000546040516101c891906101f4565b60405180910390a1565b60008054905090565b6000819050919050565b6101ee816101db565b82525050565b600060208201905061020960008301846101e5565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610249826101db565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361027b5761027a61020f565b5b600182019050919050565b600081519050919050565b600082825260208201905092915050565b60005b838110156102c05780820151818401526020810190506102a5565b60008484015250505050565b6000601f19601f8301169050919050565b60006102e882610286565b6102f28185610291565b93506103028185602086016102a2565b61030b816102cc565b840191505092915050565b6000602082019050818103600083015261033081846102dd565b905092915050565b6000610343826101db565b9150600082036103565761035561020f565b5b60018203905091905056fea264697066735822122074fa2d06189fa80d6dad60c419418caf51543918570c195ffca7cee18716e5c064736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80634f2be91f146100465780636deebae3146100505780638ada066e1461005a575b600080fd5b61004e610078565b005b610058610103565b005b6100626101d2565b60405161006f91906101f4565b60405180910390f35b60008081548092919061008a9061023e565b91905055507f64a55044d1f2eddebe1b90e8e2853e8e96931cefadbfa0b2ceb34bee360619416000546040516100c091906101f4565b60405180910390a17f938d2ee5be9cfb0f7270ee2eff90507e94b37625d9d2b3a61c97d30a4560b8296000546040516100f991906101f4565b60405180910390a1565b60008054116040518060400160405280600f81526020017f434f554e5445525f544f4f5f4c4f5700000000000000000000000000000000008152509061017f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101769190610316565b60405180910390fd5b5060008081548092919061019290610338565b91905055507f938d2ee5be9cfb0f7270ee2eff90507e94b37625d9d2b3a61c97d30a4560b8296000546040516101c891906101f4565b60405180910390a1565b60008054905090565b6000819050919050565b6101ee816101db565b82525050565b600060208201905061020960008301846101e5565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610249826101db565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361027b5761027a61020f565b5b600182019050919050565b600081519050919050565b600082825260208201905092915050565b60005b838110156102c05780820151818401526020810190506102a5565b60008484015250505050565b6000601f19601f8301169050919050565b60006102e882610286565b6102f28185610291565b93506103028185602086016102a2565b61030b816102cc565b840191505092915050565b6000602082019050818103600083015261033081846102dd565b905092915050565b6000610343826101db565b9150600082036103565761035561020f565b5b60018203905091905056fea264697066735822122074fa2d06189fa80d6dad60c419418caf51543918570c195ffca7cee18716e5c064736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/testutil/contracts/DistributionCaller.json b/precompiles/testutil/contracts/DistributionCaller.json index 3b67a175..4c9e4cd4 100644 --- a/precompiles/testutil/contracts/DistributionCaller.json +++ b/precompiles/testutil/contracts/DistributionCaller.json @@ -551,6 +551,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "string", + "name": "_validatorAddr", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "testDelegateFromContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -914,8 +932,8 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b5061477b806100206000396000f3fe60806040526004361061019c5760003560e01c80637c9db0bb116100ec578063b6a216ae1161008a578063d0e30db011610064578063d0e30db0146106a7578063d3f831be146106b1578063e0421e39146106ee578063e236c7a61461072b5761019c565b8063b6a216ae146105f0578063c7804bb51461062d578063cb85aa0a1461066a5761019c565b806398194593116100c657806398194593146104fc578063ad5c4cdd14610539578063adb2378514610576578063b2d17883146105b35761019c565b80637c9db0bb1461044457806388b2d58114610481578063963516e4146104bf5761019c565b806346e16d34116101595780636cc9ac8a116101335780636cc9ac8a146103785780636f669da4146103a157806378a5dfd1146103de578063796b96d21461041b5761019c565b806346e16d34146102d3578063613d4de81461031057806361bc221a1461034d5761019c565b80630183e4b4146101a157806301b68000146101ca5780630c05e9e4146102075780631b05020714610244578063296c60aa1461026d5780632d0ee16a14610296575b600080fd5b3480156101ad57600080fd5b506101c860048036038101906101c391906123de565b610769565b005b3480156101d657600080fd5b506101f160048036038101906101ec9190612483565b610a96565b6040516101fe9190612540565b60405180910390f35b34801561021357600080fd5b5061022e60048036038101906102299190612697565b610bde565b60405161023b91906128da565b60405180910390f35b34801561025057600080fd5b5061026b600480360381019061026691906128fc565b610c6e565b005b34801561027957600080fd5b50610294600480360381019061028f919061297f565b610df4565b005b3480156102a257600080fd5b506102bd60048036038101906102b89190612697565b610f35565b6040516102ca9190612ada565b60405180910390f35b3480156102df57600080fd5b506102fa60048036038101906102f5919061297f565b610fc3565b6040516103079190612b0b565b60405180910390f35b34801561031c57600080fd5b5061033760048036038101906103329190612b26565b61104d565b6040516103449190612ada565b60405180910390f35b34801561035957600080fd5b5061036261133e565b60405161036f9190612bc5565b60405180910390f35b34801561038457600080fd5b5061039f600480360381019061039a9190612c0c565b61134f565b005b3480156103ad57600080fd5b506103c860048036038101906103c39190612c73565b6115de565b6040516103d59190612b0b565b60405180910390f35b3480156103ea57600080fd5b506104056004803603810190610400919061297f565b611668565b6040516104129190612d39565b60405180910390f35b34801561042757600080fd5b50610442600480360381019061043d919061297f565b6116f5565b005b34801561045057600080fd5b5061046b60048036038101906104669190612697565b611836565b6040516104789190612d39565b60405180910390f35b34801561048d57600080fd5b506104a860048036038101906104a39190612dbf565b6118c0565b6040516104b6929190613001565b60405180910390f35b3480156104cb57600080fd5b506104e660048036038101906104e19190612697565b61195e565b6040516104f39190612b0b565b60405180910390f35b34801561050857600080fd5b50610523600480360381019061051e919061297f565b6119e7565b6040516105309190612ada565b60405180910390f35b34801561054557600080fd5b50610560600480360381019061055b919061297f565b611a76565b60405161056d9190612ada565b60405180910390f35b34801561058257600080fd5b5061059d60048036038101906105989190613038565b611b02565b6040516105aa9190612ada565b60405180910390f35b3480156105bf57600080fd5b506105da60048036038101906105d591906130bb565b611d8d565b6040516105e79190612ada565b60405180910390f35b3480156105fc57600080fd5b5061061760048036038101906106129190612483565b611ee2565b6040516106249190613208565b60405180910390f35b34801561063957600080fd5b50610654600480360381019061064f919061322a565b611f6c565b6040516106619190612b0b565b60405180910390f35b34801561067657600080fd5b50610691600480360381019061068c9190612483565b612084565b60405161069e91906132b4565b60405180910390f35b6106af61210e565b005b3480156106bd57600080fd5b506106d860048036038101906106d39190612697565b612110565b6040516106e59190612d39565b60405180910390f35b3480156106fa57600080fd5b5061071560048036038101906107109190612697565b61219a565b6040516107229190612ada565b60405180910390f35b34801561073757600080fd5b50610752600480360381019061074d9190612483565b612226565b6040516107609291906133dc565b60405180910390f35b811561089a5760008081819054906101000a900460070b8092919061078d90613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146108995760008473ffffffffffffffffffffffffffffffffffffffff16600f604051610811906134a3565b60006040518083038185875af1925050503d806000811461084e576040519150601f19603f3d011682016040523d82523d6000602084013e610853565b606091505b5050905080610897576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088e9061352a565b60405180910390fd5b505b5b600061080173ffffffffffffffffffffffffffffffffffffffff16632efe8a5f86866040518363ffffffff1660e01b81526004016108d99291906135b8565b6020604051808303816000875af11580156108f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091c91906135f6565b90508061095e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109559061366f565b60405180910390fd5b8115610a8f5760008081819054906101000a900460070b8092919061098290613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614610a8e5760008573ffffffffffffffffffffffffffffffffffffffff16600f604051610a06906134a3565b60006040518083038185875af1925050503d8060008114610a43576040519150601f19603f3d011682016040523d82523d6000602084013e610a48565b606091505b5050905080610a8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a839061352a565b60405180910390fd5b505b5b5050505050565b606060008061080173ffffffffffffffffffffffffffffffffffffffff1684604051602401610ac5919061369e565b6040516020818303038152906040527f5431f450000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610b4f91906136ea565b600060405180830381855afa9150503d8060008114610b8a576040519150601f19603f3d011682016040523d82523d6000602084013e610b8f565b606091505b509150915081610bd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bcb9061374d565b60405180910390fd5b8092505050919050565b610be66122b3565b61080173ffffffffffffffffffffffffffffffffffffffff166354212a89836040518263ffffffff1660e01b8152600401610c2191906132b4565b600060405180830381865afa158015610c3e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610c679190613a46565b9050919050565b3073ffffffffffffffffffffffffffffffffffffffff1663ad5c4cdd85846040518363ffffffff1660e01b8152600401610ca9929190613a8f565b6000604051808303816000875af1925050508015610cea57506040513d6000823e3d601f19601f82011682018060405250810190610ce79190613c0c565b60015b15610cf157505b8015610dee5760008081819054906101000a900460070b80929190610d1590613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008373ffffffffffffffffffffffffffffffffffffffff16600f604051610d66906134a3565b60006040518083038185875af1925050503d8060008114610da3576040519150601f19603f3d011682016040523d82523d6000602084013e610da8565b606091505b5050905080610dec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de39061352a565b60405180910390fd5b505b50505050565b600061080173ffffffffffffffffffffffffffffffffffffffff168383604051602401610e22929190613c55565b6040516020818303038152906040527f5a9d9a96000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610eac91906136ea565b600060405180830381855af49150503d8060008114610ee7576040519150601f19603f3d011682016040523d82523d6000602084013e610eec565b606091505b5050905080610f30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2790613cf7565b60405180910390fd5b505050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6130846040518363ffffffff1660e01b8152600401610f74929190613c55565b6000604051808303816000875af1158015610f93573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610fbc9190613c0c565b9050919050565b600061080173ffffffffffffffffffffffffffffffffffffffff16635a9d9a9684846040518363ffffffff1660e01b8152600401611002929190613c55565b6020604051808303816000875af1158015611021573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104591906135f6565b905092915050565b606082156111805760008081819054906101000a900460070b8092919061107390613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461117f5760008473ffffffffffffffffffffffffffffffffffffffff16600f6040516110f7906134a3565b60006040518083038185875af1925050503d8060008114611134576040519150601f19603f3d011682016040523d82523d6000602084013e611139565b606091505b505090508061117d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111749061352a565b60405180910390fd5b505b5b61080173ffffffffffffffffffffffffffffffffffffffff16633ce4e3be866040518263ffffffff1660e01b81526004016111bb91906132b4565b6000604051808303816000875af11580156111da573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906112039190613c0c565b905081156113365760008081819054906101000a900460070b8092919061122990613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146113355760008473ffffffffffffffffffffffffffffffffffffffff16600f6040516112ad906134a3565b60006040518083038185875af1925050503d80600081146112ea576040519150601f19603f3d011682016040523d82523d6000602084013e6112ef565b606091505b5050905080611333576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132a9061352a565b60405180910390fd5b505b5b949350505050565b60008054906101000a900460070b81565b811561144c5760008081819054906101000a900460070b8092919061137390613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008473ffffffffffffffffffffffffffffffffffffffff16600f6040516113c4906134a3565b60006040518083038185875af1925050503d8060008114611401576040519150601f19603f3d011682016040523d82523d6000602084013e611406565b606091505b505090508061144a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114419061352a565b60405180910390fd5b505b600061080173ffffffffffffffffffffffffffffffffffffffff1663ed41d0b686866040518363ffffffff1660e01b815260040161148b929190613d26565b6020604051808303816000875af11580156114aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ce91906135f6565b9050806114da57600080fd5b81156115d75760008081819054906101000a900460070b809291906114fe90613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008573ffffffffffffffffffffffffffffffffffffffff16600f60405161154f906134a3565b60006040518083038185875af1925050503d806000811461158c576040519150601f19603f3d011682016040523d82523d6000602084013e611591565b606091505b50509050806115d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115cc9061352a565b60405180910390fd5b505b5050505050565b600061080173ffffffffffffffffffffffffffffffffffffffff16632efe8a5f84846040518363ffffffff1660e01b815260040161161d929190613d4f565b6020604051808303816000875af115801561163c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166091906135f6565b905092915050565b606061080173ffffffffffffffffffffffffffffffffffffffff16639ad563b484846040518363ffffffff1660e01b81526004016116a7929190613c55565b600060405180830381865afa1580156116c4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906116ed9190613d78565b905092915050565b600061080173ffffffffffffffffffffffffffffffffffffffff168383604051602401611723929190613c55565b6040516020818303038152906040527f5a9d9a96000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516117ad91906136ea565b600060405180830381855afa9150503d80600081146117e8576040519150601f19603f3d011682016040523d82523d6000602084013e6117ed565b606091505b5050905080611831576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118289061374d565b60405180910390fd5b505050565b606061080173ffffffffffffffffffffffffffffffffffffffff16633dd40f78836040518263ffffffff1660e01b815260040161187391906132b4565b600060405180830381865afa158015611890573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906118b99190613d78565b9050919050565b60606118ca6122d4565b61080173ffffffffffffffffffffffffffffffffffffffff16638f2473ce878787876040518563ffffffff1660e01b815260040161190b9493929190613f4c565b600060405180830381865afa158015611928573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906119519190614224565b9150915094509492505050565b600061080173ffffffffffffffffffffffffffffffffffffffff16635a9d9a9630846040518363ffffffff1660e01b815260040161199d929190613c55565b6020604051808303816000875af11580156119bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e091906135f6565b9050919050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6184846040518363ffffffff1660e01b8152600401611a26929190613c55565b6000604051808303816000875af1158015611a45573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611a6e9190613c0c565b905092915050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6184846040518363ffffffff1660e01b8152600401611ab5929190613c55565b6000604051808303816000875af1158015611ad4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611afd9190613c0c565b600080fd5b60608215611c015760008081819054906101000a900460070b80929190611b2890613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008573ffffffffffffffffffffffffffffffffffffffff16600f604051611b79906134a3565b60006040518083038185875af1925050503d8060008114611bb6576040519150601f19603f3d011682016040523d82523d6000602084013e611bbb565b606091505b5050905080611bff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bf69061352a565b60405180910390fd5b505b61080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6186866040518363ffffffff1660e01b8152600401611c3e929190613a8f565b6000604051808303816000875af1158015611c5d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611c869190613c0c565b90508115611d855760008081819054906101000a900460070b80929190611cac90613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008573ffffffffffffffffffffffffffffffffffffffff16600f604051611cfd906134a3565b60006040518083038185875af1925050503d8060008114611d3a576040519150601f19603f3d011682016040523d82523d6000602084013e611d3f565b606091505b5050905080611d83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7a9061352a565b60405180910390fd5b505b949350505050565b6060600061080173ffffffffffffffffffffffffffffffffffffffff16635a9d9a9633876040518363ffffffff1660e01b8152600401611dce929190613c55565b6020604051808303816000875af1158015611ded573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1191906135f6565b905080611e53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4a906142e8565b60405180910390fd5b61080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6185856040518363ffffffff1660e01b8152600401611e90929190613c55565b6000604051808303816000875af1158015611eaf573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611ed89190613c0c565b9150509392505050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663a66cb605836040518263ffffffff1660e01b8152600401611f1f919061369e565b600060405180830381865afa158015611f3c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611f6591906143e9565b9050919050565b600060016000808282829054906101000a900460070b611f8c9190614432565b92506101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555061080173ffffffffffffffffffffffffffffffffffffffff1663ed41d0b684846040518363ffffffff1660e01b8152600401611ff2929190614492565b6020604051808303816000875af1158015612011573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203591906135f6565b905060016000808282829054906101000a900460070b61205591906144bb565b92506101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555092915050565b606061080173ffffffffffffffffffffffffffffffffffffffff16635431f450836040518263ffffffff1660e01b81526004016120c1919061369e565b600060405180830381865afa1580156120de573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190612107919061451b565b9050919050565b565b606061080173ffffffffffffffffffffffffffffffffffffffff166385b2d2da836040518263ffffffff1660e01b815260040161214d91906132b4565b600060405180830381865afa15801561216a573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906121939190613d78565b9050919050565b606061080173ffffffffffffffffffffffffffffffffffffffff16633ce4e3be836040518263ffffffff1660e01b81526004016121d791906132b4565b6000604051808303816000875af11580156121f6573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061221f9190613c0c565b9050919050565b60608061080173ffffffffffffffffffffffffffffffffffffffff166354be1a28846040518263ffffffff1660e01b8152600401612264919061369e565b600060405180830381865afa158015612281573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906122aa91906146cd565b91509150915091565b60405180606001604052806060815260200160608152602001606081525090565b604051806040016040528060608152602001600067ffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123378261230c565b9050919050565b6123478161232c565b811461235257600080fd5b50565b6000813590506123648161233e565b92915050565b600063ffffffff82169050919050565b6123838161236a565b811461238e57600080fd5b50565b6000813590506123a08161237a565b92915050565b60008115159050919050565b6123bb816123a6565b81146123c657600080fd5b50565b6000813590506123d8816123b2565b92915050565b600080600080608085870312156123f8576123f7612302565b5b600061240687828801612355565b945050602061241787828801612391565b9350506040612428878288016123c9565b9250506060612439878288016123c9565b91505092959194509250565b60006124508261230c565b9050919050565b61246081612445565b811461246b57600080fd5b50565b60008135905061247d81612457565b92915050565b60006020828403121561249957612498612302565b5b60006124a78482850161246e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156124ea5780820151818401526020810190506124cf565b60008484015250505050565b6000601f19601f8301169050919050565b6000612512826124b0565b61251c81856124bb565b935061252c8185602086016124cc565b612535816124f6565b840191505092915050565b6000602082019050818103600083015261255a8184612507565b905092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6125a4826124f6565b810181811067ffffffffffffffff821117156125c3576125c261256c565b5b80604052505050565b60006125d66122f8565b90506125e2828261259b565b919050565b600067ffffffffffffffff8211156126025761260161256c565b5b61260b826124f6565b9050602081019050919050565b82818337600083830152505050565b600061263a612635846125e7565b6125cc565b90508281526020810184848401111561265657612655612567565b5b612661848285612618565b509392505050565b600082601f83011261267e5761267d612562565b5b813561268e848260208601612627565b91505092915050565b6000602082840312156126ad576126ac612302565b5b600082013567ffffffffffffffff8111156126cb576126ca612307565b5b6126d784828501612669565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000612707826126e0565b61271181856126eb565b93506127218185602086016124cc565b61272a816124f6565b840191505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000819050919050565b61277481612761565b82525050565b600060ff82169050919050565b6127908161277a565b82525050565b600060608301600083015184820360008601526127b382826126fc565b91505060208301516127c8602086018261276b565b5060408301516127db6040860182612787565b508091505092915050565b60006127f28383612796565b905092915050565b6000602082019050919050565b600061281282612735565b61281c8185612740565b93508360208202850161282e85612751565b8060005b8581101561286a578484038952815161284b85826127e6565b9450612856836127fa565b925060208a01995050600181019050612832565b50829750879550505050505092915050565b6000606083016000830151848203600086015261289982826126fc565b915050602083015184820360208601526128b38282612807565b915050604083015184820360408601526128cd8282612807565b9150508091505092915050565b600060208201905081810360008301526128f4818461287c565b905092915050565b6000806000806080858703121561291657612915612302565b5b600061292487828801612355565b945050602061293587828801612355565b935050604085013567ffffffffffffffff81111561295657612955612307565b5b61296287828801612669565b9250506060612973878288016123c9565b91505092959194509250565b6000806040838503121561299657612995612302565b5b60006129a48582860161246e565b925050602083013567ffffffffffffffff8111156129c5576129c4612307565b5b6129d185828601612669565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006040830160008301518482036000860152612a2482826126fc565b9150506020830151612a39602086018261276b565b508091505092915050565b6000612a508383612a07565b905092915050565b6000602082019050919050565b6000612a70826129db565b612a7a81856129e6565b935083602082028501612a8c856129f7565b8060005b85811015612ac85784840389528151612aa98582612a44565b9450612ab483612a58565b925060208a01995050600181019050612a90565b50829750879550505050505092915050565b60006020820190508181036000830152612af48184612a65565b905092915050565b612b05816123a6565b82525050565b6000602082019050612b206000830184612afc565b92915050565b60008060008060808587031215612b4057612b3f612302565b5b600085013567ffffffffffffffff811115612b5e57612b5d612307565b5b612b6a87828801612669565b9450506020612b7b87828801612355565b9350506040612b8c878288016123c9565b9250506060612b9d878288016123c9565b91505092959194509250565b60008160070b9050919050565b612bbf81612ba9565b82525050565b6000602082019050612bda6000830184612bb6565b92915050565b612be981612761565b8114612bf457600080fd5b50565b600081359050612c0681612be0565b92915050565b60008060008060808587031215612c2657612c25612302565b5b6000612c3487828801612355565b9450506020612c4587828801612bf7565b9350506040612c56878288016123c9565b9250506060612c67878288016123c9565b91505092959194509250565b60008060408385031215612c8a57612c89612302565b5b6000612c988582860161246e565b9250506020612ca985828601612391565b9150509250929050565b600082825260208201905092915050565b6000612ccf82612735565b612cd98185612cb3565b935083602082028501612ceb85612751565b8060005b85811015612d275784840389528151612d0885826127e6565b9450612d13836127fa565b925060208a01995050600181019050612cef565b50829750879550505050505092915050565b60006020820190508181036000830152612d538184612cc4565b905092915050565b600067ffffffffffffffff82169050919050565b612d7881612d5b565b8114612d8357600080fd5b50565b600081359050612d9581612d6f565b92915050565b600080fd5b600060a08284031215612db657612db5612d9b565b5b81905092915050565b60008060008060808587031215612dd957612dd8612302565b5b600085013567ffffffffffffffff811115612df757612df6612307565b5b612e0387828801612669565b9450506020612e1487828801612d86565b9350506040612e2587828801612d86565b925050606085013567ffffffffffffffff811115612e4657612e45612307565b5b612e5287828801612da0565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612e9381612d5b565b82525050565b604082016000820151612eaf600085018261276b565b506020820151612ec26020850182612787565b50505050565b606082016000820151612ede6000850182612e8a565b506020820151612ef16020850182612e99565b50505050565b6000612f038383612ec8565b60608301905092915050565b6000602082019050919050565b6000612f2782612e5e565b612f318185612e69565b9350612f3c83612e7a565b8060005b83811015612f6d578151612f548882612ef7565b9750612f5f83612f0f565b925050600181019050612f40565b5085935050505092915050565b600082825260208201905092915050565b6000612f96826124b0565b612fa08185612f7a565b9350612fb08185602086016124cc565b612fb9816124f6565b840191505092915050565b60006040830160008301518482036000860152612fe18282612f8b565b9150506020830151612ff66020860182612e8a565b508091505092915050565b6000604082019050818103600083015261301b8185612f1c565b9050818103602083015261302f8184612fc4565b90509392505050565b6000806000806080858703121561305257613051612302565b5b600061306087828801612355565b945050602085013567ffffffffffffffff81111561308157613080612307565b5b61308d87828801612669565b935050604061309e878288016123c9565b92505060606130af878288016123c9565b91505092959194509250565b6000806000606084860312156130d4576130d3612302565b5b600084013567ffffffffffffffff8111156130f2576130f1612307565b5b6130fe86828701612669565b935050602061310f8682870161246e565b925050604084013567ffffffffffffffff8111156131305761312f612307565b5b61313c86828701612669565b9150509250925092565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061317e83836126fc565b905092915050565b6000602082019050919050565b600061319e82613146565b6131a88185613151565b9350836020820285016131ba85613162565b8060005b858110156131f657848403895281516131d78582613172565b94506131e283613186565b925060208a019950506001810190506131be565b50829750879550505050505092915050565b600060208201905081810360008301526132228184613193565b905092915050565b6000806040838503121561324157613240612302565b5b600061324f8582860161246e565b925050602061326085828601612bf7565b9150509250929050565b600082825260208201905092915050565b6000613286826126e0565b613290818561326a565b93506132a08185602086016124cc565b6132a9816124f6565b840191505092915050565b600060208201905081810360008301526132ce818461327b565b905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000604083016000830151848203600086015261331f82826126fc565b915050602083015184820360208601526133398282612807565b9150508091505092915050565b60006133528383613302565b905092915050565b6000602082019050919050565b6000613372826132d6565b61337c81856132e1565b93508360208202850161338e856132f2565b8060005b858110156133ca57848403895281516133ab8582613346565b94506133b68361335a565b925060208a01995050600181019050613392565b50829750879550505050505092915050565b600060408201905081810360008301526133f68185613367565b9050818103602083015261340a8184612cc4565b90509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061344d82612ba9565b9150677fffffffffffffff820361346757613466613413565b5b600182019050919050565b600081905092915050565b50565b600061348d600083613472565b91506134988261347d565b600082019050919050565b60006134ae82613480565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061351460218361326a565b915061351f826134b8565b604082019050919050565b6000602082019050818103600083015261354381613507565b9050919050565b6000819050919050565b600061356f61356a6135658461230c565b61354a565b61230c565b9050919050565b600061358182613554565b9050919050565b600061359382613576565b9050919050565b6135a381613588565b82525050565b6135b28161236a565b82525050565b60006040820190506135cd600083018561359a565b6135da60208301846135a9565b9392505050565b6000815190506135f0816123b2565b92915050565b60006020828403121561360c5761360b612302565b5b600061361a848285016135e1565b91505092915050565b7f6661696c656420746f20636c61696d2072657761726473000000000000000000600082015250565b600061365960178361326a565b915061366482613623565b602082019050919050565b600060208201905081810360008301526136888161364c565b9050919050565b61369881612445565b82525050565b60006020820190506136b3600083018461368f565b92915050565b60006136c4826124b0565b6136ce8185613472565b93506136de8185602086016124cc565b80840191505092915050565b60006136f682846136b9565b915081905092915050565b7f6661696c65642073746174696343616c6c20746f20707265636f6d70696c6500600082015250565b6000613737601f8361326a565b915061374282613701565b602082019050919050565b600060208201905081810360008301526137668161372a565b9050919050565b600080fd5b600080fd5b600061378a613785846125e7565b6125cc565b9050828152602081018484840111156137a6576137a5612567565b5b6137b18482856124cc565b509392505050565b600082601f8301126137ce576137cd612562565b5b81516137de848260208601613777565b91505092915050565b600067ffffffffffffffff8211156138025761380161256c565b5b602082029050602081019050919050565b600080fd5b60008151905061382781612be0565b92915050565b6138368161277a565b811461384157600080fd5b50565b6000815190506138538161382d565b92915050565b60006060828403121561386f5761386e61376d565b5b61387960606125cc565b9050600082015167ffffffffffffffff81111561389957613898613772565b5b6138a5848285016137b9565b60008301525060206138b984828501613818565b60208301525060406138cd84828501613844565b60408301525092915050565b60006138ec6138e7846137e7565b6125cc565b9050808382526020820190506020840283018581111561390f5761390e613813565b5b835b8181101561395657805167ffffffffffffffff81111561393457613933612562565b5b8086016139418982613859565b85526020850194505050602081019050613911565b5050509392505050565b600082601f83011261397557613974612562565b5b81516139858482602086016138d9565b91505092915050565b6000606082840312156139a4576139a361376d565b5b6139ae60606125cc565b9050600082015167ffffffffffffffff8111156139ce576139cd613772565b5b6139da848285016137b9565b600083015250602082015167ffffffffffffffff8111156139fe576139fd613772565b5b613a0a84828501613960565b602083015250604082015167ffffffffffffffff811115613a2e57613a2d613772565b5b613a3a84828501613960565b60408301525092915050565b600060208284031215613a5c57613a5b612302565b5b600082015167ffffffffffffffff811115613a7a57613a79612307565b5b613a868482850161398e565b91505092915050565b6000604082019050613aa4600083018561359a565b8181036020830152613ab6818461327b565b90509392505050565b600067ffffffffffffffff821115613ada57613ad961256c565b5b602082029050602081019050919050565b600060408284031215613b0157613b0061376d565b5b613b0b60406125cc565b9050600082015167ffffffffffffffff811115613b2b57613b2a613772565b5b613b37848285016137b9565b6000830152506020613b4b84828501613818565b60208301525092915050565b6000613b6a613b6584613abf565b6125cc565b90508083825260208201905060208402830185811115613b8d57613b8c613813565b5b835b81811015613bd457805167ffffffffffffffff811115613bb257613bb1612562565b5b808601613bbf8982613aeb565b85526020850194505050602081019050613b8f565b5050509392505050565b600082601f830112613bf357613bf2612562565b5b8151613c03848260208601613b57565b91505092915050565b600060208284031215613c2257613c21612302565b5b600082015167ffffffffffffffff811115613c4057613c3f612307565b5b613c4c84828501613bde565b91505092915050565b6000604082019050613c6a600083018561368f565b8181036020830152613c7c818461327b565b90509392505050565b7f6661696c65642064656c656761746543616c6c20746f20707265636f6d70696c60008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b6000613ce160218361326a565b9150613cec82613c85565b604082019050919050565b60006020820190508181036000830152613d1081613cd4565b9050919050565b613d2081612761565b82525050565b6000604082019050613d3b600083018561359a565b613d486020830184613d17565b9392505050565b6000604082019050613d64600083018561368f565b613d7160208301846135a9565b9392505050565b600060208284031215613d8e57613d8d612302565b5b600082015167ffffffffffffffff811115613dac57613dab612307565b5b613db884828501613960565b91505092915050565b613dca81612d5b565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613dfc57613dfb613dda565b5b83810192508235915060208301925067ffffffffffffffff821115613e2457613e23613dd0565b5b600182023603831315613e3a57613e39613dd5565b5b509250929050565b6000613e4e8385612f7a565b9350613e5b838584612618565b613e64836124f6565b840190509392505050565b6000613e7e6020840184612d86565b905092915050565b6000613e9560208401846123c9565b905092915050565b613ea6816123a6565b82525050565b600060a08301613ebf6000840184613ddf565b8583036000870152613ed2838284613e42565b92505050613ee36020840184613e6f565b613ef06020860182612e8a565b50613efe6040840184613e6f565b613f0b6040860182612e8a565b50613f196060840184613e86565b613f266060860182613e9d565b50613f346080840184613e86565b613f416080860182613e9d565b508091505092915050565b60006080820190508181036000830152613f66818761327b565b9050613f756020830186613dc1565b613f826040830185613dc1565b8181036060830152613f948184613eac565b905095945050505050565b600067ffffffffffffffff821115613fba57613fb961256c565b5b602082029050602081019050919050565b600081519050613fda81612d6f565b92915050565b600060408284031215613ff657613ff561376d565b5b61400060406125cc565b9050600061401084828501613818565b600083015250602061402484828501613844565b60208301525092915050565b6000606082840312156140465761404561376d565b5b61405060406125cc565b9050600061406084828501613fcb565b600083015250602061407484828501613fe0565b60208301525092915050565b600061409361408e84613f9f565b6125cc565b905080838252602082019050606084028301858111156140b6576140b5613813565b5b835b818110156140df57806140cb8882614030565b8452602084019350506060810190506140b8565b5050509392505050565b600082601f8301126140fe576140fd612562565b5b815161410e848260208601614080565b91505092915050565b600067ffffffffffffffff8211156141325761413161256c565b5b61413b826124f6565b9050602081019050919050565b600061415b61415684614117565b6125cc565b90508281526020810184848401111561417757614176612567565b5b6141828482856124cc565b509392505050565b600082601f83011261419f5761419e612562565b5b81516141af848260208601614148565b91505092915050565b6000604082840312156141ce576141cd61376d565b5b6141d860406125cc565b9050600082015167ffffffffffffffff8111156141f8576141f7613772565b5b6142048482850161418a565b600083015250602061421884828501613fcb565b60208301525092915050565b6000806040838503121561423b5761423a612302565b5b600083015167ffffffffffffffff81111561425957614258612307565b5b614265858286016140e9565b925050602083015167ffffffffffffffff81111561428657614285612307565b5b614292858286016141b8565b9150509250929050565b7f6661696c656420746f2073657420776974686472617720616464726573730000600082015250565b60006142d2601e8361326a565b91506142dd8261429c565b602082019050919050565b60006020820190508181036000830152614301816142c5565b9050919050565b600067ffffffffffffffff8211156143235761432261256c565b5b602082029050602081019050919050565b600061434761434284614308565b6125cc565b9050808382526020820190506020840283018581111561436a57614369613813565b5b835b818110156143b157805167ffffffffffffffff81111561438f5761438e612562565b5b80860161439c89826137b9565b8552602085019450505060208101905061436c565b5050509392505050565b600082601f8301126143d0576143cf612562565b5b81516143e0848260208601614334565b91505092915050565b6000602082840312156143ff576143fe612302565b5b600082015167ffffffffffffffff81111561441d5761441c612307565b5b614429848285016143bb565b91505092915050565b600061443d82612ba9565b915061444883612ba9565b925082820190507fffffffffffffffffffffffffffffffffffffffffffffffff80000000000000008112677fffffffffffffff8213171561448c5761448b613413565b5b92915050565b60006040820190506144a7600083018561368f565b6144b46020830184613d17565b9392505050565b60006144c682612ba9565b91506144d183612ba9565b92508282039050677fffffffffffffff81137fffffffffffffffffffffffffffffffffffffffffffffffff80000000000000008212171561451557614514613413565b5b92915050565b60006020828403121561453157614530612302565b5b600082015167ffffffffffffffff81111561454f5761454e612307565b5b61455b848285016137b9565b91505092915050565b600067ffffffffffffffff82111561457f5761457e61256c565b5b602082029050602081019050919050565b6000604082840312156145a6576145a561376d565b5b6145b060406125cc565b9050600082015167ffffffffffffffff8111156145d0576145cf613772565b5b6145dc848285016137b9565b600083015250602082015167ffffffffffffffff811115614600576145ff613772565b5b61460c84828501613960565b60208301525092915050565b600061462b61462684614564565b6125cc565b9050808382526020820190506020840283018581111561464e5761464d613813565b5b835b8181101561469557805167ffffffffffffffff81111561467357614672612562565b5b8086016146808982614590565b85526020850194505050602081019050614650565b5050509392505050565b600082601f8301126146b4576146b3612562565b5b81516146c4848260208601614618565b91505092915050565b600080604083850312156146e4576146e3612302565b5b600083015167ffffffffffffffff81111561470257614701612307565b5b61470e8582860161469f565b925050602083015167ffffffffffffffff81111561472f5761472e612307565b5b61473b85828601613960565b915050925092905056fea2646970667358221220a8fdbc3760bca6bed7c0d0a8bfa4c3e75e199774f0a60a0a34530a58ee2456ed64736f6c63430008130033", - "deployedBytecode": "0x60806040526004361061019c5760003560e01c80637c9db0bb116100ec578063b6a216ae1161008a578063d0e30db011610064578063d0e30db0146106a7578063d3f831be146106b1578063e0421e39146106ee578063e236c7a61461072b5761019c565b8063b6a216ae146105f0578063c7804bb51461062d578063cb85aa0a1461066a5761019c565b806398194593116100c657806398194593146104fc578063ad5c4cdd14610539578063adb2378514610576578063b2d17883146105b35761019c565b80637c9db0bb1461044457806388b2d58114610481578063963516e4146104bf5761019c565b806346e16d34116101595780636cc9ac8a116101335780636cc9ac8a146103785780636f669da4146103a157806378a5dfd1146103de578063796b96d21461041b5761019c565b806346e16d34146102d3578063613d4de81461031057806361bc221a1461034d5761019c565b80630183e4b4146101a157806301b68000146101ca5780630c05e9e4146102075780631b05020714610244578063296c60aa1461026d5780632d0ee16a14610296575b600080fd5b3480156101ad57600080fd5b506101c860048036038101906101c391906123de565b610769565b005b3480156101d657600080fd5b506101f160048036038101906101ec9190612483565b610a96565b6040516101fe9190612540565b60405180910390f35b34801561021357600080fd5b5061022e60048036038101906102299190612697565b610bde565b60405161023b91906128da565b60405180910390f35b34801561025057600080fd5b5061026b600480360381019061026691906128fc565b610c6e565b005b34801561027957600080fd5b50610294600480360381019061028f919061297f565b610df4565b005b3480156102a257600080fd5b506102bd60048036038101906102b89190612697565b610f35565b6040516102ca9190612ada565b60405180910390f35b3480156102df57600080fd5b506102fa60048036038101906102f5919061297f565b610fc3565b6040516103079190612b0b565b60405180910390f35b34801561031c57600080fd5b5061033760048036038101906103329190612b26565b61104d565b6040516103449190612ada565b60405180910390f35b34801561035957600080fd5b5061036261133e565b60405161036f9190612bc5565b60405180910390f35b34801561038457600080fd5b5061039f600480360381019061039a9190612c0c565b61134f565b005b3480156103ad57600080fd5b506103c860048036038101906103c39190612c73565b6115de565b6040516103d59190612b0b565b60405180910390f35b3480156103ea57600080fd5b506104056004803603810190610400919061297f565b611668565b6040516104129190612d39565b60405180910390f35b34801561042757600080fd5b50610442600480360381019061043d919061297f565b6116f5565b005b34801561045057600080fd5b5061046b60048036038101906104669190612697565b611836565b6040516104789190612d39565b60405180910390f35b34801561048d57600080fd5b506104a860048036038101906104a39190612dbf565b6118c0565b6040516104b6929190613001565b60405180910390f35b3480156104cb57600080fd5b506104e660048036038101906104e19190612697565b61195e565b6040516104f39190612b0b565b60405180910390f35b34801561050857600080fd5b50610523600480360381019061051e919061297f565b6119e7565b6040516105309190612ada565b60405180910390f35b34801561054557600080fd5b50610560600480360381019061055b919061297f565b611a76565b60405161056d9190612ada565b60405180910390f35b34801561058257600080fd5b5061059d60048036038101906105989190613038565b611b02565b6040516105aa9190612ada565b60405180910390f35b3480156105bf57600080fd5b506105da60048036038101906105d591906130bb565b611d8d565b6040516105e79190612ada565b60405180910390f35b3480156105fc57600080fd5b5061061760048036038101906106129190612483565b611ee2565b6040516106249190613208565b60405180910390f35b34801561063957600080fd5b50610654600480360381019061064f919061322a565b611f6c565b6040516106619190612b0b565b60405180910390f35b34801561067657600080fd5b50610691600480360381019061068c9190612483565b612084565b60405161069e91906132b4565b60405180910390f35b6106af61210e565b005b3480156106bd57600080fd5b506106d860048036038101906106d39190612697565b612110565b6040516106e59190612d39565b60405180910390f35b3480156106fa57600080fd5b5061071560048036038101906107109190612697565b61219a565b6040516107229190612ada565b60405180910390f35b34801561073757600080fd5b50610752600480360381019061074d9190612483565b612226565b6040516107609291906133dc565b60405180910390f35b811561089a5760008081819054906101000a900460070b8092919061078d90613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146108995760008473ffffffffffffffffffffffffffffffffffffffff16600f604051610811906134a3565b60006040518083038185875af1925050503d806000811461084e576040519150601f19603f3d011682016040523d82523d6000602084013e610853565b606091505b5050905080610897576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088e9061352a565b60405180910390fd5b505b5b600061080173ffffffffffffffffffffffffffffffffffffffff16632efe8a5f86866040518363ffffffff1660e01b81526004016108d99291906135b8565b6020604051808303816000875af11580156108f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091c91906135f6565b90508061095e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109559061366f565b60405180910390fd5b8115610a8f5760008081819054906101000a900460070b8092919061098290613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614610a8e5760008573ffffffffffffffffffffffffffffffffffffffff16600f604051610a06906134a3565b60006040518083038185875af1925050503d8060008114610a43576040519150601f19603f3d011682016040523d82523d6000602084013e610a48565b606091505b5050905080610a8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a839061352a565b60405180910390fd5b505b5b5050505050565b606060008061080173ffffffffffffffffffffffffffffffffffffffff1684604051602401610ac5919061369e565b6040516020818303038152906040527f5431f450000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610b4f91906136ea565b600060405180830381855afa9150503d8060008114610b8a576040519150601f19603f3d011682016040523d82523d6000602084013e610b8f565b606091505b509150915081610bd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bcb9061374d565b60405180910390fd5b8092505050919050565b610be66122b3565b61080173ffffffffffffffffffffffffffffffffffffffff166354212a89836040518263ffffffff1660e01b8152600401610c2191906132b4565b600060405180830381865afa158015610c3e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610c679190613a46565b9050919050565b3073ffffffffffffffffffffffffffffffffffffffff1663ad5c4cdd85846040518363ffffffff1660e01b8152600401610ca9929190613a8f565b6000604051808303816000875af1925050508015610cea57506040513d6000823e3d601f19601f82011682018060405250810190610ce79190613c0c565b60015b15610cf157505b8015610dee5760008081819054906101000a900460070b80929190610d1590613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008373ffffffffffffffffffffffffffffffffffffffff16600f604051610d66906134a3565b60006040518083038185875af1925050503d8060008114610da3576040519150601f19603f3d011682016040523d82523d6000602084013e610da8565b606091505b5050905080610dec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de39061352a565b60405180910390fd5b505b50505050565b600061080173ffffffffffffffffffffffffffffffffffffffff168383604051602401610e22929190613c55565b6040516020818303038152906040527f5a9d9a96000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610eac91906136ea565b600060405180830381855af49150503d8060008114610ee7576040519150601f19603f3d011682016040523d82523d6000602084013e610eec565b606091505b5050905080610f30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2790613cf7565b60405180910390fd5b505050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6130846040518363ffffffff1660e01b8152600401610f74929190613c55565b6000604051808303816000875af1158015610f93573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610fbc9190613c0c565b9050919050565b600061080173ffffffffffffffffffffffffffffffffffffffff16635a9d9a9684846040518363ffffffff1660e01b8152600401611002929190613c55565b6020604051808303816000875af1158015611021573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104591906135f6565b905092915050565b606082156111805760008081819054906101000a900460070b8092919061107390613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461117f5760008473ffffffffffffffffffffffffffffffffffffffff16600f6040516110f7906134a3565b60006040518083038185875af1925050503d8060008114611134576040519150601f19603f3d011682016040523d82523d6000602084013e611139565b606091505b505090508061117d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111749061352a565b60405180910390fd5b505b5b61080173ffffffffffffffffffffffffffffffffffffffff16633ce4e3be866040518263ffffffff1660e01b81526004016111bb91906132b4565b6000604051808303816000875af11580156111da573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906112039190613c0c565b905081156113365760008081819054906101000a900460070b8092919061122990613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146113355760008473ffffffffffffffffffffffffffffffffffffffff16600f6040516112ad906134a3565b60006040518083038185875af1925050503d80600081146112ea576040519150601f19603f3d011682016040523d82523d6000602084013e6112ef565b606091505b5050905080611333576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132a9061352a565b60405180910390fd5b505b5b949350505050565b60008054906101000a900460070b81565b811561144c5760008081819054906101000a900460070b8092919061137390613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008473ffffffffffffffffffffffffffffffffffffffff16600f6040516113c4906134a3565b60006040518083038185875af1925050503d8060008114611401576040519150601f19603f3d011682016040523d82523d6000602084013e611406565b606091505b505090508061144a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114419061352a565b60405180910390fd5b505b600061080173ffffffffffffffffffffffffffffffffffffffff1663ed41d0b686866040518363ffffffff1660e01b815260040161148b929190613d26565b6020604051808303816000875af11580156114aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ce91906135f6565b9050806114da57600080fd5b81156115d75760008081819054906101000a900460070b809291906114fe90613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008573ffffffffffffffffffffffffffffffffffffffff16600f60405161154f906134a3565b60006040518083038185875af1925050503d806000811461158c576040519150601f19603f3d011682016040523d82523d6000602084013e611591565b606091505b50509050806115d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115cc9061352a565b60405180910390fd5b505b5050505050565b600061080173ffffffffffffffffffffffffffffffffffffffff16632efe8a5f84846040518363ffffffff1660e01b815260040161161d929190613d4f565b6020604051808303816000875af115801561163c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166091906135f6565b905092915050565b606061080173ffffffffffffffffffffffffffffffffffffffff16639ad563b484846040518363ffffffff1660e01b81526004016116a7929190613c55565b600060405180830381865afa1580156116c4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906116ed9190613d78565b905092915050565b600061080173ffffffffffffffffffffffffffffffffffffffff168383604051602401611723929190613c55565b6040516020818303038152906040527f5a9d9a96000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516117ad91906136ea565b600060405180830381855afa9150503d80600081146117e8576040519150601f19603f3d011682016040523d82523d6000602084013e6117ed565b606091505b5050905080611831576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118289061374d565b60405180910390fd5b505050565b606061080173ffffffffffffffffffffffffffffffffffffffff16633dd40f78836040518263ffffffff1660e01b815260040161187391906132b4565b600060405180830381865afa158015611890573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906118b99190613d78565b9050919050565b60606118ca6122d4565b61080173ffffffffffffffffffffffffffffffffffffffff16638f2473ce878787876040518563ffffffff1660e01b815260040161190b9493929190613f4c565b600060405180830381865afa158015611928573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906119519190614224565b9150915094509492505050565b600061080173ffffffffffffffffffffffffffffffffffffffff16635a9d9a9630846040518363ffffffff1660e01b815260040161199d929190613c55565b6020604051808303816000875af11580156119bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e091906135f6565b9050919050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6184846040518363ffffffff1660e01b8152600401611a26929190613c55565b6000604051808303816000875af1158015611a45573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611a6e9190613c0c565b905092915050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6184846040518363ffffffff1660e01b8152600401611ab5929190613c55565b6000604051808303816000875af1158015611ad4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611afd9190613c0c565b600080fd5b60608215611c015760008081819054906101000a900460070b80929190611b2890613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008573ffffffffffffffffffffffffffffffffffffffff16600f604051611b79906134a3565b60006040518083038185875af1925050503d8060008114611bb6576040519150601f19603f3d011682016040523d82523d6000602084013e611bbb565b606091505b5050905080611bff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bf69061352a565b60405180910390fd5b505b61080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6186866040518363ffffffff1660e01b8152600401611c3e929190613a8f565b6000604051808303816000875af1158015611c5d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611c869190613c0c565b90508115611d855760008081819054906101000a900460070b80929190611cac90613442565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008573ffffffffffffffffffffffffffffffffffffffff16600f604051611cfd906134a3565b60006040518083038185875af1925050503d8060008114611d3a576040519150601f19603f3d011682016040523d82523d6000602084013e611d3f565b606091505b5050905080611d83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7a9061352a565b60405180910390fd5b505b949350505050565b6060600061080173ffffffffffffffffffffffffffffffffffffffff16635a9d9a9633876040518363ffffffff1660e01b8152600401611dce929190613c55565b6020604051808303816000875af1158015611ded573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1191906135f6565b905080611e53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4a906142e8565b60405180910390fd5b61080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6185856040518363ffffffff1660e01b8152600401611e90929190613c55565b6000604051808303816000875af1158015611eaf573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611ed89190613c0c565b9150509392505050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663a66cb605836040518263ffffffff1660e01b8152600401611f1f919061369e565b600060405180830381865afa158015611f3c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611f6591906143e9565b9050919050565b600060016000808282829054906101000a900460070b611f8c9190614432565b92506101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555061080173ffffffffffffffffffffffffffffffffffffffff1663ed41d0b684846040518363ffffffff1660e01b8152600401611ff2929190614492565b6020604051808303816000875af1158015612011573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203591906135f6565b905060016000808282829054906101000a900460070b61205591906144bb565b92506101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555092915050565b606061080173ffffffffffffffffffffffffffffffffffffffff16635431f450836040518263ffffffff1660e01b81526004016120c1919061369e565b600060405180830381865afa1580156120de573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190612107919061451b565b9050919050565b565b606061080173ffffffffffffffffffffffffffffffffffffffff166385b2d2da836040518263ffffffff1660e01b815260040161214d91906132b4565b600060405180830381865afa15801561216a573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906121939190613d78565b9050919050565b606061080173ffffffffffffffffffffffffffffffffffffffff16633ce4e3be836040518263ffffffff1660e01b81526004016121d791906132b4565b6000604051808303816000875af11580156121f6573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061221f9190613c0c565b9050919050565b60608061080173ffffffffffffffffffffffffffffffffffffffff166354be1a28846040518263ffffffff1660e01b8152600401612264919061369e565b600060405180830381865afa158015612281573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906122aa91906146cd565b91509150915091565b60405180606001604052806060815260200160608152602001606081525090565b604051806040016040528060608152602001600067ffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123378261230c565b9050919050565b6123478161232c565b811461235257600080fd5b50565b6000813590506123648161233e565b92915050565b600063ffffffff82169050919050565b6123838161236a565b811461238e57600080fd5b50565b6000813590506123a08161237a565b92915050565b60008115159050919050565b6123bb816123a6565b81146123c657600080fd5b50565b6000813590506123d8816123b2565b92915050565b600080600080608085870312156123f8576123f7612302565b5b600061240687828801612355565b945050602061241787828801612391565b9350506040612428878288016123c9565b9250506060612439878288016123c9565b91505092959194509250565b60006124508261230c565b9050919050565b61246081612445565b811461246b57600080fd5b50565b60008135905061247d81612457565b92915050565b60006020828403121561249957612498612302565b5b60006124a78482850161246e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156124ea5780820151818401526020810190506124cf565b60008484015250505050565b6000601f19601f8301169050919050565b6000612512826124b0565b61251c81856124bb565b935061252c8185602086016124cc565b612535816124f6565b840191505092915050565b6000602082019050818103600083015261255a8184612507565b905092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6125a4826124f6565b810181811067ffffffffffffffff821117156125c3576125c261256c565b5b80604052505050565b60006125d66122f8565b90506125e2828261259b565b919050565b600067ffffffffffffffff8211156126025761260161256c565b5b61260b826124f6565b9050602081019050919050565b82818337600083830152505050565b600061263a612635846125e7565b6125cc565b90508281526020810184848401111561265657612655612567565b5b612661848285612618565b509392505050565b600082601f83011261267e5761267d612562565b5b813561268e848260208601612627565b91505092915050565b6000602082840312156126ad576126ac612302565b5b600082013567ffffffffffffffff8111156126cb576126ca612307565b5b6126d784828501612669565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000612707826126e0565b61271181856126eb565b93506127218185602086016124cc565b61272a816124f6565b840191505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000819050919050565b61277481612761565b82525050565b600060ff82169050919050565b6127908161277a565b82525050565b600060608301600083015184820360008601526127b382826126fc565b91505060208301516127c8602086018261276b565b5060408301516127db6040860182612787565b508091505092915050565b60006127f28383612796565b905092915050565b6000602082019050919050565b600061281282612735565b61281c8185612740565b93508360208202850161282e85612751565b8060005b8581101561286a578484038952815161284b85826127e6565b9450612856836127fa565b925060208a01995050600181019050612832565b50829750879550505050505092915050565b6000606083016000830151848203600086015261289982826126fc565b915050602083015184820360208601526128b38282612807565b915050604083015184820360408601526128cd8282612807565b9150508091505092915050565b600060208201905081810360008301526128f4818461287c565b905092915050565b6000806000806080858703121561291657612915612302565b5b600061292487828801612355565b945050602061293587828801612355565b935050604085013567ffffffffffffffff81111561295657612955612307565b5b61296287828801612669565b9250506060612973878288016123c9565b91505092959194509250565b6000806040838503121561299657612995612302565b5b60006129a48582860161246e565b925050602083013567ffffffffffffffff8111156129c5576129c4612307565b5b6129d185828601612669565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006040830160008301518482036000860152612a2482826126fc565b9150506020830151612a39602086018261276b565b508091505092915050565b6000612a508383612a07565b905092915050565b6000602082019050919050565b6000612a70826129db565b612a7a81856129e6565b935083602082028501612a8c856129f7565b8060005b85811015612ac85784840389528151612aa98582612a44565b9450612ab483612a58565b925060208a01995050600181019050612a90565b50829750879550505050505092915050565b60006020820190508181036000830152612af48184612a65565b905092915050565b612b05816123a6565b82525050565b6000602082019050612b206000830184612afc565b92915050565b60008060008060808587031215612b4057612b3f612302565b5b600085013567ffffffffffffffff811115612b5e57612b5d612307565b5b612b6a87828801612669565b9450506020612b7b87828801612355565b9350506040612b8c878288016123c9565b9250506060612b9d878288016123c9565b91505092959194509250565b60008160070b9050919050565b612bbf81612ba9565b82525050565b6000602082019050612bda6000830184612bb6565b92915050565b612be981612761565b8114612bf457600080fd5b50565b600081359050612c0681612be0565b92915050565b60008060008060808587031215612c2657612c25612302565b5b6000612c3487828801612355565b9450506020612c4587828801612bf7565b9350506040612c56878288016123c9565b9250506060612c67878288016123c9565b91505092959194509250565b60008060408385031215612c8a57612c89612302565b5b6000612c988582860161246e565b9250506020612ca985828601612391565b9150509250929050565b600082825260208201905092915050565b6000612ccf82612735565b612cd98185612cb3565b935083602082028501612ceb85612751565b8060005b85811015612d275784840389528151612d0885826127e6565b9450612d13836127fa565b925060208a01995050600181019050612cef565b50829750879550505050505092915050565b60006020820190508181036000830152612d538184612cc4565b905092915050565b600067ffffffffffffffff82169050919050565b612d7881612d5b565b8114612d8357600080fd5b50565b600081359050612d9581612d6f565b92915050565b600080fd5b600060a08284031215612db657612db5612d9b565b5b81905092915050565b60008060008060808587031215612dd957612dd8612302565b5b600085013567ffffffffffffffff811115612df757612df6612307565b5b612e0387828801612669565b9450506020612e1487828801612d86565b9350506040612e2587828801612d86565b925050606085013567ffffffffffffffff811115612e4657612e45612307565b5b612e5287828801612da0565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612e9381612d5b565b82525050565b604082016000820151612eaf600085018261276b565b506020820151612ec26020850182612787565b50505050565b606082016000820151612ede6000850182612e8a565b506020820151612ef16020850182612e99565b50505050565b6000612f038383612ec8565b60608301905092915050565b6000602082019050919050565b6000612f2782612e5e565b612f318185612e69565b9350612f3c83612e7a565b8060005b83811015612f6d578151612f548882612ef7565b9750612f5f83612f0f565b925050600181019050612f40565b5085935050505092915050565b600082825260208201905092915050565b6000612f96826124b0565b612fa08185612f7a565b9350612fb08185602086016124cc565b612fb9816124f6565b840191505092915050565b60006040830160008301518482036000860152612fe18282612f8b565b9150506020830151612ff66020860182612e8a565b508091505092915050565b6000604082019050818103600083015261301b8185612f1c565b9050818103602083015261302f8184612fc4565b90509392505050565b6000806000806080858703121561305257613051612302565b5b600061306087828801612355565b945050602085013567ffffffffffffffff81111561308157613080612307565b5b61308d87828801612669565b935050604061309e878288016123c9565b92505060606130af878288016123c9565b91505092959194509250565b6000806000606084860312156130d4576130d3612302565b5b600084013567ffffffffffffffff8111156130f2576130f1612307565b5b6130fe86828701612669565b935050602061310f8682870161246e565b925050604084013567ffffffffffffffff8111156131305761312f612307565b5b61313c86828701612669565b9150509250925092565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061317e83836126fc565b905092915050565b6000602082019050919050565b600061319e82613146565b6131a88185613151565b9350836020820285016131ba85613162565b8060005b858110156131f657848403895281516131d78582613172565b94506131e283613186565b925060208a019950506001810190506131be565b50829750879550505050505092915050565b600060208201905081810360008301526132228184613193565b905092915050565b6000806040838503121561324157613240612302565b5b600061324f8582860161246e565b925050602061326085828601612bf7565b9150509250929050565b600082825260208201905092915050565b6000613286826126e0565b613290818561326a565b93506132a08185602086016124cc565b6132a9816124f6565b840191505092915050565b600060208201905081810360008301526132ce818461327b565b905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000604083016000830151848203600086015261331f82826126fc565b915050602083015184820360208601526133398282612807565b9150508091505092915050565b60006133528383613302565b905092915050565b6000602082019050919050565b6000613372826132d6565b61337c81856132e1565b93508360208202850161338e856132f2565b8060005b858110156133ca57848403895281516133ab8582613346565b94506133b68361335a565b925060208a01995050600181019050613392565b50829750879550505050505092915050565b600060408201905081810360008301526133f68185613367565b9050818103602083015261340a8184612cc4565b90509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061344d82612ba9565b9150677fffffffffffffff820361346757613466613413565b5b600182019050919050565b600081905092915050565b50565b600061348d600083613472565b91506134988261347d565b600082019050919050565b60006134ae82613480565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061351460218361326a565b915061351f826134b8565b604082019050919050565b6000602082019050818103600083015261354381613507565b9050919050565b6000819050919050565b600061356f61356a6135658461230c565b61354a565b61230c565b9050919050565b600061358182613554565b9050919050565b600061359382613576565b9050919050565b6135a381613588565b82525050565b6135b28161236a565b82525050565b60006040820190506135cd600083018561359a565b6135da60208301846135a9565b9392505050565b6000815190506135f0816123b2565b92915050565b60006020828403121561360c5761360b612302565b5b600061361a848285016135e1565b91505092915050565b7f6661696c656420746f20636c61696d2072657761726473000000000000000000600082015250565b600061365960178361326a565b915061366482613623565b602082019050919050565b600060208201905081810360008301526136888161364c565b9050919050565b61369881612445565b82525050565b60006020820190506136b3600083018461368f565b92915050565b60006136c4826124b0565b6136ce8185613472565b93506136de8185602086016124cc565b80840191505092915050565b60006136f682846136b9565b915081905092915050565b7f6661696c65642073746174696343616c6c20746f20707265636f6d70696c6500600082015250565b6000613737601f8361326a565b915061374282613701565b602082019050919050565b600060208201905081810360008301526137668161372a565b9050919050565b600080fd5b600080fd5b600061378a613785846125e7565b6125cc565b9050828152602081018484840111156137a6576137a5612567565b5b6137b18482856124cc565b509392505050565b600082601f8301126137ce576137cd612562565b5b81516137de848260208601613777565b91505092915050565b600067ffffffffffffffff8211156138025761380161256c565b5b602082029050602081019050919050565b600080fd5b60008151905061382781612be0565b92915050565b6138368161277a565b811461384157600080fd5b50565b6000815190506138538161382d565b92915050565b60006060828403121561386f5761386e61376d565b5b61387960606125cc565b9050600082015167ffffffffffffffff81111561389957613898613772565b5b6138a5848285016137b9565b60008301525060206138b984828501613818565b60208301525060406138cd84828501613844565b60408301525092915050565b60006138ec6138e7846137e7565b6125cc565b9050808382526020820190506020840283018581111561390f5761390e613813565b5b835b8181101561395657805167ffffffffffffffff81111561393457613933612562565b5b8086016139418982613859565b85526020850194505050602081019050613911565b5050509392505050565b600082601f83011261397557613974612562565b5b81516139858482602086016138d9565b91505092915050565b6000606082840312156139a4576139a361376d565b5b6139ae60606125cc565b9050600082015167ffffffffffffffff8111156139ce576139cd613772565b5b6139da848285016137b9565b600083015250602082015167ffffffffffffffff8111156139fe576139fd613772565b5b613a0a84828501613960565b602083015250604082015167ffffffffffffffff811115613a2e57613a2d613772565b5b613a3a84828501613960565b60408301525092915050565b600060208284031215613a5c57613a5b612302565b5b600082015167ffffffffffffffff811115613a7a57613a79612307565b5b613a868482850161398e565b91505092915050565b6000604082019050613aa4600083018561359a565b8181036020830152613ab6818461327b565b90509392505050565b600067ffffffffffffffff821115613ada57613ad961256c565b5b602082029050602081019050919050565b600060408284031215613b0157613b0061376d565b5b613b0b60406125cc565b9050600082015167ffffffffffffffff811115613b2b57613b2a613772565b5b613b37848285016137b9565b6000830152506020613b4b84828501613818565b60208301525092915050565b6000613b6a613b6584613abf565b6125cc565b90508083825260208201905060208402830185811115613b8d57613b8c613813565b5b835b81811015613bd457805167ffffffffffffffff811115613bb257613bb1612562565b5b808601613bbf8982613aeb565b85526020850194505050602081019050613b8f565b5050509392505050565b600082601f830112613bf357613bf2612562565b5b8151613c03848260208601613b57565b91505092915050565b600060208284031215613c2257613c21612302565b5b600082015167ffffffffffffffff811115613c4057613c3f612307565b5b613c4c84828501613bde565b91505092915050565b6000604082019050613c6a600083018561368f565b8181036020830152613c7c818461327b565b90509392505050565b7f6661696c65642064656c656761746543616c6c20746f20707265636f6d70696c60008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b6000613ce160218361326a565b9150613cec82613c85565b604082019050919050565b60006020820190508181036000830152613d1081613cd4565b9050919050565b613d2081612761565b82525050565b6000604082019050613d3b600083018561359a565b613d486020830184613d17565b9392505050565b6000604082019050613d64600083018561368f565b613d7160208301846135a9565b9392505050565b600060208284031215613d8e57613d8d612302565b5b600082015167ffffffffffffffff811115613dac57613dab612307565b5b613db884828501613960565b91505092915050565b613dca81612d5b565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613dfc57613dfb613dda565b5b83810192508235915060208301925067ffffffffffffffff821115613e2457613e23613dd0565b5b600182023603831315613e3a57613e39613dd5565b5b509250929050565b6000613e4e8385612f7a565b9350613e5b838584612618565b613e64836124f6565b840190509392505050565b6000613e7e6020840184612d86565b905092915050565b6000613e9560208401846123c9565b905092915050565b613ea6816123a6565b82525050565b600060a08301613ebf6000840184613ddf565b8583036000870152613ed2838284613e42565b92505050613ee36020840184613e6f565b613ef06020860182612e8a565b50613efe6040840184613e6f565b613f0b6040860182612e8a565b50613f196060840184613e86565b613f266060860182613e9d565b50613f346080840184613e86565b613f416080860182613e9d565b508091505092915050565b60006080820190508181036000830152613f66818761327b565b9050613f756020830186613dc1565b613f826040830185613dc1565b8181036060830152613f948184613eac565b905095945050505050565b600067ffffffffffffffff821115613fba57613fb961256c565b5b602082029050602081019050919050565b600081519050613fda81612d6f565b92915050565b600060408284031215613ff657613ff561376d565b5b61400060406125cc565b9050600061401084828501613818565b600083015250602061402484828501613844565b60208301525092915050565b6000606082840312156140465761404561376d565b5b61405060406125cc565b9050600061406084828501613fcb565b600083015250602061407484828501613fe0565b60208301525092915050565b600061409361408e84613f9f565b6125cc565b905080838252602082019050606084028301858111156140b6576140b5613813565b5b835b818110156140df57806140cb8882614030565b8452602084019350506060810190506140b8565b5050509392505050565b600082601f8301126140fe576140fd612562565b5b815161410e848260208601614080565b91505092915050565b600067ffffffffffffffff8211156141325761413161256c565b5b61413b826124f6565b9050602081019050919050565b600061415b61415684614117565b6125cc565b90508281526020810184848401111561417757614176612567565b5b6141828482856124cc565b509392505050565b600082601f83011261419f5761419e612562565b5b81516141af848260208601614148565b91505092915050565b6000604082840312156141ce576141cd61376d565b5b6141d860406125cc565b9050600082015167ffffffffffffffff8111156141f8576141f7613772565b5b6142048482850161418a565b600083015250602061421884828501613fcb565b60208301525092915050565b6000806040838503121561423b5761423a612302565b5b600083015167ffffffffffffffff81111561425957614258612307565b5b614265858286016140e9565b925050602083015167ffffffffffffffff81111561428657614285612307565b5b614292858286016141b8565b9150509250929050565b7f6661696c656420746f2073657420776974686472617720616464726573730000600082015250565b60006142d2601e8361326a565b91506142dd8261429c565b602082019050919050565b60006020820190508181036000830152614301816142c5565b9050919050565b600067ffffffffffffffff8211156143235761432261256c565b5b602082029050602081019050919050565b600061434761434284614308565b6125cc565b9050808382526020820190506020840283018581111561436a57614369613813565b5b835b818110156143b157805167ffffffffffffffff81111561438f5761438e612562565b5b80860161439c89826137b9565b8552602085019450505060208101905061436c565b5050509392505050565b600082601f8301126143d0576143cf612562565b5b81516143e0848260208601614334565b91505092915050565b6000602082840312156143ff576143fe612302565b5b600082015167ffffffffffffffff81111561441d5761441c612307565b5b614429848285016143bb565b91505092915050565b600061443d82612ba9565b915061444883612ba9565b925082820190507fffffffffffffffffffffffffffffffffffffffffffffffff80000000000000008112677fffffffffffffff8213171561448c5761448b613413565b5b92915050565b60006040820190506144a7600083018561368f565b6144b46020830184613d17565b9392505050565b60006144c682612ba9565b91506144d183612ba9565b92508282039050677fffffffffffffff81137fffffffffffffffffffffffffffffffffffffffffffffffff80000000000000008212171561451557614514613413565b5b92915050565b60006020828403121561453157614530612302565b5b600082015167ffffffffffffffff81111561454f5761454e612307565b5b61455b848285016137b9565b91505092915050565b600067ffffffffffffffff82111561457f5761457e61256c565b5b602082029050602081019050919050565b6000604082840312156145a6576145a561376d565b5b6145b060406125cc565b9050600082015167ffffffffffffffff8111156145d0576145cf613772565b5b6145dc848285016137b9565b600083015250602082015167ffffffffffffffff811115614600576145ff613772565b5b61460c84828501613960565b60208301525092915050565b600061462b61462684614564565b6125cc565b9050808382526020820190506020840283018581111561464e5761464d613813565b5b835b8181101561469557805167ffffffffffffffff81111561467357614672612562565b5b8086016146808982614590565b85526020850194505050602081019050614650565b5050509392505050565b600082601f8301126146b4576146b3612562565b5b81516146c4848260208601614618565b91505092915050565b600080604083850312156146e4576146e3612302565b5b600083015167ffffffffffffffff81111561470257614701612307565b5b61470e8582860161469f565b925050602083015167ffffffffffffffff81111561472f5761472e612307565b5b61473b85828601613960565b915050925092905056fea2646970667358221220a8fdbc3760bca6bed7c0d0a8bfa4c3e75e199774f0a60a0a34530a58ee2456ed64736f6c63430008130033", + "bytecode": "0x60806040526040518060200160405280604051806060016040528060238152602001620050e26023913981525060009060016200003e92919062000053565b503480156200004c57600080fd5b50620004a1565b828054828255906000526020600020908101928215620000a0579160200282015b828111156200009f5782518290816200008e9190620003ba565b509160200191906001019062000074565b5b509050620000af9190620000b3565b5090565b5b80821115620000d75760008181620000cd9190620000db565b50600101620000b4565b5090565b508054620000e990620001a9565b6000825580601f10620000fd57506200011e565b601f0160209004906000526020600020908101906200011d919062000121565b5b50565b5b808211156200013c57600081600090555060010162000122565b5090565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620001c257607f821691505b602082108103620001d857620001d76200017a565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620002427fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000203565b6200024e868362000203565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b60006200029b620002956200028f8462000266565b62000270565b62000266565b9050919050565b6000819050919050565b620002b7836200027a565b620002cf620002c682620002a2565b84845462000210565b825550505050565b600090565b620002e6620002d7565b620002f3818484620002ac565b505050565b5b818110156200031b576200030f600082620002dc565b600181019050620002f9565b5050565b601f8211156200036a576200033481620001de565b6200033f84620001f3565b810160208510156200034f578190505b620003676200035e85620001f3565b830182620002f8565b50505b505050565b600082821c905092915050565b60006200038f600019846008026200036f565b1980831691505092915050565b6000620003aa83836200037c565b9150826002028217905092915050565b620003c58262000140565b67ffffffffffffffff811115620003e157620003e06200014b565b5b620003ed8254620001a9565b620003fa8282856200031f565b600060209050601f8311600181146200043257600084156200041d578287015190505b6200042985826200039c565b86555062000499565b601f1984166200044286620001de565b60005b828110156200046c5784890151825560018201915060208501945060208101905062000445565b868310156200048c578489015162000488601f8916826200037c565b8355505b6001600288020188555050505b505050505050565b614c3180620004b16000396000f3fe6080604052600436106101b75760003560e01c806388b2d581116100ec578063c7804bb51161008a578063d3f831be11610064578063d3f831be146106cc578063dd987c2014610709578063e0421e3914610732578063e236c7a61461076f576101b7565b8063c7804bb514610648578063cb85aa0a14610685578063d0e30db0146106c2576101b7565b8063ad5c4cdd116100c6578063ad5c4cdd14610554578063adb2378514610591578063b2d17883146105ce578063b6a216ae1461060b576101b7565b806388b2d5811461049c578063963516e4146104da5780639819459314610517576101b7565b8063613d4de8116101595780636f669da4116101335780636f669da4146103bc57806378a5dfd1146103f9578063796b96d2146104365780637c9db0bb1461045f576101b7565b8063613d4de81461032b57806361bc221a146103685780636cc9ac8a14610393576101b7565b80631b050207116101955780631b0502071461025f578063296c60aa146102885780632d0ee16a146102b157806346e16d34146102ee576101b7565b80630183e4b4146101bc57806301b68000146101e55780630c05e9e414610222575b600080fd5b3480156101c857600080fd5b506101e360048036038101906101de919061257c565b6107ad565b005b3480156101f157600080fd5b5061020c60048036038101906102079190612621565b610adc565b60405161021991906126de565b60405180910390f35b34801561022e57600080fd5b5061024960048036038101906102449190612835565b610c24565b6040516102569190612a78565b60405180910390f35b34801561026b57600080fd5b5061028660048036038101906102819190612a9a565b610cb4565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612b1d565b610e3b565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612835565b610f7c565b6040516102e59190612c78565b60405180910390f35b3480156102fa57600080fd5b5061031560048036038101906103109190612b1d565b61100a565b6040516103229190612ca9565b60405180910390f35b34801561033757600080fd5b50610352600480360381019061034d9190612cc4565b611094565b60405161035f9190612c78565b60405180910390f35b34801561037457600080fd5b5061037d611387565b60405161038a9190612d63565b60405180910390f35b34801561039f57600080fd5b506103ba60048036038101906103b59190612daa565b61139a565b005b3480156103c857600080fd5b506103e360048036038101906103de9190612e11565b61162b565b6040516103f09190612ca9565b60405180910390f35b34801561040557600080fd5b50610420600480360381019061041b9190612b1d565b6116b5565b60405161042d9190612ed7565b60405180910390f35b34801561044257600080fd5b5061045d60048036038101906104589190612b1d565b611742565b005b34801561046b57600080fd5b5061048660048036038101906104819190612835565b611883565b6040516104939190612ed7565b60405180910390f35b3480156104a857600080fd5b506104c360048036038101906104be9190612f5d565b61190d565b6040516104d192919061319f565b60405180910390f35b3480156104e657600080fd5b5061050160048036038101906104fc9190612835565b6119ab565b60405161050e9190612ca9565b60405180910390f35b34801561052357600080fd5b5061053e60048036038101906105399190612b1d565b611a34565b60405161054b9190612c78565b60405180910390f35b34801561056057600080fd5b5061057b60048036038101906105769190612b1d565b611ac3565b6040516105889190612c78565b60405180910390f35b34801561059d57600080fd5b506105b860048036038101906105b391906131d6565b611b4f565b6040516105c59190612c78565b60405180910390f35b3480156105da57600080fd5b506105f560048036038101906105f09190613259565b611ddc565b6040516106029190612c78565b60405180910390f35b34801561061757600080fd5b50610632600480360381019061062d9190612621565b611f31565b60405161063f91906133a6565b60405180910390f35b34801561065457600080fd5b5061066f600480360381019061066a91906133c8565b611fbb565b60405161067c9190612ca9565b60405180910390f35b34801561069157600080fd5b506106ac60048036038101906106a79190612621565b6120d3565b6040516106b99190613452565b60405180910390f35b6106ca61215d565b005b3480156106d857600080fd5b506106f360048036038101906106ee9190612835565b61215f565b6040516107009190612ed7565b60405180910390f35b34801561071557600080fd5b50610730600480360381019061072b9190613474565b6121e9565b005b34801561073e57600080fd5b5061075960048036038101906107549190612835565b612338565b6040516107669190612c78565b60405180910390f35b34801561077b57600080fd5b5061079660048036038101906107919190612621565b6123c4565b6040516107a49291906135d6565b60405180910390f35b81156108df576001600081819054906101000a900460070b809291906107d29061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146108de5760008473ffffffffffffffffffffffffffffffffffffffff16600f6040516108569061369d565b60006040518083038185875af1925050503d8060008114610893576040519150601f19603f3d011682016040523d82523d6000602084013e610898565b606091505b50509050806108dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d390613724565b60405180910390fd5b505b5b600061080173ffffffffffffffffffffffffffffffffffffffff16632efe8a5f86866040518363ffffffff1660e01b815260040161091e9291906137b2565b6020604051808303816000875af115801561093d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096191906137f0565b9050806109a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099a90613869565b60405180910390fd5b8115610ad5576001600081819054906101000a900460070b809291906109c89061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614610ad45760008573ffffffffffffffffffffffffffffffffffffffff16600f604051610a4c9061369d565b60006040518083038185875af1925050503d8060008114610a89576040519150601f19603f3d011682016040523d82523d6000602084013e610a8e565b606091505b5050905080610ad2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac990613724565b60405180910390fd5b505b5b5050505050565b606060008061080173ffffffffffffffffffffffffffffffffffffffff1684604051602401610b0b9190613898565b6040516020818303038152906040527f5431f450000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610b9591906138e4565b600060405180830381855afa9150503d8060008114610bd0576040519150601f19603f3d011682016040523d82523d6000602084013e610bd5565b606091505b509150915081610c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1190613947565b60405180910390fd5b8092505050919050565b610c2c612451565b61080173ffffffffffffffffffffffffffffffffffffffff166354212a89836040518263ffffffff1660e01b8152600401610c679190613452565b600060405180830381865afa158015610c84573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610cad9190613c40565b9050919050565b3073ffffffffffffffffffffffffffffffffffffffff1663ad5c4cdd85846040518363ffffffff1660e01b8152600401610cef929190613c89565b6000604051808303816000875af1925050508015610d3057506040513d6000823e3d601f19601f82011682018060405250810190610d2d9190613e06565b60015b15610d3757505b8015610e35576001600081819054906101000a900460070b80929190610d5c9061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008373ffffffffffffffffffffffffffffffffffffffff16600f604051610dad9061369d565b60006040518083038185875af1925050503d8060008114610dea576040519150601f19603f3d011682016040523d82523d6000602084013e610def565b606091505b5050905080610e33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2a90613724565b60405180910390fd5b505b50505050565b600061080173ffffffffffffffffffffffffffffffffffffffff168383604051602401610e69929190613e4f565b6040516020818303038152906040527f5a9d9a96000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610ef391906138e4565b600060405180830381855af49150503d8060008114610f2e576040519150601f19603f3d011682016040523d82523d6000602084013e610f33565b606091505b5050905080610f77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6e90613ef1565b60405180910390fd5b505050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6130846040518363ffffffff1660e01b8152600401610fbb929190613e4f565b6000604051808303816000875af1158015610fda573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906110039190613e06565b9050919050565b600061080173ffffffffffffffffffffffffffffffffffffffff16635a9d9a9684846040518363ffffffff1660e01b8152600401611049929190613e4f565b6020604051808303816000875af1158015611068573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108c91906137f0565b905092915050565b606082156111c8576001600081819054906101000a900460070b809291906110bb9061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146111c75760008473ffffffffffffffffffffffffffffffffffffffff16600f60405161113f9061369d565b60006040518083038185875af1925050503d806000811461117c576040519150601f19603f3d011682016040523d82523d6000602084013e611181565b606091505b50509050806111c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bc90613724565b60405180910390fd5b505b5b61080173ffffffffffffffffffffffffffffffffffffffff16633ce4e3be866040518263ffffffff1660e01b81526004016112039190613452565b6000604051808303816000875af1158015611222573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061124b9190613e06565b9050811561137f576001600081819054906101000a900460070b809291906112729061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461137e5760008473ffffffffffffffffffffffffffffffffffffffff16600f6040516112f69061369d565b60006040518083038185875af1925050503d8060008114611333576040519150601f19603f3d011682016040523d82523d6000602084013e611338565b606091505b505090508061137c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137390613724565b60405180910390fd5b505b5b949350505050565b600160009054906101000a900460070b81565b8115611498576001600081819054906101000a900460070b809291906113bf9061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008473ffffffffffffffffffffffffffffffffffffffff16600f6040516114109061369d565b60006040518083038185875af1925050503d806000811461144d576040519150601f19603f3d011682016040523d82523d6000602084013e611452565b606091505b5050905080611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90613724565b60405180910390fd5b505b600061080173ffffffffffffffffffffffffffffffffffffffff1663ed41d0b686866040518363ffffffff1660e01b81526004016114d7929190613f20565b6020604051808303816000875af11580156114f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151a91906137f0565b90508061152657600080fd5b8115611624576001600081819054906101000a900460070b8092919061154b9061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008573ffffffffffffffffffffffffffffffffffffffff16600f60405161159c9061369d565b60006040518083038185875af1925050503d80600081146115d9576040519150601f19603f3d011682016040523d82523d6000602084013e6115de565b606091505b5050905080611622576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161990613724565b60405180910390fd5b505b5050505050565b600061080173ffffffffffffffffffffffffffffffffffffffff16632efe8a5f84846040518363ffffffff1660e01b815260040161166a929190613f49565b6020604051808303816000875af1158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad91906137f0565b905092915050565b606061080173ffffffffffffffffffffffffffffffffffffffff16639ad563b484846040518363ffffffff1660e01b81526004016116f4929190613e4f565b600060405180830381865afa158015611711573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061173a9190613f72565b905092915050565b600061080173ffffffffffffffffffffffffffffffffffffffff168383604051602401611770929190613e4f565b6040516020818303038152906040527f5a9d9a96000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516117fa91906138e4565b600060405180830381855afa9150503d8060008114611835576040519150601f19603f3d011682016040523d82523d6000602084013e61183a565b606091505b505090508061187e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187590613947565b60405180910390fd5b505050565b606061080173ffffffffffffffffffffffffffffffffffffffff16633dd40f78836040518263ffffffff1660e01b81526004016118c09190613452565b600060405180830381865afa1580156118dd573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906119069190613f72565b9050919050565b6060611917612472565b61080173ffffffffffffffffffffffffffffffffffffffff16638f2473ce878787876040518563ffffffff1660e01b81526004016119589493929190614146565b600060405180830381865afa158015611975573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061199e919061441e565b9150915094509492505050565b600061080173ffffffffffffffffffffffffffffffffffffffff16635a9d9a9630846040518363ffffffff1660e01b81526004016119ea929190613e4f565b6020604051808303816000875af1158015611a09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2d91906137f0565b9050919050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6184846040518363ffffffff1660e01b8152600401611a73929190613e4f565b6000604051808303816000875af1158015611a92573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611abb9190613e06565b905092915050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6184846040518363ffffffff1660e01b8152600401611b02929190613e4f565b6000604051808303816000875af1158015611b21573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611b4a9190613e06565b600080fd5b60608215611c4f576001600081819054906101000a900460070b80929190611b769061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008573ffffffffffffffffffffffffffffffffffffffff16600f604051611bc79061369d565b60006040518083038185875af1925050503d8060008114611c04576040519150601f19603f3d011682016040523d82523d6000602084013e611c09565b606091505b5050905080611c4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4490613724565b60405180910390fd5b505b61080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6186866040518363ffffffff1660e01b8152600401611c8c929190613c89565b6000604051808303816000875af1158015611cab573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611cd49190613e06565b90508115611dd4576001600081819054906101000a900460070b80929190611cfb9061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008573ffffffffffffffffffffffffffffffffffffffff16600f604051611d4c9061369d565b60006040518083038185875af1925050503d8060008114611d89576040519150601f19603f3d011682016040523d82523d6000602084013e611d8e565b606091505b5050905080611dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc990613724565b60405180910390fd5b505b949350505050565b6060600061080173ffffffffffffffffffffffffffffffffffffffff16635a9d9a9633876040518363ffffffff1660e01b8152600401611e1d929190613e4f565b6020604051808303816000875af1158015611e3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6091906137f0565b905080611ea2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e99906144e2565b60405180910390fd5b61080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6185856040518363ffffffff1660e01b8152600401611edf929190613e4f565b6000604051808303816000875af1158015611efe573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611f279190613e06565b9150509392505050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663a66cb605836040518263ffffffff1660e01b8152600401611f6e9190613898565b600060405180830381865afa158015611f8b573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611fb491906145e3565b9050919050565b600060018060008282829054906101000a900460070b611fdb919061462c565b92506101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555061080173ffffffffffffffffffffffffffffffffffffffff1663ed41d0b684846040518363ffffffff1660e01b815260040161204192919061468c565b6020604051808303816000875af1158015612060573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208491906137f0565b905060018060008282829054906101000a900460070b6120a491906146b5565b92506101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555092915050565b606061080173ffffffffffffffffffffffffffffffffffffffff16635431f450836040518263ffffffff1660e01b81526004016121109190613898565b600060405180830381865afa15801561212d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906121569190614715565b9050919050565b565b606061080173ffffffffffffffffffffffffffffffffffffffff166385b2d2da836040518263ffffffff1660e01b815260040161219c9190613452565b600060405180830381865afa1580156121b9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906121e29190613f72565b9050919050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895308460006040518463ffffffff1660e01b815260040161222b9392919061490c565b6020604051808303816000875af115801561224a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061226e91906137f0565b9050806122b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122a7906149bc565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3085856040518463ffffffff1660e01b81526004016122ef939291906149dc565b6020604051808303816000875af115801561230e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233291906137f0565b50505050565b606061080173ffffffffffffffffffffffffffffffffffffffff16633ce4e3be836040518263ffffffff1660e01b81526004016123759190613452565b6000604051808303816000875af1158015612394573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906123bd9190613e06565b9050919050565b60608061080173ffffffffffffffffffffffffffffffffffffffff166354be1a28846040518263ffffffff1660e01b81526004016124029190613898565b600060405180830381865afa15801561241f573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906124489190614b83565b91509150915091565b60405180606001604052806060815260200160608152602001606081525090565b604051806040016040528060608152602001600067ffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006124d5826124aa565b9050919050565b6124e5816124ca565b81146124f057600080fd5b50565b600081359050612502816124dc565b92915050565b600063ffffffff82169050919050565b61252181612508565b811461252c57600080fd5b50565b60008135905061253e81612518565b92915050565b60008115159050919050565b61255981612544565b811461256457600080fd5b50565b60008135905061257681612550565b92915050565b60008060008060808587031215612596576125956124a0565b5b60006125a4878288016124f3565b94505060206125b58782880161252f565b93505060406125c687828801612567565b92505060606125d787828801612567565b91505092959194509250565b60006125ee826124aa565b9050919050565b6125fe816125e3565b811461260957600080fd5b50565b60008135905061261b816125f5565b92915050565b600060208284031215612637576126366124a0565b5b60006126458482850161260c565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561268857808201518184015260208101905061266d565b60008484015250505050565b6000601f19601f8301169050919050565b60006126b08261264e565b6126ba8185612659565b93506126ca81856020860161266a565b6126d381612694565b840191505092915050565b600060208201905081810360008301526126f881846126a5565b905092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61274282612694565b810181811067ffffffffffffffff821117156127615761276061270a565b5b80604052505050565b6000612774612496565b90506127808282612739565b919050565b600067ffffffffffffffff8211156127a05761279f61270a565b5b6127a982612694565b9050602081019050919050565b82818337600083830152505050565b60006127d86127d384612785565b61276a565b9050828152602081018484840111156127f4576127f3612705565b5b6127ff8482856127b6565b509392505050565b600082601f83011261281c5761281b612700565b5b813561282c8482602086016127c5565b91505092915050565b60006020828403121561284b5761284a6124a0565b5b600082013567ffffffffffffffff811115612869576128686124a5565b5b61287584828501612807565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60006128a58261287e565b6128af8185612889565b93506128bf81856020860161266a565b6128c881612694565b840191505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000819050919050565b612912816128ff565b82525050565b600060ff82169050919050565b61292e81612918565b82525050565b60006060830160008301518482036000860152612951828261289a565b91505060208301516129666020860182612909565b5060408301516129796040860182612925565b508091505092915050565b60006129908383612934565b905092915050565b6000602082019050919050565b60006129b0826128d3565b6129ba81856128de565b9350836020820285016129cc856128ef565b8060005b85811015612a0857848403895281516129e98582612984565b94506129f483612998565b925060208a019950506001810190506129d0565b50829750879550505050505092915050565b60006060830160008301518482036000860152612a37828261289a565b91505060208301518482036020860152612a5182826129a5565b91505060408301518482036040860152612a6b82826129a5565b9150508091505092915050565b60006020820190508181036000830152612a928184612a1a565b905092915050565b60008060008060808587031215612ab457612ab36124a0565b5b6000612ac2878288016124f3565b9450506020612ad3878288016124f3565b935050604085013567ffffffffffffffff811115612af457612af36124a5565b5b612b0087828801612807565b9250506060612b1187828801612567565b91505092959194509250565b60008060408385031215612b3457612b336124a0565b5b6000612b428582860161260c565b925050602083013567ffffffffffffffff811115612b6357612b626124a5565b5b612b6f85828601612807565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006040830160008301518482036000860152612bc2828261289a565b9150506020830151612bd76020860182612909565b508091505092915050565b6000612bee8383612ba5565b905092915050565b6000602082019050919050565b6000612c0e82612b79565b612c188185612b84565b935083602082028501612c2a85612b95565b8060005b85811015612c665784840389528151612c478582612be2565b9450612c5283612bf6565b925060208a01995050600181019050612c2e565b50829750879550505050505092915050565b60006020820190508181036000830152612c928184612c03565b905092915050565b612ca381612544565b82525050565b6000602082019050612cbe6000830184612c9a565b92915050565b60008060008060808587031215612cde57612cdd6124a0565b5b600085013567ffffffffffffffff811115612cfc57612cfb6124a5565b5b612d0887828801612807565b9450506020612d19878288016124f3565b9350506040612d2a87828801612567565b9250506060612d3b87828801612567565b91505092959194509250565b60008160070b9050919050565b612d5d81612d47565b82525050565b6000602082019050612d786000830184612d54565b92915050565b612d87816128ff565b8114612d9257600080fd5b50565b600081359050612da481612d7e565b92915050565b60008060008060808587031215612dc457612dc36124a0565b5b6000612dd2878288016124f3565b9450506020612de387828801612d95565b9350506040612df487828801612567565b9250506060612e0587828801612567565b91505092959194509250565b60008060408385031215612e2857612e276124a0565b5b6000612e368582860161260c565b9250506020612e478582860161252f565b9150509250929050565b600082825260208201905092915050565b6000612e6d826128d3565b612e778185612e51565b935083602082028501612e89856128ef565b8060005b85811015612ec55784840389528151612ea68582612984565b9450612eb183612998565b925060208a01995050600181019050612e8d565b50829750879550505050505092915050565b60006020820190508181036000830152612ef18184612e62565b905092915050565b600067ffffffffffffffff82169050919050565b612f1681612ef9565b8114612f2157600080fd5b50565b600081359050612f3381612f0d565b92915050565b600080fd5b600060a08284031215612f5457612f53612f39565b5b81905092915050565b60008060008060808587031215612f7757612f766124a0565b5b600085013567ffffffffffffffff811115612f9557612f946124a5565b5b612fa187828801612807565b9450506020612fb287828801612f24565b9350506040612fc387828801612f24565b925050606085013567ffffffffffffffff811115612fe457612fe36124a5565b5b612ff087828801612f3e565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61303181612ef9565b82525050565b60408201600082015161304d6000850182612909565b5060208201516130606020850182612925565b50505050565b60608201600082015161307c6000850182613028565b50602082015161308f6020850182613037565b50505050565b60006130a18383613066565b60608301905092915050565b6000602082019050919050565b60006130c582612ffc565b6130cf8185613007565b93506130da83613018565b8060005b8381101561310b5781516130f28882613095565b97506130fd836130ad565b9250506001810190506130de565b5085935050505092915050565b600082825260208201905092915050565b60006131348261264e565b61313e8185613118565b935061314e81856020860161266a565b61315781612694565b840191505092915050565b6000604083016000830151848203600086015261317f8282613129565b91505060208301516131946020860182613028565b508091505092915050565b600060408201905081810360008301526131b981856130ba565b905081810360208301526131cd8184613162565b90509392505050565b600080600080608085870312156131f0576131ef6124a0565b5b60006131fe878288016124f3565b945050602085013567ffffffffffffffff81111561321f5761321e6124a5565b5b61322b87828801612807565b935050604061323c87828801612567565b925050606061324d87828801612567565b91505092959194509250565b600080600060608486031215613272576132716124a0565b5b600084013567ffffffffffffffff8111156132905761328f6124a5565b5b61329c86828701612807565b93505060206132ad8682870161260c565b925050604084013567ffffffffffffffff8111156132ce576132cd6124a5565b5b6132da86828701612807565b9150509250925092565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061331c838361289a565b905092915050565b6000602082019050919050565b600061333c826132e4565b61334681856132ef565b93508360208202850161335885613300565b8060005b8581101561339457848403895281516133758582613310565b945061338083613324565b925060208a0199505060018101905061335c565b50829750879550505050505092915050565b600060208201905081810360008301526133c08184613331565b905092915050565b600080604083850312156133df576133de6124a0565b5b60006133ed8582860161260c565b92505060206133fe85828601612d95565b9150509250929050565b600082825260208201905092915050565b60006134248261287e565b61342e8185613408565b935061343e81856020860161266a565b61344781612694565b840191505092915050565b6000602082019050818103600083015261346c8184613419565b905092915050565b6000806040838503121561348b5761348a6124a0565b5b600083013567ffffffffffffffff8111156134a9576134a86124a5565b5b6134b585828601612807565b92505060206134c685828601612d95565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006040830160008301518482036000860152613519828261289a565b9150506020830151848203602086015261353382826129a5565b9150508091505092915050565b600061354c83836134fc565b905092915050565b6000602082019050919050565b600061356c826134d0565b61357681856134db565b935083602082028501613588856134ec565b8060005b858110156135c457848403895281516135a58582613540565b94506135b083613554565b925060208a0199505060018101905061358c565b50829750879550505050505092915050565b600060408201905081810360008301526135f08185613561565b905081810360208301526136048184612e62565b90509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061364782612d47565b9150677fffffffffffffff82036136615761366061360d565b5b600182019050919050565b600081905092915050565b50565b600061368760008361366c565b915061369282613677565b600082019050919050565b60006136a88261367a565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061370e602183613408565b9150613719826136b2565b604082019050919050565b6000602082019050818103600083015261373d81613701565b9050919050565b6000819050919050565b600061376961376461375f846124aa565b613744565b6124aa565b9050919050565b600061377b8261374e565b9050919050565b600061378d82613770565b9050919050565b61379d81613782565b82525050565b6137ac81612508565b82525050565b60006040820190506137c76000830185613794565b6137d460208301846137a3565b9392505050565b6000815190506137ea81612550565b92915050565b600060208284031215613806576138056124a0565b5b6000613814848285016137db565b91505092915050565b7f6661696c656420746f20636c61696d2072657761726473000000000000000000600082015250565b6000613853601783613408565b915061385e8261381d565b602082019050919050565b6000602082019050818103600083015261388281613846565b9050919050565b613892816125e3565b82525050565b60006020820190506138ad6000830184613889565b92915050565b60006138be8261264e565b6138c8818561366c565b93506138d881856020860161266a565b80840191505092915050565b60006138f082846138b3565b915081905092915050565b7f6661696c65642073746174696343616c6c20746f20707265636f6d70696c6500600082015250565b6000613931601f83613408565b915061393c826138fb565b602082019050919050565b6000602082019050818103600083015261396081613924565b9050919050565b600080fd5b600080fd5b600061398461397f84612785565b61276a565b9050828152602081018484840111156139a05761399f612705565b5b6139ab84828561266a565b509392505050565b600082601f8301126139c8576139c7612700565b5b81516139d8848260208601613971565b91505092915050565b600067ffffffffffffffff8211156139fc576139fb61270a565b5b602082029050602081019050919050565b600080fd5b600081519050613a2181612d7e565b92915050565b613a3081612918565b8114613a3b57600080fd5b50565b600081519050613a4d81613a27565b92915050565b600060608284031215613a6957613a68613967565b5b613a73606061276a565b9050600082015167ffffffffffffffff811115613a9357613a9261396c565b5b613a9f848285016139b3565b6000830152506020613ab384828501613a12565b6020830152506040613ac784828501613a3e565b60408301525092915050565b6000613ae6613ae1846139e1565b61276a565b90508083825260208201905060208402830185811115613b0957613b08613a0d565b5b835b81811015613b5057805167ffffffffffffffff811115613b2e57613b2d612700565b5b808601613b3b8982613a53565b85526020850194505050602081019050613b0b565b5050509392505050565b600082601f830112613b6f57613b6e612700565b5b8151613b7f848260208601613ad3565b91505092915050565b600060608284031215613b9e57613b9d613967565b5b613ba8606061276a565b9050600082015167ffffffffffffffff811115613bc857613bc761396c565b5b613bd4848285016139b3565b600083015250602082015167ffffffffffffffff811115613bf857613bf761396c565b5b613c0484828501613b5a565b602083015250604082015167ffffffffffffffff811115613c2857613c2761396c565b5b613c3484828501613b5a565b60408301525092915050565b600060208284031215613c5657613c556124a0565b5b600082015167ffffffffffffffff811115613c7457613c736124a5565b5b613c8084828501613b88565b91505092915050565b6000604082019050613c9e6000830185613794565b8181036020830152613cb08184613419565b90509392505050565b600067ffffffffffffffff821115613cd457613cd361270a565b5b602082029050602081019050919050565b600060408284031215613cfb57613cfa613967565b5b613d05604061276a565b9050600082015167ffffffffffffffff811115613d2557613d2461396c565b5b613d31848285016139b3565b6000830152506020613d4584828501613a12565b60208301525092915050565b6000613d64613d5f84613cb9565b61276a565b90508083825260208201905060208402830185811115613d8757613d86613a0d565b5b835b81811015613dce57805167ffffffffffffffff811115613dac57613dab612700565b5b808601613db98982613ce5565b85526020850194505050602081019050613d89565b5050509392505050565b600082601f830112613ded57613dec612700565b5b8151613dfd848260208601613d51565b91505092915050565b600060208284031215613e1c57613e1b6124a0565b5b600082015167ffffffffffffffff811115613e3a57613e396124a5565b5b613e4684828501613dd8565b91505092915050565b6000604082019050613e646000830185613889565b8181036020830152613e768184613419565b90509392505050565b7f6661696c65642064656c656761746543616c6c20746f20707265636f6d70696c60008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b6000613edb602183613408565b9150613ee682613e7f565b604082019050919050565b60006020820190508181036000830152613f0a81613ece565b9050919050565b613f1a816128ff565b82525050565b6000604082019050613f356000830185613794565b613f426020830184613f11565b9392505050565b6000604082019050613f5e6000830185613889565b613f6b60208301846137a3565b9392505050565b600060208284031215613f8857613f876124a0565b5b600082015167ffffffffffffffff811115613fa657613fa56124a5565b5b613fb284828501613b5a565b91505092915050565b613fc481612ef9565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613ff657613ff5613fd4565b5b83810192508235915060208301925067ffffffffffffffff82111561401e5761401d613fca565b5b60018202360383131561403457614033613fcf565b5b509250929050565b60006140488385613118565b93506140558385846127b6565b61405e83612694565b840190509392505050565b60006140786020840184612f24565b905092915050565b600061408f6020840184612567565b905092915050565b6140a081612544565b82525050565b600060a083016140b96000840184613fd9565b85830360008701526140cc83828461403c565b925050506140dd6020840184614069565b6140ea6020860182613028565b506140f86040840184614069565b6141056040860182613028565b506141136060840184614080565b6141206060860182614097565b5061412e6080840184614080565b61413b6080860182614097565b508091505092915050565b600060808201905081810360008301526141608187613419565b905061416f6020830186613fbb565b61417c6040830185613fbb565b818103606083015261418e81846140a6565b905095945050505050565b600067ffffffffffffffff8211156141b4576141b361270a565b5b602082029050602081019050919050565b6000815190506141d481612f0d565b92915050565b6000604082840312156141f0576141ef613967565b5b6141fa604061276a565b9050600061420a84828501613a12565b600083015250602061421e84828501613a3e565b60208301525092915050565b6000606082840312156142405761423f613967565b5b61424a604061276a565b9050600061425a848285016141c5565b600083015250602061426e848285016141da565b60208301525092915050565b600061428d61428884614199565b61276a565b905080838252602082019050606084028301858111156142b0576142af613a0d565b5b835b818110156142d957806142c5888261422a565b8452602084019350506060810190506142b2565b5050509392505050565b600082601f8301126142f8576142f7612700565b5b815161430884826020860161427a565b91505092915050565b600067ffffffffffffffff82111561432c5761432b61270a565b5b61433582612694565b9050602081019050919050565b600061435561435084614311565b61276a565b90508281526020810184848401111561437157614370612705565b5b61437c84828561266a565b509392505050565b600082601f83011261439957614398612700565b5b81516143a9848260208601614342565b91505092915050565b6000604082840312156143c8576143c7613967565b5b6143d2604061276a565b9050600082015167ffffffffffffffff8111156143f2576143f161396c565b5b6143fe84828501614384565b6000830152506020614412848285016141c5565b60208301525092915050565b60008060408385031215614435576144346124a0565b5b600083015167ffffffffffffffff811115614453576144526124a5565b5b61445f858286016142e3565b925050602083015167ffffffffffffffff8111156144805761447f6124a5565b5b61448c858286016143b2565b9150509250929050565b7f6661696c656420746f2073657420776974686472617720616464726573730000600082015250565b60006144cc601e83613408565b91506144d782614496565b602082019050919050565b600060208201905081810360008301526144fb816144bf565b9050919050565b600067ffffffffffffffff82111561451d5761451c61270a565b5b602082029050602081019050919050565b600061454161453c84614502565b61276a565b9050808382526020820190506020840283018581111561456457614563613a0d565b5b835b818110156145ab57805167ffffffffffffffff81111561458957614588612700565b5b80860161459689826139b3565b85526020850194505050602081019050614566565b5050509392505050565b600082601f8301126145ca576145c9612700565b5b81516145da84826020860161452e565b91505092915050565b6000602082840312156145f9576145f86124a0565b5b600082015167ffffffffffffffff811115614617576146166124a5565b5b614623848285016145b5565b91505092915050565b600061463782612d47565b915061464283612d47565b925082820190507fffffffffffffffffffffffffffffffffffffffffffffffff80000000000000008112677fffffffffffffff821317156146865761468561360d565b5b92915050565b60006040820190506146a16000830185613889565b6146ae6020830184613f11565b9392505050565b60006146c082612d47565b91506146cb83612d47565b92508282039050677fffffffffffffff81137fffffffffffffffffffffffffffffffffffffffffffffffff80000000000000008212171561470f5761470e61360d565b5b92915050565b60006020828403121561472b5761472a6124a0565b5b600082015167ffffffffffffffff811115614749576147486124a5565b5b614755848285016139b3565b91505092915050565b600081549050919050565b60008190508160005260206000209050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806147c557607f821691505b6020821081036147d8576147d761477e565b5b50919050565b60008190508160005260206000209050919050565b60008154614800816147ad565b61480a8186612889565b94506001821660008114614825576001811461483b5761486e565b60ff19831686528115156020028601935061486e565b614844856147de565b60005b8381101561486657815481890152600182019150602081019050614847565b808801955050505b50505092915050565b600061488383836147f3565b905092915050565b6000600182019050919050565b60006148a38261475e565b6148ad81856132ef565b9350836020820285016148bf85614769565b8060005b858110156148fa578484038952816148db8582614877565b94506148e68361488b565b925060208a019950506001810190506148c3565b50829750879550505050505092915050565b60006060820190506149216000830186613889565b61492e6020830185613f11565b81810360408301526149408184614898565b9050949350505050565b7f4661696c656420746f20617070726f7665207374616b696e67206d6574686f6460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b60006149a6602183613408565b91506149b18261494a565b604082019050919050565b600060208201905081810360008301526149d581614999565b9050919050565b60006060820190506149f16000830186613889565b8181036020830152614a038185613419565b9050614a126040830184613f11565b949350505050565b600067ffffffffffffffff821115614a3557614a3461270a565b5b602082029050602081019050919050565b600060408284031215614a5c57614a5b613967565b5b614a66604061276a565b9050600082015167ffffffffffffffff811115614a8657614a8561396c565b5b614a92848285016139b3565b600083015250602082015167ffffffffffffffff811115614ab657614ab561396c565b5b614ac284828501613b5a565b60208301525092915050565b6000614ae1614adc84614a1a565b61276a565b90508083825260208201905060208402830185811115614b0457614b03613a0d565b5b835b81811015614b4b57805167ffffffffffffffff811115614b2957614b28612700565b5b808601614b368982614a46565b85526020850194505050602081019050614b06565b5050509392505050565b600082601f830112614b6a57614b69612700565b5b8151614b7a848260208601614ace565b91505092915050565b60008060408385031215614b9a57614b996124a0565b5b600083015167ffffffffffffffff811115614bb857614bb76124a5565b5b614bc485828601614b55565b925050602083015167ffffffffffffffff811115614be557614be46124a5565b5b614bf185828601613b5a565b915050925092905056fea2646970667358221220d99e4a023cfa00d35d739659c1ad9fb6f15b297affc8bff9a0b4c062ca1f348864736f6c634300081400332f636f736d6f732e7374616b696e672e763162657461312e4d736744656c6567617465", + "deployedBytecode": "0x6080604052600436106101b75760003560e01c806388b2d581116100ec578063c7804bb51161008a578063d3f831be11610064578063d3f831be146106cc578063dd987c2014610709578063e0421e3914610732578063e236c7a61461076f576101b7565b8063c7804bb514610648578063cb85aa0a14610685578063d0e30db0146106c2576101b7565b8063ad5c4cdd116100c6578063ad5c4cdd14610554578063adb2378514610591578063b2d17883146105ce578063b6a216ae1461060b576101b7565b806388b2d5811461049c578063963516e4146104da5780639819459314610517576101b7565b8063613d4de8116101595780636f669da4116101335780636f669da4146103bc57806378a5dfd1146103f9578063796b96d2146104365780637c9db0bb1461045f576101b7565b8063613d4de81461032b57806361bc221a146103685780636cc9ac8a14610393576101b7565b80631b050207116101955780631b0502071461025f578063296c60aa146102885780632d0ee16a146102b157806346e16d34146102ee576101b7565b80630183e4b4146101bc57806301b68000146101e55780630c05e9e414610222575b600080fd5b3480156101c857600080fd5b506101e360048036038101906101de919061257c565b6107ad565b005b3480156101f157600080fd5b5061020c60048036038101906102079190612621565b610adc565b60405161021991906126de565b60405180910390f35b34801561022e57600080fd5b5061024960048036038101906102449190612835565b610c24565b6040516102569190612a78565b60405180910390f35b34801561026b57600080fd5b5061028660048036038101906102819190612a9a565b610cb4565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612b1d565b610e3b565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612835565b610f7c565b6040516102e59190612c78565b60405180910390f35b3480156102fa57600080fd5b5061031560048036038101906103109190612b1d565b61100a565b6040516103229190612ca9565b60405180910390f35b34801561033757600080fd5b50610352600480360381019061034d9190612cc4565b611094565b60405161035f9190612c78565b60405180910390f35b34801561037457600080fd5b5061037d611387565b60405161038a9190612d63565b60405180910390f35b34801561039f57600080fd5b506103ba60048036038101906103b59190612daa565b61139a565b005b3480156103c857600080fd5b506103e360048036038101906103de9190612e11565b61162b565b6040516103f09190612ca9565b60405180910390f35b34801561040557600080fd5b50610420600480360381019061041b9190612b1d565b6116b5565b60405161042d9190612ed7565b60405180910390f35b34801561044257600080fd5b5061045d60048036038101906104589190612b1d565b611742565b005b34801561046b57600080fd5b5061048660048036038101906104819190612835565b611883565b6040516104939190612ed7565b60405180910390f35b3480156104a857600080fd5b506104c360048036038101906104be9190612f5d565b61190d565b6040516104d192919061319f565b60405180910390f35b3480156104e657600080fd5b5061050160048036038101906104fc9190612835565b6119ab565b60405161050e9190612ca9565b60405180910390f35b34801561052357600080fd5b5061053e60048036038101906105399190612b1d565b611a34565b60405161054b9190612c78565b60405180910390f35b34801561056057600080fd5b5061057b60048036038101906105769190612b1d565b611ac3565b6040516105889190612c78565b60405180910390f35b34801561059d57600080fd5b506105b860048036038101906105b391906131d6565b611b4f565b6040516105c59190612c78565b60405180910390f35b3480156105da57600080fd5b506105f560048036038101906105f09190613259565b611ddc565b6040516106029190612c78565b60405180910390f35b34801561061757600080fd5b50610632600480360381019061062d9190612621565b611f31565b60405161063f91906133a6565b60405180910390f35b34801561065457600080fd5b5061066f600480360381019061066a91906133c8565b611fbb565b60405161067c9190612ca9565b60405180910390f35b34801561069157600080fd5b506106ac60048036038101906106a79190612621565b6120d3565b6040516106b99190613452565b60405180910390f35b6106ca61215d565b005b3480156106d857600080fd5b506106f360048036038101906106ee9190612835565b61215f565b6040516107009190612ed7565b60405180910390f35b34801561071557600080fd5b50610730600480360381019061072b9190613474565b6121e9565b005b34801561073e57600080fd5b5061075960048036038101906107549190612835565b612338565b6040516107669190612c78565b60405180910390f35b34801561077b57600080fd5b5061079660048036038101906107919190612621565b6123c4565b6040516107a49291906135d6565b60405180910390f35b81156108df576001600081819054906101000a900460070b809291906107d29061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146108de5760008473ffffffffffffffffffffffffffffffffffffffff16600f6040516108569061369d565b60006040518083038185875af1925050503d8060008114610893576040519150601f19603f3d011682016040523d82523d6000602084013e610898565b606091505b50509050806108dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d390613724565b60405180910390fd5b505b5b600061080173ffffffffffffffffffffffffffffffffffffffff16632efe8a5f86866040518363ffffffff1660e01b815260040161091e9291906137b2565b6020604051808303816000875af115801561093d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096191906137f0565b9050806109a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099a90613869565b60405180910390fd5b8115610ad5576001600081819054906101000a900460070b809291906109c89061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614610ad45760008573ffffffffffffffffffffffffffffffffffffffff16600f604051610a4c9061369d565b60006040518083038185875af1925050503d8060008114610a89576040519150601f19603f3d011682016040523d82523d6000602084013e610a8e565b606091505b5050905080610ad2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac990613724565b60405180910390fd5b505b5b5050505050565b606060008061080173ffffffffffffffffffffffffffffffffffffffff1684604051602401610b0b9190613898565b6040516020818303038152906040527f5431f450000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610b9591906138e4565b600060405180830381855afa9150503d8060008114610bd0576040519150601f19603f3d011682016040523d82523d6000602084013e610bd5565b606091505b509150915081610c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1190613947565b60405180910390fd5b8092505050919050565b610c2c612451565b61080173ffffffffffffffffffffffffffffffffffffffff166354212a89836040518263ffffffff1660e01b8152600401610c679190613452565b600060405180830381865afa158015610c84573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610cad9190613c40565b9050919050565b3073ffffffffffffffffffffffffffffffffffffffff1663ad5c4cdd85846040518363ffffffff1660e01b8152600401610cef929190613c89565b6000604051808303816000875af1925050508015610d3057506040513d6000823e3d601f19601f82011682018060405250810190610d2d9190613e06565b60015b15610d3757505b8015610e35576001600081819054906101000a900460070b80929190610d5c9061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008373ffffffffffffffffffffffffffffffffffffffff16600f604051610dad9061369d565b60006040518083038185875af1925050503d8060008114610dea576040519150601f19603f3d011682016040523d82523d6000602084013e610def565b606091505b5050905080610e33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2a90613724565b60405180910390fd5b505b50505050565b600061080173ffffffffffffffffffffffffffffffffffffffff168383604051602401610e69929190613e4f565b6040516020818303038152906040527f5a9d9a96000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610ef391906138e4565b600060405180830381855af49150503d8060008114610f2e576040519150601f19603f3d011682016040523d82523d6000602084013e610f33565b606091505b5050905080610f77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6e90613ef1565b60405180910390fd5b505050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6130846040518363ffffffff1660e01b8152600401610fbb929190613e4f565b6000604051808303816000875af1158015610fda573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906110039190613e06565b9050919050565b600061080173ffffffffffffffffffffffffffffffffffffffff16635a9d9a9684846040518363ffffffff1660e01b8152600401611049929190613e4f565b6020604051808303816000875af1158015611068573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108c91906137f0565b905092915050565b606082156111c8576001600081819054906101000a900460070b809291906110bb9061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146111c75760008473ffffffffffffffffffffffffffffffffffffffff16600f60405161113f9061369d565b60006040518083038185875af1925050503d806000811461117c576040519150601f19603f3d011682016040523d82523d6000602084013e611181565b606091505b50509050806111c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bc90613724565b60405180910390fd5b505b5b61080173ffffffffffffffffffffffffffffffffffffffff16633ce4e3be866040518263ffffffff1660e01b81526004016112039190613452565b6000604051808303816000875af1158015611222573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061124b9190613e06565b9050811561137f576001600081819054906101000a900460070b809291906112729061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461137e5760008473ffffffffffffffffffffffffffffffffffffffff16600f6040516112f69061369d565b60006040518083038185875af1925050503d8060008114611333576040519150601f19603f3d011682016040523d82523d6000602084013e611338565b606091505b505090508061137c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137390613724565b60405180910390fd5b505b5b949350505050565b600160009054906101000a900460070b81565b8115611498576001600081819054906101000a900460070b809291906113bf9061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008473ffffffffffffffffffffffffffffffffffffffff16600f6040516114109061369d565b60006040518083038185875af1925050503d806000811461144d576040519150601f19603f3d011682016040523d82523d6000602084013e611452565b606091505b5050905080611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90613724565b60405180910390fd5b505b600061080173ffffffffffffffffffffffffffffffffffffffff1663ed41d0b686866040518363ffffffff1660e01b81526004016114d7929190613f20565b6020604051808303816000875af11580156114f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151a91906137f0565b90508061152657600080fd5b8115611624576001600081819054906101000a900460070b8092919061154b9061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008573ffffffffffffffffffffffffffffffffffffffff16600f60405161159c9061369d565b60006040518083038185875af1925050503d80600081146115d9576040519150601f19603f3d011682016040523d82523d6000602084013e6115de565b606091505b5050905080611622576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161990613724565b60405180910390fd5b505b5050505050565b600061080173ffffffffffffffffffffffffffffffffffffffff16632efe8a5f84846040518363ffffffff1660e01b815260040161166a929190613f49565b6020604051808303816000875af1158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad91906137f0565b905092915050565b606061080173ffffffffffffffffffffffffffffffffffffffff16639ad563b484846040518363ffffffff1660e01b81526004016116f4929190613e4f565b600060405180830381865afa158015611711573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061173a9190613f72565b905092915050565b600061080173ffffffffffffffffffffffffffffffffffffffff168383604051602401611770929190613e4f565b6040516020818303038152906040527f5a9d9a96000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516117fa91906138e4565b600060405180830381855afa9150503d8060008114611835576040519150601f19603f3d011682016040523d82523d6000602084013e61183a565b606091505b505090508061187e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187590613947565b60405180910390fd5b505050565b606061080173ffffffffffffffffffffffffffffffffffffffff16633dd40f78836040518263ffffffff1660e01b81526004016118c09190613452565b600060405180830381865afa1580156118dd573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906119069190613f72565b9050919050565b6060611917612472565b61080173ffffffffffffffffffffffffffffffffffffffff16638f2473ce878787876040518563ffffffff1660e01b81526004016119589493929190614146565b600060405180830381865afa158015611975573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061199e919061441e565b9150915094509492505050565b600061080173ffffffffffffffffffffffffffffffffffffffff16635a9d9a9630846040518363ffffffff1660e01b81526004016119ea929190613e4f565b6020604051808303816000875af1158015611a09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2d91906137f0565b9050919050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6184846040518363ffffffff1660e01b8152600401611a73929190613e4f565b6000604051808303816000875af1158015611a92573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611abb9190613e06565b905092915050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6184846040518363ffffffff1660e01b8152600401611b02929190613e4f565b6000604051808303816000875af1158015611b21573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611b4a9190613e06565b600080fd5b60608215611c4f576001600081819054906101000a900460070b80929190611b769061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008573ffffffffffffffffffffffffffffffffffffffff16600f604051611bc79061369d565b60006040518083038185875af1925050503d8060008114611c04576040519150601f19603f3d011682016040523d82523d6000602084013e611c09565b606091505b5050905080611c4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4490613724565b60405180910390fd5b505b61080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6186866040518363ffffffff1660e01b8152600401611c8c929190613c89565b6000604051808303816000875af1158015611cab573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611cd49190613e06565b90508115611dd4576001600081819054906101000a900460070b80929190611cfb9061363c565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008573ffffffffffffffffffffffffffffffffffffffff16600f604051611d4c9061369d565b60006040518083038185875af1925050503d8060008114611d89576040519150601f19603f3d011682016040523d82523d6000602084013e611d8e565b606091505b5050905080611dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc990613724565b60405180910390fd5b505b949350505050565b6060600061080173ffffffffffffffffffffffffffffffffffffffff16635a9d9a9633876040518363ffffffff1660e01b8152600401611e1d929190613e4f565b6020604051808303816000875af1158015611e3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6091906137f0565b905080611ea2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e99906144e2565b60405180910390fd5b61080173ffffffffffffffffffffffffffffffffffffffff1663b46a8d6185856040518363ffffffff1660e01b8152600401611edf929190613e4f565b6000604051808303816000875af1158015611efe573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611f279190613e06565b9150509392505050565b606061080173ffffffffffffffffffffffffffffffffffffffff1663a66cb605836040518263ffffffff1660e01b8152600401611f6e9190613898565b600060405180830381865afa158015611f8b573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611fb491906145e3565b9050919050565b600060018060008282829054906101000a900460070b611fdb919061462c565b92506101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555061080173ffffffffffffffffffffffffffffffffffffffff1663ed41d0b684846040518363ffffffff1660e01b815260040161204192919061468c565b6020604051808303816000875af1158015612060573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208491906137f0565b905060018060008282829054906101000a900460070b6120a491906146b5565b92506101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555092915050565b606061080173ffffffffffffffffffffffffffffffffffffffff16635431f450836040518263ffffffff1660e01b81526004016121109190613898565b600060405180830381865afa15801561212d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906121569190614715565b9050919050565b565b606061080173ffffffffffffffffffffffffffffffffffffffff166385b2d2da836040518263ffffffff1660e01b815260040161219c9190613452565b600060405180830381865afa1580156121b9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906121e29190613f72565b9050919050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663b6039895308460006040518463ffffffff1660e01b815260040161222b9392919061490c565b6020604051808303816000875af115801561224a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061226e91906137f0565b9050806122b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122a7906149bc565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3085856040518463ffffffff1660e01b81526004016122ef939291906149dc565b6020604051808303816000875af115801561230e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233291906137f0565b50505050565b606061080173ffffffffffffffffffffffffffffffffffffffff16633ce4e3be836040518263ffffffff1660e01b81526004016123759190613452565b6000604051808303816000875af1158015612394573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906123bd9190613e06565b9050919050565b60608061080173ffffffffffffffffffffffffffffffffffffffff166354be1a28846040518263ffffffff1660e01b81526004016124029190613898565b600060405180830381865afa15801561241f573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906124489190614b83565b91509150915091565b60405180606001604052806060815260200160608152602001606081525090565b604051806040016040528060608152602001600067ffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006124d5826124aa565b9050919050565b6124e5816124ca565b81146124f057600080fd5b50565b600081359050612502816124dc565b92915050565b600063ffffffff82169050919050565b61252181612508565b811461252c57600080fd5b50565b60008135905061253e81612518565b92915050565b60008115159050919050565b61255981612544565b811461256457600080fd5b50565b60008135905061257681612550565b92915050565b60008060008060808587031215612596576125956124a0565b5b60006125a4878288016124f3565b94505060206125b58782880161252f565b93505060406125c687828801612567565b92505060606125d787828801612567565b91505092959194509250565b60006125ee826124aa565b9050919050565b6125fe816125e3565b811461260957600080fd5b50565b60008135905061261b816125f5565b92915050565b600060208284031215612637576126366124a0565b5b60006126458482850161260c565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561268857808201518184015260208101905061266d565b60008484015250505050565b6000601f19601f8301169050919050565b60006126b08261264e565b6126ba8185612659565b93506126ca81856020860161266a565b6126d381612694565b840191505092915050565b600060208201905081810360008301526126f881846126a5565b905092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61274282612694565b810181811067ffffffffffffffff821117156127615761276061270a565b5b80604052505050565b6000612774612496565b90506127808282612739565b919050565b600067ffffffffffffffff8211156127a05761279f61270a565b5b6127a982612694565b9050602081019050919050565b82818337600083830152505050565b60006127d86127d384612785565b61276a565b9050828152602081018484840111156127f4576127f3612705565b5b6127ff8482856127b6565b509392505050565b600082601f83011261281c5761281b612700565b5b813561282c8482602086016127c5565b91505092915050565b60006020828403121561284b5761284a6124a0565b5b600082013567ffffffffffffffff811115612869576128686124a5565b5b61287584828501612807565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60006128a58261287e565b6128af8185612889565b93506128bf81856020860161266a565b6128c881612694565b840191505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000819050919050565b612912816128ff565b82525050565b600060ff82169050919050565b61292e81612918565b82525050565b60006060830160008301518482036000860152612951828261289a565b91505060208301516129666020860182612909565b5060408301516129796040860182612925565b508091505092915050565b60006129908383612934565b905092915050565b6000602082019050919050565b60006129b0826128d3565b6129ba81856128de565b9350836020820285016129cc856128ef565b8060005b85811015612a0857848403895281516129e98582612984565b94506129f483612998565b925060208a019950506001810190506129d0565b50829750879550505050505092915050565b60006060830160008301518482036000860152612a37828261289a565b91505060208301518482036020860152612a5182826129a5565b91505060408301518482036040860152612a6b82826129a5565b9150508091505092915050565b60006020820190508181036000830152612a928184612a1a565b905092915050565b60008060008060808587031215612ab457612ab36124a0565b5b6000612ac2878288016124f3565b9450506020612ad3878288016124f3565b935050604085013567ffffffffffffffff811115612af457612af36124a5565b5b612b0087828801612807565b9250506060612b1187828801612567565b91505092959194509250565b60008060408385031215612b3457612b336124a0565b5b6000612b428582860161260c565b925050602083013567ffffffffffffffff811115612b6357612b626124a5565b5b612b6f85828601612807565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006040830160008301518482036000860152612bc2828261289a565b9150506020830151612bd76020860182612909565b508091505092915050565b6000612bee8383612ba5565b905092915050565b6000602082019050919050565b6000612c0e82612b79565b612c188185612b84565b935083602082028501612c2a85612b95565b8060005b85811015612c665784840389528151612c478582612be2565b9450612c5283612bf6565b925060208a01995050600181019050612c2e565b50829750879550505050505092915050565b60006020820190508181036000830152612c928184612c03565b905092915050565b612ca381612544565b82525050565b6000602082019050612cbe6000830184612c9a565b92915050565b60008060008060808587031215612cde57612cdd6124a0565b5b600085013567ffffffffffffffff811115612cfc57612cfb6124a5565b5b612d0887828801612807565b9450506020612d19878288016124f3565b9350506040612d2a87828801612567565b9250506060612d3b87828801612567565b91505092959194509250565b60008160070b9050919050565b612d5d81612d47565b82525050565b6000602082019050612d786000830184612d54565b92915050565b612d87816128ff565b8114612d9257600080fd5b50565b600081359050612da481612d7e565b92915050565b60008060008060808587031215612dc457612dc36124a0565b5b6000612dd2878288016124f3565b9450506020612de387828801612d95565b9350506040612df487828801612567565b9250506060612e0587828801612567565b91505092959194509250565b60008060408385031215612e2857612e276124a0565b5b6000612e368582860161260c565b9250506020612e478582860161252f565b9150509250929050565b600082825260208201905092915050565b6000612e6d826128d3565b612e778185612e51565b935083602082028501612e89856128ef565b8060005b85811015612ec55784840389528151612ea68582612984565b9450612eb183612998565b925060208a01995050600181019050612e8d565b50829750879550505050505092915050565b60006020820190508181036000830152612ef18184612e62565b905092915050565b600067ffffffffffffffff82169050919050565b612f1681612ef9565b8114612f2157600080fd5b50565b600081359050612f3381612f0d565b92915050565b600080fd5b600060a08284031215612f5457612f53612f39565b5b81905092915050565b60008060008060808587031215612f7757612f766124a0565b5b600085013567ffffffffffffffff811115612f9557612f946124a5565b5b612fa187828801612807565b9450506020612fb287828801612f24565b9350506040612fc387828801612f24565b925050606085013567ffffffffffffffff811115612fe457612fe36124a5565b5b612ff087828801612f3e565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61303181612ef9565b82525050565b60408201600082015161304d6000850182612909565b5060208201516130606020850182612925565b50505050565b60608201600082015161307c6000850182613028565b50602082015161308f6020850182613037565b50505050565b60006130a18383613066565b60608301905092915050565b6000602082019050919050565b60006130c582612ffc565b6130cf8185613007565b93506130da83613018565b8060005b8381101561310b5781516130f28882613095565b97506130fd836130ad565b9250506001810190506130de565b5085935050505092915050565b600082825260208201905092915050565b60006131348261264e565b61313e8185613118565b935061314e81856020860161266a565b61315781612694565b840191505092915050565b6000604083016000830151848203600086015261317f8282613129565b91505060208301516131946020860182613028565b508091505092915050565b600060408201905081810360008301526131b981856130ba565b905081810360208301526131cd8184613162565b90509392505050565b600080600080608085870312156131f0576131ef6124a0565b5b60006131fe878288016124f3565b945050602085013567ffffffffffffffff81111561321f5761321e6124a5565b5b61322b87828801612807565b935050604061323c87828801612567565b925050606061324d87828801612567565b91505092959194509250565b600080600060608486031215613272576132716124a0565b5b600084013567ffffffffffffffff8111156132905761328f6124a5565b5b61329c86828701612807565b93505060206132ad8682870161260c565b925050604084013567ffffffffffffffff8111156132ce576132cd6124a5565b5b6132da86828701612807565b9150509250925092565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061331c838361289a565b905092915050565b6000602082019050919050565b600061333c826132e4565b61334681856132ef565b93508360208202850161335885613300565b8060005b8581101561339457848403895281516133758582613310565b945061338083613324565b925060208a0199505060018101905061335c565b50829750879550505050505092915050565b600060208201905081810360008301526133c08184613331565b905092915050565b600080604083850312156133df576133de6124a0565b5b60006133ed8582860161260c565b92505060206133fe85828601612d95565b9150509250929050565b600082825260208201905092915050565b60006134248261287e565b61342e8185613408565b935061343e81856020860161266a565b61344781612694565b840191505092915050565b6000602082019050818103600083015261346c8184613419565b905092915050565b6000806040838503121561348b5761348a6124a0565b5b600083013567ffffffffffffffff8111156134a9576134a86124a5565b5b6134b585828601612807565b92505060206134c685828601612d95565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006040830160008301518482036000860152613519828261289a565b9150506020830151848203602086015261353382826129a5565b9150508091505092915050565b600061354c83836134fc565b905092915050565b6000602082019050919050565b600061356c826134d0565b61357681856134db565b935083602082028501613588856134ec565b8060005b858110156135c457848403895281516135a58582613540565b94506135b083613554565b925060208a0199505060018101905061358c565b50829750879550505050505092915050565b600060408201905081810360008301526135f08185613561565b905081810360208301526136048184612e62565b90509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061364782612d47565b9150677fffffffffffffff82036136615761366061360d565b5b600182019050919050565b600081905092915050565b50565b600061368760008361366c565b915061369282613677565b600082019050919050565b60006136a88261367a565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061370e602183613408565b9150613719826136b2565b604082019050919050565b6000602082019050818103600083015261373d81613701565b9050919050565b6000819050919050565b600061376961376461375f846124aa565b613744565b6124aa565b9050919050565b600061377b8261374e565b9050919050565b600061378d82613770565b9050919050565b61379d81613782565b82525050565b6137ac81612508565b82525050565b60006040820190506137c76000830185613794565b6137d460208301846137a3565b9392505050565b6000815190506137ea81612550565b92915050565b600060208284031215613806576138056124a0565b5b6000613814848285016137db565b91505092915050565b7f6661696c656420746f20636c61696d2072657761726473000000000000000000600082015250565b6000613853601783613408565b915061385e8261381d565b602082019050919050565b6000602082019050818103600083015261388281613846565b9050919050565b613892816125e3565b82525050565b60006020820190506138ad6000830184613889565b92915050565b60006138be8261264e565b6138c8818561366c565b93506138d881856020860161266a565b80840191505092915050565b60006138f082846138b3565b915081905092915050565b7f6661696c65642073746174696343616c6c20746f20707265636f6d70696c6500600082015250565b6000613931601f83613408565b915061393c826138fb565b602082019050919050565b6000602082019050818103600083015261396081613924565b9050919050565b600080fd5b600080fd5b600061398461397f84612785565b61276a565b9050828152602081018484840111156139a05761399f612705565b5b6139ab84828561266a565b509392505050565b600082601f8301126139c8576139c7612700565b5b81516139d8848260208601613971565b91505092915050565b600067ffffffffffffffff8211156139fc576139fb61270a565b5b602082029050602081019050919050565b600080fd5b600081519050613a2181612d7e565b92915050565b613a3081612918565b8114613a3b57600080fd5b50565b600081519050613a4d81613a27565b92915050565b600060608284031215613a6957613a68613967565b5b613a73606061276a565b9050600082015167ffffffffffffffff811115613a9357613a9261396c565b5b613a9f848285016139b3565b6000830152506020613ab384828501613a12565b6020830152506040613ac784828501613a3e565b60408301525092915050565b6000613ae6613ae1846139e1565b61276a565b90508083825260208201905060208402830185811115613b0957613b08613a0d565b5b835b81811015613b5057805167ffffffffffffffff811115613b2e57613b2d612700565b5b808601613b3b8982613a53565b85526020850194505050602081019050613b0b565b5050509392505050565b600082601f830112613b6f57613b6e612700565b5b8151613b7f848260208601613ad3565b91505092915050565b600060608284031215613b9e57613b9d613967565b5b613ba8606061276a565b9050600082015167ffffffffffffffff811115613bc857613bc761396c565b5b613bd4848285016139b3565b600083015250602082015167ffffffffffffffff811115613bf857613bf761396c565b5b613c0484828501613b5a565b602083015250604082015167ffffffffffffffff811115613c2857613c2761396c565b5b613c3484828501613b5a565b60408301525092915050565b600060208284031215613c5657613c556124a0565b5b600082015167ffffffffffffffff811115613c7457613c736124a5565b5b613c8084828501613b88565b91505092915050565b6000604082019050613c9e6000830185613794565b8181036020830152613cb08184613419565b90509392505050565b600067ffffffffffffffff821115613cd457613cd361270a565b5b602082029050602081019050919050565b600060408284031215613cfb57613cfa613967565b5b613d05604061276a565b9050600082015167ffffffffffffffff811115613d2557613d2461396c565b5b613d31848285016139b3565b6000830152506020613d4584828501613a12565b60208301525092915050565b6000613d64613d5f84613cb9565b61276a565b90508083825260208201905060208402830185811115613d8757613d86613a0d565b5b835b81811015613dce57805167ffffffffffffffff811115613dac57613dab612700565b5b808601613db98982613ce5565b85526020850194505050602081019050613d89565b5050509392505050565b600082601f830112613ded57613dec612700565b5b8151613dfd848260208601613d51565b91505092915050565b600060208284031215613e1c57613e1b6124a0565b5b600082015167ffffffffffffffff811115613e3a57613e396124a5565b5b613e4684828501613dd8565b91505092915050565b6000604082019050613e646000830185613889565b8181036020830152613e768184613419565b90509392505050565b7f6661696c65642064656c656761746543616c6c20746f20707265636f6d70696c60008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b6000613edb602183613408565b9150613ee682613e7f565b604082019050919050565b60006020820190508181036000830152613f0a81613ece565b9050919050565b613f1a816128ff565b82525050565b6000604082019050613f356000830185613794565b613f426020830184613f11565b9392505050565b6000604082019050613f5e6000830185613889565b613f6b60208301846137a3565b9392505050565b600060208284031215613f8857613f876124a0565b5b600082015167ffffffffffffffff811115613fa657613fa56124a5565b5b613fb284828501613b5a565b91505092915050565b613fc481612ef9565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613ff657613ff5613fd4565b5b83810192508235915060208301925067ffffffffffffffff82111561401e5761401d613fca565b5b60018202360383131561403457614033613fcf565b5b509250929050565b60006140488385613118565b93506140558385846127b6565b61405e83612694565b840190509392505050565b60006140786020840184612f24565b905092915050565b600061408f6020840184612567565b905092915050565b6140a081612544565b82525050565b600060a083016140b96000840184613fd9565b85830360008701526140cc83828461403c565b925050506140dd6020840184614069565b6140ea6020860182613028565b506140f86040840184614069565b6141056040860182613028565b506141136060840184614080565b6141206060860182614097565b5061412e6080840184614080565b61413b6080860182614097565b508091505092915050565b600060808201905081810360008301526141608187613419565b905061416f6020830186613fbb565b61417c6040830185613fbb565b818103606083015261418e81846140a6565b905095945050505050565b600067ffffffffffffffff8211156141b4576141b361270a565b5b602082029050602081019050919050565b6000815190506141d481612f0d565b92915050565b6000604082840312156141f0576141ef613967565b5b6141fa604061276a565b9050600061420a84828501613a12565b600083015250602061421e84828501613a3e565b60208301525092915050565b6000606082840312156142405761423f613967565b5b61424a604061276a565b9050600061425a848285016141c5565b600083015250602061426e848285016141da565b60208301525092915050565b600061428d61428884614199565b61276a565b905080838252602082019050606084028301858111156142b0576142af613a0d565b5b835b818110156142d957806142c5888261422a565b8452602084019350506060810190506142b2565b5050509392505050565b600082601f8301126142f8576142f7612700565b5b815161430884826020860161427a565b91505092915050565b600067ffffffffffffffff82111561432c5761432b61270a565b5b61433582612694565b9050602081019050919050565b600061435561435084614311565b61276a565b90508281526020810184848401111561437157614370612705565b5b61437c84828561266a565b509392505050565b600082601f83011261439957614398612700565b5b81516143a9848260208601614342565b91505092915050565b6000604082840312156143c8576143c7613967565b5b6143d2604061276a565b9050600082015167ffffffffffffffff8111156143f2576143f161396c565b5b6143fe84828501614384565b6000830152506020614412848285016141c5565b60208301525092915050565b60008060408385031215614435576144346124a0565b5b600083015167ffffffffffffffff811115614453576144526124a5565b5b61445f858286016142e3565b925050602083015167ffffffffffffffff8111156144805761447f6124a5565b5b61448c858286016143b2565b9150509250929050565b7f6661696c656420746f2073657420776974686472617720616464726573730000600082015250565b60006144cc601e83613408565b91506144d782614496565b602082019050919050565b600060208201905081810360008301526144fb816144bf565b9050919050565b600067ffffffffffffffff82111561451d5761451c61270a565b5b602082029050602081019050919050565b600061454161453c84614502565b61276a565b9050808382526020820190506020840283018581111561456457614563613a0d565b5b835b818110156145ab57805167ffffffffffffffff81111561458957614588612700565b5b80860161459689826139b3565b85526020850194505050602081019050614566565b5050509392505050565b600082601f8301126145ca576145c9612700565b5b81516145da84826020860161452e565b91505092915050565b6000602082840312156145f9576145f86124a0565b5b600082015167ffffffffffffffff811115614617576146166124a5565b5b614623848285016145b5565b91505092915050565b600061463782612d47565b915061464283612d47565b925082820190507fffffffffffffffffffffffffffffffffffffffffffffffff80000000000000008112677fffffffffffffff821317156146865761468561360d565b5b92915050565b60006040820190506146a16000830185613889565b6146ae6020830184613f11565b9392505050565b60006146c082612d47565b91506146cb83612d47565b92508282039050677fffffffffffffff81137fffffffffffffffffffffffffffffffffffffffffffffffff80000000000000008212171561470f5761470e61360d565b5b92915050565b60006020828403121561472b5761472a6124a0565b5b600082015167ffffffffffffffff811115614749576147486124a5565b5b614755848285016139b3565b91505092915050565b600081549050919050565b60008190508160005260206000209050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806147c557607f821691505b6020821081036147d8576147d761477e565b5b50919050565b60008190508160005260206000209050919050565b60008154614800816147ad565b61480a8186612889565b94506001821660008114614825576001811461483b5761486e565b60ff19831686528115156020028601935061486e565b614844856147de565b60005b8381101561486657815481890152600182019150602081019050614847565b808801955050505b50505092915050565b600061488383836147f3565b905092915050565b6000600182019050919050565b60006148a38261475e565b6148ad81856132ef565b9350836020820285016148bf85614769565b8060005b858110156148fa578484038952816148db8582614877565b94506148e68361488b565b925060208a019950506001810190506148c3565b50829750879550505050505092915050565b60006060820190506149216000830186613889565b61492e6020830185613f11565b81810360408301526149408184614898565b9050949350505050565b7f4661696c656420746f20617070726f7665207374616b696e67206d6574686f6460008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b60006149a6602183613408565b91506149b18261494a565b604082019050919050565b600060208201905081810360008301526149d581614999565b9050919050565b60006060820190506149f16000830186613889565b8181036020830152614a038185613419565b9050614a126040830184613f11565b949350505050565b600067ffffffffffffffff821115614a3557614a3461270a565b5b602082029050602081019050919050565b600060408284031215614a5c57614a5b613967565b5b614a66604061276a565b9050600082015167ffffffffffffffff811115614a8657614a8561396c565b5b614a92848285016139b3565b600083015250602082015167ffffffffffffffff811115614ab657614ab561396c565b5b614ac284828501613b5a565b60208301525092915050565b6000614ae1614adc84614a1a565b61276a565b90508083825260208201905060208402830185811115614b0457614b03613a0d565b5b835b81811015614b4b57805167ffffffffffffffff811115614b2957614b28612700565b5b808601614b368982614a46565b85526020850194505050602081019050614b06565b5050509392505050565b600082601f830112614b6a57614b69612700565b5b8151614b7a848260208601614ace565b91505092915050565b60008060408385031215614b9a57614b996124a0565b5b600083015167ffffffffffffffff811115614bb857614bb76124a5565b5b614bc485828601614b55565b925050602083015167ffffffffffffffff811115614be557614be46124a5565b5b614bf185828601613b5a565b915050925092905056fea2646970667358221220d99e4a023cfa00d35d739659c1ad9fb6f15b297affc8bff9a0b4c062ca1f348864736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/testutil/contracts/DistributionCaller.sol b/precompiles/testutil/contracts/DistributionCaller.sol index a3f55076..cf4f5512 100644 --- a/precompiles/testutil/contracts/DistributionCaller.sol +++ b/precompiles/testutil/contracts/DistributionCaller.sol @@ -2,9 +2,11 @@ pragma solidity >=0.8.17; import "../../distribution/DistributionI.sol" as distribution; +import "../../staking/StakingI.sol" as staking; import "../../common/Types.sol" as types; contract DistributionCaller { + string[] private delegateMethod = [staking.MSG_DELEGATE]; int64 public counter; function testSetWithdrawAddressFromContract( @@ -12,9 +14,9 @@ contract DistributionCaller { ) public returns (bool) { return distribution.DISTRIBUTION_CONTRACT.setWithdrawAddress( - address(this), - _withdrawAddr - ); + address(this), + _withdrawAddr + ); } function testWithdrawDelegatorRewardsFromContract( @@ -22,9 +24,9 @@ contract DistributionCaller { ) public returns (types.Coin[] memory) { return distribution.DISTRIBUTION_CONTRACT.withdrawDelegatorRewards( - address(this), - _valAddr - ); + address(this), + _valAddr + ); } function testSetWithdrawAddress( @@ -33,9 +35,9 @@ contract DistributionCaller { ) public returns (bool) { return distribution.DISTRIBUTION_CONTRACT.setWithdrawAddress( - _delAddr, - _withdrawAddr - ); + _delAddr, + _withdrawAddr + ); } function testWithdrawDelegatorRewardsWithTransfer( @@ -68,10 +70,10 @@ contract DistributionCaller { bool _after ) public { try - DistributionCaller(address(this)).withdrawDelegatorRewardsAndRevert( - _delAddr, - _valAddr - ) + DistributionCaller(address(this)).withdrawDelegatorRewardsAndRevert( + _delAddr, + _valAddr + ) {} catch {} if (_after) { counter++; @@ -86,9 +88,9 @@ contract DistributionCaller { ) public returns (types.Coin[] memory) { return distribution.DISTRIBUTION_CONTRACT.withdrawDelegatorRewards( - _delAddr, - _valAddr - ); + _delAddr, + _valAddr + ); } function withdrawDelegatorRewardsAndRevert( @@ -107,8 +109,8 @@ contract DistributionCaller { ) public returns (types.Coin[] memory) { return distribution.DISTRIBUTION_CONTRACT.withdrawValidatorCommission( - _valAddr - ); + _valAddr + ); } function testWithdrawValidatorCommissionWithTransfer( @@ -143,9 +145,9 @@ contract DistributionCaller { ) public returns (bool success) { return distribution.DISTRIBUTION_CONTRACT.claimRewards( - _delAddr, - _maxRetrieve - ); + _delAddr, + _maxRetrieve + ); } /// @dev testFundCommunityPool defines a method to allow an account to directly @@ -222,13 +224,34 @@ contract DistributionCaller { } } + /// @dev This function calls the staking precompile's delegate method. + /// @param _validatorAddr The validator address to delegate to. + /// @param _amount The amount to delegate. + function testDelegateFromContract( + string memory _validatorAddr, + uint256 _amount + ) public { + // Create approval + bool success = staking.STAKING_CONTRACT.approve( + address(this), + _amount, + delegateMethod + ); + require(success, "Failed to approve staking methods"); + staking.STAKING_CONTRACT.delegate( + address(this), + _validatorAddr, + _amount + ); + } + function getValidatorDistributionInfo( string memory _valAddr ) public view returns (distribution.ValidatorDistributionInfo memory) { return distribution.DISTRIBUTION_CONTRACT.validatorDistributionInfo( - _valAddr - ); + _valAddr + ); } function getValidatorOutstandingRewards( @@ -236,8 +259,8 @@ contract DistributionCaller { ) public view returns (types.DecCoin[] memory) { return distribution.DISTRIBUTION_CONTRACT.validatorOutstandingRewards( - _valAddr - ); + _valAddr + ); } function getValidatorCommission( @@ -252,20 +275,20 @@ contract DistributionCaller { uint64 _endingHeight, types.PageRequest calldata pageRequest ) - public - view - returns ( - distribution.ValidatorSlashEvent[] memory, - distribution.PageResponse memory - ) + public + view + returns ( + distribution.ValidatorSlashEvent[] memory, + distribution.PageResponse memory + ) { return distribution.DISTRIBUTION_CONTRACT.validatorSlashes( - _valAddr, - _startingHeight, - _endingHeight, - pageRequest - ); + _valAddr, + _startingHeight, + _endingHeight, + pageRequest + ); } function getDelegationRewards( @@ -274,20 +297,20 @@ contract DistributionCaller { ) public view returns (types.DecCoin[] memory) { return distribution.DISTRIBUTION_CONTRACT.delegationRewards( - _delAddr, - _valAddr - ); + _delAddr, + _valAddr + ); } function getDelegationTotalRewards( address _delAddr ) - public - view - returns ( - distribution.DelegationDelegatorReward[] memory rewards, - types.DecCoin[] memory total - ) + public + view + returns ( + distribution.DelegationDelegatorReward[] memory rewards, + types.DecCoin[] memory total + ) { return distribution.DISTRIBUTION_CONTRACT.delegationTotalRewards(_delAddr); @@ -304,8 +327,8 @@ contract DistributionCaller { ) public view returns (string memory) { return distribution.DISTRIBUTION_CONTRACT.delegatorWithdrawAddress( - _delAddr - ); + _delAddr + ); } // testRevertState allows sender to change the withdraw address @@ -323,9 +346,9 @@ contract DistributionCaller { return distribution.DISTRIBUTION_CONTRACT.withdrawDelegatorRewards( - _delAddr, - _valAddr - ); + _delAddr, + _valAddr + ); } function delegateCallSetWithdrawAddress( @@ -335,12 +358,12 @@ contract DistributionCaller { (bool success, ) = distribution .DISTRIBUTION_PRECOMPILE_ADDRESS .delegatecall( - abi.encodeWithSignature( - "setWithdrawAddress(address,string)", - _delAddr, - _withdrawAddr - ) - ); + abi.encodeWithSignature( + "setWithdrawAddress(address,string)", + _delAddr, + _withdrawAddr + ) + ); require(success, "failed delegateCall to precompile"); } @@ -351,12 +374,12 @@ contract DistributionCaller { (bool success, ) = distribution .DISTRIBUTION_PRECOMPILE_ADDRESS .staticcall( - abi.encodeWithSignature( - "setWithdrawAddress(address,string)", - _delAddr, - _withdrawAddr - ) - ); + abi.encodeWithSignature( + "setWithdrawAddress(address,string)", + _delAddr, + _withdrawAddr + ) + ); require(success, "failed staticCall to precompile"); } @@ -366,11 +389,11 @@ contract DistributionCaller { (bool success, bytes memory data) = distribution .DISTRIBUTION_PRECOMPILE_ADDRESS .staticcall( - abi.encodeWithSignature( - "delegatorWithdrawAddress(address)", - _delAddr - ) - ); + abi.encodeWithSignature( + "delegatorWithdrawAddress(address)", + _delAddr + ) + ); require(success, "failed staticCall to precompile"); return data; } diff --git a/precompiles/testutil/contracts/FlashLoan.json b/precompiles/testutil/contracts/FlashLoan.json index 383dc5f9..61f0888b 100644 --- a/precompiles/testutil/contracts/FlashLoan.json +++ b/precompiles/testutil/contracts/FlashLoan.json @@ -103,8 +103,8 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506113ea806100606000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80638da5cb5b146100515780638f5184301461006f578063ee52ad711461008b578063f12fae93146100bb575b600080fd5b6100596100eb565b6040516100669190610bdd565b60405180910390f35b61008960048036038101906100849190610db4565b61010f565b005b6100a560048036038101906100a09190610db4565b6101da565b6040516100b29190610e3e565b60405180910390f35b6100d560048036038101906100d09190610db4565b6107c9565b6040516100e29190610e3e565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8585856040518463ffffffff1660e01b815260040161015093929190610ee7565b6020604051808303816000875af115801561016f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101939190610f51565b9050806101d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101cc90610fca565b60405180910390fd5b600080fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461026b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102629061105c565b60405180910390fd5b6000849050828173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b81526004016102ac92919061107c565b602060405180830381865afa1580156102c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ed91906110ba565b101561032e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032590611133565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016103699190610bdd565b602060405180830381865afa158015610386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103aa91906110ba565b905060008273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330886040518463ffffffff1660e01b81526004016103eb93929190611153565b6020604051808303816000875af115801561040a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042e9190610f51565b905080610470576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610467906111fc565b60405180910390fd5b848261047c919061124b565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016104b59190610bdd565b602060405180830381865afa1580156104d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f691906110ba565b14610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d906112cb565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3388886040518463ffffffff1660e01b815260040161057593929190610ee7565b6020604051808303816000875af1158015610594573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b89190610f51565b9050806105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190610fca565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016106339190610bdd565b602060405180830381865afa158015610650573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067491906110ba565b91508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b81526004016106b19291906112eb565b6020604051808303816000875af11580156106d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f49190610f51565b5084826107019190611314565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161073a9190610bdd565b602060405180830381865afa158015610757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077b91906110ba565b146107bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b290611394565b60405180910390fd5b600193505050509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461085a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108519061105c565b60405180910390fd5b6000849050828173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b815260040161089b92919061107c565b602060405180830381865afa1580156108b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dc91906110ba565b101561091d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091490611133565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109589190610bdd565b602060405180830381865afa158015610975573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099991906110ba565b905060008273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330886040518463ffffffff1660e01b81526004016109da93929190611153565b6020604051808303816000875af11580156109f9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1d9190610f51565b905080610a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a56906111fc565b60405180910390fd5b8482610a6b919061124b565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610aa49190610bdd565b602060405180830381865afa158015610ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae591906110ba565b14610b25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1c906112cb565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16638f5184303388886040518463ffffffff1660e01b8152600401610b6293929190610ee7565b600060405180830381600087803b158015610b7c57600080fd5b505af1925050508015610b8d575060015b50600193505050509392505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610bc782610b9c565b9050919050565b610bd781610bbc565b82525050565b6000602082019050610bf26000830184610bce565b92915050565b6000604051905090565b600080fd5b600080fd5b610c1581610bbc565b8114610c2057600080fd5b50565b600081359050610c3281610c0c565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610c8b82610c42565b810181811067ffffffffffffffff82111715610caa57610ca9610c53565b5b80604052505050565b6000610cbd610bf8565b9050610cc98282610c82565b919050565b600067ffffffffffffffff821115610ce957610ce8610c53565b5b610cf282610c42565b9050602081019050919050565b82818337600083830152505050565b6000610d21610d1c84610cce565b610cb3565b905082815260208101848484011115610d3d57610d3c610c3d565b5b610d48848285610cff565b509392505050565b600082601f830112610d6557610d64610c38565b5b8135610d75848260208601610d0e565b91505092915050565b6000819050919050565b610d9181610d7e565b8114610d9c57600080fd5b50565b600081359050610dae81610d88565b92915050565b600080600060608486031215610dcd57610dcc610c02565b5b6000610ddb86828701610c23565b935050602084013567ffffffffffffffff811115610dfc57610dfb610c07565b5b610e0886828701610d50565b9250506040610e1986828701610d9f565b9150509250925092565b60008115159050919050565b610e3881610e23565b82525050565b6000602082019050610e536000830184610e2f565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610e93578082015181840152602081019050610e78565b60008484015250505050565b6000610eaa82610e59565b610eb48185610e64565b9350610ec4818560208601610e75565b610ecd81610c42565b840191505092915050565b610ee181610d7e565b82525050565b6000606082019050610efc6000830186610bce565b8181036020830152610f0e8185610e9f565b9050610f1d6040830184610ed8565b949350505050565b610f2e81610e23565b8114610f3957600080fd5b50565b600081519050610f4b81610f25565b92915050565b600060208284031215610f6757610f66610c02565b5b6000610f7584828501610f3c565b91505092915050565b7f6661696c656420746f2064656c65676174650000000000000000000000000000600082015250565b6000610fb4601283610e64565b9150610fbf82610f7e565b602082019050919050565b60006020820190508181036000830152610fe381610fa7565b9050919050565b7f4f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f60008201527f6e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000611046602183610e64565b915061105182610fea565b604082019050919050565b6000602082019050818103600083015261107581611039565b9050919050565b60006040820190506110916000830185610bce565b61109e6020830184610bce565b9392505050565b6000815190506110b481610d88565b92915050565b6000602082840312156110d0576110cf610c02565b5b60006110de848285016110a5565b91505092915050565b7f496e73756666696369656e7420616c6c6f77616e636500000000000000000000600082015250565b600061111d601683610e64565b9150611128826110e7565b602082019050919050565b6000602082019050818103600083015261114c81611110565b9050919050565b60006060820190506111686000830186610bce565b6111756020830185610bce565b6111826040830184610ed8565b949350505050565b7f4661696c656420746f207472616e7366657220746f6b656e7320666f7220666c60008201527f617368206c6f616e000000000000000000000000000000000000000000000000602082015250565b60006111e6602883610e64565b91506111f18261118a565b604082019050919050565b60006020820190508181036000830152611215816111d9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061125682610d7e565b915061126183610d7e565b92508282019050808211156112795761127861121c565b5b92915050565b7f466c617368206c6f616e206661696c6564000000000000000000000000000000600082015250565b60006112b5601183610e64565b91506112c08261127f565b602082019050919050565b600060208201905081810360008301526112e4816112a8565b9050919050565b60006040820190506113006000830185610bce565b61130d6020830184610ed8565b9392505050565b600061131f82610d7e565b915061132a83610d7e565b92508282039050818111156113425761134161121c565b5b92915050565b7f466c617368206c6f616e2072657061796d656e74206661696c65640000000000600082015250565b600061137e601b83610e64565b915061138982611348565b602082019050919050565b600060208201905081810360008301526113ad81611371565b905091905056fea26469706673582212208e1d52c36a32622af075b98cf15a237fb7323d1e2ace6e9cb8d762d107b21e9864736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80638da5cb5b146100515780638f5184301461006f578063ee52ad711461008b578063f12fae93146100bb575b600080fd5b6100596100eb565b6040516100669190610bdd565b60405180910390f35b61008960048036038101906100849190610db4565b61010f565b005b6100a560048036038101906100a09190610db4565b6101da565b6040516100b29190610e3e565b60405180910390f35b6100d560048036038101906100d09190610db4565b6107c9565b6040516100e29190610e3e565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8585856040518463ffffffff1660e01b815260040161015093929190610ee7565b6020604051808303816000875af115801561016f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101939190610f51565b9050806101d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101cc90610fca565b60405180910390fd5b600080fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461026b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102629061105c565b60405180910390fd5b6000849050828173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b81526004016102ac92919061107c565b602060405180830381865afa1580156102c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ed91906110ba565b101561032e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032590611133565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016103699190610bdd565b602060405180830381865afa158015610386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103aa91906110ba565b905060008273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330886040518463ffffffff1660e01b81526004016103eb93929190611153565b6020604051808303816000875af115801561040a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042e9190610f51565b905080610470576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610467906111fc565b60405180910390fd5b848261047c919061124b565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016104b59190610bdd565b602060405180830381865afa1580156104d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f691906110ba565b14610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d906112cb565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3388886040518463ffffffff1660e01b815260040161057593929190610ee7565b6020604051808303816000875af1158015610594573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b89190610f51565b9050806105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190610fca565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016106339190610bdd565b602060405180830381865afa158015610650573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067491906110ba565b91508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b81526004016106b19291906112eb565b6020604051808303816000875af11580156106d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f49190610f51565b5084826107019190611314565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161073a9190610bdd565b602060405180830381865afa158015610757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077b91906110ba565b146107bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b290611394565b60405180910390fd5b600193505050509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461085a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108519061105c565b60405180910390fd5b6000849050828173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b815260040161089b92919061107c565b602060405180830381865afa1580156108b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dc91906110ba565b101561091d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091490611133565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109589190610bdd565b602060405180830381865afa158015610975573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099991906110ba565b905060008273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330886040518463ffffffff1660e01b81526004016109da93929190611153565b6020604051808303816000875af11580156109f9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1d9190610f51565b905080610a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a56906111fc565b60405180910390fd5b8482610a6b919061124b565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610aa49190610bdd565b602060405180830381865afa158015610ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae591906110ba565b14610b25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1c906112cb565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16638f5184303388886040518463ffffffff1660e01b8152600401610b6293929190610ee7565b600060405180830381600087803b158015610b7c57600080fd5b505af1925050508015610b8d575060015b50600193505050509392505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610bc782610b9c565b9050919050565b610bd781610bbc565b82525050565b6000602082019050610bf26000830184610bce565b92915050565b6000604051905090565b600080fd5b600080fd5b610c1581610bbc565b8114610c2057600080fd5b50565b600081359050610c3281610c0c565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610c8b82610c42565b810181811067ffffffffffffffff82111715610caa57610ca9610c53565b5b80604052505050565b6000610cbd610bf8565b9050610cc98282610c82565b919050565b600067ffffffffffffffff821115610ce957610ce8610c53565b5b610cf282610c42565b9050602081019050919050565b82818337600083830152505050565b6000610d21610d1c84610cce565b610cb3565b905082815260208101848484011115610d3d57610d3c610c3d565b5b610d48848285610cff565b509392505050565b600082601f830112610d6557610d64610c38565b5b8135610d75848260208601610d0e565b91505092915050565b6000819050919050565b610d9181610d7e565b8114610d9c57600080fd5b50565b600081359050610dae81610d88565b92915050565b600080600060608486031215610dcd57610dcc610c02565b5b6000610ddb86828701610c23565b935050602084013567ffffffffffffffff811115610dfc57610dfb610c07565b5b610e0886828701610d50565b9250506040610e1986828701610d9f565b9150509250925092565b60008115159050919050565b610e3881610e23565b82525050565b6000602082019050610e536000830184610e2f565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610e93578082015181840152602081019050610e78565b60008484015250505050565b6000610eaa82610e59565b610eb48185610e64565b9350610ec4818560208601610e75565b610ecd81610c42565b840191505092915050565b610ee181610d7e565b82525050565b6000606082019050610efc6000830186610bce565b8181036020830152610f0e8185610e9f565b9050610f1d6040830184610ed8565b949350505050565b610f2e81610e23565b8114610f3957600080fd5b50565b600081519050610f4b81610f25565b92915050565b600060208284031215610f6757610f66610c02565b5b6000610f7584828501610f3c565b91505092915050565b7f6661696c656420746f2064656c65676174650000000000000000000000000000600082015250565b6000610fb4601283610e64565b9150610fbf82610f7e565b602082019050919050565b60006020820190508181036000830152610fe381610fa7565b9050919050565b7f4f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f60008201527f6e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000611046602183610e64565b915061105182610fea565b604082019050919050565b6000602082019050818103600083015261107581611039565b9050919050565b60006040820190506110916000830185610bce565b61109e6020830184610bce565b9392505050565b6000815190506110b481610d88565b92915050565b6000602082840312156110d0576110cf610c02565b5b60006110de848285016110a5565b91505092915050565b7f496e73756666696369656e7420616c6c6f77616e636500000000000000000000600082015250565b600061111d601683610e64565b9150611128826110e7565b602082019050919050565b6000602082019050818103600083015261114c81611110565b9050919050565b60006060820190506111686000830186610bce565b6111756020830185610bce565b6111826040830184610ed8565b949350505050565b7f4661696c656420746f207472616e7366657220746f6b656e7320666f7220666c60008201527f617368206c6f616e000000000000000000000000000000000000000000000000602082015250565b60006111e6602883610e64565b91506111f18261118a565b604082019050919050565b60006020820190508181036000830152611215816111d9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061125682610d7e565b915061126183610d7e565b92508282019050808211156112795761127861121c565b5b92915050565b7f466c617368206c6f616e206661696c6564000000000000000000000000000000600082015250565b60006112b5601183610e64565b91506112c08261127f565b602082019050919050565b600060208201905081810360008301526112e4816112a8565b9050919050565b60006040820190506113006000830185610bce565b61130d6020830184610ed8565b9392505050565b600061131f82610d7e565b915061132a83610d7e565b92508282039050818111156113425761134161121c565b5b92915050565b7f466c617368206c6f616e2072657061796d656e74206661696c65640000000000600082015250565b600061137e601b83610e64565b915061138982611348565b602082019050919050565b600060208201905081810360008301526113ad81611371565b905091905056fea26469706673582212208e1d52c36a32622af075b98cf15a237fb7323d1e2ace6e9cb8d762d107b21e9864736f6c63430008130033", + "bytecode": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506113ea806100606000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80638da5cb5b146100515780638f5184301461006f578063ee52ad711461008b578063f12fae93146100bb575b600080fd5b6100596100eb565b6040516100669190610bdd565b60405180910390f35b61008960048036038101906100849190610db4565b61010f565b005b6100a560048036038101906100a09190610db4565b6101da565b6040516100b29190610e3e565b60405180910390f35b6100d560048036038101906100d09190610db4565b6107c9565b6040516100e29190610e3e565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8585856040518463ffffffff1660e01b815260040161015093929190610ee7565b6020604051808303816000875af115801561016f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101939190610f51565b9050806101d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101cc90610fca565b60405180910390fd5b600080fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461026b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102629061105c565b60405180910390fd5b6000849050828173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b81526004016102ac92919061107c565b602060405180830381865afa1580156102c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ed91906110ba565b101561032e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032590611133565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016103699190610bdd565b602060405180830381865afa158015610386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103aa91906110ba565b905060008273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330886040518463ffffffff1660e01b81526004016103eb93929190611153565b6020604051808303816000875af115801561040a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042e9190610f51565b905080610470576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610467906111fc565b60405180910390fd5b848261047c919061124b565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016104b59190610bdd565b602060405180830381865afa1580156104d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f691906110ba565b14610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d906112cb565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3388886040518463ffffffff1660e01b815260040161057593929190610ee7565b6020604051808303816000875af1158015610594573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b89190610f51565b9050806105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190610fca565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016106339190610bdd565b602060405180830381865afa158015610650573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067491906110ba565b91508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b81526004016106b19291906112eb565b6020604051808303816000875af11580156106d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f49190610f51565b5084826107019190611314565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161073a9190610bdd565b602060405180830381865afa158015610757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077b91906110ba565b146107bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b290611394565b60405180910390fd5b600193505050509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461085a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108519061105c565b60405180910390fd5b6000849050828173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b815260040161089b92919061107c565b602060405180830381865afa1580156108b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dc91906110ba565b101561091d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091490611133565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109589190610bdd565b602060405180830381865afa158015610975573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099991906110ba565b905060008273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330886040518463ffffffff1660e01b81526004016109da93929190611153565b6020604051808303816000875af11580156109f9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1d9190610f51565b905080610a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a56906111fc565b60405180910390fd5b8482610a6b919061124b565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610aa49190610bdd565b602060405180830381865afa158015610ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae591906110ba565b14610b25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1c906112cb565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16638f5184303388886040518463ffffffff1660e01b8152600401610b6293929190610ee7565b600060405180830381600087803b158015610b7c57600080fd5b505af1925050508015610b8d575060015b50600193505050509392505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610bc782610b9c565b9050919050565b610bd781610bbc565b82525050565b6000602082019050610bf26000830184610bce565b92915050565b6000604051905090565b600080fd5b600080fd5b610c1581610bbc565b8114610c2057600080fd5b50565b600081359050610c3281610c0c565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610c8b82610c42565b810181811067ffffffffffffffff82111715610caa57610ca9610c53565b5b80604052505050565b6000610cbd610bf8565b9050610cc98282610c82565b919050565b600067ffffffffffffffff821115610ce957610ce8610c53565b5b610cf282610c42565b9050602081019050919050565b82818337600083830152505050565b6000610d21610d1c84610cce565b610cb3565b905082815260208101848484011115610d3d57610d3c610c3d565b5b610d48848285610cff565b509392505050565b600082601f830112610d6557610d64610c38565b5b8135610d75848260208601610d0e565b91505092915050565b6000819050919050565b610d9181610d7e565b8114610d9c57600080fd5b50565b600081359050610dae81610d88565b92915050565b600080600060608486031215610dcd57610dcc610c02565b5b6000610ddb86828701610c23565b935050602084013567ffffffffffffffff811115610dfc57610dfb610c07565b5b610e0886828701610d50565b9250506040610e1986828701610d9f565b9150509250925092565b60008115159050919050565b610e3881610e23565b82525050565b6000602082019050610e536000830184610e2f565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610e93578082015181840152602081019050610e78565b60008484015250505050565b6000610eaa82610e59565b610eb48185610e64565b9350610ec4818560208601610e75565b610ecd81610c42565b840191505092915050565b610ee181610d7e565b82525050565b6000606082019050610efc6000830186610bce565b8181036020830152610f0e8185610e9f565b9050610f1d6040830184610ed8565b949350505050565b610f2e81610e23565b8114610f3957600080fd5b50565b600081519050610f4b81610f25565b92915050565b600060208284031215610f6757610f66610c02565b5b6000610f7584828501610f3c565b91505092915050565b7f6661696c656420746f2064656c65676174650000000000000000000000000000600082015250565b6000610fb4601283610e64565b9150610fbf82610f7e565b602082019050919050565b60006020820190508181036000830152610fe381610fa7565b9050919050565b7f4f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f60008201527f6e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000611046602183610e64565b915061105182610fea565b604082019050919050565b6000602082019050818103600083015261107581611039565b9050919050565b60006040820190506110916000830185610bce565b61109e6020830184610bce565b9392505050565b6000815190506110b481610d88565b92915050565b6000602082840312156110d0576110cf610c02565b5b60006110de848285016110a5565b91505092915050565b7f496e73756666696369656e7420616c6c6f77616e636500000000000000000000600082015250565b600061111d601683610e64565b9150611128826110e7565b602082019050919050565b6000602082019050818103600083015261114c81611110565b9050919050565b60006060820190506111686000830186610bce565b6111756020830185610bce565b6111826040830184610ed8565b949350505050565b7f4661696c656420746f207472616e7366657220746f6b656e7320666f7220666c60008201527f617368206c6f616e000000000000000000000000000000000000000000000000602082015250565b60006111e6602883610e64565b91506111f18261118a565b604082019050919050565b60006020820190508181036000830152611215816111d9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061125682610d7e565b915061126183610d7e565b92508282019050808211156112795761127861121c565b5b92915050565b7f466c617368206c6f616e206661696c6564000000000000000000000000000000600082015250565b60006112b5601183610e64565b91506112c08261127f565b602082019050919050565b600060208201905081810360008301526112e4816112a8565b9050919050565b60006040820190506113006000830185610bce565b61130d6020830184610ed8565b9392505050565b600061131f82610d7e565b915061132a83610d7e565b92508282039050818111156113425761134161121c565b5b92915050565b7f466c617368206c6f616e2072657061796d656e74206661696c65640000000000600082015250565b600061137e601b83610e64565b915061138982611348565b602082019050919050565b600060208201905081810360008301526113ad81611371565b905091905056fea26469706673582212204bf47c7fb4f7232bbeafe5164c63233aef93cb82a349302eba0eea95c680729564736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80638da5cb5b146100515780638f5184301461006f578063ee52ad711461008b578063f12fae93146100bb575b600080fd5b6100596100eb565b6040516100669190610bdd565b60405180910390f35b61008960048036038101906100849190610db4565b61010f565b005b6100a560048036038101906100a09190610db4565b6101da565b6040516100b29190610e3e565b60405180910390f35b6100d560048036038101906100d09190610db4565b6107c9565b6040516100e29190610e3e565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061080073ffffffffffffffffffffffffffffffffffffffff166353266bbb8585856040518463ffffffff1660e01b815260040161015093929190610ee7565b6020604051808303816000875af115801561016f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101939190610f51565b9050806101d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101cc90610fca565b60405180910390fd5b600080fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461026b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102629061105c565b60405180910390fd5b6000849050828173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b81526004016102ac92919061107c565b602060405180830381865afa1580156102c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ed91906110ba565b101561032e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032590611133565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016103699190610bdd565b602060405180830381865afa158015610386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103aa91906110ba565b905060008273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330886040518463ffffffff1660e01b81526004016103eb93929190611153565b6020604051808303816000875af115801561040a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042e9190610f51565b905080610470576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610467906111fc565b60405180910390fd5b848261047c919061124b565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016104b59190610bdd565b602060405180830381865afa1580156104d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f691906110ba565b14610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d906112cb565b60405180910390fd5b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb3388886040518463ffffffff1660e01b815260040161057593929190610ee7565b6020604051808303816000875af1158015610594573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b89190610f51565b9050806105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190610fca565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016106339190610bdd565b602060405180830381865afa158015610650573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067491906110ba565b91508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b81526004016106b19291906112eb565b6020604051808303816000875af11580156106d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f49190610f51565b5084826107019190611314565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161073a9190610bdd565b602060405180830381865afa158015610757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077b91906110ba565b146107bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b290611394565b60405180910390fd5b600193505050509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461085a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108519061105c565b60405180910390fd5b6000849050828173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b815260040161089b92919061107c565b602060405180830381865afa1580156108b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dc91906110ba565b101561091d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091490611133565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109589190610bdd565b602060405180830381865afa158015610975573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099991906110ba565b905060008273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330886040518463ffffffff1660e01b81526004016109da93929190611153565b6020604051808303816000875af11580156109f9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1d9190610f51565b905080610a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a56906111fc565b60405180910390fd5b8482610a6b919061124b565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610aa49190610bdd565b602060405180830381865afa158015610ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae591906110ba565b14610b25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1c906112cb565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16638f5184303388886040518463ffffffff1660e01b8152600401610b6293929190610ee7565b600060405180830381600087803b158015610b7c57600080fd5b505af1925050508015610b8d575060015b50600193505050509392505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610bc782610b9c565b9050919050565b610bd781610bbc565b82525050565b6000602082019050610bf26000830184610bce565b92915050565b6000604051905090565b600080fd5b600080fd5b610c1581610bbc565b8114610c2057600080fd5b50565b600081359050610c3281610c0c565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610c8b82610c42565b810181811067ffffffffffffffff82111715610caa57610ca9610c53565b5b80604052505050565b6000610cbd610bf8565b9050610cc98282610c82565b919050565b600067ffffffffffffffff821115610ce957610ce8610c53565b5b610cf282610c42565b9050602081019050919050565b82818337600083830152505050565b6000610d21610d1c84610cce565b610cb3565b905082815260208101848484011115610d3d57610d3c610c3d565b5b610d48848285610cff565b509392505050565b600082601f830112610d6557610d64610c38565b5b8135610d75848260208601610d0e565b91505092915050565b6000819050919050565b610d9181610d7e565b8114610d9c57600080fd5b50565b600081359050610dae81610d88565b92915050565b600080600060608486031215610dcd57610dcc610c02565b5b6000610ddb86828701610c23565b935050602084013567ffffffffffffffff811115610dfc57610dfb610c07565b5b610e0886828701610d50565b9250506040610e1986828701610d9f565b9150509250925092565b60008115159050919050565b610e3881610e23565b82525050565b6000602082019050610e536000830184610e2f565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610e93578082015181840152602081019050610e78565b60008484015250505050565b6000610eaa82610e59565b610eb48185610e64565b9350610ec4818560208601610e75565b610ecd81610c42565b840191505092915050565b610ee181610d7e565b82525050565b6000606082019050610efc6000830186610bce565b8181036020830152610f0e8185610e9f565b9050610f1d6040830184610ed8565b949350505050565b610f2e81610e23565b8114610f3957600080fd5b50565b600081519050610f4b81610f25565b92915050565b600060208284031215610f6757610f66610c02565b5b6000610f7584828501610f3c565b91505092915050565b7f6661696c656420746f2064656c65676174650000000000000000000000000000600082015250565b6000610fb4601283610e64565b9150610fbf82610f7e565b602082019050919050565b60006020820190508181036000830152610fe381610fa7565b9050919050565b7f4f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f60008201527f6e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000611046602183610e64565b915061105182610fea565b604082019050919050565b6000602082019050818103600083015261107581611039565b9050919050565b60006040820190506110916000830185610bce565b61109e6020830184610bce565b9392505050565b6000815190506110b481610d88565b92915050565b6000602082840312156110d0576110cf610c02565b5b60006110de848285016110a5565b91505092915050565b7f496e73756666696369656e7420616c6c6f77616e636500000000000000000000600082015250565b600061111d601683610e64565b9150611128826110e7565b602082019050919050565b6000602082019050818103600083015261114c81611110565b9050919050565b60006060820190506111686000830186610bce565b6111756020830185610bce565b6111826040830184610ed8565b949350505050565b7f4661696c656420746f207472616e7366657220746f6b656e7320666f7220666c60008201527f617368206c6f616e000000000000000000000000000000000000000000000000602082015250565b60006111e6602883610e64565b91506111f18261118a565b604082019050919050565b60006020820190508181036000830152611215816111d9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061125682610d7e565b915061126183610d7e565b92508282019050808211156112795761127861121c565b5b92915050565b7f466c617368206c6f616e206661696c6564000000000000000000000000000000600082015250565b60006112b5601183610e64565b91506112c08261127f565b602082019050919050565b600060208201905081810360008301526112e4816112a8565b9050919050565b60006040820190506113006000830185610bce565b61130d6020830184610ed8565b9392505050565b600061131f82610d7e565b915061132a83610d7e565b92508282039050818111156113425761134161121c565b5b92915050565b7f466c617368206c6f616e2072657061796d656e74206661696c65640000000000600082015250565b600061137e601b83610e64565b915061138982611348565b602082019050919050565b600060208201905081810360008301526113ad81611371565b905091905056fea26469706673582212204bf47c7fb4f7232bbeafe5164c63233aef93cb82a349302eba0eea95c680729564736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/testutil/contracts/InterchainSender.json b/precompiles/testutil/contracts/InterchainSender.json index b07d6123..2d6d645a 100644 --- a/precompiles/testutil/contracts/InterchainSender.json +++ b/precompiles/testutil/contracts/InterchainSender.json @@ -558,8 +558,8 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b50613818806100206000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063a363df841161008c578063dfa10f3911610066578063dfa10f3914610210578063ee5766d914610241578063f298e7a814610271578063f3675f081461028d576100cf565b8063a363df8414610194578063b9672879146101c4578063c595699a146101e0576100cf565b80631dba685b146100d4578063424af9f6146100f057806361bc221a1461010c5780636fdf23cc1461012a5780637492bdd81461015a5780637a6185e11461018a575b600080fd5b6100ee60048036038101906100e99190611302565b6102a9565b005b61010a6004803603810190610105919061149c565b61070f565b005b6101146107e9565b6040516101219190611581565b60405180910390f35b610144600480360381019061013f9190611636565b6107fa565b6040516101519190611788565b60405180910390f35b610174600480360381019061016f9190611636565b610898565b6040516101819190611788565b60405180910390f35b610192610936565b005b6101ae60048036038101906101a991906117e1565b6109fb565b6040516101bb9190611bc4565b60405180910390f35b6101de60048036038101906101d99190611be6565b610a88565b005b6101fa60048036038101906101f59190611d20565b610d4b565b6040516102079190611db3565b60405180910390f35b61022a60048036038101906102259190611df9565b610dd5565b604051610238929190611fe9565b60405180910390f35b61025b60048036038101906102569190611d20565b610e69565b6040516102689190612064565b60405180910390f35b61028b6004803603810190610286919061149c565b610ef9565b005b6102a760048036038101906102a291906120dc565b610fd3565b005b82156103a65760008081819054906101000a900460070b809291906102cd90612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008973ffffffffffffffffffffffffffffffffffffffff16600f60405161031e906121b9565b60006040518083038185875af1925050503d806000811461035b576040519150601f19603f3d011682016040523d82523d6000602084013e610360565b606091505b50509050806103a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161039b90612240565b60405180910390fd5b505b60006040518060400160405280606467ffffffffffffffff168152602001606467ffffffffffffffff16815250905061080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a60028b610403919061228f565b8f8b8860006040518963ffffffff1660e01b815260040161042b9897969594939291906123bb565b6020604051808303816000875af115801561044a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046e919061247f565b50821561056c5760008081819054906101000a900460070b8092919061049390612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008a73ffffffffffffffffffffffffffffffffffffffff16600f6040516104e4906121b9565b60006040518083038185875af1925050503d8060008114610521576040519150601f19603f3d011682016040523d82523d6000602084013e610526565b606091505b505090508061056a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056190612240565b60405180910390fd5b505b61080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a60028b61059a919061228f565b8f8b8860006040518963ffffffff1660e01b81526004016105c29897969594939291906123bb565b6020604051808303816000875af11580156105e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610605919061247f565b5081156107035760008081819054906101000a900460070b8092919061062a90612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008a73ffffffffffffffffffffffffffffffffffffffff16600f60405161067b906121b9565b60006040518083038185875af1925050503d80600081146106b8576040519150601f19603f3d011682016040523d82523d6000602084013e6106bd565b606091505b5050905080610701576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f890612240565b60405180910390fd5b505b50505050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff166354de647b308a8a8a8a8a8a8a6040518963ffffffff1660e01b815260040161075a9897969594939291906124e8565b6020604051808303816000875af1158015610779573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079d919061256b565b9050806107df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d6906125e4565b60405180910390fd5b5050505050505050565b60008054906101000a900460070b81565b600061080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a8a308b8b8b8b6040518a63ffffffff1660e01b815260040161084799989796959493929190612604565b6020604051808303816000875af1158015610866573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088a919061247f565b905098975050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a8a338b8b8b8b6040518a63ffffffff1660e01b81526004016108e599989796959493929190612604565b6020604051808303816000875af1158015610904573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610928919061247f565b905098975050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff166374a8f103306040518263ffffffff1660e01b815260040161097391906126b5565b6020604051808303816000875af1158015610992573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b6919061256b565b9050806109f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ef9061271c565b60405180910390fd5b50565b606061080273ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff1660e01b8152600401610a3a92919061273c565b600060405180830381865afa158015610a57573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610a809190612c11565b905092915050565b8115610b855760008081819054906101000a900460070b80929190610aac90612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008973ffffffffffffffffffffffffffffffffffffffff16600f604051610afd906121b9565b60006040518083038185875af1925050503d8060008114610b3a576040519150601f19603f3d011682016040523d82523d6000602084013e610b3f565b606091505b5050905080610b83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7a90612240565b60405180910390fd5b505b60006040518060400160405280606467ffffffffffffffff168152602001606467ffffffffffffffff16815250905061080273ffffffffffffffffffffffffffffffffffffffff1663632535b9898989898e8a8860006040518963ffffffff1660e01b8152600401610bfe989796959493929190612c5a565b6020604051808303816000875af1158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c41919061247f565b508115610d3f5760008081819054906101000a900460070b80929190610c6690612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008a73ffffffffffffffffffffffffffffffffffffffff16600f604051610cb7906121b9565b60006040518083038185875af1925050503d8060008114610cf4576040519150601f19603f3d011682016040523d82523d6000602084013e610cf9565b606091505b5050905080610d3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3490612240565b60405180910390fd5b505b50505050505050505050565b606061080273ffffffffffffffffffffffffffffffffffffffff1663b5cb6e7d836040518263ffffffff1660e01b8152600401610d889190611db3565b600060405180830381865afa158015610da5573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610dce9190612d09565b9050919050565b6060610ddf61109e565b61080273ffffffffffffffffffffffffffffffffffffffff166322b6fad6846040518263ffffffff1660e01b8152600401610e1a9190612ece565b600060405180830381865afa158015610e37573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610e609190613166565b91509150915091565b610e716110c2565b61080273ffffffffffffffffffffffffffffffffffffffff1663a815cdd9836040518263ffffffff1660e01b8152600401610eac9190611db3565b600060405180830381865afa158015610ec9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610ef291906131de565b9050919050565b600061080273ffffffffffffffffffffffffffffffffffffffff1663b3f536ec308a8a8a8a8a8a8a6040518963ffffffff1660e01b8152600401610f449897969594939291906124e8565b6020604051808303816000875af1158015610f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f87919061256b565b905080610fc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc090613273565b60405180910390fd5b5050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff1663473c90c73085856040518463ffffffff1660e01b815260040161101493929190613744565b6020604051808303816000875af1158015611033573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611057919061256b565b905080611099576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611090906137c2565b60405180910390fd5b505050565b604051806040016040528060608152602001600067ffffffffffffffff1681525090565b604051806040016040528060608152602001606081525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061111b826110f0565b9050919050565b61112b81611110565b811461113657600080fd5b50565b60008135905061114881611122565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6111a182611158565b810181811067ffffffffffffffff821117156111c0576111bf611169565b5b80604052505050565b60006111d36110dc565b90506111df8282611198565b919050565b600067ffffffffffffffff8211156111ff576111fe611169565b5b61120882611158565b9050602081019050919050565b82818337600083830152505050565b6000611237611232846111e4565b6111c9565b90508281526020810184848401111561125357611252611153565b5b61125e848285611215565b509392505050565b600082601f83011261127b5761127a61114e565b5b813561128b848260208601611224565b91505092915050565b6000819050919050565b6112a781611294565b81146112b257600080fd5b50565b6000813590506112c48161129e565b92915050565b60008115159050919050565b6112df816112ca565b81146112ea57600080fd5b50565b6000813590506112fc816112d6565b92915050565b60008060008060008060008060006101208a8c031215611325576113246110e6565b5b60006113338c828d01611139565b99505060208a013567ffffffffffffffff811115611354576113536110eb565b5b6113608c828d01611266565b98505060408a013567ffffffffffffffff811115611381576113806110eb565b5b61138d8c828d01611266565b97505060608a013567ffffffffffffffff8111156113ae576113ad6110eb565b5b6113ba8c828d01611266565b96505060806113cb8c828d016112b5565b95505060a08a013567ffffffffffffffff8111156113ec576113eb6110eb565b5b6113f88c828d01611266565b94505060c06114098c828d016112ed565b93505060e061141a8c828d016112ed565b92505061010061142c8c828d016112ed565b9150509295985092959850929598565b600080fd5b600080fd5b60008083601f84011261145c5761145b61114e565b5b8235905067ffffffffffffffff8111156114795761147861143c565b5b60208301915083600182028301111561149557611494611441565b5b9250929050565b60008060008060008060006080888a0312156114bb576114ba6110e6565b5b600088013567ffffffffffffffff8111156114d9576114d86110eb565b5b6114e58a828b01611446565b9750975050602088013567ffffffffffffffff811115611508576115076110eb565b5b6115148a828b01611446565b9550955050604088013567ffffffffffffffff811115611537576115366110eb565b5b6115438a828b01611446565b935093505060606115568a828b016112b5565b91505092959891949750929550565b60008160070b9050919050565b61157b81611565565b82525050565b60006020820190506115966000830184611572565b92915050565b600080fd5b600080fd5b600067ffffffffffffffff82169050919050565b6115c3816115a6565b81146115ce57600080fd5b50565b6000813590506115e0816115ba565b92915050565b6000604082840312156115fc576115fb61159c565b5b61160660406111c9565b90506000611616848285016115d1565b600083015250602061162a848285016115d1565b60208301525092915050565b600080600080600080600080610120898b031215611657576116566110e6565b5b600089013567ffffffffffffffff811115611675576116746110eb565b5b6116818b828c01611266565b985050602089013567ffffffffffffffff8111156116a2576116a16110eb565b5b6116ae8b828c01611266565b975050604089013567ffffffffffffffff8111156116cf576116ce6110eb565b5b6116db8b828c01611266565b96505060606116ec8b828c016112b5565b955050608089013567ffffffffffffffff81111561170d5761170c6110eb565b5b6117198b828c01611266565b94505060a061172a8b828c016115e6565b93505060e061173b8b828c016115d1565b92505061010089013567ffffffffffffffff81111561175d5761175c6110eb565b5b6117698b828c01611266565b9150509295985092959890939650565b611782816115a6565b82525050565b600060208201905061179d6000830184611779565b92915050565b60006117ae826110f0565b9050919050565b6117be816117a3565b81146117c957600080fd5b50565b6000813590506117db816117b5565b92915050565b600080604083850312156117f8576117f76110e6565b5b6000611806858286016117cc565b9250506020611817858286016117cc565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561188757808201518184015260208101905061186c565b60008484015250505050565b600061189e8261184d565b6118a88185611858565b93506118b8818560208601611869565b6118c181611158565b840191505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61190181611294565b82525050565b600060408301600083015184820360008601526119248282611893565b915050602083015161193960208601826118f8565b508091505092915050565b60006119508383611907565b905092915050565b6000602082019050919050565b6000611970826118cc565b61197a81856118d7565b93508360208202850161198c856118e8565b8060005b858110156119c857848403895281516119a98582611944565b94506119b483611958565b925060208a01995050600181019050611990565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000611a128383611893565b905092915050565b6000602082019050919050565b6000611a32826119da565b611a3c81856119e5565b935083602082028501611a4e856119f6565b8060005b85811015611a8a5784840389528151611a6b8582611a06565b9450611a7683611a1a565b925060208a01995050600181019050611a52565b50829750879550505050505092915050565b600060a0830160008301518482036000860152611ab98282611893565b91505060208301518482036020860152611ad38282611893565b91505060408301518482036040860152611aed8282611965565b91505060608301518482036060860152611b078282611a27565b91505060808301518482036080860152611b218282611a27565b9150508091505092915050565b6000611b3a8383611a9c565b905092915050565b6000602082019050919050565b6000611b5a82611821565b611b64818561182c565b935083602082028501611b768561183d565b8060005b85811015611bb25784840389528151611b938582611b2e565b9450611b9e83611b42565b925060208a01995050600181019050611b7a565b50829750879550505050505092915050565b60006020820190508181036000830152611bde8184611b4f565b905092915050565b60008060008060008060008060006101208a8c031215611c0957611c086110e6565b5b6000611c178c828d01611139565b9950506020611c288c828d016117cc565b98505060408a013567ffffffffffffffff811115611c4957611c486110eb565b5b611c558c828d01611266565b97505060608a013567ffffffffffffffff811115611c7657611c756110eb565b5b611c828c828d01611266565b96505060808a013567ffffffffffffffff811115611ca357611ca26110eb565b5b611caf8c828d01611266565b95505060a0611cc08c828d016112b5565b94505060c08a013567ffffffffffffffff811115611ce157611ce06110eb565b5b611ced8c828d01611266565b93505060e0611cfe8c828d016112ed565b925050610100611d108c828d016112ed565b9150509295985092959850929598565b600060208284031215611d3657611d356110e6565b5b600082013567ffffffffffffffff811115611d5457611d536110eb565b5b611d6084828501611266565b91505092915050565b600082825260208201905092915050565b6000611d858261184d565b611d8f8185611d69565b9350611d9f818560208601611869565b611da881611158565b840191505092915050565b60006020820190508181036000830152611dcd8184611d7a565b905092915050565b600080fd5b600060a08284031215611df057611def611dd5565b5b81905092915050565b600060208284031215611e0f57611e0e6110e6565b5b600082013567ffffffffffffffff811115611e2d57611e2c6110eb565b5b611e3984828501611dda565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006040830160008301518482036000860152611e8b8282611893565b91505060208301518482036020860152611ea58282611893565b9150508091505092915050565b6000611ebe8383611e6e565b905092915050565b6000602082019050919050565b6000611ede82611e42565b611ee88185611e4d565b935083602082028501611efa85611e5e565b8060005b85811015611f365784840389528151611f178582611eb2565b9450611f2283611ec6565b925060208a01995050600181019050611efe565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b6000611f6f82611f48565b611f798185611f53565b9350611f89818560208601611869565b611f9281611158565b840191505092915050565b611fa6816115a6565b82525050565b60006040830160008301518482036000860152611fc98282611f64565b9150506020830151611fde6020860182611f9d565b508091505092915050565b600060408201905081810360008301526120038185611ed3565b905081810360208301526120178184611fac565b90509392505050565b6000604083016000830151848203600086015261203d8282611893565b915050602083015184820360208601526120578282611893565b9150508091505092915050565b6000602082019050818103600083015261207e8184612020565b905092915050565b60008083601f84011261209c5761209b61114e565b5b8235905067ffffffffffffffff8111156120b9576120b861143c565b5b6020830191508360208202830111156120d5576120d4611441565b5b9250929050565b600080602083850312156120f3576120f26110e6565b5b600083013567ffffffffffffffff811115612111576121106110eb565b5b61211d85828601612086565b92509250509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061216382611565565b9150677fffffffffffffff820361217d5761217c612129565b5b600182019050919050565b600081905092915050565b50565b60006121a3600083612188565b91506121ae82612193565b600082019050919050565b60006121c482612196565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061222a602183611d69565b9150612235826121ce565b604082019050919050565b600060208201905081810360008301526122598161221d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061229a82611294565b91506122a583611294565b9250826122b5576122b4612260565b5b828204905092915050565b6122c981611294565b82525050565b6000819050919050565b60006122f46122ef6122ea846110f0565b6122cf565b6110f0565b9050919050565b6000612306826122d9565b9050919050565b6000612318826122fb565b9050919050565b6123288161230d565b82525050565b6040820160008201516123446000850182611f9d565b5060208201516123576020850182611f9d565b50505050565b6000819050919050565b600061238261237d6123788461235d565b6122cf565b6115a6565b9050919050565b61239281612367565b82525050565b60006123a5600083611d69565b91506123b082612193565b600082019050919050565b60006101408201905081810360008301526123d6818b611d7a565b905081810360208301526123ea818a611d7a565b905081810360408301526123fe8189611d7a565b905061240d60608301886122c0565b61241a608083018761231f565b81810360a083015261242c8186611d7a565b905061243b60c083018561232e565b612449610100830184612389565b81810361012083015261245b81612398565b90509998505050505050505050565b600081519050612479816115ba565b92915050565b600060208284031215612495576124946110e6565b5b60006124a38482850161246a565b91505092915050565b6124b5816117a3565b82525050565b60006124c78385611d69565b93506124d4838584611215565b6124dd83611158565b840190509392505050565b600060a0820190506124fd600083018b6124ac565b818103602083015261251081898b6124bb565b905081810360408301526125258187896124bb565b9050818103606083015261253a8185876124bb565b905061254960808301846122c0565b9998505050505050505050565b600081519050612565816112d6565b92915050565b600060208284031215612581576125806110e6565b5b600061258f84828501612556565b91505092915050565b7f4661696c656420746f20696e63726561736520616c6c6f77616e636500000000600082015250565b60006125ce601c83611d69565b91506125d982612598565b602082019050919050565b600060208201905081810360008301526125fd816125c1565b9050919050565b600061014082019050818103600083015261261f818c611d7a565b90508181036020830152612633818b611d7a565b90508181036040830152612647818a611d7a565b905061265660608301896122c0565b61266360808301886124ac565b81810360a08301526126758187611d7a565b905061268460c083018661232e565b612692610100830185611779565b8181036101208301526126a58184611d7a565b90509a9950505050505050505050565b60006020820190506126ca60008301846124ac565b92915050565b7f4661696c656420746f207265766f6b6520617070726f76616c00000000000000600082015250565b6000612706601983611d69565b9150612711826126d0565b602082019050919050565b60006020820190508181036000830152612735816126f9565b9050919050565b600060408201905061275160008301856124ac565b61275e60208301846124ac565b9392505050565b600067ffffffffffffffff8211156127805761277f611169565b5b602082029050602081019050919050565b60006127a461279f846111e4565b6111c9565b9050828152602081018484840111156127c0576127bf611153565b5b6127cb848285611869565b509392505050565b600082601f8301126127e8576127e761114e565b5b81516127f8848260208601612791565b91505092915050565b600067ffffffffffffffff82111561281c5761281b611169565b5b602082029050602081019050919050565b60008151905061283c8161129e565b92915050565b6000604082840312156128585761285761159c565b5b61286260406111c9565b9050600082015167ffffffffffffffff811115612882576128816115a1565b5b61288e848285016127d3565b60008301525060206128a28482850161282d565b60208301525092915050565b60006128c16128bc84612801565b6111c9565b905080838252602082019050602084028301858111156128e4576128e3611441565b5b835b8181101561292b57805167ffffffffffffffff8111156129095761290861114e565b5b8086016129168982612842565b855260208501945050506020810190506128e6565b5050509392505050565b600082601f83011261294a5761294961114e565b5b815161295a8482602086016128ae565b91505092915050565b600067ffffffffffffffff82111561297e5761297d611169565b5b602082029050602081019050919050565b60006129a261299d84612963565b6111c9565b905080838252602082019050602084028301858111156129c5576129c4611441565b5b835b81811015612a0c57805167ffffffffffffffff8111156129ea576129e961114e565b5b8086016129f789826127d3565b855260208501945050506020810190506129c7565b5050509392505050565b600082601f830112612a2b57612a2a61114e565b5b8151612a3b84826020860161298f565b91505092915050565b600060a08284031215612a5a57612a5961159c565b5b612a6460a06111c9565b9050600082015167ffffffffffffffff811115612a8457612a836115a1565b5b612a90848285016127d3565b600083015250602082015167ffffffffffffffff811115612ab457612ab36115a1565b5b612ac0848285016127d3565b602083015250604082015167ffffffffffffffff811115612ae457612ae36115a1565b5b612af084828501612935565b604083015250606082015167ffffffffffffffff811115612b1457612b136115a1565b5b612b2084828501612a16565b606083015250608082015167ffffffffffffffff811115612b4457612b436115a1565b5b612b5084828501612a16565b60808301525092915050565b6000612b6f612b6a84612765565b6111c9565b90508083825260208201905060208402830185811115612b9257612b91611441565b5b835b81811015612bd957805167ffffffffffffffff811115612bb757612bb661114e565b5b808601612bc48982612a44565b85526020850194505050602081019050612b94565b5050509392505050565b600082601f830112612bf857612bf761114e565b5b8151612c08848260208601612b5c565b91505092915050565b600060208284031215612c2757612c266110e6565b5b600082015167ffffffffffffffff811115612c4557612c446110eb565b5b612c5184828501612be3565b91505092915050565b6000610140820190508181036000830152612c75818b611d7a565b90508181036020830152612c89818a611d7a565b90508181036040830152612c9d8189611d7a565b9050612cac60608301886122c0565b612cb960808301876124ac565b81810360a0830152612ccb8186611d7a565b9050612cda60c083018561232e565b612ce8610100830184612389565b818103610120830152612cfa81612398565b90509998505050505050505050565b600060208284031215612d1f57612d1e6110e6565b5b600082015167ffffffffffffffff811115612d3d57612d3c6110eb565b5b612d49848285016127d3565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112612d7e57612d7d612d5c565b5b83810192508235915060208301925067ffffffffffffffff821115612da657612da5612d52565b5b600182023603831315612dbc57612dbb612d57565b5b509250929050565b6000612dd08385611f53565b9350612ddd838584611215565b612de683611158565b840190509392505050565b6000612e0060208401846115d1565b905092915050565b6000612e1760208401846112ed565b905092915050565b612e28816112ca565b82525050565b600060a08301612e416000840184612d61565b8583036000870152612e54838284612dc4565b92505050612e656020840184612df1565b612e726020860182611f9d565b50612e806040840184612df1565b612e8d6040860182611f9d565b50612e9b6060840184612e08565b612ea86060860182612e1f565b50612eb66080840184612e08565b612ec36080860182612e1f565b508091505092915050565b60006020820190508181036000830152612ee88184612e2e565b905092915050565b600067ffffffffffffffff821115612f0b57612f0a611169565b5b602082029050602081019050919050565b600060408284031215612f3257612f3161159c565b5b612f3c60406111c9565b9050600082015167ffffffffffffffff811115612f5c57612f5b6115a1565b5b612f68848285016127d3565b600083015250602082015167ffffffffffffffff811115612f8c57612f8b6115a1565b5b612f98848285016127d3565b60208301525092915050565b6000612fb7612fb284612ef0565b6111c9565b90508083825260208201905060208402830185811115612fda57612fd9611441565b5b835b8181101561302157805167ffffffffffffffff811115612fff57612ffe61114e565b5b80860161300c8982612f1c565b85526020850194505050602081019050612fdc565b5050509392505050565b600082601f8301126130405761303f61114e565b5b8151613050848260208601612fa4565b91505092915050565b600067ffffffffffffffff82111561307457613073611169565b5b61307d82611158565b9050602081019050919050565b600061309d61309884613059565b6111c9565b9050828152602081018484840111156130b9576130b8611153565b5b6130c4848285611869565b509392505050565b600082601f8301126130e1576130e061114e565b5b81516130f184826020860161308a565b91505092915050565b6000604082840312156131105761310f61159c565b5b61311a60406111c9565b9050600082015167ffffffffffffffff81111561313a576131396115a1565b5b613146848285016130cc565b600083015250602061315a8482850161246a565b60208301525092915050565b6000806040838503121561317d5761317c6110e6565b5b600083015167ffffffffffffffff81111561319b5761319a6110eb565b5b6131a78582860161302b565b925050602083015167ffffffffffffffff8111156131c8576131c76110eb565b5b6131d4858286016130fa565b9150509250929050565b6000602082840312156131f4576131f36110e6565b5b600082015167ffffffffffffffff811115613212576132116110eb565b5b61321e84828501612f1c565b91505092915050565b7f4661696c656420746f20646563726561736520616c6c6f77616e636500000000600082015250565b600061325d601c83611d69565b915061326882613227565b602082019050919050565b6000602082019050818103600083015261328c81613250565b9050919050565b6000819050919050565b600080833560016020038436030381126132ba576132b9612d5c565b5b83810192508235915060208301925067ffffffffffffffff8211156132e2576132e1612d52565b5b6001820236038313156132f8576132f7612d57565b5b509250929050565b600061330c8385611858565b9350613319838584611215565b61332283611158565b840190509392505050565b6000808335600160200384360303811261334a57613349612d5c565b5b83810192508235915060208301925067ffffffffffffffff82111561337257613371612d52565b5b60208202360383131561338857613387612d57565b5b509250929050565b6000819050919050565b60006133a960208401846112b5565b905092915050565b6000604083016133c4600084018461329d565b85830360008701526133d7838284613300565b925050506133e8602084018461339a565b6133f560208601826118f8565b508091505092915050565b600061340c83836133b1565b905092915050565b6000823560016040038336030381126134305761342f612d5c565b5b82810191505092915050565b6000602082019050919050565b600061345583856118d7565b93508360208402850161346784613390565b8060005b878110156134ab5784840389526134828284613414565b61348c8582613400565b94506134978361343c565b925060208a0199505060018101905061346b565b50829750879450505050509392505050565b600080833560016020038436030381126134da576134d9612d5c565b5b83810192508235915060208301925067ffffffffffffffff82111561350257613501612d52565b5b60208202360383131561351857613517612d57565b5b509250929050565b6000819050919050565b6000613537848484613300565b90509392505050565b6000602082019050919050565b600061355983856119e5565b93508360208402850161356b84613520565b8060005b878110156135b1578484038952613586828461329d565b61359186828461352a565b955061359c84613540565b935060208b019a50505060018101905061356f565b50829750879450505050509392505050565b600060a083016135d6600084018461329d565b85830360008701526135e9838284613300565b925050506135fa602084018461329d565b858303602087015261360d838284613300565b9250505061361e604084018461332d565b8583036040870152613631838284613449565b9250505061364260608401846134bd565b858303606087015261365583828461354d565b9250505061366660808401846134bd565b858303608087015261367983828461354d565b925050508091505092915050565b600061369383836135c3565b905092915050565b60008235600160a0038336030381126136b7576136b6612d5c565b5b82810191505092915050565b6000602082019050919050565b60006136dc838561182c565b9350836020840285016136ee84613293565b8060005b87811015613732578484038952613709828461369b565b6137138582613687565b945061371e836136c3565b925060208a019950506001810190506136f2565b50829750879450505050509392505050565b600060408201905061375960008301866124ac565b818103602083015261376c8184866136d0565b9050949350505050565b7f4661696c656420746f20706572666f726d20617070726f76616c000000000000600082015250565b60006137ac601a83611d69565b91506137b782613776565b602082019050919050565b600060208201905081810360008301526137db8161379f565b905091905056fea2646970667358221220bcb453fc471282c5300ef2cce92af3966ecb2c9f9fc8ddec271f9520efa16a1164736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063a363df841161008c578063dfa10f3911610066578063dfa10f3914610210578063ee5766d914610241578063f298e7a814610271578063f3675f081461028d576100cf565b8063a363df8414610194578063b9672879146101c4578063c595699a146101e0576100cf565b80631dba685b146100d4578063424af9f6146100f057806361bc221a1461010c5780636fdf23cc1461012a5780637492bdd81461015a5780637a6185e11461018a575b600080fd5b6100ee60048036038101906100e99190611302565b6102a9565b005b61010a6004803603810190610105919061149c565b61070f565b005b6101146107e9565b6040516101219190611581565b60405180910390f35b610144600480360381019061013f9190611636565b6107fa565b6040516101519190611788565b60405180910390f35b610174600480360381019061016f9190611636565b610898565b6040516101819190611788565b60405180910390f35b610192610936565b005b6101ae60048036038101906101a991906117e1565b6109fb565b6040516101bb9190611bc4565b60405180910390f35b6101de60048036038101906101d99190611be6565b610a88565b005b6101fa60048036038101906101f59190611d20565b610d4b565b6040516102079190611db3565b60405180910390f35b61022a60048036038101906102259190611df9565b610dd5565b604051610238929190611fe9565b60405180910390f35b61025b60048036038101906102569190611d20565b610e69565b6040516102689190612064565b60405180910390f35b61028b6004803603810190610286919061149c565b610ef9565b005b6102a760048036038101906102a291906120dc565b610fd3565b005b82156103a65760008081819054906101000a900460070b809291906102cd90612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008973ffffffffffffffffffffffffffffffffffffffff16600f60405161031e906121b9565b60006040518083038185875af1925050503d806000811461035b576040519150601f19603f3d011682016040523d82523d6000602084013e610360565b606091505b50509050806103a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161039b90612240565b60405180910390fd5b505b60006040518060400160405280606467ffffffffffffffff168152602001606467ffffffffffffffff16815250905061080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a60028b610403919061228f565b8f8b8860006040518963ffffffff1660e01b815260040161042b9897969594939291906123bb565b6020604051808303816000875af115801561044a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046e919061247f565b50821561056c5760008081819054906101000a900460070b8092919061049390612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008a73ffffffffffffffffffffffffffffffffffffffff16600f6040516104e4906121b9565b60006040518083038185875af1925050503d8060008114610521576040519150601f19603f3d011682016040523d82523d6000602084013e610526565b606091505b505090508061056a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056190612240565b60405180910390fd5b505b61080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a60028b61059a919061228f565b8f8b8860006040518963ffffffff1660e01b81526004016105c29897969594939291906123bb565b6020604051808303816000875af11580156105e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610605919061247f565b5081156107035760008081819054906101000a900460070b8092919061062a90612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008a73ffffffffffffffffffffffffffffffffffffffff16600f60405161067b906121b9565b60006040518083038185875af1925050503d80600081146106b8576040519150601f19603f3d011682016040523d82523d6000602084013e6106bd565b606091505b5050905080610701576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f890612240565b60405180910390fd5b505b50505050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff166354de647b308a8a8a8a8a8a8a6040518963ffffffff1660e01b815260040161075a9897969594939291906124e8565b6020604051808303816000875af1158015610779573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079d919061256b565b9050806107df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d6906125e4565b60405180910390fd5b5050505050505050565b60008054906101000a900460070b81565b600061080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a8a308b8b8b8b6040518a63ffffffff1660e01b815260040161084799989796959493929190612604565b6020604051808303816000875af1158015610866573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088a919061247f565b905098975050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a8a338b8b8b8b6040518a63ffffffff1660e01b81526004016108e599989796959493929190612604565b6020604051808303816000875af1158015610904573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610928919061247f565b905098975050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff166374a8f103306040518263ffffffff1660e01b815260040161097391906126b5565b6020604051808303816000875af1158015610992573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b6919061256b565b9050806109f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ef9061271c565b60405180910390fd5b50565b606061080273ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff1660e01b8152600401610a3a92919061273c565b600060405180830381865afa158015610a57573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610a809190612c11565b905092915050565b8115610b855760008081819054906101000a900460070b80929190610aac90612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008973ffffffffffffffffffffffffffffffffffffffff16600f604051610afd906121b9565b60006040518083038185875af1925050503d8060008114610b3a576040519150601f19603f3d011682016040523d82523d6000602084013e610b3f565b606091505b5050905080610b83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7a90612240565b60405180910390fd5b505b60006040518060400160405280606467ffffffffffffffff168152602001606467ffffffffffffffff16815250905061080273ffffffffffffffffffffffffffffffffffffffff1663632535b9898989898e8a8860006040518963ffffffff1660e01b8152600401610bfe989796959493929190612c5a565b6020604051808303816000875af1158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c41919061247f565b508115610d3f5760008081819054906101000a900460070b80929190610c6690612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008a73ffffffffffffffffffffffffffffffffffffffff16600f604051610cb7906121b9565b60006040518083038185875af1925050503d8060008114610cf4576040519150601f19603f3d011682016040523d82523d6000602084013e610cf9565b606091505b5050905080610d3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3490612240565b60405180910390fd5b505b50505050505050505050565b606061080273ffffffffffffffffffffffffffffffffffffffff1663b5cb6e7d836040518263ffffffff1660e01b8152600401610d889190611db3565b600060405180830381865afa158015610da5573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610dce9190612d09565b9050919050565b6060610ddf61109e565b61080273ffffffffffffffffffffffffffffffffffffffff166322b6fad6846040518263ffffffff1660e01b8152600401610e1a9190612ece565b600060405180830381865afa158015610e37573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610e609190613166565b91509150915091565b610e716110c2565b61080273ffffffffffffffffffffffffffffffffffffffff1663a815cdd9836040518263ffffffff1660e01b8152600401610eac9190611db3565b600060405180830381865afa158015610ec9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610ef291906131de565b9050919050565b600061080273ffffffffffffffffffffffffffffffffffffffff1663b3f536ec308a8a8a8a8a8a8a6040518963ffffffff1660e01b8152600401610f449897969594939291906124e8565b6020604051808303816000875af1158015610f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f87919061256b565b905080610fc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc090613273565b60405180910390fd5b5050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff1663473c90c73085856040518463ffffffff1660e01b815260040161101493929190613744565b6020604051808303816000875af1158015611033573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611057919061256b565b905080611099576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611090906137c2565b60405180910390fd5b505050565b604051806040016040528060608152602001600067ffffffffffffffff1681525090565b604051806040016040528060608152602001606081525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061111b826110f0565b9050919050565b61112b81611110565b811461113657600080fd5b50565b60008135905061114881611122565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6111a182611158565b810181811067ffffffffffffffff821117156111c0576111bf611169565b5b80604052505050565b60006111d36110dc565b90506111df8282611198565b919050565b600067ffffffffffffffff8211156111ff576111fe611169565b5b61120882611158565b9050602081019050919050565b82818337600083830152505050565b6000611237611232846111e4565b6111c9565b90508281526020810184848401111561125357611252611153565b5b61125e848285611215565b509392505050565b600082601f83011261127b5761127a61114e565b5b813561128b848260208601611224565b91505092915050565b6000819050919050565b6112a781611294565b81146112b257600080fd5b50565b6000813590506112c48161129e565b92915050565b60008115159050919050565b6112df816112ca565b81146112ea57600080fd5b50565b6000813590506112fc816112d6565b92915050565b60008060008060008060008060006101208a8c031215611325576113246110e6565b5b60006113338c828d01611139565b99505060208a013567ffffffffffffffff811115611354576113536110eb565b5b6113608c828d01611266565b98505060408a013567ffffffffffffffff811115611381576113806110eb565b5b61138d8c828d01611266565b97505060608a013567ffffffffffffffff8111156113ae576113ad6110eb565b5b6113ba8c828d01611266565b96505060806113cb8c828d016112b5565b95505060a08a013567ffffffffffffffff8111156113ec576113eb6110eb565b5b6113f88c828d01611266565b94505060c06114098c828d016112ed565b93505060e061141a8c828d016112ed565b92505061010061142c8c828d016112ed565b9150509295985092959850929598565b600080fd5b600080fd5b60008083601f84011261145c5761145b61114e565b5b8235905067ffffffffffffffff8111156114795761147861143c565b5b60208301915083600182028301111561149557611494611441565b5b9250929050565b60008060008060008060006080888a0312156114bb576114ba6110e6565b5b600088013567ffffffffffffffff8111156114d9576114d86110eb565b5b6114e58a828b01611446565b9750975050602088013567ffffffffffffffff811115611508576115076110eb565b5b6115148a828b01611446565b9550955050604088013567ffffffffffffffff811115611537576115366110eb565b5b6115438a828b01611446565b935093505060606115568a828b016112b5565b91505092959891949750929550565b60008160070b9050919050565b61157b81611565565b82525050565b60006020820190506115966000830184611572565b92915050565b600080fd5b600080fd5b600067ffffffffffffffff82169050919050565b6115c3816115a6565b81146115ce57600080fd5b50565b6000813590506115e0816115ba565b92915050565b6000604082840312156115fc576115fb61159c565b5b61160660406111c9565b90506000611616848285016115d1565b600083015250602061162a848285016115d1565b60208301525092915050565b600080600080600080600080610120898b031215611657576116566110e6565b5b600089013567ffffffffffffffff811115611675576116746110eb565b5b6116818b828c01611266565b985050602089013567ffffffffffffffff8111156116a2576116a16110eb565b5b6116ae8b828c01611266565b975050604089013567ffffffffffffffff8111156116cf576116ce6110eb565b5b6116db8b828c01611266565b96505060606116ec8b828c016112b5565b955050608089013567ffffffffffffffff81111561170d5761170c6110eb565b5b6117198b828c01611266565b94505060a061172a8b828c016115e6565b93505060e061173b8b828c016115d1565b92505061010089013567ffffffffffffffff81111561175d5761175c6110eb565b5b6117698b828c01611266565b9150509295985092959890939650565b611782816115a6565b82525050565b600060208201905061179d6000830184611779565b92915050565b60006117ae826110f0565b9050919050565b6117be816117a3565b81146117c957600080fd5b50565b6000813590506117db816117b5565b92915050565b600080604083850312156117f8576117f76110e6565b5b6000611806858286016117cc565b9250506020611817858286016117cc565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561188757808201518184015260208101905061186c565b60008484015250505050565b600061189e8261184d565b6118a88185611858565b93506118b8818560208601611869565b6118c181611158565b840191505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61190181611294565b82525050565b600060408301600083015184820360008601526119248282611893565b915050602083015161193960208601826118f8565b508091505092915050565b60006119508383611907565b905092915050565b6000602082019050919050565b6000611970826118cc565b61197a81856118d7565b93508360208202850161198c856118e8565b8060005b858110156119c857848403895281516119a98582611944565b94506119b483611958565b925060208a01995050600181019050611990565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000611a128383611893565b905092915050565b6000602082019050919050565b6000611a32826119da565b611a3c81856119e5565b935083602082028501611a4e856119f6565b8060005b85811015611a8a5784840389528151611a6b8582611a06565b9450611a7683611a1a565b925060208a01995050600181019050611a52565b50829750879550505050505092915050565b600060a0830160008301518482036000860152611ab98282611893565b91505060208301518482036020860152611ad38282611893565b91505060408301518482036040860152611aed8282611965565b91505060608301518482036060860152611b078282611a27565b91505060808301518482036080860152611b218282611a27565b9150508091505092915050565b6000611b3a8383611a9c565b905092915050565b6000602082019050919050565b6000611b5a82611821565b611b64818561182c565b935083602082028501611b768561183d565b8060005b85811015611bb25784840389528151611b938582611b2e565b9450611b9e83611b42565b925060208a01995050600181019050611b7a565b50829750879550505050505092915050565b60006020820190508181036000830152611bde8184611b4f565b905092915050565b60008060008060008060008060006101208a8c031215611c0957611c086110e6565b5b6000611c178c828d01611139565b9950506020611c288c828d016117cc565b98505060408a013567ffffffffffffffff811115611c4957611c486110eb565b5b611c558c828d01611266565b97505060608a013567ffffffffffffffff811115611c7657611c756110eb565b5b611c828c828d01611266565b96505060808a013567ffffffffffffffff811115611ca357611ca26110eb565b5b611caf8c828d01611266565b95505060a0611cc08c828d016112b5565b94505060c08a013567ffffffffffffffff811115611ce157611ce06110eb565b5b611ced8c828d01611266565b93505060e0611cfe8c828d016112ed565b925050610100611d108c828d016112ed565b9150509295985092959850929598565b600060208284031215611d3657611d356110e6565b5b600082013567ffffffffffffffff811115611d5457611d536110eb565b5b611d6084828501611266565b91505092915050565b600082825260208201905092915050565b6000611d858261184d565b611d8f8185611d69565b9350611d9f818560208601611869565b611da881611158565b840191505092915050565b60006020820190508181036000830152611dcd8184611d7a565b905092915050565b600080fd5b600060a08284031215611df057611def611dd5565b5b81905092915050565b600060208284031215611e0f57611e0e6110e6565b5b600082013567ffffffffffffffff811115611e2d57611e2c6110eb565b5b611e3984828501611dda565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006040830160008301518482036000860152611e8b8282611893565b91505060208301518482036020860152611ea58282611893565b9150508091505092915050565b6000611ebe8383611e6e565b905092915050565b6000602082019050919050565b6000611ede82611e42565b611ee88185611e4d565b935083602082028501611efa85611e5e565b8060005b85811015611f365784840389528151611f178582611eb2565b9450611f2283611ec6565b925060208a01995050600181019050611efe565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b6000611f6f82611f48565b611f798185611f53565b9350611f89818560208601611869565b611f9281611158565b840191505092915050565b611fa6816115a6565b82525050565b60006040830160008301518482036000860152611fc98282611f64565b9150506020830151611fde6020860182611f9d565b508091505092915050565b600060408201905081810360008301526120038185611ed3565b905081810360208301526120178184611fac565b90509392505050565b6000604083016000830151848203600086015261203d8282611893565b915050602083015184820360208601526120578282611893565b9150508091505092915050565b6000602082019050818103600083015261207e8184612020565b905092915050565b60008083601f84011261209c5761209b61114e565b5b8235905067ffffffffffffffff8111156120b9576120b861143c565b5b6020830191508360208202830111156120d5576120d4611441565b5b9250929050565b600080602083850312156120f3576120f26110e6565b5b600083013567ffffffffffffffff811115612111576121106110eb565b5b61211d85828601612086565b92509250509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061216382611565565b9150677fffffffffffffff820361217d5761217c612129565b5b600182019050919050565b600081905092915050565b50565b60006121a3600083612188565b91506121ae82612193565b600082019050919050565b60006121c482612196565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061222a602183611d69565b9150612235826121ce565b604082019050919050565b600060208201905081810360008301526122598161221d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061229a82611294565b91506122a583611294565b9250826122b5576122b4612260565b5b828204905092915050565b6122c981611294565b82525050565b6000819050919050565b60006122f46122ef6122ea846110f0565b6122cf565b6110f0565b9050919050565b6000612306826122d9565b9050919050565b6000612318826122fb565b9050919050565b6123288161230d565b82525050565b6040820160008201516123446000850182611f9d565b5060208201516123576020850182611f9d565b50505050565b6000819050919050565b600061238261237d6123788461235d565b6122cf565b6115a6565b9050919050565b61239281612367565b82525050565b60006123a5600083611d69565b91506123b082612193565b600082019050919050565b60006101408201905081810360008301526123d6818b611d7a565b905081810360208301526123ea818a611d7a565b905081810360408301526123fe8189611d7a565b905061240d60608301886122c0565b61241a608083018761231f565b81810360a083015261242c8186611d7a565b905061243b60c083018561232e565b612449610100830184612389565b81810361012083015261245b81612398565b90509998505050505050505050565b600081519050612479816115ba565b92915050565b600060208284031215612495576124946110e6565b5b60006124a38482850161246a565b91505092915050565b6124b5816117a3565b82525050565b60006124c78385611d69565b93506124d4838584611215565b6124dd83611158565b840190509392505050565b600060a0820190506124fd600083018b6124ac565b818103602083015261251081898b6124bb565b905081810360408301526125258187896124bb565b9050818103606083015261253a8185876124bb565b905061254960808301846122c0565b9998505050505050505050565b600081519050612565816112d6565b92915050565b600060208284031215612581576125806110e6565b5b600061258f84828501612556565b91505092915050565b7f4661696c656420746f20696e63726561736520616c6c6f77616e636500000000600082015250565b60006125ce601c83611d69565b91506125d982612598565b602082019050919050565b600060208201905081810360008301526125fd816125c1565b9050919050565b600061014082019050818103600083015261261f818c611d7a565b90508181036020830152612633818b611d7a565b90508181036040830152612647818a611d7a565b905061265660608301896122c0565b61266360808301886124ac565b81810360a08301526126758187611d7a565b905061268460c083018661232e565b612692610100830185611779565b8181036101208301526126a58184611d7a565b90509a9950505050505050505050565b60006020820190506126ca60008301846124ac565b92915050565b7f4661696c656420746f207265766f6b6520617070726f76616c00000000000000600082015250565b6000612706601983611d69565b9150612711826126d0565b602082019050919050565b60006020820190508181036000830152612735816126f9565b9050919050565b600060408201905061275160008301856124ac565b61275e60208301846124ac565b9392505050565b600067ffffffffffffffff8211156127805761277f611169565b5b602082029050602081019050919050565b60006127a461279f846111e4565b6111c9565b9050828152602081018484840111156127c0576127bf611153565b5b6127cb848285611869565b509392505050565b600082601f8301126127e8576127e761114e565b5b81516127f8848260208601612791565b91505092915050565b600067ffffffffffffffff82111561281c5761281b611169565b5b602082029050602081019050919050565b60008151905061283c8161129e565b92915050565b6000604082840312156128585761285761159c565b5b61286260406111c9565b9050600082015167ffffffffffffffff811115612882576128816115a1565b5b61288e848285016127d3565b60008301525060206128a28482850161282d565b60208301525092915050565b60006128c16128bc84612801565b6111c9565b905080838252602082019050602084028301858111156128e4576128e3611441565b5b835b8181101561292b57805167ffffffffffffffff8111156129095761290861114e565b5b8086016129168982612842565b855260208501945050506020810190506128e6565b5050509392505050565b600082601f83011261294a5761294961114e565b5b815161295a8482602086016128ae565b91505092915050565b600067ffffffffffffffff82111561297e5761297d611169565b5b602082029050602081019050919050565b60006129a261299d84612963565b6111c9565b905080838252602082019050602084028301858111156129c5576129c4611441565b5b835b81811015612a0c57805167ffffffffffffffff8111156129ea576129e961114e565b5b8086016129f789826127d3565b855260208501945050506020810190506129c7565b5050509392505050565b600082601f830112612a2b57612a2a61114e565b5b8151612a3b84826020860161298f565b91505092915050565b600060a08284031215612a5a57612a5961159c565b5b612a6460a06111c9565b9050600082015167ffffffffffffffff811115612a8457612a836115a1565b5b612a90848285016127d3565b600083015250602082015167ffffffffffffffff811115612ab457612ab36115a1565b5b612ac0848285016127d3565b602083015250604082015167ffffffffffffffff811115612ae457612ae36115a1565b5b612af084828501612935565b604083015250606082015167ffffffffffffffff811115612b1457612b136115a1565b5b612b2084828501612a16565b606083015250608082015167ffffffffffffffff811115612b4457612b436115a1565b5b612b5084828501612a16565b60808301525092915050565b6000612b6f612b6a84612765565b6111c9565b90508083825260208201905060208402830185811115612b9257612b91611441565b5b835b81811015612bd957805167ffffffffffffffff811115612bb757612bb661114e565b5b808601612bc48982612a44565b85526020850194505050602081019050612b94565b5050509392505050565b600082601f830112612bf857612bf761114e565b5b8151612c08848260208601612b5c565b91505092915050565b600060208284031215612c2757612c266110e6565b5b600082015167ffffffffffffffff811115612c4557612c446110eb565b5b612c5184828501612be3565b91505092915050565b6000610140820190508181036000830152612c75818b611d7a565b90508181036020830152612c89818a611d7a565b90508181036040830152612c9d8189611d7a565b9050612cac60608301886122c0565b612cb960808301876124ac565b81810360a0830152612ccb8186611d7a565b9050612cda60c083018561232e565b612ce8610100830184612389565b818103610120830152612cfa81612398565b90509998505050505050505050565b600060208284031215612d1f57612d1e6110e6565b5b600082015167ffffffffffffffff811115612d3d57612d3c6110eb565b5b612d49848285016127d3565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112612d7e57612d7d612d5c565b5b83810192508235915060208301925067ffffffffffffffff821115612da657612da5612d52565b5b600182023603831315612dbc57612dbb612d57565b5b509250929050565b6000612dd08385611f53565b9350612ddd838584611215565b612de683611158565b840190509392505050565b6000612e0060208401846115d1565b905092915050565b6000612e1760208401846112ed565b905092915050565b612e28816112ca565b82525050565b600060a08301612e416000840184612d61565b8583036000870152612e54838284612dc4565b92505050612e656020840184612df1565b612e726020860182611f9d565b50612e806040840184612df1565b612e8d6040860182611f9d565b50612e9b6060840184612e08565b612ea86060860182612e1f565b50612eb66080840184612e08565b612ec36080860182612e1f565b508091505092915050565b60006020820190508181036000830152612ee88184612e2e565b905092915050565b600067ffffffffffffffff821115612f0b57612f0a611169565b5b602082029050602081019050919050565b600060408284031215612f3257612f3161159c565b5b612f3c60406111c9565b9050600082015167ffffffffffffffff811115612f5c57612f5b6115a1565b5b612f68848285016127d3565b600083015250602082015167ffffffffffffffff811115612f8c57612f8b6115a1565b5b612f98848285016127d3565b60208301525092915050565b6000612fb7612fb284612ef0565b6111c9565b90508083825260208201905060208402830185811115612fda57612fd9611441565b5b835b8181101561302157805167ffffffffffffffff811115612fff57612ffe61114e565b5b80860161300c8982612f1c565b85526020850194505050602081019050612fdc565b5050509392505050565b600082601f8301126130405761303f61114e565b5b8151613050848260208601612fa4565b91505092915050565b600067ffffffffffffffff82111561307457613073611169565b5b61307d82611158565b9050602081019050919050565b600061309d61309884613059565b6111c9565b9050828152602081018484840111156130b9576130b8611153565b5b6130c4848285611869565b509392505050565b600082601f8301126130e1576130e061114e565b5b81516130f184826020860161308a565b91505092915050565b6000604082840312156131105761310f61159c565b5b61311a60406111c9565b9050600082015167ffffffffffffffff81111561313a576131396115a1565b5b613146848285016130cc565b600083015250602061315a8482850161246a565b60208301525092915050565b6000806040838503121561317d5761317c6110e6565b5b600083015167ffffffffffffffff81111561319b5761319a6110eb565b5b6131a78582860161302b565b925050602083015167ffffffffffffffff8111156131c8576131c76110eb565b5b6131d4858286016130fa565b9150509250929050565b6000602082840312156131f4576131f36110e6565b5b600082015167ffffffffffffffff811115613212576132116110eb565b5b61321e84828501612f1c565b91505092915050565b7f4661696c656420746f20646563726561736520616c6c6f77616e636500000000600082015250565b600061325d601c83611d69565b915061326882613227565b602082019050919050565b6000602082019050818103600083015261328c81613250565b9050919050565b6000819050919050565b600080833560016020038436030381126132ba576132b9612d5c565b5b83810192508235915060208301925067ffffffffffffffff8211156132e2576132e1612d52565b5b6001820236038313156132f8576132f7612d57565b5b509250929050565b600061330c8385611858565b9350613319838584611215565b61332283611158565b840190509392505050565b6000808335600160200384360303811261334a57613349612d5c565b5b83810192508235915060208301925067ffffffffffffffff82111561337257613371612d52565b5b60208202360383131561338857613387612d57565b5b509250929050565b6000819050919050565b60006133a960208401846112b5565b905092915050565b6000604083016133c4600084018461329d565b85830360008701526133d7838284613300565b925050506133e8602084018461339a565b6133f560208601826118f8565b508091505092915050565b600061340c83836133b1565b905092915050565b6000823560016040038336030381126134305761342f612d5c565b5b82810191505092915050565b6000602082019050919050565b600061345583856118d7565b93508360208402850161346784613390565b8060005b878110156134ab5784840389526134828284613414565b61348c8582613400565b94506134978361343c565b925060208a0199505060018101905061346b565b50829750879450505050509392505050565b600080833560016020038436030381126134da576134d9612d5c565b5b83810192508235915060208301925067ffffffffffffffff82111561350257613501612d52565b5b60208202360383131561351857613517612d57565b5b509250929050565b6000819050919050565b6000613537848484613300565b90509392505050565b6000602082019050919050565b600061355983856119e5565b93508360208402850161356b84613520565b8060005b878110156135b1578484038952613586828461329d565b61359186828461352a565b955061359c84613540565b935060208b019a50505060018101905061356f565b50829750879450505050509392505050565b600060a083016135d6600084018461329d565b85830360008701526135e9838284613300565b925050506135fa602084018461329d565b858303602087015261360d838284613300565b9250505061361e604084018461332d565b8583036040870152613631838284613449565b9250505061364260608401846134bd565b858303606087015261365583828461354d565b9250505061366660808401846134bd565b858303608087015261367983828461354d565b925050508091505092915050565b600061369383836135c3565b905092915050565b60008235600160a0038336030381126136b7576136b6612d5c565b5b82810191505092915050565b6000602082019050919050565b60006136dc838561182c565b9350836020840285016136ee84613293565b8060005b87811015613732578484038952613709828461369b565b6137138582613687565b945061371e836136c3565b925060208a019950506001810190506136f2565b50829750879450505050509392505050565b600060408201905061375960008301866124ac565b818103602083015261376c8184866136d0565b9050949350505050565b7f4661696c656420746f20706572666f726d20617070726f76616c000000000000600082015250565b60006137ac601a83611d69565b91506137b782613776565b602082019050919050565b600060208201905081810360008301526137db8161379f565b905091905056fea2646970667358221220bcb453fc471282c5300ef2cce92af3966ecb2c9f9fc8ddec271f9520efa16a1164736f6c63430008130033", + "bytecode": "0x608060405234801561001057600080fd5b50613818806100206000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063a363df841161008c578063dfa10f3911610066578063dfa10f3914610210578063ee5766d914610241578063f298e7a814610271578063f3675f081461028d576100cf565b8063a363df8414610194578063b9672879146101c4578063c595699a146101e0576100cf565b80631dba685b146100d4578063424af9f6146100f057806361bc221a1461010c5780636fdf23cc1461012a5780637492bdd81461015a5780637a6185e11461018a575b600080fd5b6100ee60048036038101906100e99190611302565b6102a9565b005b61010a6004803603810190610105919061149c565b61070f565b005b6101146107e9565b6040516101219190611581565b60405180910390f35b610144600480360381019061013f9190611636565b6107fa565b6040516101519190611788565b60405180910390f35b610174600480360381019061016f9190611636565b610898565b6040516101819190611788565b60405180910390f35b610192610936565b005b6101ae60048036038101906101a991906117e1565b6109fb565b6040516101bb9190611bc4565b60405180910390f35b6101de60048036038101906101d99190611be6565b610a88565b005b6101fa60048036038101906101f59190611d20565b610d4b565b6040516102079190611db3565b60405180910390f35b61022a60048036038101906102259190611df9565b610dd5565b604051610238929190611fe9565b60405180910390f35b61025b60048036038101906102569190611d20565b610e69565b6040516102689190612064565b60405180910390f35b61028b6004803603810190610286919061149c565b610ef9565b005b6102a760048036038101906102a291906120dc565b610fd3565b005b82156103a65760008081819054906101000a900460070b809291906102cd90612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008973ffffffffffffffffffffffffffffffffffffffff16600f60405161031e906121b9565b60006040518083038185875af1925050503d806000811461035b576040519150601f19603f3d011682016040523d82523d6000602084013e610360565b606091505b50509050806103a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161039b90612240565b60405180910390fd5b505b60006040518060400160405280606467ffffffffffffffff168152602001606467ffffffffffffffff16815250905061080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a60028b610403919061228f565b8f8b8860006040518963ffffffff1660e01b815260040161042b9897969594939291906123bb565b6020604051808303816000875af115801561044a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046e919061247f565b50821561056c5760008081819054906101000a900460070b8092919061049390612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008a73ffffffffffffffffffffffffffffffffffffffff16600f6040516104e4906121b9565b60006040518083038185875af1925050503d8060008114610521576040519150601f19603f3d011682016040523d82523d6000602084013e610526565b606091505b505090508061056a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056190612240565b60405180910390fd5b505b61080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a60028b61059a919061228f565b8f8b8860006040518963ffffffff1660e01b81526004016105c29897969594939291906123bb565b6020604051808303816000875af11580156105e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610605919061247f565b5081156107035760008081819054906101000a900460070b8092919061062a90612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008a73ffffffffffffffffffffffffffffffffffffffff16600f60405161067b906121b9565b60006040518083038185875af1925050503d80600081146106b8576040519150601f19603f3d011682016040523d82523d6000602084013e6106bd565b606091505b5050905080610701576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f890612240565b60405180910390fd5b505b50505050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff166354de647b308a8a8a8a8a8a8a6040518963ffffffff1660e01b815260040161075a9897969594939291906124e8565b6020604051808303816000875af1158015610779573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079d919061256b565b9050806107df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d6906125e4565b60405180910390fd5b5050505050505050565b60008054906101000a900460070b81565b600061080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a8a308b8b8b8b6040518a63ffffffff1660e01b815260040161084799989796959493929190612604565b6020604051808303816000875af1158015610866573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088a919061247f565b905098975050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a8a338b8b8b8b6040518a63ffffffff1660e01b81526004016108e599989796959493929190612604565b6020604051808303816000875af1158015610904573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610928919061247f565b905098975050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff166374a8f103306040518263ffffffff1660e01b815260040161097391906126b5565b6020604051808303816000875af1158015610992573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b6919061256b565b9050806109f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ef9061271c565b60405180910390fd5b50565b606061080273ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff1660e01b8152600401610a3a92919061273c565b600060405180830381865afa158015610a57573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610a809190612c11565b905092915050565b8115610b855760008081819054906101000a900460070b80929190610aac90612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008973ffffffffffffffffffffffffffffffffffffffff16600f604051610afd906121b9565b60006040518083038185875af1925050503d8060008114610b3a576040519150601f19603f3d011682016040523d82523d6000602084013e610b3f565b606091505b5050905080610b83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7a90612240565b60405180910390fd5b505b60006040518060400160405280606467ffffffffffffffff168152602001606467ffffffffffffffff16815250905061080273ffffffffffffffffffffffffffffffffffffffff1663632535b9898989898e8a8860006040518963ffffffff1660e01b8152600401610bfe989796959493929190612c5a565b6020604051808303816000875af1158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c41919061247f565b508115610d3f5760008081819054906101000a900460070b80929190610c6690612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008a73ffffffffffffffffffffffffffffffffffffffff16600f604051610cb7906121b9565b60006040518083038185875af1925050503d8060008114610cf4576040519150601f19603f3d011682016040523d82523d6000602084013e610cf9565b606091505b5050905080610d3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3490612240565b60405180910390fd5b505b50505050505050505050565b606061080273ffffffffffffffffffffffffffffffffffffffff1663b5cb6e7d836040518263ffffffff1660e01b8152600401610d889190611db3565b600060405180830381865afa158015610da5573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610dce9190612d09565b9050919050565b6060610ddf61109e565b61080273ffffffffffffffffffffffffffffffffffffffff166322b6fad6846040518263ffffffff1660e01b8152600401610e1a9190612ece565b600060405180830381865afa158015610e37573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610e609190613166565b91509150915091565b610e716110c2565b61080273ffffffffffffffffffffffffffffffffffffffff1663a815cdd9836040518263ffffffff1660e01b8152600401610eac9190611db3565b600060405180830381865afa158015610ec9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610ef291906131de565b9050919050565b600061080273ffffffffffffffffffffffffffffffffffffffff1663b3f536ec308a8a8a8a8a8a8a6040518963ffffffff1660e01b8152600401610f449897969594939291906124e8565b6020604051808303816000875af1158015610f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f87919061256b565b905080610fc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc090613273565b60405180910390fd5b5050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff1663473c90c73085856040518463ffffffff1660e01b815260040161101493929190613744565b6020604051808303816000875af1158015611033573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611057919061256b565b905080611099576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611090906137c2565b60405180910390fd5b505050565b604051806040016040528060608152602001600067ffffffffffffffff1681525090565b604051806040016040528060608152602001606081525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061111b826110f0565b9050919050565b61112b81611110565b811461113657600080fd5b50565b60008135905061114881611122565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6111a182611158565b810181811067ffffffffffffffff821117156111c0576111bf611169565b5b80604052505050565b60006111d36110dc565b90506111df8282611198565b919050565b600067ffffffffffffffff8211156111ff576111fe611169565b5b61120882611158565b9050602081019050919050565b82818337600083830152505050565b6000611237611232846111e4565b6111c9565b90508281526020810184848401111561125357611252611153565b5b61125e848285611215565b509392505050565b600082601f83011261127b5761127a61114e565b5b813561128b848260208601611224565b91505092915050565b6000819050919050565b6112a781611294565b81146112b257600080fd5b50565b6000813590506112c48161129e565b92915050565b60008115159050919050565b6112df816112ca565b81146112ea57600080fd5b50565b6000813590506112fc816112d6565b92915050565b60008060008060008060008060006101208a8c031215611325576113246110e6565b5b60006113338c828d01611139565b99505060208a013567ffffffffffffffff811115611354576113536110eb565b5b6113608c828d01611266565b98505060408a013567ffffffffffffffff811115611381576113806110eb565b5b61138d8c828d01611266565b97505060608a013567ffffffffffffffff8111156113ae576113ad6110eb565b5b6113ba8c828d01611266565b96505060806113cb8c828d016112b5565b95505060a08a013567ffffffffffffffff8111156113ec576113eb6110eb565b5b6113f88c828d01611266565b94505060c06114098c828d016112ed565b93505060e061141a8c828d016112ed565b92505061010061142c8c828d016112ed565b9150509295985092959850929598565b600080fd5b600080fd5b60008083601f84011261145c5761145b61114e565b5b8235905067ffffffffffffffff8111156114795761147861143c565b5b60208301915083600182028301111561149557611494611441565b5b9250929050565b60008060008060008060006080888a0312156114bb576114ba6110e6565b5b600088013567ffffffffffffffff8111156114d9576114d86110eb565b5b6114e58a828b01611446565b9750975050602088013567ffffffffffffffff811115611508576115076110eb565b5b6115148a828b01611446565b9550955050604088013567ffffffffffffffff811115611537576115366110eb565b5b6115438a828b01611446565b935093505060606115568a828b016112b5565b91505092959891949750929550565b60008160070b9050919050565b61157b81611565565b82525050565b60006020820190506115966000830184611572565b92915050565b600080fd5b600080fd5b600067ffffffffffffffff82169050919050565b6115c3816115a6565b81146115ce57600080fd5b50565b6000813590506115e0816115ba565b92915050565b6000604082840312156115fc576115fb61159c565b5b61160660406111c9565b90506000611616848285016115d1565b600083015250602061162a848285016115d1565b60208301525092915050565b600080600080600080600080610120898b031215611657576116566110e6565b5b600089013567ffffffffffffffff811115611675576116746110eb565b5b6116818b828c01611266565b985050602089013567ffffffffffffffff8111156116a2576116a16110eb565b5b6116ae8b828c01611266565b975050604089013567ffffffffffffffff8111156116cf576116ce6110eb565b5b6116db8b828c01611266565b96505060606116ec8b828c016112b5565b955050608089013567ffffffffffffffff81111561170d5761170c6110eb565b5b6117198b828c01611266565b94505060a061172a8b828c016115e6565b93505060e061173b8b828c016115d1565b92505061010089013567ffffffffffffffff81111561175d5761175c6110eb565b5b6117698b828c01611266565b9150509295985092959890939650565b611782816115a6565b82525050565b600060208201905061179d6000830184611779565b92915050565b60006117ae826110f0565b9050919050565b6117be816117a3565b81146117c957600080fd5b50565b6000813590506117db816117b5565b92915050565b600080604083850312156117f8576117f76110e6565b5b6000611806858286016117cc565b9250506020611817858286016117cc565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561188757808201518184015260208101905061186c565b60008484015250505050565b600061189e8261184d565b6118a88185611858565b93506118b8818560208601611869565b6118c181611158565b840191505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61190181611294565b82525050565b600060408301600083015184820360008601526119248282611893565b915050602083015161193960208601826118f8565b508091505092915050565b60006119508383611907565b905092915050565b6000602082019050919050565b6000611970826118cc565b61197a81856118d7565b93508360208202850161198c856118e8565b8060005b858110156119c857848403895281516119a98582611944565b94506119b483611958565b925060208a01995050600181019050611990565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000611a128383611893565b905092915050565b6000602082019050919050565b6000611a32826119da565b611a3c81856119e5565b935083602082028501611a4e856119f6565b8060005b85811015611a8a5784840389528151611a6b8582611a06565b9450611a7683611a1a565b925060208a01995050600181019050611a52565b50829750879550505050505092915050565b600060a0830160008301518482036000860152611ab98282611893565b91505060208301518482036020860152611ad38282611893565b91505060408301518482036040860152611aed8282611965565b91505060608301518482036060860152611b078282611a27565b91505060808301518482036080860152611b218282611a27565b9150508091505092915050565b6000611b3a8383611a9c565b905092915050565b6000602082019050919050565b6000611b5a82611821565b611b64818561182c565b935083602082028501611b768561183d565b8060005b85811015611bb25784840389528151611b938582611b2e565b9450611b9e83611b42565b925060208a01995050600181019050611b7a565b50829750879550505050505092915050565b60006020820190508181036000830152611bde8184611b4f565b905092915050565b60008060008060008060008060006101208a8c031215611c0957611c086110e6565b5b6000611c178c828d01611139565b9950506020611c288c828d016117cc565b98505060408a013567ffffffffffffffff811115611c4957611c486110eb565b5b611c558c828d01611266565b97505060608a013567ffffffffffffffff811115611c7657611c756110eb565b5b611c828c828d01611266565b96505060808a013567ffffffffffffffff811115611ca357611ca26110eb565b5b611caf8c828d01611266565b95505060a0611cc08c828d016112b5565b94505060c08a013567ffffffffffffffff811115611ce157611ce06110eb565b5b611ced8c828d01611266565b93505060e0611cfe8c828d016112ed565b925050610100611d108c828d016112ed565b9150509295985092959850929598565b600060208284031215611d3657611d356110e6565b5b600082013567ffffffffffffffff811115611d5457611d536110eb565b5b611d6084828501611266565b91505092915050565b600082825260208201905092915050565b6000611d858261184d565b611d8f8185611d69565b9350611d9f818560208601611869565b611da881611158565b840191505092915050565b60006020820190508181036000830152611dcd8184611d7a565b905092915050565b600080fd5b600060a08284031215611df057611def611dd5565b5b81905092915050565b600060208284031215611e0f57611e0e6110e6565b5b600082013567ffffffffffffffff811115611e2d57611e2c6110eb565b5b611e3984828501611dda565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006040830160008301518482036000860152611e8b8282611893565b91505060208301518482036020860152611ea58282611893565b9150508091505092915050565b6000611ebe8383611e6e565b905092915050565b6000602082019050919050565b6000611ede82611e42565b611ee88185611e4d565b935083602082028501611efa85611e5e565b8060005b85811015611f365784840389528151611f178582611eb2565b9450611f2283611ec6565b925060208a01995050600181019050611efe565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b6000611f6f82611f48565b611f798185611f53565b9350611f89818560208601611869565b611f9281611158565b840191505092915050565b611fa6816115a6565b82525050565b60006040830160008301518482036000860152611fc98282611f64565b9150506020830151611fde6020860182611f9d565b508091505092915050565b600060408201905081810360008301526120038185611ed3565b905081810360208301526120178184611fac565b90509392505050565b6000604083016000830151848203600086015261203d8282611893565b915050602083015184820360208601526120578282611893565b9150508091505092915050565b6000602082019050818103600083015261207e8184612020565b905092915050565b60008083601f84011261209c5761209b61114e565b5b8235905067ffffffffffffffff8111156120b9576120b861143c565b5b6020830191508360208202830111156120d5576120d4611441565b5b9250929050565b600080602083850312156120f3576120f26110e6565b5b600083013567ffffffffffffffff811115612111576121106110eb565b5b61211d85828601612086565b92509250509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061216382611565565b9150677fffffffffffffff820361217d5761217c612129565b5b600182019050919050565b600081905092915050565b50565b60006121a3600083612188565b91506121ae82612193565b600082019050919050565b60006121c482612196565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061222a602183611d69565b9150612235826121ce565b604082019050919050565b600060208201905081810360008301526122598161221d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061229a82611294565b91506122a583611294565b9250826122b5576122b4612260565b5b828204905092915050565b6122c981611294565b82525050565b6000819050919050565b60006122f46122ef6122ea846110f0565b6122cf565b6110f0565b9050919050565b6000612306826122d9565b9050919050565b6000612318826122fb565b9050919050565b6123288161230d565b82525050565b6040820160008201516123446000850182611f9d565b5060208201516123576020850182611f9d565b50505050565b6000819050919050565b600061238261237d6123788461235d565b6122cf565b6115a6565b9050919050565b61239281612367565b82525050565b60006123a5600083611d69565b91506123b082612193565b600082019050919050565b60006101408201905081810360008301526123d6818b611d7a565b905081810360208301526123ea818a611d7a565b905081810360408301526123fe8189611d7a565b905061240d60608301886122c0565b61241a608083018761231f565b81810360a083015261242c8186611d7a565b905061243b60c083018561232e565b612449610100830184612389565b81810361012083015261245b81612398565b90509998505050505050505050565b600081519050612479816115ba565b92915050565b600060208284031215612495576124946110e6565b5b60006124a38482850161246a565b91505092915050565b6124b5816117a3565b82525050565b60006124c78385611d69565b93506124d4838584611215565b6124dd83611158565b840190509392505050565b600060a0820190506124fd600083018b6124ac565b818103602083015261251081898b6124bb565b905081810360408301526125258187896124bb565b9050818103606083015261253a8185876124bb565b905061254960808301846122c0565b9998505050505050505050565b600081519050612565816112d6565b92915050565b600060208284031215612581576125806110e6565b5b600061258f84828501612556565b91505092915050565b7f4661696c656420746f20696e63726561736520616c6c6f77616e636500000000600082015250565b60006125ce601c83611d69565b91506125d982612598565b602082019050919050565b600060208201905081810360008301526125fd816125c1565b9050919050565b600061014082019050818103600083015261261f818c611d7a565b90508181036020830152612633818b611d7a565b90508181036040830152612647818a611d7a565b905061265660608301896122c0565b61266360808301886124ac565b81810360a08301526126758187611d7a565b905061268460c083018661232e565b612692610100830185611779565b8181036101208301526126a58184611d7a565b90509a9950505050505050505050565b60006020820190506126ca60008301846124ac565b92915050565b7f4661696c656420746f207265766f6b6520617070726f76616c00000000000000600082015250565b6000612706601983611d69565b9150612711826126d0565b602082019050919050565b60006020820190508181036000830152612735816126f9565b9050919050565b600060408201905061275160008301856124ac565b61275e60208301846124ac565b9392505050565b600067ffffffffffffffff8211156127805761277f611169565b5b602082029050602081019050919050565b60006127a461279f846111e4565b6111c9565b9050828152602081018484840111156127c0576127bf611153565b5b6127cb848285611869565b509392505050565b600082601f8301126127e8576127e761114e565b5b81516127f8848260208601612791565b91505092915050565b600067ffffffffffffffff82111561281c5761281b611169565b5b602082029050602081019050919050565b60008151905061283c8161129e565b92915050565b6000604082840312156128585761285761159c565b5b61286260406111c9565b9050600082015167ffffffffffffffff811115612882576128816115a1565b5b61288e848285016127d3565b60008301525060206128a28482850161282d565b60208301525092915050565b60006128c16128bc84612801565b6111c9565b905080838252602082019050602084028301858111156128e4576128e3611441565b5b835b8181101561292b57805167ffffffffffffffff8111156129095761290861114e565b5b8086016129168982612842565b855260208501945050506020810190506128e6565b5050509392505050565b600082601f83011261294a5761294961114e565b5b815161295a8482602086016128ae565b91505092915050565b600067ffffffffffffffff82111561297e5761297d611169565b5b602082029050602081019050919050565b60006129a261299d84612963565b6111c9565b905080838252602082019050602084028301858111156129c5576129c4611441565b5b835b81811015612a0c57805167ffffffffffffffff8111156129ea576129e961114e565b5b8086016129f789826127d3565b855260208501945050506020810190506129c7565b5050509392505050565b600082601f830112612a2b57612a2a61114e565b5b8151612a3b84826020860161298f565b91505092915050565b600060a08284031215612a5a57612a5961159c565b5b612a6460a06111c9565b9050600082015167ffffffffffffffff811115612a8457612a836115a1565b5b612a90848285016127d3565b600083015250602082015167ffffffffffffffff811115612ab457612ab36115a1565b5b612ac0848285016127d3565b602083015250604082015167ffffffffffffffff811115612ae457612ae36115a1565b5b612af084828501612935565b604083015250606082015167ffffffffffffffff811115612b1457612b136115a1565b5b612b2084828501612a16565b606083015250608082015167ffffffffffffffff811115612b4457612b436115a1565b5b612b5084828501612a16565b60808301525092915050565b6000612b6f612b6a84612765565b6111c9565b90508083825260208201905060208402830185811115612b9257612b91611441565b5b835b81811015612bd957805167ffffffffffffffff811115612bb757612bb661114e565b5b808601612bc48982612a44565b85526020850194505050602081019050612b94565b5050509392505050565b600082601f830112612bf857612bf761114e565b5b8151612c08848260208601612b5c565b91505092915050565b600060208284031215612c2757612c266110e6565b5b600082015167ffffffffffffffff811115612c4557612c446110eb565b5b612c5184828501612be3565b91505092915050565b6000610140820190508181036000830152612c75818b611d7a565b90508181036020830152612c89818a611d7a565b90508181036040830152612c9d8189611d7a565b9050612cac60608301886122c0565b612cb960808301876124ac565b81810360a0830152612ccb8186611d7a565b9050612cda60c083018561232e565b612ce8610100830184612389565b818103610120830152612cfa81612398565b90509998505050505050505050565b600060208284031215612d1f57612d1e6110e6565b5b600082015167ffffffffffffffff811115612d3d57612d3c6110eb565b5b612d49848285016127d3565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112612d7e57612d7d612d5c565b5b83810192508235915060208301925067ffffffffffffffff821115612da657612da5612d52565b5b600182023603831315612dbc57612dbb612d57565b5b509250929050565b6000612dd08385611f53565b9350612ddd838584611215565b612de683611158565b840190509392505050565b6000612e0060208401846115d1565b905092915050565b6000612e1760208401846112ed565b905092915050565b612e28816112ca565b82525050565b600060a08301612e416000840184612d61565b8583036000870152612e54838284612dc4565b92505050612e656020840184612df1565b612e726020860182611f9d565b50612e806040840184612df1565b612e8d6040860182611f9d565b50612e9b6060840184612e08565b612ea86060860182612e1f565b50612eb66080840184612e08565b612ec36080860182612e1f565b508091505092915050565b60006020820190508181036000830152612ee88184612e2e565b905092915050565b600067ffffffffffffffff821115612f0b57612f0a611169565b5b602082029050602081019050919050565b600060408284031215612f3257612f3161159c565b5b612f3c60406111c9565b9050600082015167ffffffffffffffff811115612f5c57612f5b6115a1565b5b612f68848285016127d3565b600083015250602082015167ffffffffffffffff811115612f8c57612f8b6115a1565b5b612f98848285016127d3565b60208301525092915050565b6000612fb7612fb284612ef0565b6111c9565b90508083825260208201905060208402830185811115612fda57612fd9611441565b5b835b8181101561302157805167ffffffffffffffff811115612fff57612ffe61114e565b5b80860161300c8982612f1c565b85526020850194505050602081019050612fdc565b5050509392505050565b600082601f8301126130405761303f61114e565b5b8151613050848260208601612fa4565b91505092915050565b600067ffffffffffffffff82111561307457613073611169565b5b61307d82611158565b9050602081019050919050565b600061309d61309884613059565b6111c9565b9050828152602081018484840111156130b9576130b8611153565b5b6130c4848285611869565b509392505050565b600082601f8301126130e1576130e061114e565b5b81516130f184826020860161308a565b91505092915050565b6000604082840312156131105761310f61159c565b5b61311a60406111c9565b9050600082015167ffffffffffffffff81111561313a576131396115a1565b5b613146848285016130cc565b600083015250602061315a8482850161246a565b60208301525092915050565b6000806040838503121561317d5761317c6110e6565b5b600083015167ffffffffffffffff81111561319b5761319a6110eb565b5b6131a78582860161302b565b925050602083015167ffffffffffffffff8111156131c8576131c76110eb565b5b6131d4858286016130fa565b9150509250929050565b6000602082840312156131f4576131f36110e6565b5b600082015167ffffffffffffffff811115613212576132116110eb565b5b61321e84828501612f1c565b91505092915050565b7f4661696c656420746f20646563726561736520616c6c6f77616e636500000000600082015250565b600061325d601c83611d69565b915061326882613227565b602082019050919050565b6000602082019050818103600083015261328c81613250565b9050919050565b6000819050919050565b600080833560016020038436030381126132ba576132b9612d5c565b5b83810192508235915060208301925067ffffffffffffffff8211156132e2576132e1612d52565b5b6001820236038313156132f8576132f7612d57565b5b509250929050565b600061330c8385611858565b9350613319838584611215565b61332283611158565b840190509392505050565b6000808335600160200384360303811261334a57613349612d5c565b5b83810192508235915060208301925067ffffffffffffffff82111561337257613371612d52565b5b60208202360383131561338857613387612d57565b5b509250929050565b6000819050919050565b60006133a960208401846112b5565b905092915050565b6000604083016133c4600084018461329d565b85830360008701526133d7838284613300565b925050506133e8602084018461339a565b6133f560208601826118f8565b508091505092915050565b600061340c83836133b1565b905092915050565b6000823560016040038336030381126134305761342f612d5c565b5b82810191505092915050565b6000602082019050919050565b600061345583856118d7565b93508360208402850161346784613390565b8060005b878110156134ab5784840389526134828284613414565b61348c8582613400565b94506134978361343c565b925060208a0199505060018101905061346b565b50829750879450505050509392505050565b600080833560016020038436030381126134da576134d9612d5c565b5b83810192508235915060208301925067ffffffffffffffff82111561350257613501612d52565b5b60208202360383131561351857613517612d57565b5b509250929050565b6000819050919050565b6000613537848484613300565b90509392505050565b6000602082019050919050565b600061355983856119e5565b93508360208402850161356b84613520565b8060005b878110156135b1578484038952613586828461329d565b61359186828461352a565b955061359c84613540565b935060208b019a50505060018101905061356f565b50829750879450505050509392505050565b600060a083016135d6600084018461329d565b85830360008701526135e9838284613300565b925050506135fa602084018461329d565b858303602087015261360d838284613300565b9250505061361e604084018461332d565b8583036040870152613631838284613449565b9250505061364260608401846134bd565b858303606087015261365583828461354d565b9250505061366660808401846134bd565b858303608087015261367983828461354d565b925050508091505092915050565b600061369383836135c3565b905092915050565b60008235600160a0038336030381126136b7576136b6612d5c565b5b82810191505092915050565b6000602082019050919050565b60006136dc838561182c565b9350836020840285016136ee84613293565b8060005b87811015613732578484038952613709828461369b565b6137138582613687565b945061371e836136c3565b925060208a019950506001810190506136f2565b50829750879450505050509392505050565b600060408201905061375960008301866124ac565b818103602083015261376c8184866136d0565b9050949350505050565b7f4661696c656420746f20706572666f726d20617070726f76616c000000000000600082015250565b60006137ac601a83611d69565b91506137b782613776565b602082019050919050565b600060208201905081810360008301526137db8161379f565b905091905056fea26469706673582212207be0ce4d0a8d92b87200fc1f1502c94bf3336b2ea1b72d9b3a8530020fc7057564736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063a363df841161008c578063dfa10f3911610066578063dfa10f3914610210578063ee5766d914610241578063f298e7a814610271578063f3675f081461028d576100cf565b8063a363df8414610194578063b9672879146101c4578063c595699a146101e0576100cf565b80631dba685b146100d4578063424af9f6146100f057806361bc221a1461010c5780636fdf23cc1461012a5780637492bdd81461015a5780637a6185e11461018a575b600080fd5b6100ee60048036038101906100e99190611302565b6102a9565b005b61010a6004803603810190610105919061149c565b61070f565b005b6101146107e9565b6040516101219190611581565b60405180910390f35b610144600480360381019061013f9190611636565b6107fa565b6040516101519190611788565b60405180910390f35b610174600480360381019061016f9190611636565b610898565b6040516101819190611788565b60405180910390f35b610192610936565b005b6101ae60048036038101906101a991906117e1565b6109fb565b6040516101bb9190611bc4565b60405180910390f35b6101de60048036038101906101d99190611be6565b610a88565b005b6101fa60048036038101906101f59190611d20565b610d4b565b6040516102079190611db3565b60405180910390f35b61022a60048036038101906102259190611df9565b610dd5565b604051610238929190611fe9565b60405180910390f35b61025b60048036038101906102569190611d20565b610e69565b6040516102689190612064565b60405180910390f35b61028b6004803603810190610286919061149c565b610ef9565b005b6102a760048036038101906102a291906120dc565b610fd3565b005b82156103a65760008081819054906101000a900460070b809291906102cd90612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008973ffffffffffffffffffffffffffffffffffffffff16600f60405161031e906121b9565b60006040518083038185875af1925050503d806000811461035b576040519150601f19603f3d011682016040523d82523d6000602084013e610360565b606091505b50509050806103a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161039b90612240565b60405180910390fd5b505b60006040518060400160405280606467ffffffffffffffff168152602001606467ffffffffffffffff16815250905061080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a60028b610403919061228f565b8f8b8860006040518963ffffffff1660e01b815260040161042b9897969594939291906123bb565b6020604051808303816000875af115801561044a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046e919061247f565b50821561056c5760008081819054906101000a900460070b8092919061049390612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008a73ffffffffffffffffffffffffffffffffffffffff16600f6040516104e4906121b9565b60006040518083038185875af1925050503d8060008114610521576040519150601f19603f3d011682016040523d82523d6000602084013e610526565b606091505b505090508061056a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056190612240565b60405180910390fd5b505b61080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a60028b61059a919061228f565b8f8b8860006040518963ffffffff1660e01b81526004016105c29897969594939291906123bb565b6020604051808303816000875af11580156105e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610605919061247f565b5081156107035760008081819054906101000a900460070b8092919061062a90612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008a73ffffffffffffffffffffffffffffffffffffffff16600f60405161067b906121b9565b60006040518083038185875af1925050503d80600081146106b8576040519150601f19603f3d011682016040523d82523d6000602084013e6106bd565b606091505b5050905080610701576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f890612240565b60405180910390fd5b505b50505050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff166354de647b308a8a8a8a8a8a8a6040518963ffffffff1660e01b815260040161075a9897969594939291906124e8565b6020604051808303816000875af1158015610779573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079d919061256b565b9050806107df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d6906125e4565b60405180910390fd5b5050505050505050565b60008054906101000a900460070b81565b600061080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a8a308b8b8b8b6040518a63ffffffff1660e01b815260040161084799989796959493929190612604565b6020604051808303816000875af1158015610866573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088a919061247f565b905098975050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff1663632535b98a8a8a8a338b8b8b8b6040518a63ffffffff1660e01b81526004016108e599989796959493929190612604565b6020604051808303816000875af1158015610904573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610928919061247f565b905098975050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff166374a8f103306040518263ffffffff1660e01b815260040161097391906126b5565b6020604051808303816000875af1158015610992573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b6919061256b565b9050806109f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ef9061271c565b60405180910390fd5b50565b606061080273ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff1660e01b8152600401610a3a92919061273c565b600060405180830381865afa158015610a57573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610a809190612c11565b905092915050565b8115610b855760008081819054906101000a900460070b80929190610aac90612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008973ffffffffffffffffffffffffffffffffffffffff16600f604051610afd906121b9565b60006040518083038185875af1925050503d8060008114610b3a576040519150601f19603f3d011682016040523d82523d6000602084013e610b3f565b606091505b5050905080610b83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7a90612240565b60405180910390fd5b505b60006040518060400160405280606467ffffffffffffffff168152602001606467ffffffffffffffff16815250905061080273ffffffffffffffffffffffffffffffffffffffff1663632535b9898989898e8a8860006040518963ffffffff1660e01b8152600401610bfe989796959493929190612c5a565b6020604051808303816000875af1158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c41919061247f565b508115610d3f5760008081819054906101000a900460070b80929190610c6690612158565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505060008a73ffffffffffffffffffffffffffffffffffffffff16600f604051610cb7906121b9565b60006040518083038185875af1925050503d8060008114610cf4576040519150601f19603f3d011682016040523d82523d6000602084013e610cf9565b606091505b5050905080610d3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3490612240565b60405180910390fd5b505b50505050505050505050565b606061080273ffffffffffffffffffffffffffffffffffffffff1663b5cb6e7d836040518263ffffffff1660e01b8152600401610d889190611db3565b600060405180830381865afa158015610da5573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610dce9190612d09565b9050919050565b6060610ddf61109e565b61080273ffffffffffffffffffffffffffffffffffffffff166322b6fad6846040518263ffffffff1660e01b8152600401610e1a9190612ece565b600060405180830381865afa158015610e37573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610e609190613166565b91509150915091565b610e716110c2565b61080273ffffffffffffffffffffffffffffffffffffffff1663a815cdd9836040518263ffffffff1660e01b8152600401610eac9190611db3565b600060405180830381865afa158015610ec9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610ef291906131de565b9050919050565b600061080273ffffffffffffffffffffffffffffffffffffffff1663b3f536ec308a8a8a8a8a8a8a6040518963ffffffff1660e01b8152600401610f449897969594939291906124e8565b6020604051808303816000875af1158015610f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f87919061256b565b905080610fc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc090613273565b60405180910390fd5b5050505050505050565b600061080273ffffffffffffffffffffffffffffffffffffffff1663473c90c73085856040518463ffffffff1660e01b815260040161101493929190613744565b6020604051808303816000875af1158015611033573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611057919061256b565b905080611099576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611090906137c2565b60405180910390fd5b505050565b604051806040016040528060608152602001600067ffffffffffffffff1681525090565b604051806040016040528060608152602001606081525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061111b826110f0565b9050919050565b61112b81611110565b811461113657600080fd5b50565b60008135905061114881611122565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6111a182611158565b810181811067ffffffffffffffff821117156111c0576111bf611169565b5b80604052505050565b60006111d36110dc565b90506111df8282611198565b919050565b600067ffffffffffffffff8211156111ff576111fe611169565b5b61120882611158565b9050602081019050919050565b82818337600083830152505050565b6000611237611232846111e4565b6111c9565b90508281526020810184848401111561125357611252611153565b5b61125e848285611215565b509392505050565b600082601f83011261127b5761127a61114e565b5b813561128b848260208601611224565b91505092915050565b6000819050919050565b6112a781611294565b81146112b257600080fd5b50565b6000813590506112c48161129e565b92915050565b60008115159050919050565b6112df816112ca565b81146112ea57600080fd5b50565b6000813590506112fc816112d6565b92915050565b60008060008060008060008060006101208a8c031215611325576113246110e6565b5b60006113338c828d01611139565b99505060208a013567ffffffffffffffff811115611354576113536110eb565b5b6113608c828d01611266565b98505060408a013567ffffffffffffffff811115611381576113806110eb565b5b61138d8c828d01611266565b97505060608a013567ffffffffffffffff8111156113ae576113ad6110eb565b5b6113ba8c828d01611266565b96505060806113cb8c828d016112b5565b95505060a08a013567ffffffffffffffff8111156113ec576113eb6110eb565b5b6113f88c828d01611266565b94505060c06114098c828d016112ed565b93505060e061141a8c828d016112ed565b92505061010061142c8c828d016112ed565b9150509295985092959850929598565b600080fd5b600080fd5b60008083601f84011261145c5761145b61114e565b5b8235905067ffffffffffffffff8111156114795761147861143c565b5b60208301915083600182028301111561149557611494611441565b5b9250929050565b60008060008060008060006080888a0312156114bb576114ba6110e6565b5b600088013567ffffffffffffffff8111156114d9576114d86110eb565b5b6114e58a828b01611446565b9750975050602088013567ffffffffffffffff811115611508576115076110eb565b5b6115148a828b01611446565b9550955050604088013567ffffffffffffffff811115611537576115366110eb565b5b6115438a828b01611446565b935093505060606115568a828b016112b5565b91505092959891949750929550565b60008160070b9050919050565b61157b81611565565b82525050565b60006020820190506115966000830184611572565b92915050565b600080fd5b600080fd5b600067ffffffffffffffff82169050919050565b6115c3816115a6565b81146115ce57600080fd5b50565b6000813590506115e0816115ba565b92915050565b6000604082840312156115fc576115fb61159c565b5b61160660406111c9565b90506000611616848285016115d1565b600083015250602061162a848285016115d1565b60208301525092915050565b600080600080600080600080610120898b031215611657576116566110e6565b5b600089013567ffffffffffffffff811115611675576116746110eb565b5b6116818b828c01611266565b985050602089013567ffffffffffffffff8111156116a2576116a16110eb565b5b6116ae8b828c01611266565b975050604089013567ffffffffffffffff8111156116cf576116ce6110eb565b5b6116db8b828c01611266565b96505060606116ec8b828c016112b5565b955050608089013567ffffffffffffffff81111561170d5761170c6110eb565b5b6117198b828c01611266565b94505060a061172a8b828c016115e6565b93505060e061173b8b828c016115d1565b92505061010089013567ffffffffffffffff81111561175d5761175c6110eb565b5b6117698b828c01611266565b9150509295985092959890939650565b611782816115a6565b82525050565b600060208201905061179d6000830184611779565b92915050565b60006117ae826110f0565b9050919050565b6117be816117a3565b81146117c957600080fd5b50565b6000813590506117db816117b5565b92915050565b600080604083850312156117f8576117f76110e6565b5b6000611806858286016117cc565b9250506020611817858286016117cc565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561188757808201518184015260208101905061186c565b60008484015250505050565b600061189e8261184d565b6118a88185611858565b93506118b8818560208601611869565b6118c181611158565b840191505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61190181611294565b82525050565b600060408301600083015184820360008601526119248282611893565b915050602083015161193960208601826118f8565b508091505092915050565b60006119508383611907565b905092915050565b6000602082019050919050565b6000611970826118cc565b61197a81856118d7565b93508360208202850161198c856118e8565b8060005b858110156119c857848403895281516119a98582611944565b94506119b483611958565b925060208a01995050600181019050611990565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000611a128383611893565b905092915050565b6000602082019050919050565b6000611a32826119da565b611a3c81856119e5565b935083602082028501611a4e856119f6565b8060005b85811015611a8a5784840389528151611a6b8582611a06565b9450611a7683611a1a565b925060208a01995050600181019050611a52565b50829750879550505050505092915050565b600060a0830160008301518482036000860152611ab98282611893565b91505060208301518482036020860152611ad38282611893565b91505060408301518482036040860152611aed8282611965565b91505060608301518482036060860152611b078282611a27565b91505060808301518482036080860152611b218282611a27565b9150508091505092915050565b6000611b3a8383611a9c565b905092915050565b6000602082019050919050565b6000611b5a82611821565b611b64818561182c565b935083602082028501611b768561183d565b8060005b85811015611bb25784840389528151611b938582611b2e565b9450611b9e83611b42565b925060208a01995050600181019050611b7a565b50829750879550505050505092915050565b60006020820190508181036000830152611bde8184611b4f565b905092915050565b60008060008060008060008060006101208a8c031215611c0957611c086110e6565b5b6000611c178c828d01611139565b9950506020611c288c828d016117cc565b98505060408a013567ffffffffffffffff811115611c4957611c486110eb565b5b611c558c828d01611266565b97505060608a013567ffffffffffffffff811115611c7657611c756110eb565b5b611c828c828d01611266565b96505060808a013567ffffffffffffffff811115611ca357611ca26110eb565b5b611caf8c828d01611266565b95505060a0611cc08c828d016112b5565b94505060c08a013567ffffffffffffffff811115611ce157611ce06110eb565b5b611ced8c828d01611266565b93505060e0611cfe8c828d016112ed565b925050610100611d108c828d016112ed565b9150509295985092959850929598565b600060208284031215611d3657611d356110e6565b5b600082013567ffffffffffffffff811115611d5457611d536110eb565b5b611d6084828501611266565b91505092915050565b600082825260208201905092915050565b6000611d858261184d565b611d8f8185611d69565b9350611d9f818560208601611869565b611da881611158565b840191505092915050565b60006020820190508181036000830152611dcd8184611d7a565b905092915050565b600080fd5b600060a08284031215611df057611def611dd5565b5b81905092915050565b600060208284031215611e0f57611e0e6110e6565b5b600082013567ffffffffffffffff811115611e2d57611e2c6110eb565b5b611e3984828501611dda565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006040830160008301518482036000860152611e8b8282611893565b91505060208301518482036020860152611ea58282611893565b9150508091505092915050565b6000611ebe8383611e6e565b905092915050565b6000602082019050919050565b6000611ede82611e42565b611ee88185611e4d565b935083602082028501611efa85611e5e565b8060005b85811015611f365784840389528151611f178582611eb2565b9450611f2283611ec6565b925060208a01995050600181019050611efe565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b6000611f6f82611f48565b611f798185611f53565b9350611f89818560208601611869565b611f9281611158565b840191505092915050565b611fa6816115a6565b82525050565b60006040830160008301518482036000860152611fc98282611f64565b9150506020830151611fde6020860182611f9d565b508091505092915050565b600060408201905081810360008301526120038185611ed3565b905081810360208301526120178184611fac565b90509392505050565b6000604083016000830151848203600086015261203d8282611893565b915050602083015184820360208601526120578282611893565b9150508091505092915050565b6000602082019050818103600083015261207e8184612020565b905092915050565b60008083601f84011261209c5761209b61114e565b5b8235905067ffffffffffffffff8111156120b9576120b861143c565b5b6020830191508360208202830111156120d5576120d4611441565b5b9250929050565b600080602083850312156120f3576120f26110e6565b5b600083013567ffffffffffffffff811115612111576121106110eb565b5b61211d85828601612086565b92509250509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061216382611565565b9150677fffffffffffffff820361217d5761217c612129565b5b600182019050919050565b600081905092915050565b50565b60006121a3600083612188565b91506121ae82612193565b600082019050919050565b60006121c482612196565b9150819050919050565b7f4661696c656420746f2073656e6420457468657220746f2064656c656761746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061222a602183611d69565b9150612235826121ce565b604082019050919050565b600060208201905081810360008301526122598161221d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061229a82611294565b91506122a583611294565b9250826122b5576122b4612260565b5b828204905092915050565b6122c981611294565b82525050565b6000819050919050565b60006122f46122ef6122ea846110f0565b6122cf565b6110f0565b9050919050565b6000612306826122d9565b9050919050565b6000612318826122fb565b9050919050565b6123288161230d565b82525050565b6040820160008201516123446000850182611f9d565b5060208201516123576020850182611f9d565b50505050565b6000819050919050565b600061238261237d6123788461235d565b6122cf565b6115a6565b9050919050565b61239281612367565b82525050565b60006123a5600083611d69565b91506123b082612193565b600082019050919050565b60006101408201905081810360008301526123d6818b611d7a565b905081810360208301526123ea818a611d7a565b905081810360408301526123fe8189611d7a565b905061240d60608301886122c0565b61241a608083018761231f565b81810360a083015261242c8186611d7a565b905061243b60c083018561232e565b612449610100830184612389565b81810361012083015261245b81612398565b90509998505050505050505050565b600081519050612479816115ba565b92915050565b600060208284031215612495576124946110e6565b5b60006124a38482850161246a565b91505092915050565b6124b5816117a3565b82525050565b60006124c78385611d69565b93506124d4838584611215565b6124dd83611158565b840190509392505050565b600060a0820190506124fd600083018b6124ac565b818103602083015261251081898b6124bb565b905081810360408301526125258187896124bb565b9050818103606083015261253a8185876124bb565b905061254960808301846122c0565b9998505050505050505050565b600081519050612565816112d6565b92915050565b600060208284031215612581576125806110e6565b5b600061258f84828501612556565b91505092915050565b7f4661696c656420746f20696e63726561736520616c6c6f77616e636500000000600082015250565b60006125ce601c83611d69565b91506125d982612598565b602082019050919050565b600060208201905081810360008301526125fd816125c1565b9050919050565b600061014082019050818103600083015261261f818c611d7a565b90508181036020830152612633818b611d7a565b90508181036040830152612647818a611d7a565b905061265660608301896122c0565b61266360808301886124ac565b81810360a08301526126758187611d7a565b905061268460c083018661232e565b612692610100830185611779565b8181036101208301526126a58184611d7a565b90509a9950505050505050505050565b60006020820190506126ca60008301846124ac565b92915050565b7f4661696c656420746f207265766f6b6520617070726f76616c00000000000000600082015250565b6000612706601983611d69565b9150612711826126d0565b602082019050919050565b60006020820190508181036000830152612735816126f9565b9050919050565b600060408201905061275160008301856124ac565b61275e60208301846124ac565b9392505050565b600067ffffffffffffffff8211156127805761277f611169565b5b602082029050602081019050919050565b60006127a461279f846111e4565b6111c9565b9050828152602081018484840111156127c0576127bf611153565b5b6127cb848285611869565b509392505050565b600082601f8301126127e8576127e761114e565b5b81516127f8848260208601612791565b91505092915050565b600067ffffffffffffffff82111561281c5761281b611169565b5b602082029050602081019050919050565b60008151905061283c8161129e565b92915050565b6000604082840312156128585761285761159c565b5b61286260406111c9565b9050600082015167ffffffffffffffff811115612882576128816115a1565b5b61288e848285016127d3565b60008301525060206128a28482850161282d565b60208301525092915050565b60006128c16128bc84612801565b6111c9565b905080838252602082019050602084028301858111156128e4576128e3611441565b5b835b8181101561292b57805167ffffffffffffffff8111156129095761290861114e565b5b8086016129168982612842565b855260208501945050506020810190506128e6565b5050509392505050565b600082601f83011261294a5761294961114e565b5b815161295a8482602086016128ae565b91505092915050565b600067ffffffffffffffff82111561297e5761297d611169565b5b602082029050602081019050919050565b60006129a261299d84612963565b6111c9565b905080838252602082019050602084028301858111156129c5576129c4611441565b5b835b81811015612a0c57805167ffffffffffffffff8111156129ea576129e961114e565b5b8086016129f789826127d3565b855260208501945050506020810190506129c7565b5050509392505050565b600082601f830112612a2b57612a2a61114e565b5b8151612a3b84826020860161298f565b91505092915050565b600060a08284031215612a5a57612a5961159c565b5b612a6460a06111c9565b9050600082015167ffffffffffffffff811115612a8457612a836115a1565b5b612a90848285016127d3565b600083015250602082015167ffffffffffffffff811115612ab457612ab36115a1565b5b612ac0848285016127d3565b602083015250604082015167ffffffffffffffff811115612ae457612ae36115a1565b5b612af084828501612935565b604083015250606082015167ffffffffffffffff811115612b1457612b136115a1565b5b612b2084828501612a16565b606083015250608082015167ffffffffffffffff811115612b4457612b436115a1565b5b612b5084828501612a16565b60808301525092915050565b6000612b6f612b6a84612765565b6111c9565b90508083825260208201905060208402830185811115612b9257612b91611441565b5b835b81811015612bd957805167ffffffffffffffff811115612bb757612bb661114e565b5b808601612bc48982612a44565b85526020850194505050602081019050612b94565b5050509392505050565b600082601f830112612bf857612bf761114e565b5b8151612c08848260208601612b5c565b91505092915050565b600060208284031215612c2757612c266110e6565b5b600082015167ffffffffffffffff811115612c4557612c446110eb565b5b612c5184828501612be3565b91505092915050565b6000610140820190508181036000830152612c75818b611d7a565b90508181036020830152612c89818a611d7a565b90508181036040830152612c9d8189611d7a565b9050612cac60608301886122c0565b612cb960808301876124ac565b81810360a0830152612ccb8186611d7a565b9050612cda60c083018561232e565b612ce8610100830184612389565b818103610120830152612cfa81612398565b90509998505050505050505050565b600060208284031215612d1f57612d1e6110e6565b5b600082015167ffffffffffffffff811115612d3d57612d3c6110eb565b5b612d49848285016127d3565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112612d7e57612d7d612d5c565b5b83810192508235915060208301925067ffffffffffffffff821115612da657612da5612d52565b5b600182023603831315612dbc57612dbb612d57565b5b509250929050565b6000612dd08385611f53565b9350612ddd838584611215565b612de683611158565b840190509392505050565b6000612e0060208401846115d1565b905092915050565b6000612e1760208401846112ed565b905092915050565b612e28816112ca565b82525050565b600060a08301612e416000840184612d61565b8583036000870152612e54838284612dc4565b92505050612e656020840184612df1565b612e726020860182611f9d565b50612e806040840184612df1565b612e8d6040860182611f9d565b50612e9b6060840184612e08565b612ea86060860182612e1f565b50612eb66080840184612e08565b612ec36080860182612e1f565b508091505092915050565b60006020820190508181036000830152612ee88184612e2e565b905092915050565b600067ffffffffffffffff821115612f0b57612f0a611169565b5b602082029050602081019050919050565b600060408284031215612f3257612f3161159c565b5b612f3c60406111c9565b9050600082015167ffffffffffffffff811115612f5c57612f5b6115a1565b5b612f68848285016127d3565b600083015250602082015167ffffffffffffffff811115612f8c57612f8b6115a1565b5b612f98848285016127d3565b60208301525092915050565b6000612fb7612fb284612ef0565b6111c9565b90508083825260208201905060208402830185811115612fda57612fd9611441565b5b835b8181101561302157805167ffffffffffffffff811115612fff57612ffe61114e565b5b80860161300c8982612f1c565b85526020850194505050602081019050612fdc565b5050509392505050565b600082601f8301126130405761303f61114e565b5b8151613050848260208601612fa4565b91505092915050565b600067ffffffffffffffff82111561307457613073611169565b5b61307d82611158565b9050602081019050919050565b600061309d61309884613059565b6111c9565b9050828152602081018484840111156130b9576130b8611153565b5b6130c4848285611869565b509392505050565b600082601f8301126130e1576130e061114e565b5b81516130f184826020860161308a565b91505092915050565b6000604082840312156131105761310f61159c565b5b61311a60406111c9565b9050600082015167ffffffffffffffff81111561313a576131396115a1565b5b613146848285016130cc565b600083015250602061315a8482850161246a565b60208301525092915050565b6000806040838503121561317d5761317c6110e6565b5b600083015167ffffffffffffffff81111561319b5761319a6110eb565b5b6131a78582860161302b565b925050602083015167ffffffffffffffff8111156131c8576131c76110eb565b5b6131d4858286016130fa565b9150509250929050565b6000602082840312156131f4576131f36110e6565b5b600082015167ffffffffffffffff811115613212576132116110eb565b5b61321e84828501612f1c565b91505092915050565b7f4661696c656420746f20646563726561736520616c6c6f77616e636500000000600082015250565b600061325d601c83611d69565b915061326882613227565b602082019050919050565b6000602082019050818103600083015261328c81613250565b9050919050565b6000819050919050565b600080833560016020038436030381126132ba576132b9612d5c565b5b83810192508235915060208301925067ffffffffffffffff8211156132e2576132e1612d52565b5b6001820236038313156132f8576132f7612d57565b5b509250929050565b600061330c8385611858565b9350613319838584611215565b61332283611158565b840190509392505050565b6000808335600160200384360303811261334a57613349612d5c565b5b83810192508235915060208301925067ffffffffffffffff82111561337257613371612d52565b5b60208202360383131561338857613387612d57565b5b509250929050565b6000819050919050565b60006133a960208401846112b5565b905092915050565b6000604083016133c4600084018461329d565b85830360008701526133d7838284613300565b925050506133e8602084018461339a565b6133f560208601826118f8565b508091505092915050565b600061340c83836133b1565b905092915050565b6000823560016040038336030381126134305761342f612d5c565b5b82810191505092915050565b6000602082019050919050565b600061345583856118d7565b93508360208402850161346784613390565b8060005b878110156134ab5784840389526134828284613414565b61348c8582613400565b94506134978361343c565b925060208a0199505060018101905061346b565b50829750879450505050509392505050565b600080833560016020038436030381126134da576134d9612d5c565b5b83810192508235915060208301925067ffffffffffffffff82111561350257613501612d52565b5b60208202360383131561351857613517612d57565b5b509250929050565b6000819050919050565b6000613537848484613300565b90509392505050565b6000602082019050919050565b600061355983856119e5565b93508360208402850161356b84613520565b8060005b878110156135b1578484038952613586828461329d565b61359186828461352a565b955061359c84613540565b935060208b019a50505060018101905061356f565b50829750879450505050509392505050565b600060a083016135d6600084018461329d565b85830360008701526135e9838284613300565b925050506135fa602084018461329d565b858303602087015261360d838284613300565b9250505061361e604084018461332d565b8583036040870152613631838284613449565b9250505061364260608401846134bd565b858303606087015261365583828461354d565b9250505061366660808401846134bd565b858303608087015261367983828461354d565b925050508091505092915050565b600061369383836135c3565b905092915050565b60008235600160a0038336030381126136b7576136b6612d5c565b5b82810191505092915050565b6000602082019050919050565b60006136dc838561182c565b9350836020840285016136ee84613293565b8060005b87811015613732578484038952613709828461369b565b6137138582613687565b945061371e836136c3565b925060208a019950506001810190506136f2565b50829750879450505050509392505050565b600060408201905061375960008301866124ac565b818103602083015261376c8184866136d0565b9050949350505050565b7f4661696c656420746f20706572666f726d20617070726f76616c000000000000600082015250565b60006137ac601a83611d69565b91506137b782613776565b602082019050919050565b600060208201905081810360008301526137db8161379f565b905091905056fea26469706673582212207be0ce4d0a8d92b87200fc1f1502c94bf3336b2ea1b72d9b3a8530020fc7057564736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/testutil/contracts/InterchainSenderCaller.json b/precompiles/testutil/contracts/InterchainSenderCaller.json index 83b75ba8..a5d70ab9 100644 --- a/precompiles/testutil/contracts/InterchainSenderCaller.json +++ b/precompiles/testutil/contracts/InterchainSenderCaller.json @@ -180,8 +180,8 @@ "type": "function" } ], - "bytecode": "0x6080604052604051610c04380380610c04833981810160405281019061002591906100cf565b80600060086101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100fc565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061009c82610071565b9050919050565b6100ac81610091565b81146100b757600080fd5b50565b6000815190506100c9816100a3565b92915050565b6000602082840312156100e5576100e461006c565b5b60006100f3848285016100ba565b91505092915050565b610af98061010b6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063073989ff1461005c578063427c1cb61461007857806361bc221a1461009457806369a98b2b146100b2578063ec3c5a14146100ce575b600080fd5b61007660048036038101906100719190610752565b6100ea565b005b610092600480360381019061008d9190610752565b6101f1565b005b61009c61030d565b6040516100a9919061086b565b60405180910390f35b6100cc60048036038101906100c79190610752565b61031e565b005b6100e860048036038101906100e39190610752565b6104c4565b005b60008081819054906101000a900460070b80929190610108906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff1663427c1cb68787878787876040518763ffffffff1660e01b815260040161017596959493929190610982565b600060405180830381600087803b15801561018f57600080fd5b505af19250505080156101a0575060015b5060008081819054906101000a900460070b809291906101bf906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555050505050505050565b600060089054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dba685b87878787878760018060016040518a63ffffffff1660e01b815260040161025e99989796959493929190610a1a565b600060405180830381600087803b15801561027857600080fd5b505af115801561028c573d6000803e3d6000fd5b505050503073ffffffffffffffffffffffffffffffffffffffff1663ec3c5a148787878787876040518763ffffffff1660e01b81526004016102d396959493929190610982565b600060405180830381600087803b1580156102ed57600080fd5b505af1158015610301573d6000803e3d6000fd5b50505050505050505050565b60008054906101000a900460070b81565b60008081819054906101000a900460070b8092919061033c906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555050600060089054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dba685b87878787878760018060016040518a63ffffffff1660e01b81526004016103d399989796959493929190610a1a565b600060405180830381600087803b1580156103ed57600080fd5b505af1158015610401573d6000803e3d6000fd5b505050503073ffffffffffffffffffffffffffffffffffffffff1663ec3c5a148787878787876040518763ffffffff1660e01b815260040161044896959493929190610982565b600060405180830381600087803b15801561046257600080fd5b505af1925050508015610473575060015b5060008081819054906101000a900460070b80929190610492906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555050505050505050565b600060089054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dba685b87878787878760018060016040518a63ffffffff1660e01b815260040161053199989796959493929190610a1a565b600060405180830381600087803b15801561054b57600080fd5b505af115801561055f573d6000803e3d6000fd5b600080fd5b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006105a382610578565b9050919050565b6105b381610598565b81146105be57600080fd5b50565b6000813590506105d0816105aa565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610629826105e0565b810181811067ffffffffffffffff82111715610648576106476105f1565b5b80604052505050565b600061065b610564565b90506106678282610620565b919050565b600067ffffffffffffffff821115610687576106866105f1565b5b610690826105e0565b9050602081019050919050565b82818337600083830152505050565b60006106bf6106ba8461066c565b610651565b9050828152602081018484840111156106db576106da6105db565b5b6106e684828561069d565b509392505050565b600082601f830112610703576107026105d6565b5b81356107138482602086016106ac565b91505092915050565b6000819050919050565b61072f8161071c565b811461073a57600080fd5b50565b60008135905061074c81610726565b92915050565b60008060008060008060c0878903121561076f5761076e61056e565b5b600061077d89828a016105c1565b965050602087013567ffffffffffffffff81111561079e5761079d610573565b5b6107aa89828a016106ee565b955050604087013567ffffffffffffffff8111156107cb576107ca610573565b5b6107d789828a016106ee565b945050606087013567ffffffffffffffff8111156107f8576107f7610573565b5b61080489828a016106ee565b935050608061081589828a0161073d565b92505060a087013567ffffffffffffffff81111561083657610835610573565b5b61084289828a016106ee565b9150509295509295509295565b60008160070b9050919050565b6108658161084f565b82525050565b6000602082019050610880600083018461085c565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006108c08261084f565b9150677fffffffffffffff82036108da576108d9610886565b5b600182019050919050565b6108ee81610598565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561092e578082015181840152602081019050610913565b60008484015250505050565b6000610945826108f4565b61094f81856108ff565b935061095f818560208601610910565b610968816105e0565b840191505092915050565b61097c8161071c565b82525050565b600060c08201905061099760008301896108e5565b81810360208301526109a9818861093a565b905081810360408301526109bd818761093a565b905081810360608301526109d1818661093a565b90506109e06080830185610973565b81810360a08301526109f2818461093a565b9050979650505050505050565b60008115159050919050565b610a14816109ff565b82525050565b600061012082019050610a30600083018c6108e5565b8181036020830152610a42818b61093a565b90508181036040830152610a56818a61093a565b90508181036060830152610a6a818961093a565b9050610a796080830188610973565b81810360a0830152610a8b818761093a565b9050610a9a60c0830186610a0b565b610aa760e0830185610a0b565b610ab5610100830184610a0b565b9a995050505050505050505056fea26469706673582212204a432452bb0bd915f708a0a4612563309d280b35f9edfe9f1f0be2ed5db8033464736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063073989ff1461005c578063427c1cb61461007857806361bc221a1461009457806369a98b2b146100b2578063ec3c5a14146100ce575b600080fd5b61007660048036038101906100719190610752565b6100ea565b005b610092600480360381019061008d9190610752565b6101f1565b005b61009c61030d565b6040516100a9919061086b565b60405180910390f35b6100cc60048036038101906100c79190610752565b61031e565b005b6100e860048036038101906100e39190610752565b6104c4565b005b60008081819054906101000a900460070b80929190610108906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff1663427c1cb68787878787876040518763ffffffff1660e01b815260040161017596959493929190610982565b600060405180830381600087803b15801561018f57600080fd5b505af19250505080156101a0575060015b5060008081819054906101000a900460070b809291906101bf906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555050505050505050565b600060089054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dba685b87878787878760018060016040518a63ffffffff1660e01b815260040161025e99989796959493929190610a1a565b600060405180830381600087803b15801561027857600080fd5b505af115801561028c573d6000803e3d6000fd5b505050503073ffffffffffffffffffffffffffffffffffffffff1663ec3c5a148787878787876040518763ffffffff1660e01b81526004016102d396959493929190610982565b600060405180830381600087803b1580156102ed57600080fd5b505af1158015610301573d6000803e3d6000fd5b50505050505050505050565b60008054906101000a900460070b81565b60008081819054906101000a900460070b8092919061033c906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555050600060089054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dba685b87878787878760018060016040518a63ffffffff1660e01b81526004016103d399989796959493929190610a1a565b600060405180830381600087803b1580156103ed57600080fd5b505af1158015610401573d6000803e3d6000fd5b505050503073ffffffffffffffffffffffffffffffffffffffff1663ec3c5a148787878787876040518763ffffffff1660e01b815260040161044896959493929190610982565b600060405180830381600087803b15801561046257600080fd5b505af1925050508015610473575060015b5060008081819054906101000a900460070b80929190610492906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555050505050505050565b600060089054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dba685b87878787878760018060016040518a63ffffffff1660e01b815260040161053199989796959493929190610a1a565b600060405180830381600087803b15801561054b57600080fd5b505af115801561055f573d6000803e3d6000fd5b600080fd5b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006105a382610578565b9050919050565b6105b381610598565b81146105be57600080fd5b50565b6000813590506105d0816105aa565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610629826105e0565b810181811067ffffffffffffffff82111715610648576106476105f1565b5b80604052505050565b600061065b610564565b90506106678282610620565b919050565b600067ffffffffffffffff821115610687576106866105f1565b5b610690826105e0565b9050602081019050919050565b82818337600083830152505050565b60006106bf6106ba8461066c565b610651565b9050828152602081018484840111156106db576106da6105db565b5b6106e684828561069d565b509392505050565b600082601f830112610703576107026105d6565b5b81356107138482602086016106ac565b91505092915050565b6000819050919050565b61072f8161071c565b811461073a57600080fd5b50565b60008135905061074c81610726565b92915050565b60008060008060008060c0878903121561076f5761076e61056e565b5b600061077d89828a016105c1565b965050602087013567ffffffffffffffff81111561079e5761079d610573565b5b6107aa89828a016106ee565b955050604087013567ffffffffffffffff8111156107cb576107ca610573565b5b6107d789828a016106ee565b945050606087013567ffffffffffffffff8111156107f8576107f7610573565b5b61080489828a016106ee565b935050608061081589828a0161073d565b92505060a087013567ffffffffffffffff81111561083657610835610573565b5b61084289828a016106ee565b9150509295509295509295565b60008160070b9050919050565b6108658161084f565b82525050565b6000602082019050610880600083018461085c565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006108c08261084f565b9150677fffffffffffffff82036108da576108d9610886565b5b600182019050919050565b6108ee81610598565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561092e578082015181840152602081019050610913565b60008484015250505050565b6000610945826108f4565b61094f81856108ff565b935061095f818560208601610910565b610968816105e0565b840191505092915050565b61097c8161071c565b82525050565b600060c08201905061099760008301896108e5565b81810360208301526109a9818861093a565b905081810360408301526109bd818761093a565b905081810360608301526109d1818661093a565b90506109e06080830185610973565b81810360a08301526109f2818461093a565b9050979650505050505050565b60008115159050919050565b610a14816109ff565b82525050565b600061012082019050610a30600083018c6108e5565b8181036020830152610a42818b61093a565b90508181036040830152610a56818a61093a565b90508181036060830152610a6a818961093a565b9050610a796080830188610973565b81810360a0830152610a8b818761093a565b9050610a9a60c0830186610a0b565b610aa760e0830185610a0b565b610ab5610100830184610a0b565b9a995050505050505050505056fea26469706673582212204a432452bb0bd915f708a0a4612563309d280b35f9edfe9f1f0be2ed5db8033464736f6c63430008130033", + "bytecode": "0x6080604052604051610c04380380610c04833981810160405281019061002591906100cf565b80600060086101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100fc565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061009c82610071565b9050919050565b6100ac81610091565b81146100b757600080fd5b50565b6000815190506100c9816100a3565b92915050565b6000602082840312156100e5576100e461006c565b5b60006100f3848285016100ba565b91505092915050565b610af98061010b6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063073989ff1461005c578063427c1cb61461007857806361bc221a1461009457806369a98b2b146100b2578063ec3c5a14146100ce575b600080fd5b61007660048036038101906100719190610752565b6100ea565b005b610092600480360381019061008d9190610752565b6101f1565b005b61009c61030d565b6040516100a9919061086b565b60405180910390f35b6100cc60048036038101906100c79190610752565b61031e565b005b6100e860048036038101906100e39190610752565b6104c4565b005b60008081819054906101000a900460070b80929190610108906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff1663427c1cb68787878787876040518763ffffffff1660e01b815260040161017596959493929190610982565b600060405180830381600087803b15801561018f57600080fd5b505af19250505080156101a0575060015b5060008081819054906101000a900460070b809291906101bf906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555050505050505050565b600060089054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dba685b87878787878760018060016040518a63ffffffff1660e01b815260040161025e99989796959493929190610a1a565b600060405180830381600087803b15801561027857600080fd5b505af115801561028c573d6000803e3d6000fd5b505050503073ffffffffffffffffffffffffffffffffffffffff1663ec3c5a148787878787876040518763ffffffff1660e01b81526004016102d396959493929190610982565b600060405180830381600087803b1580156102ed57600080fd5b505af1158015610301573d6000803e3d6000fd5b50505050505050505050565b60008054906101000a900460070b81565b60008081819054906101000a900460070b8092919061033c906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555050600060089054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dba685b87878787878760018060016040518a63ffffffff1660e01b81526004016103d399989796959493929190610a1a565b600060405180830381600087803b1580156103ed57600080fd5b505af1158015610401573d6000803e3d6000fd5b505050503073ffffffffffffffffffffffffffffffffffffffff1663ec3c5a148787878787876040518763ffffffff1660e01b815260040161044896959493929190610982565b600060405180830381600087803b15801561046257600080fd5b505af1925050508015610473575060015b5060008081819054906101000a900460070b80929190610492906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555050505050505050565b600060089054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dba685b87878787878760018060016040518a63ffffffff1660e01b815260040161053199989796959493929190610a1a565b600060405180830381600087803b15801561054b57600080fd5b505af115801561055f573d6000803e3d6000fd5b600080fd5b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006105a382610578565b9050919050565b6105b381610598565b81146105be57600080fd5b50565b6000813590506105d0816105aa565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610629826105e0565b810181811067ffffffffffffffff82111715610648576106476105f1565b5b80604052505050565b600061065b610564565b90506106678282610620565b919050565b600067ffffffffffffffff821115610687576106866105f1565b5b610690826105e0565b9050602081019050919050565b82818337600083830152505050565b60006106bf6106ba8461066c565b610651565b9050828152602081018484840111156106db576106da6105db565b5b6106e684828561069d565b509392505050565b600082601f830112610703576107026105d6565b5b81356107138482602086016106ac565b91505092915050565b6000819050919050565b61072f8161071c565b811461073a57600080fd5b50565b60008135905061074c81610726565b92915050565b60008060008060008060c0878903121561076f5761076e61056e565b5b600061077d89828a016105c1565b965050602087013567ffffffffffffffff81111561079e5761079d610573565b5b6107aa89828a016106ee565b955050604087013567ffffffffffffffff8111156107cb576107ca610573565b5b6107d789828a016106ee565b945050606087013567ffffffffffffffff8111156107f8576107f7610573565b5b61080489828a016106ee565b935050608061081589828a0161073d565b92505060a087013567ffffffffffffffff81111561083657610835610573565b5b61084289828a016106ee565b9150509295509295509295565b60008160070b9050919050565b6108658161084f565b82525050565b6000602082019050610880600083018461085c565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006108c08261084f565b9150677fffffffffffffff82036108da576108d9610886565b5b600182019050919050565b6108ee81610598565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561092e578082015181840152602081019050610913565b60008484015250505050565b6000610945826108f4565b61094f81856108ff565b935061095f818560208601610910565b610968816105e0565b840191505092915050565b61097c8161071c565b82525050565b600060c08201905061099760008301896108e5565b81810360208301526109a9818861093a565b905081810360408301526109bd818761093a565b905081810360608301526109d1818661093a565b90506109e06080830185610973565b81810360a08301526109f2818461093a565b9050979650505050505050565b60008115159050919050565b610a14816109ff565b82525050565b600061012082019050610a30600083018c6108e5565b8181036020830152610a42818b61093a565b90508181036040830152610a56818a61093a565b90508181036060830152610a6a818961093a565b9050610a796080830188610973565b81810360a0830152610a8b818761093a565b9050610a9a60c0830186610a0b565b610aa760e0830185610a0b565b610ab5610100830184610a0b565b9a995050505050505050505056fea264697066735822122006c420c5aa76bec23eee91c787113b6c1dfdae997bcb2dcf4c8df1eba21043d964736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063073989ff1461005c578063427c1cb61461007857806361bc221a1461009457806369a98b2b146100b2578063ec3c5a14146100ce575b600080fd5b61007660048036038101906100719190610752565b6100ea565b005b610092600480360381019061008d9190610752565b6101f1565b005b61009c61030d565b6040516100a9919061086b565b60405180910390f35b6100cc60048036038101906100c79190610752565b61031e565b005b6100e860048036038101906100e39190610752565b6104c4565b005b60008081819054906101000a900460070b80929190610108906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550503073ffffffffffffffffffffffffffffffffffffffff1663427c1cb68787878787876040518763ffffffff1660e01b815260040161017596959493929190610982565b600060405180830381600087803b15801561018f57600080fd5b505af19250505080156101a0575060015b5060008081819054906101000a900460070b809291906101bf906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555050505050505050565b600060089054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dba685b87878787878760018060016040518a63ffffffff1660e01b815260040161025e99989796959493929190610a1a565b600060405180830381600087803b15801561027857600080fd5b505af115801561028c573d6000803e3d6000fd5b505050503073ffffffffffffffffffffffffffffffffffffffff1663ec3c5a148787878787876040518763ffffffff1660e01b81526004016102d396959493929190610982565b600060405180830381600087803b1580156102ed57600080fd5b505af1158015610301573d6000803e3d6000fd5b50505050505050505050565b60008054906101000a900460070b81565b60008081819054906101000a900460070b8092919061033c906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555050600060089054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dba685b87878787878760018060016040518a63ffffffff1660e01b81526004016103d399989796959493929190610a1a565b600060405180830381600087803b1580156103ed57600080fd5b505af1158015610401573d6000803e3d6000fd5b505050503073ffffffffffffffffffffffffffffffffffffffff1663ec3c5a148787878787876040518763ffffffff1660e01b815260040161044896959493929190610982565b600060405180830381600087803b15801561046257600080fd5b505af1925050508015610473575060015b5060008081819054906101000a900460070b80929190610492906108b5565b91906101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff16021790555050505050505050565b600060089054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631dba685b87878787878760018060016040518a63ffffffff1660e01b815260040161053199989796959493929190610a1a565b600060405180830381600087803b15801561054b57600080fd5b505af115801561055f573d6000803e3d6000fd5b600080fd5b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006105a382610578565b9050919050565b6105b381610598565b81146105be57600080fd5b50565b6000813590506105d0816105aa565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610629826105e0565b810181811067ffffffffffffffff82111715610648576106476105f1565b5b80604052505050565b600061065b610564565b90506106678282610620565b919050565b600067ffffffffffffffff821115610687576106866105f1565b5b610690826105e0565b9050602081019050919050565b82818337600083830152505050565b60006106bf6106ba8461066c565b610651565b9050828152602081018484840111156106db576106da6105db565b5b6106e684828561069d565b509392505050565b600082601f830112610703576107026105d6565b5b81356107138482602086016106ac565b91505092915050565b6000819050919050565b61072f8161071c565b811461073a57600080fd5b50565b60008135905061074c81610726565b92915050565b60008060008060008060c0878903121561076f5761076e61056e565b5b600061077d89828a016105c1565b965050602087013567ffffffffffffffff81111561079e5761079d610573565b5b6107aa89828a016106ee565b955050604087013567ffffffffffffffff8111156107cb576107ca610573565b5b6107d789828a016106ee565b945050606087013567ffffffffffffffff8111156107f8576107f7610573565b5b61080489828a016106ee565b935050608061081589828a0161073d565b92505060a087013567ffffffffffffffff81111561083657610835610573565b5b61084289828a016106ee565b9150509295509295509295565b60008160070b9050919050565b6108658161084f565b82525050565b6000602082019050610880600083018461085c565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006108c08261084f565b9150677fffffffffffffff82036108da576108d9610886565b5b600182019050919050565b6108ee81610598565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561092e578082015181840152602081019050610913565b60008484015250505050565b6000610945826108f4565b61094f81856108ff565b935061095f818560208601610910565b610968816105e0565b840191505092915050565b61097c8161071c565b82525050565b600060c08201905061099760008301896108e5565b81810360208301526109a9818861093a565b905081810360408301526109bd818761093a565b905081810360608301526109d1818661093a565b90506109e06080830185610973565b81810360a08301526109f2818461093a565b9050979650505050505050565b60008115159050919050565b610a14816109ff565b82525050565b600061012082019050610a30600083018c6108e5565b8181036020830152610a42818b61093a565b90508181036040830152610a56818a61093a565b90508181036060830152610a6a818961093a565b9050610a796080830188610973565b81810360a0830152610a8b818761093a565b9050610a9a60c0830186610a0b565b610aa760e0830185610a0b565b610ab5610100830184610a0b565b9a995050505050505050505056fea264697066735822122006c420c5aa76bec23eee91c787113b6c1dfdae997bcb2dcf4c8df1eba21043d964736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/testutil/contracts/Reverter.json b/precompiles/testutil/contracts/Reverter.json index d112a79c..138f596c 100644 --- a/precompiles/testutil/contracts/Reverter.json +++ b/precompiles/testutil/contracts/Reverter.json @@ -38,8 +38,8 @@ "type": "receive" } ], - "bytecode": "0x608060405260008055610c17806100176000396000f3fe60806040526004361061002d5760003560e01c806379388e9414610039578063c04062261461006257610034565b3661003457005b600080fd5b34801561004557600080fd5b50610060600480360381019061005b9190610360565b610079565b005b34801561006e57600080fd5b50610077610131565b005b808290604051610088906102d4565b82906040518091039083f590509050801580156100a9573d6000803e3d6000fd5b505061080173ffffffffffffffffffffffffffffffffffffffff166354be1a28306040518263ffffffff1660e01b81526004016100e691906103e1565b600060405180830381865afa158015610103573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061012c9190610884565b600080fd5b6000808154809291906101439061092b565b91905055503073ffffffffffffffffffffffffffffffffffffffff166379388e9460005460001b476040518363ffffffff1660e01b8152600401610188929190610991565b600060405180830381600087803b1580156101a257600080fd5b505af19250505080156101b3575060015b61022f5760006101c760005460001b610249565b90508073ffffffffffffffffffffffffffffffffffffffff16633ccfd60b6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561021157600080fd5b505af1158015610225573d6000803e3d6000fd5b5050505050610230565b5b6000808154809291906102429061092b565b9190505550565b60008060ff60f81b308460405180602001610263906102d4565b6020820181038252601f19601f820116604052506040516020016102879190610a01565b604051602081830303815290604052805190602001206040516020016102b09493929190610ace565b6040516020818303038152906040528051906020012060001c905080915050919050565b60c580610b1d83390190565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b610307816102f4565b811461031257600080fd5b50565b600081359050610324816102fe565b92915050565b6000819050919050565b61033d8161032a565b811461034857600080fd5b50565b60008135905061035a81610334565b92915050565b60008060408385031215610377576103766102ea565b5b600061038585828601610315565b92505060206103968582860161034b565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103cb826103a0565b9050919050565b6103db816103c0565b82525050565b60006020820190506103f660008301846103d2565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61044a82610401565b810181811067ffffffffffffffff8211171561046957610468610412565b5b80604052505050565b600061047c6102e0565b90506104888282610441565b919050565b600067ffffffffffffffff8211156104a8576104a7610412565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600080fd5b600067ffffffffffffffff8211156104e8576104e7610412565b5b6104f182610401565b9050602081019050919050565b60005b8381101561051c578082015181840152602081019050610501565b60008484015250505050565b600061053b610536846104cd565b610472565b905082815260208101848484011115610557576105566104c8565b5b6105628482856104fe565b509392505050565b600082601f83011261057f5761057e6103fc565b5b815161058f848260208601610528565b91505092915050565b600067ffffffffffffffff8211156105b3576105b2610412565b5b602082029050602081019050919050565b6000815190506105d381610334565b92915050565b600060ff82169050919050565b6105ef816105d9565b81146105fa57600080fd5b50565b60008151905061060c816105e6565b92915050565b600060608284031215610628576106276104be565b5b6106326060610472565b9050600082015167ffffffffffffffff811115610652576106516104c3565b5b61065e8482850161056a565b6000830152506020610672848285016105c4565b6020830152506040610686848285016105fd565b60408301525092915050565b60006106a56106a084610598565b610472565b905080838252602082019050602084028301858111156106c8576106c76104b9565b5b835b8181101561070f57805167ffffffffffffffff8111156106ed576106ec6103fc565b5b8086016106fa8982610612565b855260208501945050506020810190506106ca565b5050509392505050565b600082601f83011261072e5761072d6103fc565b5b815161073e848260208601610692565b91505092915050565b60006040828403121561075d5761075c6104be565b5b6107676040610472565b9050600082015167ffffffffffffffff811115610787576107866104c3565b5b6107938482850161056a565b600083015250602082015167ffffffffffffffff8111156107b7576107b66104c3565b5b6107c384828501610719565b60208301525092915050565b60006107e26107dd8461048d565b610472565b90508083825260208201905060208402830185811115610805576108046104b9565b5b835b8181101561084c57805167ffffffffffffffff81111561082a576108296103fc565b5b8086016108378982610747565b85526020850194505050602081019050610807565b5050509392505050565b600082601f83011261086b5761086a6103fc565b5b815161087b8482602086016107cf565b91505092915050565b6000806040838503121561089b5761089a6102ea565b5b600083015167ffffffffffffffff8111156108b9576108b86102ef565b5b6108c585828601610856565b925050602083015167ffffffffffffffff8111156108e6576108e56102ef565b5b6108f285828601610719565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109368261032a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610968576109676108fc565b5b600182019050919050565b61097c816102f4565b82525050565b61098b8161032a565b82525050565b60006040820190506109a66000830185610973565b6109b36020830184610982565b9392505050565b600081519050919050565b600081905092915050565b60006109db826109ba565b6109e581856109c5565b93506109f58185602086016104fe565b80840191505092915050565b6000610a0d82846109d0565b915081905092915050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b6000819050919050565b610a5f610a5a82610a18565b610a44565b82525050565b60008160601b9050919050565b6000610a7d82610a65565b9050919050565b6000610a8f82610a72565b9050919050565b610aa7610aa2826103c0565b610a84565b82525050565b6000819050919050565b610ac8610ac3826102f4565b610aad565b82525050565b6000610ada8287610a4e565b600182019150610aea8286610a96565b601482019150610afa8285610ab7565b602082019150610b0a8284610ab7565b6020820191508190509594505050505056fe608060405260b3806100126000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80633ccfd60b14602d575b600080fd5b60336035565b005b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015607a573d6000803e3d6000fd5b5056fea26469706673582212200cca7e94767cc41a8eff494693f692a362784efcf8724ef105e5c5948d07a98a64736f6c63430008130033a26469706673582212209eedc0bf8ca98ddf4547c45c1938b3294a8c876293b916e6991af709591c556764736f6c63430008130033", - "deployedBytecode": "0x60806040526004361061002d5760003560e01c806379388e9414610039578063c04062261461006257610034565b3661003457005b600080fd5b34801561004557600080fd5b50610060600480360381019061005b9190610360565b610079565b005b34801561006e57600080fd5b50610077610131565b005b808290604051610088906102d4565b82906040518091039083f590509050801580156100a9573d6000803e3d6000fd5b505061080173ffffffffffffffffffffffffffffffffffffffff166354be1a28306040518263ffffffff1660e01b81526004016100e691906103e1565b600060405180830381865afa158015610103573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061012c9190610884565b600080fd5b6000808154809291906101439061092b565b91905055503073ffffffffffffffffffffffffffffffffffffffff166379388e9460005460001b476040518363ffffffff1660e01b8152600401610188929190610991565b600060405180830381600087803b1580156101a257600080fd5b505af19250505080156101b3575060015b61022f5760006101c760005460001b610249565b90508073ffffffffffffffffffffffffffffffffffffffff16633ccfd60b6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561021157600080fd5b505af1158015610225573d6000803e3d6000fd5b5050505050610230565b5b6000808154809291906102429061092b565b9190505550565b60008060ff60f81b308460405180602001610263906102d4565b6020820181038252601f19601f820116604052506040516020016102879190610a01565b604051602081830303815290604052805190602001206040516020016102b09493929190610ace565b6040516020818303038152906040528051906020012060001c905080915050919050565b60c580610b1d83390190565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b610307816102f4565b811461031257600080fd5b50565b600081359050610324816102fe565b92915050565b6000819050919050565b61033d8161032a565b811461034857600080fd5b50565b60008135905061035a81610334565b92915050565b60008060408385031215610377576103766102ea565b5b600061038585828601610315565b92505060206103968582860161034b565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103cb826103a0565b9050919050565b6103db816103c0565b82525050565b60006020820190506103f660008301846103d2565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61044a82610401565b810181811067ffffffffffffffff8211171561046957610468610412565b5b80604052505050565b600061047c6102e0565b90506104888282610441565b919050565b600067ffffffffffffffff8211156104a8576104a7610412565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600080fd5b600067ffffffffffffffff8211156104e8576104e7610412565b5b6104f182610401565b9050602081019050919050565b60005b8381101561051c578082015181840152602081019050610501565b60008484015250505050565b600061053b610536846104cd565b610472565b905082815260208101848484011115610557576105566104c8565b5b6105628482856104fe565b509392505050565b600082601f83011261057f5761057e6103fc565b5b815161058f848260208601610528565b91505092915050565b600067ffffffffffffffff8211156105b3576105b2610412565b5b602082029050602081019050919050565b6000815190506105d381610334565b92915050565b600060ff82169050919050565b6105ef816105d9565b81146105fa57600080fd5b50565b60008151905061060c816105e6565b92915050565b600060608284031215610628576106276104be565b5b6106326060610472565b9050600082015167ffffffffffffffff811115610652576106516104c3565b5b61065e8482850161056a565b6000830152506020610672848285016105c4565b6020830152506040610686848285016105fd565b60408301525092915050565b60006106a56106a084610598565b610472565b905080838252602082019050602084028301858111156106c8576106c76104b9565b5b835b8181101561070f57805167ffffffffffffffff8111156106ed576106ec6103fc565b5b8086016106fa8982610612565b855260208501945050506020810190506106ca565b5050509392505050565b600082601f83011261072e5761072d6103fc565b5b815161073e848260208601610692565b91505092915050565b60006040828403121561075d5761075c6104be565b5b6107676040610472565b9050600082015167ffffffffffffffff811115610787576107866104c3565b5b6107938482850161056a565b600083015250602082015167ffffffffffffffff8111156107b7576107b66104c3565b5b6107c384828501610719565b60208301525092915050565b60006107e26107dd8461048d565b610472565b90508083825260208201905060208402830185811115610805576108046104b9565b5b835b8181101561084c57805167ffffffffffffffff81111561082a576108296103fc565b5b8086016108378982610747565b85526020850194505050602081019050610807565b5050509392505050565b600082601f83011261086b5761086a6103fc565b5b815161087b8482602086016107cf565b91505092915050565b6000806040838503121561089b5761089a6102ea565b5b600083015167ffffffffffffffff8111156108b9576108b86102ef565b5b6108c585828601610856565b925050602083015167ffffffffffffffff8111156108e6576108e56102ef565b5b6108f285828601610719565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109368261032a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610968576109676108fc565b5b600182019050919050565b61097c816102f4565b82525050565b61098b8161032a565b82525050565b60006040820190506109a66000830185610973565b6109b36020830184610982565b9392505050565b600081519050919050565b600081905092915050565b60006109db826109ba565b6109e581856109c5565b93506109f58185602086016104fe565b80840191505092915050565b6000610a0d82846109d0565b915081905092915050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b6000819050919050565b610a5f610a5a82610a18565b610a44565b82525050565b60008160601b9050919050565b6000610a7d82610a65565b9050919050565b6000610a8f82610a72565b9050919050565b610aa7610aa2826103c0565b610a84565b82525050565b6000819050919050565b610ac8610ac3826102f4565b610aad565b82525050565b6000610ada8287610a4e565b600182019150610aea8286610a96565b601482019150610afa8285610ab7565b602082019150610b0a8284610ab7565b6020820191508190509594505050505056fe608060405260b3806100126000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80633ccfd60b14602d575b600080fd5b60336035565b005b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015607a573d6000803e3d6000fd5b5056fea26469706673582212200cca7e94767cc41a8eff494693f692a362784efcf8724ef105e5c5948d07a98a64736f6c63430008130033a26469706673582212209eedc0bf8ca98ddf4547c45c1938b3294a8c876293b916e6991af709591c556764736f6c63430008130033", + "bytecode": "0x608060405260008055610c17806100176000396000f3fe60806040526004361061002d5760003560e01c806379388e9414610039578063c04062261461006257610034565b3661003457005b600080fd5b34801561004557600080fd5b50610060600480360381019061005b9190610360565b610079565b005b34801561006e57600080fd5b50610077610131565b005b808290604051610088906102d4565b82906040518091039083f590509050801580156100a9573d6000803e3d6000fd5b505061080173ffffffffffffffffffffffffffffffffffffffff166354be1a28306040518263ffffffff1660e01b81526004016100e691906103e1565b600060405180830381865afa158015610103573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061012c9190610884565b600080fd5b6000808154809291906101439061092b565b91905055503073ffffffffffffffffffffffffffffffffffffffff166379388e9460005460001b476040518363ffffffff1660e01b8152600401610188929190610991565b600060405180830381600087803b1580156101a257600080fd5b505af19250505080156101b3575060015b61022f5760006101c760005460001b610249565b90508073ffffffffffffffffffffffffffffffffffffffff16633ccfd60b6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561021157600080fd5b505af1158015610225573d6000803e3d6000fd5b5050505050610230565b5b6000808154809291906102429061092b565b9190505550565b60008060ff60f81b308460405180602001610263906102d4565b6020820181038252601f19601f820116604052506040516020016102879190610a01565b604051602081830303815290604052805190602001206040516020016102b09493929190610ace565b6040516020818303038152906040528051906020012060001c905080915050919050565b60c580610b1d83390190565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b610307816102f4565b811461031257600080fd5b50565b600081359050610324816102fe565b92915050565b6000819050919050565b61033d8161032a565b811461034857600080fd5b50565b60008135905061035a81610334565b92915050565b60008060408385031215610377576103766102ea565b5b600061038585828601610315565b92505060206103968582860161034b565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103cb826103a0565b9050919050565b6103db816103c0565b82525050565b60006020820190506103f660008301846103d2565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61044a82610401565b810181811067ffffffffffffffff8211171561046957610468610412565b5b80604052505050565b600061047c6102e0565b90506104888282610441565b919050565b600067ffffffffffffffff8211156104a8576104a7610412565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600080fd5b600067ffffffffffffffff8211156104e8576104e7610412565b5b6104f182610401565b9050602081019050919050565b60005b8381101561051c578082015181840152602081019050610501565b60008484015250505050565b600061053b610536846104cd565b610472565b905082815260208101848484011115610557576105566104c8565b5b6105628482856104fe565b509392505050565b600082601f83011261057f5761057e6103fc565b5b815161058f848260208601610528565b91505092915050565b600067ffffffffffffffff8211156105b3576105b2610412565b5b602082029050602081019050919050565b6000815190506105d381610334565b92915050565b600060ff82169050919050565b6105ef816105d9565b81146105fa57600080fd5b50565b60008151905061060c816105e6565b92915050565b600060608284031215610628576106276104be565b5b6106326060610472565b9050600082015167ffffffffffffffff811115610652576106516104c3565b5b61065e8482850161056a565b6000830152506020610672848285016105c4565b6020830152506040610686848285016105fd565b60408301525092915050565b60006106a56106a084610598565b610472565b905080838252602082019050602084028301858111156106c8576106c76104b9565b5b835b8181101561070f57805167ffffffffffffffff8111156106ed576106ec6103fc565b5b8086016106fa8982610612565b855260208501945050506020810190506106ca565b5050509392505050565b600082601f83011261072e5761072d6103fc565b5b815161073e848260208601610692565b91505092915050565b60006040828403121561075d5761075c6104be565b5b6107676040610472565b9050600082015167ffffffffffffffff811115610787576107866104c3565b5b6107938482850161056a565b600083015250602082015167ffffffffffffffff8111156107b7576107b66104c3565b5b6107c384828501610719565b60208301525092915050565b60006107e26107dd8461048d565b610472565b90508083825260208201905060208402830185811115610805576108046104b9565b5b835b8181101561084c57805167ffffffffffffffff81111561082a576108296103fc565b5b8086016108378982610747565b85526020850194505050602081019050610807565b5050509392505050565b600082601f83011261086b5761086a6103fc565b5b815161087b8482602086016107cf565b91505092915050565b6000806040838503121561089b5761089a6102ea565b5b600083015167ffffffffffffffff8111156108b9576108b86102ef565b5b6108c585828601610856565b925050602083015167ffffffffffffffff8111156108e6576108e56102ef565b5b6108f285828601610719565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109368261032a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610968576109676108fc565b5b600182019050919050565b61097c816102f4565b82525050565b61098b8161032a565b82525050565b60006040820190506109a66000830185610973565b6109b36020830184610982565b9392505050565b600081519050919050565b600081905092915050565b60006109db826109ba565b6109e581856109c5565b93506109f58185602086016104fe565b80840191505092915050565b6000610a0d82846109d0565b915081905092915050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b6000819050919050565b610a5f610a5a82610a18565b610a44565b82525050565b60008160601b9050919050565b6000610a7d82610a65565b9050919050565b6000610a8f82610a72565b9050919050565b610aa7610aa2826103c0565b610a84565b82525050565b6000819050919050565b610ac8610ac3826102f4565b610aad565b82525050565b6000610ada8287610a4e565b600182019150610aea8286610a96565b601482019150610afa8285610ab7565b602082019150610b0a8284610ab7565b6020820191508190509594505050505056fe608060405260b3806100126000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80633ccfd60b14602d575b600080fd5b60336035565b005b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015607a573d6000803e3d6000fd5b5056fea26469706673582212208482f02feff8e2ffa47dea3b6d200c026f496abf8829ad76a2302f53a190264064736f6c63430008140033a2646970667358221220d1d6abbe99a0323bea0f24ca72a995f7b732ef455ccf21b5919d55a3269e9c0164736f6c63430008140033", + "deployedBytecode": "0x60806040526004361061002d5760003560e01c806379388e9414610039578063c04062261461006257610034565b3661003457005b600080fd5b34801561004557600080fd5b50610060600480360381019061005b9190610360565b610079565b005b34801561006e57600080fd5b50610077610131565b005b808290604051610088906102d4565b82906040518091039083f590509050801580156100a9573d6000803e3d6000fd5b505061080173ffffffffffffffffffffffffffffffffffffffff166354be1a28306040518263ffffffff1660e01b81526004016100e691906103e1565b600060405180830381865afa158015610103573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061012c9190610884565b600080fd5b6000808154809291906101439061092b565b91905055503073ffffffffffffffffffffffffffffffffffffffff166379388e9460005460001b476040518363ffffffff1660e01b8152600401610188929190610991565b600060405180830381600087803b1580156101a257600080fd5b505af19250505080156101b3575060015b61022f5760006101c760005460001b610249565b90508073ffffffffffffffffffffffffffffffffffffffff16633ccfd60b6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561021157600080fd5b505af1158015610225573d6000803e3d6000fd5b5050505050610230565b5b6000808154809291906102429061092b565b9190505550565b60008060ff60f81b308460405180602001610263906102d4565b6020820181038252601f19601f820116604052506040516020016102879190610a01565b604051602081830303815290604052805190602001206040516020016102b09493929190610ace565b6040516020818303038152906040528051906020012060001c905080915050919050565b60c580610b1d83390190565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b610307816102f4565b811461031257600080fd5b50565b600081359050610324816102fe565b92915050565b6000819050919050565b61033d8161032a565b811461034857600080fd5b50565b60008135905061035a81610334565b92915050565b60008060408385031215610377576103766102ea565b5b600061038585828601610315565b92505060206103968582860161034b565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103cb826103a0565b9050919050565b6103db816103c0565b82525050565b60006020820190506103f660008301846103d2565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61044a82610401565b810181811067ffffffffffffffff8211171561046957610468610412565b5b80604052505050565b600061047c6102e0565b90506104888282610441565b919050565b600067ffffffffffffffff8211156104a8576104a7610412565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600080fd5b600067ffffffffffffffff8211156104e8576104e7610412565b5b6104f182610401565b9050602081019050919050565b60005b8381101561051c578082015181840152602081019050610501565b60008484015250505050565b600061053b610536846104cd565b610472565b905082815260208101848484011115610557576105566104c8565b5b6105628482856104fe565b509392505050565b600082601f83011261057f5761057e6103fc565b5b815161058f848260208601610528565b91505092915050565b600067ffffffffffffffff8211156105b3576105b2610412565b5b602082029050602081019050919050565b6000815190506105d381610334565b92915050565b600060ff82169050919050565b6105ef816105d9565b81146105fa57600080fd5b50565b60008151905061060c816105e6565b92915050565b600060608284031215610628576106276104be565b5b6106326060610472565b9050600082015167ffffffffffffffff811115610652576106516104c3565b5b61065e8482850161056a565b6000830152506020610672848285016105c4565b6020830152506040610686848285016105fd565b60408301525092915050565b60006106a56106a084610598565b610472565b905080838252602082019050602084028301858111156106c8576106c76104b9565b5b835b8181101561070f57805167ffffffffffffffff8111156106ed576106ec6103fc565b5b8086016106fa8982610612565b855260208501945050506020810190506106ca565b5050509392505050565b600082601f83011261072e5761072d6103fc565b5b815161073e848260208601610692565b91505092915050565b60006040828403121561075d5761075c6104be565b5b6107676040610472565b9050600082015167ffffffffffffffff811115610787576107866104c3565b5b6107938482850161056a565b600083015250602082015167ffffffffffffffff8111156107b7576107b66104c3565b5b6107c384828501610719565b60208301525092915050565b60006107e26107dd8461048d565b610472565b90508083825260208201905060208402830185811115610805576108046104b9565b5b835b8181101561084c57805167ffffffffffffffff81111561082a576108296103fc565b5b8086016108378982610747565b85526020850194505050602081019050610807565b5050509392505050565b600082601f83011261086b5761086a6103fc565b5b815161087b8482602086016107cf565b91505092915050565b6000806040838503121561089b5761089a6102ea565b5b600083015167ffffffffffffffff8111156108b9576108b86102ef565b5b6108c585828601610856565b925050602083015167ffffffffffffffff8111156108e6576108e56102ef565b5b6108f285828601610719565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109368261032a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610968576109676108fc565b5b600182019050919050565b61097c816102f4565b82525050565b61098b8161032a565b82525050565b60006040820190506109a66000830185610973565b6109b36020830184610982565b9392505050565b600081519050919050565b600081905092915050565b60006109db826109ba565b6109e581856109c5565b93506109f58185602086016104fe565b80840191505092915050565b6000610a0d82846109d0565b915081905092915050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b6000819050919050565b610a5f610a5a82610a18565b610a44565b82525050565b60008160601b9050919050565b6000610a7d82610a65565b9050919050565b6000610a8f82610a72565b9050919050565b610aa7610aa2826103c0565b610a84565b82525050565b6000819050919050565b610ac8610ac3826102f4565b610aad565b82525050565b6000610ada8287610a4e565b600182019150610aea8286610a96565b601482019150610afa8285610ab7565b602082019150610b0a8284610ab7565b6020820191508190509594505050505056fe608060405260b3806100126000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80633ccfd60b14602d575b600080fd5b60336035565b005b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015607a573d6000803e3d6000fd5b5056fea26469706673582212208482f02feff8e2ffa47dea3b6d200c026f496abf8829ad76a2302f53a190264064736f6c63430008140033a2646970667358221220d1d6abbe99a0323bea0f24ca72a995f7b732ef455ccf21b5919d55a3269e9c0164736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/testutil/contracts/StakingReverter.json b/precompiles/testutil/contracts/StakingReverter.json index 1b593074..e43ef295 100644 --- a/precompiles/testutil/contracts/StakingReverter.json +++ b/precompiles/testutil/contracts/StakingReverter.json @@ -44,6 +44,24 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "numTimes", + "type": "uint256" + }, + { + "internalType": "string", + "name": "validatorAddress", + "type": "string" + } + ], + "name": "multipleDelegations", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -157,8 +175,8 @@ "type": "function" } ], - "bytecode": "0x608060405260008055610f2a806100176000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80634e5a8fe514610051578063668f452b1461006d578063cbc367d41461009e578063f66013d7146100ce575b600080fd5b61006b6004803603810190610066919061049d565b6100ea565b005b610087600480360381019061008291906104fd565b61018c565b604051610095929190610635565b60405180910390f35b6100b860048036038101906100b391906106c3565b610226565b6040516100c591906108ae565b60405180910390f35b6100e860048036038101906100e391906104fd565b6102d6565b005b6000808154809291906100fc906108ff565b919050555060005b83811015610186573073ffffffffffffffffffffffffffffffffffffffff1663f66013d784846040518363ffffffff1660e01b8152600401610147929190610994565b600060405180830381600087803b15801561016157600080fd5b505af1925050508015610172575060015b50808061017e906108ff565b915050610104565b50505050565b6000610196610360565b61080073ffffffffffffffffffffffffffffffffffffffff1663241774e63086866040518463ffffffff1660e01b81526004016101d5939291906109c7565b600060405180830381865afa1580156101f2573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061021b9190610ba5565b915091509250929050565b61022e61037a565b60005b838110156102cf5761080073ffffffffffffffffffffffffffffffffffffffff1663223b3b7a846040518263ffffffff1660e01b81526004016102749190610c01565b600060405180830381865afa158015610291573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906102ba9190610df9565b915080806102c7906108ff565b915050610231565b5092915050565b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb308484600a6040518563ffffffff1660e01b81526004016103189493929190610e87565b6020604051808303816000875af1158015610337573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061035b9190610ec7565b600080fd5b604051806040016040528060608152602001600081525090565b6040518061016001604052806060815260200160608152602001600015158152602001600060038111156103b1576103b061071e565b5b8152602001600081526020016000815260200160608152602001600060070b8152602001600060070b815260200160008152602001600081525090565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b61041581610402565b811461042057600080fd5b50565b6000813590506104328161040c565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261045d5761045c610438565b5b8235905067ffffffffffffffff81111561047a5761047961043d565b5b60208301915083600182028301111561049657610495610442565b5b9250929050565b6000806000604084860312156104b6576104b56103f8565b5b60006104c486828701610423565b935050602084013567ffffffffffffffff8111156104e5576104e46103fd565b5b6104f186828701610447565b92509250509250925092565b60008060208385031215610514576105136103f8565b5b600083013567ffffffffffffffff811115610532576105316103fd565b5b61053e85828601610447565b92509250509250929050565b61055381610402565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610593578082015181840152602081019050610578565b60008484015250505050565b6000601f19601f8301169050919050565b60006105bb82610559565b6105c58185610564565b93506105d5818560208601610575565b6105de8161059f565b840191505092915050565b6105f281610402565b82525050565b6000604083016000830151848203600086015261061582826105b0565b915050602083015161062a60208601826105e9565b508091505092915050565b600060408201905061064a600083018561054a565b818103602083015261065c81846105f8565b90509392505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061069082610665565b9050919050565b6106a081610685565b81146106ab57600080fd5b50565b6000813590506106bd81610697565b92915050565b600080604083850312156106da576106d96103f8565b5b60006106e885828601610423565b92505060206106f9858286016106ae565b9150509250929050565b60008115159050919050565b61071881610703565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061075e5761075d61071e565b5b50565b600081905061076f8261074d565b919050565b600061077f82610761565b9050919050565b61078f81610774565b82525050565b60008160070b9050919050565b6107ab81610795565b82525050565b60006101608301600083015184820360008601526107cf82826105b0565b915050602083015184820360208601526107e982826105b0565b91505060408301516107fe604086018261070f565b5060608301516108116060860182610786565b50608083015161082460808601826105e9565b5060a083015161083760a08601826105e9565b5060c083015184820360c086015261084f82826105b0565b91505060e083015161086460e08601826107a2565b506101008301516108796101008601826107a2565b5061012083015161088e6101208601826105e9565b506101408301516108a36101408601826105e9565b508091505092915050565b600060208201905081810360008301526108c881846107b1565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061090a82610402565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361093c5761093b6108d0565b5b600182019050919050565b600082825260208201905092915050565b82818337600083830152505050565b60006109738385610947565b9350610980838584610958565b6109898361059f565b840190509392505050565b600060208201905081810360008301526109af818486610967565b90509392505050565b6109c181610685565b82525050565b60006040820190506109dc60008301866109b8565b81810360208301526109ef818486610967565b9050949350505050565b600081519050610a088161040c565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a4b8261059f565b810181811067ffffffffffffffff82111715610a6a57610a69610a13565b5b80604052505050565b6000610a7d6103ee565b9050610a898282610a42565b919050565b600080fd5b600080fd5b600067ffffffffffffffff821115610ab357610ab2610a13565b5b610abc8261059f565b9050602081019050919050565b6000610adc610ad784610a98565b610a73565b905082815260208101848484011115610af857610af7610a93565b5b610b03848285610575565b509392505050565b600082601f830112610b2057610b1f610438565b5b8151610b30848260208601610ac9565b91505092915050565b600060408284031215610b4f57610b4e610a0e565b5b610b596040610a73565b9050600082015167ffffffffffffffff811115610b7957610b78610a8e565b5b610b8584828501610b0b565b6000830152506020610b99848285016109f9565b60208301525092915050565b60008060408385031215610bbc57610bbb6103f8565b5b6000610bca858286016109f9565b925050602083015167ffffffffffffffff811115610beb57610bea6103fd565b5b610bf785828601610b39565b9150509250929050565b6000602082019050610c1660008301846109b8565b92915050565b610c2581610703565b8114610c3057600080fd5b50565b600081519050610c4281610c1c565b92915050565b60048110610c5557600080fd5b50565b600081519050610c6781610c48565b92915050565b610c7681610795565b8114610c8157600080fd5b50565b600081519050610c9381610c6d565b92915050565b60006101608284031215610cb057610caf610a0e565b5b610cbb610160610a73565b9050600082015167ffffffffffffffff811115610cdb57610cda610a8e565b5b610ce784828501610b0b565b600083015250602082015167ffffffffffffffff811115610d0b57610d0a610a8e565b5b610d1784828501610b0b565b6020830152506040610d2b84828501610c33565b6040830152506060610d3f84828501610c58565b6060830152506080610d53848285016109f9565b60808301525060a0610d67848285016109f9565b60a08301525060c082015167ffffffffffffffff811115610d8b57610d8a610a8e565b5b610d9784828501610b0b565b60c08301525060e0610dab84828501610c84565b60e083015250610100610dc084828501610c84565b61010083015250610120610dd6848285016109f9565b61012083015250610140610dec848285016109f9565b6101408301525092915050565b600060208284031215610e0f57610e0e6103f8565b5b600082015167ffffffffffffffff811115610e2d57610e2c6103fd565b5b610e3984828501610c99565b91505092915050565b6000819050919050565b6000819050919050565b6000610e71610e6c610e6784610e42565b610e4c565b610402565b9050919050565b610e8181610e56565b82525050565b6000606082019050610e9c60008301876109b8565b8181036020830152610eaf818587610967565b9050610ebe6040830184610e78565b95945050505050565b600060208284031215610edd57610edc6103f8565b5b6000610eeb84828501610c33565b9150509291505056fea264697066735822122065bd7ead5aeed227652c5f7a1cd2f7e458fbac5943bc70b2e7e985c82969ffac64736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80634e5a8fe514610051578063668f452b1461006d578063cbc367d41461009e578063f66013d7146100ce575b600080fd5b61006b6004803603810190610066919061049d565b6100ea565b005b610087600480360381019061008291906104fd565b61018c565b604051610095929190610635565b60405180910390f35b6100b860048036038101906100b391906106c3565b610226565b6040516100c591906108ae565b60405180910390f35b6100e860048036038101906100e391906104fd565b6102d6565b005b6000808154809291906100fc906108ff565b919050555060005b83811015610186573073ffffffffffffffffffffffffffffffffffffffff1663f66013d784846040518363ffffffff1660e01b8152600401610147929190610994565b600060405180830381600087803b15801561016157600080fd5b505af1925050508015610172575060015b50808061017e906108ff565b915050610104565b50505050565b6000610196610360565b61080073ffffffffffffffffffffffffffffffffffffffff1663241774e63086866040518463ffffffff1660e01b81526004016101d5939291906109c7565b600060405180830381865afa1580156101f2573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061021b9190610ba5565b915091509250929050565b61022e61037a565b60005b838110156102cf5761080073ffffffffffffffffffffffffffffffffffffffff1663223b3b7a846040518263ffffffff1660e01b81526004016102749190610c01565b600060405180830381865afa158015610291573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906102ba9190610df9565b915080806102c7906108ff565b915050610231565b5092915050565b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb308484600a6040518563ffffffff1660e01b81526004016103189493929190610e87565b6020604051808303816000875af1158015610337573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061035b9190610ec7565b600080fd5b604051806040016040528060608152602001600081525090565b6040518061016001604052806060815260200160608152602001600015158152602001600060038111156103b1576103b061071e565b5b8152602001600081526020016000815260200160608152602001600060070b8152602001600060070b815260200160008152602001600081525090565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b61041581610402565b811461042057600080fd5b50565b6000813590506104328161040c565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261045d5761045c610438565b5b8235905067ffffffffffffffff81111561047a5761047961043d565b5b60208301915083600182028301111561049657610495610442565b5b9250929050565b6000806000604084860312156104b6576104b56103f8565b5b60006104c486828701610423565b935050602084013567ffffffffffffffff8111156104e5576104e46103fd565b5b6104f186828701610447565b92509250509250925092565b60008060208385031215610514576105136103f8565b5b600083013567ffffffffffffffff811115610532576105316103fd565b5b61053e85828601610447565b92509250509250929050565b61055381610402565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610593578082015181840152602081019050610578565b60008484015250505050565b6000601f19601f8301169050919050565b60006105bb82610559565b6105c58185610564565b93506105d5818560208601610575565b6105de8161059f565b840191505092915050565b6105f281610402565b82525050565b6000604083016000830151848203600086015261061582826105b0565b915050602083015161062a60208601826105e9565b508091505092915050565b600060408201905061064a600083018561054a565b818103602083015261065c81846105f8565b90509392505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061069082610665565b9050919050565b6106a081610685565b81146106ab57600080fd5b50565b6000813590506106bd81610697565b92915050565b600080604083850312156106da576106d96103f8565b5b60006106e885828601610423565b92505060206106f9858286016106ae565b9150509250929050565b60008115159050919050565b61071881610703565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061075e5761075d61071e565b5b50565b600081905061076f8261074d565b919050565b600061077f82610761565b9050919050565b61078f81610774565b82525050565b60008160070b9050919050565b6107ab81610795565b82525050565b60006101608301600083015184820360008601526107cf82826105b0565b915050602083015184820360208601526107e982826105b0565b91505060408301516107fe604086018261070f565b5060608301516108116060860182610786565b50608083015161082460808601826105e9565b5060a083015161083760a08601826105e9565b5060c083015184820360c086015261084f82826105b0565b91505060e083015161086460e08601826107a2565b506101008301516108796101008601826107a2565b5061012083015161088e6101208601826105e9565b506101408301516108a36101408601826105e9565b508091505092915050565b600060208201905081810360008301526108c881846107b1565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061090a82610402565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361093c5761093b6108d0565b5b600182019050919050565b600082825260208201905092915050565b82818337600083830152505050565b60006109738385610947565b9350610980838584610958565b6109898361059f565b840190509392505050565b600060208201905081810360008301526109af818486610967565b90509392505050565b6109c181610685565b82525050565b60006040820190506109dc60008301866109b8565b81810360208301526109ef818486610967565b9050949350505050565b600081519050610a088161040c565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a4b8261059f565b810181811067ffffffffffffffff82111715610a6a57610a69610a13565b5b80604052505050565b6000610a7d6103ee565b9050610a898282610a42565b919050565b600080fd5b600080fd5b600067ffffffffffffffff821115610ab357610ab2610a13565b5b610abc8261059f565b9050602081019050919050565b6000610adc610ad784610a98565b610a73565b905082815260208101848484011115610af857610af7610a93565b5b610b03848285610575565b509392505050565b600082601f830112610b2057610b1f610438565b5b8151610b30848260208601610ac9565b91505092915050565b600060408284031215610b4f57610b4e610a0e565b5b610b596040610a73565b9050600082015167ffffffffffffffff811115610b7957610b78610a8e565b5b610b8584828501610b0b565b6000830152506020610b99848285016109f9565b60208301525092915050565b60008060408385031215610bbc57610bbb6103f8565b5b6000610bca858286016109f9565b925050602083015167ffffffffffffffff811115610beb57610bea6103fd565b5b610bf785828601610b39565b9150509250929050565b6000602082019050610c1660008301846109b8565b92915050565b610c2581610703565b8114610c3057600080fd5b50565b600081519050610c4281610c1c565b92915050565b60048110610c5557600080fd5b50565b600081519050610c6781610c48565b92915050565b610c7681610795565b8114610c8157600080fd5b50565b600081519050610c9381610c6d565b92915050565b60006101608284031215610cb057610caf610a0e565b5b610cbb610160610a73565b9050600082015167ffffffffffffffff811115610cdb57610cda610a8e565b5b610ce784828501610b0b565b600083015250602082015167ffffffffffffffff811115610d0b57610d0a610a8e565b5b610d1784828501610b0b565b6020830152506040610d2b84828501610c33565b6040830152506060610d3f84828501610c58565b6060830152506080610d53848285016109f9565b60808301525060a0610d67848285016109f9565b60a08301525060c082015167ffffffffffffffff811115610d8b57610d8a610a8e565b5b610d9784828501610b0b565b60c08301525060e0610dab84828501610c84565b60e083015250610100610dc084828501610c84565b61010083015250610120610dd6848285016109f9565b61012083015250610140610dec848285016109f9565b6101408301525092915050565b600060208284031215610e0f57610e0e6103f8565b5b600082015167ffffffffffffffff811115610e2d57610e2c6103fd565b5b610e3984828501610c99565b91505092915050565b6000819050919050565b6000819050919050565b6000610e71610e6c610e6784610e42565b610e4c565b610402565b9050919050565b610e8181610e56565b82525050565b6000606082019050610e9c60008301876109b8565b8181036020830152610eaf818587610967565b9050610ebe6040830184610e78565b95945050505050565b600060208284031215610edd57610edc6103f8565b5b6000610eeb84828501610c33565b9150509291505056fea264697066735822122065bd7ead5aeed227652c5f7a1cd2f7e458fbac5943bc70b2e7e985c82969ffac64736f6c63430008130033", + "bytecode": "0x608060405260008055610ff9806100176000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80634e5a8fe51461005c57806352fce7b114610078578063668f452b14610094578063cbc367d4146100c5578063f66013d7146100f5575b600080fd5b6100766004803603810190610071919061056c565b610111565b005b610092600480360381019061008d919061056c565b6101b3565b005b6100ae60048036038101906100a991906105cc565b61025b565b6040516100bc929190610704565b60405180910390f35b6100df60048036038101906100da9190610792565b6102f5565b6040516100ec919061097d565b60405180910390f35b61010f600480360381019061010a91906105cc565b6103a5565b005b600080815480929190610123906109ce565b919050555060005b838110156101ad573073ffffffffffffffffffffffffffffffffffffffff1663f66013d784846040518363ffffffff1660e01b815260040161016e929190610a63565b600060405180830381600087803b15801561018857600080fd5b505af1925050508015610199575060015b5080806101a5906109ce565b91505061012b565b50505050565b6000808154809291906101c5906109ce565b919050555060005b83811015610255573073ffffffffffffffffffffffffffffffffffffffff1663f66013d784846040518363ffffffff1660e01b8152600401610210929190610a63565b600060405180830381600087803b15801561022a57600080fd5b505af115801561023e573d6000803e3d6000fd5b50505050808061024d906109ce565b9150506101cd565b50505050565b600061026561042f565b61080073ffffffffffffffffffffffffffffffffffffffff1663241774e63086866040518463ffffffff1660e01b81526004016102a493929190610a96565b600060405180830381865afa1580156102c1573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906102ea9190610c74565b915091509250929050565b6102fd610449565b60005b8381101561039e5761080073ffffffffffffffffffffffffffffffffffffffff1663223b3b7a846040518263ffffffff1660e01b81526004016103439190610cd0565b600060405180830381865afa158015610360573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906103899190610ec8565b91508080610396906109ce565b915050610300565b5092915050565b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb308484600a6040518563ffffffff1660e01b81526004016103e79493929190610f56565b6020604051808303816000875af1158015610406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042a9190610f96565b600080fd5b604051806040016040528060608152602001600081525090565b6040518061016001604052806060815260200160608152602001600015158152602001600060038111156104805761047f6107ed565b5b8152602001600081526020016000815260200160608152602001600060070b8152602001600060070b815260200160008152602001600081525090565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b6104e4816104d1565b81146104ef57600080fd5b50565b600081359050610501816104db565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261052c5761052b610507565b5b8235905067ffffffffffffffff8111156105495761054861050c565b5b60208301915083600182028301111561056557610564610511565b5b9250929050565b600080600060408486031215610585576105846104c7565b5b6000610593868287016104f2565b935050602084013567ffffffffffffffff8111156105b4576105b36104cc565b5b6105c086828701610516565b92509250509250925092565b600080602083850312156105e3576105e26104c7565b5b600083013567ffffffffffffffff811115610601576106006104cc565b5b61060d85828601610516565b92509250509250929050565b610622816104d1565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610662578082015181840152602081019050610647565b60008484015250505050565b6000601f19601f8301169050919050565b600061068a82610628565b6106948185610633565b93506106a4818560208601610644565b6106ad8161066e565b840191505092915050565b6106c1816104d1565b82525050565b600060408301600083015184820360008601526106e4828261067f565b91505060208301516106f960208601826106b8565b508091505092915050565b60006040820190506107196000830185610619565b818103602083015261072b81846106c7565b90509392505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061075f82610734565b9050919050565b61076f81610754565b811461077a57600080fd5b50565b60008135905061078c81610766565b92915050565b600080604083850312156107a9576107a86104c7565b5b60006107b7858286016104f2565b92505060206107c88582860161077d565b9150509250929050565b60008115159050919050565b6107e7816107d2565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061082d5761082c6107ed565b5b50565b600081905061083e8261081c565b919050565b600061084e82610830565b9050919050565b61085e81610843565b82525050565b60008160070b9050919050565b61087a81610864565b82525050565b600061016083016000830151848203600086015261089e828261067f565b915050602083015184820360208601526108b8828261067f565b91505060408301516108cd60408601826107de565b5060608301516108e06060860182610855565b5060808301516108f360808601826106b8565b5060a083015161090660a08601826106b8565b5060c083015184820360c086015261091e828261067f565b91505060e083015161093360e0860182610871565b50610100830151610948610100860182610871565b5061012083015161095d6101208601826106b8565b506101408301516109726101408601826106b8565b508091505092915050565b600060208201905081810360008301526109978184610880565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109d9826104d1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610a0b57610a0a61099f565b5b600182019050919050565b600082825260208201905092915050565b82818337600083830152505050565b6000610a428385610a16565b9350610a4f838584610a27565b610a588361066e565b840190509392505050565b60006020820190508181036000830152610a7e818486610a36565b90509392505050565b610a9081610754565b82525050565b6000604082019050610aab6000830186610a87565b8181036020830152610abe818486610a36565b9050949350505050565b600081519050610ad7816104db565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610b1a8261066e565b810181811067ffffffffffffffff82111715610b3957610b38610ae2565b5b80604052505050565b6000610b4c6104bd565b9050610b588282610b11565b919050565b600080fd5b600080fd5b600067ffffffffffffffff821115610b8257610b81610ae2565b5b610b8b8261066e565b9050602081019050919050565b6000610bab610ba684610b67565b610b42565b905082815260208101848484011115610bc757610bc6610b62565b5b610bd2848285610644565b509392505050565b600082601f830112610bef57610bee610507565b5b8151610bff848260208601610b98565b91505092915050565b600060408284031215610c1e57610c1d610add565b5b610c286040610b42565b9050600082015167ffffffffffffffff811115610c4857610c47610b5d565b5b610c5484828501610bda565b6000830152506020610c6884828501610ac8565b60208301525092915050565b60008060408385031215610c8b57610c8a6104c7565b5b6000610c9985828601610ac8565b925050602083015167ffffffffffffffff811115610cba57610cb96104cc565b5b610cc685828601610c08565b9150509250929050565b6000602082019050610ce56000830184610a87565b92915050565b610cf4816107d2565b8114610cff57600080fd5b50565b600081519050610d1181610ceb565b92915050565b60048110610d2457600080fd5b50565b600081519050610d3681610d17565b92915050565b610d4581610864565b8114610d5057600080fd5b50565b600081519050610d6281610d3c565b92915050565b60006101608284031215610d7f57610d7e610add565b5b610d8a610160610b42565b9050600082015167ffffffffffffffff811115610daa57610da9610b5d565b5b610db684828501610bda565b600083015250602082015167ffffffffffffffff811115610dda57610dd9610b5d565b5b610de684828501610bda565b6020830152506040610dfa84828501610d02565b6040830152506060610e0e84828501610d27565b6060830152506080610e2284828501610ac8565b60808301525060a0610e3684828501610ac8565b60a08301525060c082015167ffffffffffffffff811115610e5a57610e59610b5d565b5b610e6684828501610bda565b60c08301525060e0610e7a84828501610d53565b60e083015250610100610e8f84828501610d53565b61010083015250610120610ea584828501610ac8565b61012083015250610140610ebb84828501610ac8565b6101408301525092915050565b600060208284031215610ede57610edd6104c7565b5b600082015167ffffffffffffffff811115610efc57610efb6104cc565b5b610f0884828501610d68565b91505092915050565b6000819050919050565b6000819050919050565b6000610f40610f3b610f3684610f11565b610f1b565b6104d1565b9050919050565b610f5081610f25565b82525050565b6000606082019050610f6b6000830187610a87565b8181036020830152610f7e818587610a36565b9050610f8d6040830184610f47565b95945050505050565b600060208284031215610fac57610fab6104c7565b5b6000610fba84828501610d02565b9150509291505056fea2646970667358221220b282ed8018a0ad364a4b7f1887b03ff0d802222429b6f649cfe13f491c189af764736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c80634e5a8fe51461005c57806352fce7b114610078578063668f452b14610094578063cbc367d4146100c5578063f66013d7146100f5575b600080fd5b6100766004803603810190610071919061056c565b610111565b005b610092600480360381019061008d919061056c565b6101b3565b005b6100ae60048036038101906100a991906105cc565b61025b565b6040516100bc929190610704565b60405180910390f35b6100df60048036038101906100da9190610792565b6102f5565b6040516100ec919061097d565b60405180910390f35b61010f600480360381019061010a91906105cc565b6103a5565b005b600080815480929190610123906109ce565b919050555060005b838110156101ad573073ffffffffffffffffffffffffffffffffffffffff1663f66013d784846040518363ffffffff1660e01b815260040161016e929190610a63565b600060405180830381600087803b15801561018857600080fd5b505af1925050508015610199575060015b5080806101a5906109ce565b91505061012b565b50505050565b6000808154809291906101c5906109ce565b919050555060005b83811015610255573073ffffffffffffffffffffffffffffffffffffffff1663f66013d784846040518363ffffffff1660e01b8152600401610210929190610a63565b600060405180830381600087803b15801561022a57600080fd5b505af115801561023e573d6000803e3d6000fd5b50505050808061024d906109ce565b9150506101cd565b50505050565b600061026561042f565b61080073ffffffffffffffffffffffffffffffffffffffff1663241774e63086866040518463ffffffff1660e01b81526004016102a493929190610a96565b600060405180830381865afa1580156102c1573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906102ea9190610c74565b915091509250929050565b6102fd610449565b60005b8381101561039e5761080073ffffffffffffffffffffffffffffffffffffffff1663223b3b7a846040518263ffffffff1660e01b81526004016103439190610cd0565b600060405180830381865afa158015610360573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906103899190610ec8565b91508080610396906109ce565b915050610300565b5092915050565b61080073ffffffffffffffffffffffffffffffffffffffff166353266bbb308484600a6040518563ffffffff1660e01b81526004016103e79493929190610f56565b6020604051808303816000875af1158015610406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042a9190610f96565b600080fd5b604051806040016040528060608152602001600081525090565b6040518061016001604052806060815260200160608152602001600015158152602001600060038111156104805761047f6107ed565b5b8152602001600081526020016000815260200160608152602001600060070b8152602001600060070b815260200160008152602001600081525090565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b6104e4816104d1565b81146104ef57600080fd5b50565b600081359050610501816104db565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261052c5761052b610507565b5b8235905067ffffffffffffffff8111156105495761054861050c565b5b60208301915083600182028301111561056557610564610511565b5b9250929050565b600080600060408486031215610585576105846104c7565b5b6000610593868287016104f2565b935050602084013567ffffffffffffffff8111156105b4576105b36104cc565b5b6105c086828701610516565b92509250509250925092565b600080602083850312156105e3576105e26104c7565b5b600083013567ffffffffffffffff811115610601576106006104cc565b5b61060d85828601610516565b92509250509250929050565b610622816104d1565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610662578082015181840152602081019050610647565b60008484015250505050565b6000601f19601f8301169050919050565b600061068a82610628565b6106948185610633565b93506106a4818560208601610644565b6106ad8161066e565b840191505092915050565b6106c1816104d1565b82525050565b600060408301600083015184820360008601526106e4828261067f565b91505060208301516106f960208601826106b8565b508091505092915050565b60006040820190506107196000830185610619565b818103602083015261072b81846106c7565b90509392505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061075f82610734565b9050919050565b61076f81610754565b811461077a57600080fd5b50565b60008135905061078c81610766565b92915050565b600080604083850312156107a9576107a86104c7565b5b60006107b7858286016104f2565b92505060206107c88582860161077d565b9150509250929050565b60008115159050919050565b6107e7816107d2565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061082d5761082c6107ed565b5b50565b600081905061083e8261081c565b919050565b600061084e82610830565b9050919050565b61085e81610843565b82525050565b60008160070b9050919050565b61087a81610864565b82525050565b600061016083016000830151848203600086015261089e828261067f565b915050602083015184820360208601526108b8828261067f565b91505060408301516108cd60408601826107de565b5060608301516108e06060860182610855565b5060808301516108f360808601826106b8565b5060a083015161090660a08601826106b8565b5060c083015184820360c086015261091e828261067f565b91505060e083015161093360e0860182610871565b50610100830151610948610100860182610871565b5061012083015161095d6101208601826106b8565b506101408301516109726101408601826106b8565b508091505092915050565b600060208201905081810360008301526109978184610880565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109d9826104d1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610a0b57610a0a61099f565b5b600182019050919050565b600082825260208201905092915050565b82818337600083830152505050565b6000610a428385610a16565b9350610a4f838584610a27565b610a588361066e565b840190509392505050565b60006020820190508181036000830152610a7e818486610a36565b90509392505050565b610a9081610754565b82525050565b6000604082019050610aab6000830186610a87565b8181036020830152610abe818486610a36565b9050949350505050565b600081519050610ad7816104db565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610b1a8261066e565b810181811067ffffffffffffffff82111715610b3957610b38610ae2565b5b80604052505050565b6000610b4c6104bd565b9050610b588282610b11565b919050565b600080fd5b600080fd5b600067ffffffffffffffff821115610b8257610b81610ae2565b5b610b8b8261066e565b9050602081019050919050565b6000610bab610ba684610b67565b610b42565b905082815260208101848484011115610bc757610bc6610b62565b5b610bd2848285610644565b509392505050565b600082601f830112610bef57610bee610507565b5b8151610bff848260208601610b98565b91505092915050565b600060408284031215610c1e57610c1d610add565b5b610c286040610b42565b9050600082015167ffffffffffffffff811115610c4857610c47610b5d565b5b610c5484828501610bda565b6000830152506020610c6884828501610ac8565b60208301525092915050565b60008060408385031215610c8b57610c8a6104c7565b5b6000610c9985828601610ac8565b925050602083015167ffffffffffffffff811115610cba57610cb96104cc565b5b610cc685828601610c08565b9150509250929050565b6000602082019050610ce56000830184610a87565b92915050565b610cf4816107d2565b8114610cff57600080fd5b50565b600081519050610d1181610ceb565b92915050565b60048110610d2457600080fd5b50565b600081519050610d3681610d17565b92915050565b610d4581610864565b8114610d5057600080fd5b50565b600081519050610d6281610d3c565b92915050565b60006101608284031215610d7f57610d7e610add565b5b610d8a610160610b42565b9050600082015167ffffffffffffffff811115610daa57610da9610b5d565b5b610db684828501610bda565b600083015250602082015167ffffffffffffffff811115610dda57610dd9610b5d565b5b610de684828501610bda565b6020830152506040610dfa84828501610d02565b6040830152506060610e0e84828501610d27565b6060830152506080610e2284828501610ac8565b60808301525060a0610e3684828501610ac8565b60a08301525060c082015167ffffffffffffffff811115610e5a57610e59610b5d565b5b610e6684828501610bda565b60c08301525060e0610e7a84828501610d53565b60e083015250610100610e8f84828501610d53565b61010083015250610120610ea584828501610ac8565b61012083015250610140610ebb84828501610ac8565b6101408301525092915050565b600060208284031215610ede57610edd6104c7565b5b600082015167ffffffffffffffff811115610efc57610efb6104cc565b5b610f0884828501610d68565b91505092915050565b6000819050919050565b6000819050919050565b6000610f40610f3b610f3684610f11565b610f1b565b6104d1565b9050919050565b610f5081610f25565b82525050565b6000606082019050610f6b6000830187610a87565b8181036020830152610f7e818587610a36565b9050610f8d6040830184610f47565b95945050505050565b600060208284031215610fac57610fab6104c7565b5b6000610fba84828501610d02565b9150509291505056fea2646970667358221220b282ed8018a0ad364a4b7f1887b03ff0d802222429b6f649cfe13f491c189af764736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/precompiles/testutil/contracts/StakingReverter.sol b/precompiles/testutil/contracts/StakingReverter.sol index e287d470..52659691 100644 --- a/precompiles/testutil/contracts/StakingReverter.sol +++ b/precompiles/testutil/contracts/StakingReverter.sol @@ -13,13 +13,24 @@ contract StakingReverter { for (uint i = 0; i < numTimes; i++) { try - StakingReverter(address(this)).performDelegation( - validatorAddress - ) + StakingReverter(address(this)).performDelegation( + validatorAddress + ) {} catch {} } } + function multipleDelegations( + uint numTimes, + string calldata validatorAddress + ) external { + counter++; + + for (uint i = 0; i < numTimes; i++) { + StakingReverter(address(this)).performDelegation(validatorAddress); + } + } + function performDelegation(string calldata validatorAddress) external { STAKING_CONTRACT.delegate(address(this), validatorAddress, 10); revert(); diff --git a/precompiles/testutil/contracts/contracts.go b/precompiles/testutil/contracts/contracts.go index 139265e5..1ac9ca31 100644 --- a/precompiles/testutil/contracts/contracts.go +++ b/precompiles/testutil/contracts/contracts.go @@ -19,24 +19,24 @@ import ( ) // Call is a helper function to call any arbitrary smart contract. -func Call(ctx sdk.Context, app *exampleapp.ExampleChain, args CallArgs) (res abci.ResponseDeliverTx, ethRes *evmtypes.MsgEthereumTxResponse, err error) { +func Call(ctx sdk.Context, app *exampleapp.ExampleChain, args CallArgs) (res abci.ExecTxResult, ethRes *evmtypes.MsgEthereumTxResponse, err error) { var ( nonce uint64 gasLimit = args.GasLimit ) if args.PrivKey == nil { - return abci.ResponseDeliverTx{}, nil, fmt.Errorf("private key is required; got: %v", args.PrivKey) + return abci.ExecTxResult{}, nil, fmt.Errorf("private key is required; got: %v", args.PrivKey) } pk, ok := args.PrivKey.(*ethsecp256k1.PrivKey) if !ok { - return abci.ResponseDeliverTx{}, nil, errors.New("error while casting type ethsecp256k1.PrivKey on provided private key") + return abci.ExecTxResult{}, nil, errors.New("error while casting type ethsecp256k1.PrivKey on provided private key") } key, err := pk.ToECDSA() if err != nil { - return abci.ResponseDeliverTx{}, nil, fmt.Errorf("error while converting private key to ecdsa: %v", err) + return abci.ExecTxResult{}, nil, fmt.Errorf("error while converting private key to ecdsa: %v", err) } addr := crypto.PubkeyToAddress(key.PublicKey) @@ -64,7 +64,7 @@ func Call(ctx sdk.Context, app *exampleapp.ExampleChain, args CallArgs) (res abc // Create MsgEthereumTx that calls the contract input, err := args.ContractABI.Pack(args.MethodName, args.Args...) if err != nil { - return abci.ResponseDeliverTx{}, nil, fmt.Errorf("error while packing the input: %v", err) + return abci.ExecTxResult{}, nil, fmt.Errorf("error while packing the input: %v", err) } // Create MsgEthereumTx that calls the contract @@ -100,7 +100,7 @@ func Call(ctx sdk.Context, app *exampleapp.ExampleChain, args CallArgs) (res abc // CallContractAndCheckLogs is a helper function to call any arbitrary smart contract and check that the logs // contain the expected events. -func CallContractAndCheckLogs(ctx sdk.Context, app *exampleapp.ExampleChain, cArgs CallArgs, logCheckArgs precompiletestutil.LogCheckArgs) (abci.ResponseDeliverTx, *evmtypes.MsgEthereumTxResponse, error) { +func CallContractAndCheckLogs(ctx sdk.Context, app *exampleapp.ExampleChain, cArgs CallArgs, logCheckArgs precompiletestutil.LogCheckArgs) (abci.ExecTxResult, *evmtypes.MsgEthereumTxResponse, error) { res, ethRes, err := Call(ctx, app, cArgs) if err != nil { return res, nil, err diff --git a/precompiles/testutil/errors.go b/precompiles/testutil/errors.go index e5244996..e2bffbac 100644 --- a/precompiles/testutil/errors.go +++ b/precompiles/testutil/errors.go @@ -13,7 +13,7 @@ import ( // CheckVMError is a helper function used to check if the transaction is reverted with the expected error message // in the VmError field of the MsgEthereumResponse struct. -func CheckVMError(res abci.ResponseDeliverTx, expErrMsg string, args ...interface{}) error { +func CheckVMError(res abci.ExecTxResult, expErrMsg string, args ...interface{}) error { if !res.IsOK() { return fmt.Errorf("code 0 was expected on response but got code %d", res.Code) } diff --git a/precompiles/testutil/events.go b/precompiles/testutil/events.go index 9e8bc5c6..0cdf5013 100644 --- a/precompiles/testutil/events.go +++ b/precompiles/testutil/events.go @@ -21,7 +21,7 @@ import ( // CheckAuthorizationEvents is a helper function used in the integration tests and checks if the approval event is emitted. // // If the amount is nil, it will not check for the amount in the event, which should be used for any generic approvals. -func CheckAuthorizationEvents(event abi.Event, precompileAddr, granter, grantee common.Address, res abci.ResponseDeliverTx, height int64, msgTypes []string, amount *big.Int) { +func CheckAuthorizationEvents(event abi.Event, precompileAddr, granter, grantee common.Address, res abci.ExecTxResult, height int64, msgTypes []string, amount *big.Int) { var log evmtypes.Log // Tx log is always the second last event txLogAttributes := res.Events[len(res.Events)-2].Attributes @@ -35,7 +35,7 @@ func CheckAuthorizationEvents(event abi.Event, precompileAddr, granter, grantee // Check if the log has the expected indexed fields and data Expect(log.Address).To(Equal(precompileAddr.String()), "expected different address in event") - Expect(log.BlockNumber).To(Equal(uint64(height)), "expected different block number in event") + Expect(log.BlockNumber).To(Equal(uint64(height)), "expected different block number in event") //nolint:gosec // G115 // block height won't exceed uint64 Expect(log.Topics[0]).To(Equal(event.ID.String()), "expected different event ID") Expect(common.HexToAddress(log.Topics[1])).To(Equal(grantee), "expected different grantee in event") Expect(common.HexToAddress(log.Topics[2])).To(Equal(granter), "expected different granter in event") diff --git a/precompiles/testutil/ibc.go b/precompiles/testutil/ibc.go index 56eb7cad..71c9f222 100644 --- a/precompiles/testutil/ibc.go +++ b/precompiles/testutil/ibc.go @@ -4,7 +4,7 @@ package testutil import ( - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" ) var ( diff --git a/precompiles/testutil/logs.go b/precompiles/testutil/logs.go index 2d148cee..ea219fda 100644 --- a/precompiles/testutil/logs.go +++ b/precompiles/testutil/logs.go @@ -40,7 +40,7 @@ func CheckLogs(logArgs LogCheckArgs) error { ) } - if err := CheckVMError(logArgs.Res, logArgs.ErrContains); err != nil { //nolint:govet // fine to pass variable errContains here + if err := CheckVMError(logArgs.Res, "%s", logArgs.ErrContains); err != nil { return err } @@ -82,7 +82,7 @@ type LogCheckArgs struct { // Res is the response of the transaction. // // NOTE: This does not have to be set when using contracts.CallContractAndCheckLogs. - Res abci.ResponseDeliverTx + Res abci.ExecTxResult } // WithABIEvents sets the ABIEvents field of LogCheckArgs. @@ -114,7 +114,7 @@ func (l LogCheckArgs) WithExpPass(expPass bool) LogCheckArgs { } // WithRes sets the Res field of LogCheckArgs. -func (l LogCheckArgs) WithRes(res abci.ResponseDeliverTx) LogCheckArgs { +func (l LogCheckArgs) WithRes(res abci.ExecTxResult) LogCheckArgs { l.Res = res return l } diff --git a/precompiles/testutil/staking.go b/precompiles/testutil/staking.go index ffc4f71b..f3907d39 100644 --- a/precompiles/testutil/staking.go +++ b/precompiles/testutil/staking.go @@ -19,15 +19,18 @@ import ( // in the staking keeper. func CreateValidator(ctx sdk.Context, t *testing.T, pubKey cryptotypes.PubKey, sk stakingkeeper.Keeper, stakeAmt math.Int) { zeroDec := math.LegacyZeroDec() - stakingParams := sk.GetParams(ctx) - stakingParams.BondDenom = sk.BondDenom(ctx) + stakingParams, err := sk.GetParams(ctx) + require.NoError(t, err) + stakingParams.BondDenom, err = sk.BondDenom(ctx) + require.NoError(t, err) stakingParams.MinCommissionRate = zeroDec - err := sk.SetParams(ctx, stakingParams) + err = sk.SetParams(ctx, stakingParams) require.NoError(t, err) stakingHelper := teststaking.NewHelper(t, ctx, &sk) stakingHelper.Commission = stakingtypes.NewCommissionRates(zeroDec, zeroDec, zeroDec) - stakingHelper.Denom = sk.BondDenom(ctx) + stakingHelper.Denom, err = sk.BondDenom(ctx) + require.NoError(t, err) valAddr := sdk.ValAddress(pubKey.Address()) stakingHelper.CreateValidator(valAddr, pubKey, stakeAmt, true) diff --git a/precompiles/testutil/testing.go b/precompiles/testutil/testing.go index dc678d32..e54025cf 100644 --- a/precompiles/testutil/testing.go +++ b/precompiles/testutil/testing.go @@ -1,11 +1,13 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package testutil import ( "math/big" "testing" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/x/evm/core/vm" @@ -15,7 +17,7 @@ import ( // NewPrecompileContract creates a new precompile contract and sets the gas meter. func NewPrecompileContract(t *testing.T, ctx sdk.Context, caller common.Address, precompile vm.ContractRef, gas uint64) (*vm.Contract, sdk.Context) { contract := vm.NewContract(vm.AccountRef(caller), precompile, big.NewInt(0), gas) - ctx = ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) + ctx = ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()) initialGas := ctx.GasMeter().GasConsumed() require.Equal(t, uint64(0), initialGas) return contract, ctx diff --git a/proto/buf.gen.pulsar.yaml b/proto/buf.gen.pulsar.yaml new file mode 100644 index 00000000..41cfbe2a --- /dev/null +++ b/proto/buf.gen.pulsar.yaml @@ -0,0 +1,20 @@ +version: v1 +managed: + enabled: true + go_package_prefix: + default: cosmossdk.io/api + except: + - buf.build/googleapis/googleapis + - buf.build/cosmos/gogo-proto + - buf.build/cosmos/cosmos-proto + override: +plugins: + - name: go-pulsar + out: ../api + opt: paths=source_relative + - name: go-grpc + out: ../api + opt: paths=source_relative + - name: go-cosmos-orm + out: ../api + opt: paths=source_relative diff --git a/proto/os/erc20/v1/erc20.proto b/proto/os/erc20/v1/erc20.proto index 420d004b..8e019aff 100644 --- a/proto/os/erc20/v1/erc20.proto +++ b/proto/os/erc20/v1/erc20.proto @@ -38,6 +38,8 @@ message TokenPair { // Deprecated: RegisterCoinProposal is a gov Content type to register a token // pair for a native Cosmos coin. We're keeping it to remove the existing // proposals from store. After that, remove this message. +// +// NOTE: Keep this message for backwards compatibility on proposals query message RegisterCoinProposal { option (gogoproto.equal) = false; // title of the proposal @@ -58,8 +60,10 @@ message ProposalMetadata { [ (gogoproto.nullable) = false ]; } -// RegisterERC20Proposal is a gov Content type to register a token pair for an -// ERC20 token +// Deprecated: RegisterERC20Proposal is a gov Content type to register a token +// pair for an ERC20 token. +// +// NOTE: Keep this message for backwards compatibility on proposals query message RegisterERC20Proposal { option (gogoproto.equal) = false; // title of the proposal @@ -70,8 +74,10 @@ message RegisterERC20Proposal { repeated string erc20addresses = 3; } -// ToggleTokenConversionProposal is a gov Content type to toggle the conversion -// of a token pair. +// Deprecated: ToggleTokenConversionProposal is a gov Content type to toggle the +// conversion of a token pair. +// +// NOTE: Keep this message for backwards compatibility on proposals query message ToggleTokenConversionProposal { option (gogoproto.equal) = true; // title of the proposal diff --git a/proto/os/erc20/v1/genesis.proto b/proto/os/erc20/v1/genesis.proto index 8f8e09d5..4f0ee404 100644 --- a/proto/os/erc20/v1/genesis.proto +++ b/proto/os/erc20/v1/genesis.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package os.erc20.v1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "os/erc20/v1/erc20.proto"; @@ -11,9 +12,11 @@ option go_package = "github.com/evmos/os/x/erc20/types"; // GenesisState defines the module's genesis state. message GenesisState { // params are the erc20 module parameters at genesis - Params params = 1 [ (gogoproto.nullable) = false ]; + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; // token_pairs is a slice of the registered token pairs at genesis - repeated TokenPair token_pairs = 2 [ (gogoproto.nullable) = false ]; + repeated TokenPair token_pairs = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // Params defines the erc20 module params diff --git a/proto/os/erc20/v1/query.proto b/proto/os/erc20/v1/query.proto index 4104fb83..5a0b2ba4 100644 --- a/proto/os/erc20/v1/query.proto +++ b/proto/os/erc20/v1/query.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package os.erc20.v1; +import "amino/amino.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; @@ -40,7 +41,8 @@ message QueryTokenPairsRequest { // method. message QueryTokenPairsResponse { // token_pairs is a slice of registered token pairs for the erc20 module - repeated TokenPair token_pairs = 1 [ (gogoproto.nullable) = false ]; + repeated TokenPair token_pairs = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } @@ -57,7 +59,8 @@ message QueryTokenPairRequest { message QueryTokenPairResponse { // token_pairs returns the info about a registered token pair for the erc20 // module - TokenPair token_pair = 1 [ (gogoproto.nullable) = false ]; + TokenPair token_pair = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // QueryParamsRequest is the request type for the Query/Params RPC method. @@ -67,5 +70,6 @@ message QueryParamsRequest {} // method. message QueryParamsResponse { // params are the erc20 module parameters - Params params = 1 [ (gogoproto.nullable) = false ]; + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } diff --git a/proto/os/erc20/v1/tx.proto b/proto/os/erc20/v1/tx.proto index 5b259016..12bde493 100644 --- a/proto/os/erc20/v1/tx.proto +++ b/proto/os/erc20/v1/tx.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package os.erc20.v1; +import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; @@ -14,27 +15,40 @@ option go_package = "github.com/evmos/os/x/erc20/types"; // Msg defines the erc20 Msg service. service Msg { + option (cosmos.msg.v1.service) = true; // ConvertERC20 mints a native Cosmos coin representation of the ERC20 token // contract that is registered on the token mapping. rpc ConvertERC20(MsgConvertERC20) returns (MsgConvertERC20Response) { option (google.api.http).get = "/os/erc20/v1/tx/convert_erc20"; }; - // UpdateParams defined a governance operation for updating the x/erc20 module + // UpdateParams defines a governance operation for updating the x/erc20 module // parameters. The authority is hard-coded to the Cosmos SDK x/gov module // account rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + // RegisterERC20 defines a governance operation for registering a token pair + // for the specified erc20 contract. The authority is hard-coded to the Cosmos + // SDK x/gov module account + rpc RegisterERC20(MsgRegisterERC20) returns (MsgRegisterERC20Response); + // ToggleConversion defines a governance operation for enabling/disablen a + // token pair conversion. The authority is hard-coded to the Cosmos SDK x/gov + // module account + rpc ToggleConversion(MsgToggleConversion) + returns (MsgToggleConversionResponse); } // MsgConvertERC20 defines a Msg to convert a ERC20 token to a native Cosmos // coin. message MsgConvertERC20 { + option (amino.name) = "os/MsgConvertERC20"; + option (cosmos.msg.v1.signer) = "sender"; // contract_address of an ERC20 token contract, that is registered in a token // pair string contract_address = 1; // amount of ERC20 tokens to convert string amount = 2 [ (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; // receiver is the bech32 address to receive native Cosmos coins string receiver = 3; @@ -63,6 +77,7 @@ message MsgConvertCoinResponse {} // MsgUpdateParams is the Msg/UpdateParams request type for Erc20 parameters. // Since: cosmos-sdk 0.47 message MsgUpdateParams { + option (amino.name) = "os/x/erc20/MsgUpdateParams"; option (cosmos.msg.v1.signer) = "authority"; // authority is the address of the governance account. @@ -70,10 +85,46 @@ message MsgUpdateParams { // params defines the x/evm parameters to update. // NOTE: All parameters must be supplied. - Params params = 2 [ (gogoproto.nullable) = false ]; + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. // Since: cosmos-sdk 0.47 message MsgUpdateParamsResponse {} + +// MsgRegisterERC20 is the Msg/RegisterERC20 request type for registering +// an Erc20 contract token pair. +message MsgRegisterERC20 { + option (amino.name) = "os/x/erc20/MsgRegisterERC20"; + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // erc20addresses is a slice of ERC20 token contract hex addresses + repeated string erc20addresses = 2; +} + +// MsgRegisterERC20Response defines the response structure for executing a +// MsgRegisterERC20 message. +message MsgRegisterERC20Response {} + +// MsgToggleConversion is the Msg/MsgToggleConversion request type for toggling +// an Erc20 contract conversion capability. +message MsgToggleConversion { + option (amino.name) = "os/x/erc20/MsgToggleConversion"; + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // token identifier can be either the hex contract address of the ERC20 or the + // Cosmos base denomination + string token = 2; +} + +// MsgToggleConversionResponse defines the response structure for executing a +// ToggleConversion message. +message MsgToggleConversionResponse {} diff --git a/proto/os/evm/v1/evm.proto b/proto/os/evm/v1/evm.proto index bcf0e421..2a79dc3f 100644 --- a/proto/os/evm/v1/evm.proto +++ b/proto/os/evm/v1/evm.proto @@ -3,12 +3,14 @@ syntax = "proto3"; package os.evm.v1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/evmos/os/x/evm/types"; // Params defines the EVM module parameters message Params { + option (amino.name) = "evmos/x/evm/Params"; // evm_denom represents the token denomination used to run the EVM state // transitions. string evm_denom = 1 [ (gogoproto.moretags) = "yaml:\"evm_denom\"" ]; @@ -22,8 +24,10 @@ message Params { // chain_config defines the EVM chain configuration parameters ChainConfig chain_config = 5 [ (gogoproto.moretags) = "yaml:\"chain_config\"", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; + // allow_unprotected_txs defines if replay-protected (i.e non EIP155 // signed) transactions can be executed on the state machine. bool allow_unprotected_txs = 6; @@ -270,7 +274,8 @@ message TxResult { // logs. TransactionLogs tx_logs = 3 [ (gogoproto.moretags) = "yaml:\"tx_logs\"", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; // ret defines the bytes from the execution. bytes ret = 4; diff --git a/proto/os/evm/v1/genesis.proto b/proto/os/evm/v1/genesis.proto index 28e7b2b9..267fa929 100644 --- a/proto/os/evm/v1/genesis.proto +++ b/proto/os/evm/v1/genesis.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package os.evm.v1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "os/evm/v1/evm.proto"; @@ -11,9 +12,11 @@ option go_package = "github.com/evmos/os/x/evm/types"; // GenesisState defines the evm module's genesis state. message GenesisState { // accounts is an array containing the ethereum genesis accounts. - repeated GenesisAccount accounts = 1 [ (gogoproto.nullable) = false ]; + repeated GenesisAccount accounts = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; // params defines all the parameters of the module. - Params params = 2 [ (gogoproto.nullable) = false ]; + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // GenesisAccount defines an account to be initialized in the genesis state. @@ -25,6 +28,9 @@ message GenesisAccount { // code defines the hex bytes of the account code. string code = 2; // storage defines the set of state key values for the account. - repeated State storage = 3 - [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "Storage" ]; + repeated State storage = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "Storage" + ]; } diff --git a/proto/os/evm/v1/query.proto b/proto/os/evm/v1/query.proto index 3a03ecbd..bcec5388 100644 --- a/proto/os/evm/v1/query.proto +++ b/proto/os/evm/v1/query.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package os.evm.v1; +import "amino/amino.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; @@ -16,13 +17,13 @@ option go_package = "github.com/evmos/os/x/evm/types"; service Query { // Account queries an Ethereum account. rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { - option (google.api.http).get = "/os/evm/v1/account/{address}"; + option (google.api.http).get = "/evmos/evm/v1/account/{address}"; } // CosmosAccount queries an Ethereum account's Cosmos Address. rpc CosmosAccount(QueryCosmosAccountRequest) returns (QueryCosmosAccountResponse) { - option (google.api.http).get = "/os/evm/v1/cosmos_account/{address}"; + option (google.api.http).get = "/evmos/evm/v1/cosmos_account/{address}"; } // ValidatorAccount queries an Ethereum account's from a validator consensus @@ -30,56 +31,56 @@ service Query { rpc ValidatorAccount(QueryValidatorAccountRequest) returns (QueryValidatorAccountResponse) { option (google.api.http).get = - "/os/evm/v1/validator_account/{cons_address}"; + "/evmos/evm/v1/validator_account/{cons_address}"; } // Balance queries the balance of a the EVM denomination for a single // account. rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { - option (google.api.http).get = "/os/evm/v1/balances/{address}"; + option (google.api.http).get = "/evmos/evm/v1/balances/{address}"; } // Storage queries the balance of all coins for a single account. rpc Storage(QueryStorageRequest) returns (QueryStorageResponse) { - option (google.api.http).get = "/os/evm/v1/storage/{address}/{key}"; + option (google.api.http).get = "/evmos/evm/v1/storage/{address}/{key}"; } // Code queries the balance of all coins for a single account. rpc Code(QueryCodeRequest) returns (QueryCodeResponse) { - option (google.api.http).get = "/os/evm/v1/codes/{address}"; + option (google.api.http).get = "/evmos/evm/v1/codes/{address}"; } // Params queries the parameters of x/evm module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/os/evm/v1/params"; + option (google.api.http).get = "/evmos/evm/v1/params"; } // EthCall implements the `eth_call` rpc api rpc EthCall(EthCallRequest) returns (MsgEthereumTxResponse) { - option (google.api.http).get = "/os/evm/v1/eth_call"; + option (google.api.http).get = "/evmos/evm/v1/eth_call"; } // EstimateGas implements the `eth_estimateGas` rpc api rpc EstimateGas(EthCallRequest) returns (EstimateGasResponse) { - option (google.api.http).get = "/os/evm/v1/estimate_gas"; + option (google.api.http).get = "/evmos/evm/v1/estimate_gas"; } // TraceTx implements the `debug_traceTransaction` rpc api rpc TraceTx(QueryTraceTxRequest) returns (QueryTraceTxResponse) { - option (google.api.http).get = "/os/evm/v1/trace_tx"; + option (google.api.http).get = "/evmos/evm/v1/trace_tx"; } // TraceBlock implements the `debug_traceBlockByNumber` and // `debug_traceBlockByHash` rpc api rpc TraceBlock(QueryTraceBlockRequest) returns (QueryTraceBlockResponse) { - option (google.api.http).get = "/os/evm/v1/trace_block"; + option (google.api.http).get = "/evmos/evm/v1/trace_block"; } // BaseFee queries the base fee of the parent block of the current block, // it's similar to feemarket module's method, but also checks london hardfork // status. rpc BaseFee(QueryBaseFeeRequest) returns (QueryBaseFeeResponse) { - option (google.api.http).get = "/os/evm/v1/base_fee"; + option (google.api.http).get = "/evmos/evm/v1/base_fee"; } } @@ -219,7 +220,8 @@ message QueryParamsRequest {} // QueryParamsResponse defines the response type for querying x/evm parameters. message QueryParamsResponse { // params define the evm module parameters. - Params params = 1 [ (gogoproto.nullable) = false ]; + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // EthCallRequest defines EthCall request @@ -259,8 +261,11 @@ message QueryTraceTxRequest { // block_hash of requested transaction string block_hash = 6; // block_time of requested transaction - google.protobuf.Timestamp block_time = 7 - [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + google.protobuf.Timestamp block_time = 7 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.stdtime) = true + ]; // proposer_address is the proposer of the requested block bytes proposer_address = 8 [ (gogoproto.casttype) = @@ -288,8 +293,11 @@ message QueryTraceBlockRequest { // block_hash (hex) of the traced block string block_hash = 6; // block_time of the traced block - google.protobuf.Timestamp block_time = 7 - [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + google.protobuf.Timestamp block_time = 7 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.stdtime) = true + ]; // proposer_address is the address of the requested block bytes proposer_address = 8 [ (gogoproto.casttype) = diff --git a/proto/os/evm/v1/tx.proto b/proto/os/evm/v1/tx.proto index c5dc4e31..5f24f367 100644 --- a/proto/os/evm/v1/tx.proto +++ b/proto/os/evm/v1/tx.proto @@ -1,8 +1,10 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + syntax = "proto3"; package os.evm.v1; +import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; @@ -14,6 +16,7 @@ option go_package = "github.com/evmos/os/x/evm/types"; // Msg defines the evm Msg service. service Msg { + option (cosmos.msg.v1.service) = true; // EthereumTx defines a method submitting Ethereum transactions. rpc EthereumTx(MsgEthereumTx) returns (MsgEthereumTxResponse) { option (google.api.http).post = "/os/evm/v1/ethereum_tx"; @@ -26,15 +29,18 @@ service Msg { // MsgEthereumTx encapsulates an Ethereum transaction as an SDK message. message MsgEthereumTx { + option (amino.name) = "os/MsgEthereumTx"; + option (gogoproto.goproto_getters) = false; // data is inner transaction data of the Ethereum transaction google.protobuf.Any data = 1; // size is the encoded storage size of the transaction (DEPRECATED) - double size = 2 [ (gogoproto.jsontag) = "-" ]; + double size = 2 [ (gogoproto.jsontag) = "-", (amino.dont_omitempty) = true ]; // hash of the transaction in hex format - string hash = 3 [ (gogoproto.moretags) = "rlp:\"-\"" ]; + string hash = 3 + [ (gogoproto.moretags) = "rlp:\"-\"", (amino.dont_omitempty) = true ]; // from is the ethereum signer address in hex format. This address value is // checked against the address derived from the signature (V, R, S) using the // secp256k1 elliptic curve @@ -45,6 +51,8 @@ message MsgEthereumTx { // NOTE: All non-protected transactions (i.e non EIP155 signed) will fail if the // AllowUnprotectedTxs parameter is disabled. message LegacyTx { + option (amino.name) = "os/LegacyTx"; + option (gogoproto.goproto_getters) = false; option (cosmos_proto.implements_interface) = "TxData"; @@ -73,6 +81,8 @@ message LegacyTx { // AccessListTx is the data of EIP-2930 access list transactions. message AccessListTx { + option (amino.name) = "os/AccessListTx"; + option (gogoproto.goproto_getters) = false; option (cosmos_proto.implements_interface) = "TxData"; @@ -101,7 +111,8 @@ message AccessListTx { repeated AccessTuple accesses = 8 [ (gogoproto.castrepeated) = "AccessList", (gogoproto.jsontag) = "accessList", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; // v defines the signature value bytes v = 9; @@ -113,6 +124,8 @@ message AccessListTx { // DynamicFeeTx is the data of EIP-1559 dynamic fee transactions. message DynamicFeeTx { + option (amino.name) = "os/DynamicFeeTx"; + option (gogoproto.goproto_getters) = false; option (cosmos_proto.implements_interface) = "TxData"; @@ -143,7 +156,8 @@ message DynamicFeeTx { repeated AccessTuple accesses = 9 [ (gogoproto.castrepeated) = "AccessList", (gogoproto.jsontag) = "accessList", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; // v defines the signature value bytes v = 10; @@ -180,6 +194,7 @@ message MsgEthereumTxResponse { // MsgUpdateParams defines a Msg for updating the x/evm module parameters. message MsgUpdateParams { + option (amino.name) = "os/x/evm/MsgUpdateParams"; option (cosmos.msg.v1.signer) = "authority"; // authority is the address of the governance account. @@ -187,7 +202,8 @@ message MsgUpdateParams { // params defines the x/evm parameters to update. // NOTE: All parameters must be supplied. - Params params = 2 [ (gogoproto.nullable) = false ]; + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // MsgUpdateParamsResponse defines the response structure for executing a diff --git a/proto/os/feemarket/v1/events.proto b/proto/os/feemarket/v1/events.proto index 361d3ac7..05d70eb4 100644 --- a/proto/os/feemarket/v1/events.proto +++ b/proto/os/feemarket/v1/events.proto @@ -5,7 +5,7 @@ package os.feemarket.v1; option go_package = "github.com/evmos/os/x/feemarket/types"; -// EventFeeMarket is the event type for the fee market module +// EventFeeMarket is the event type for the feemarket module message EventFeeMarket { // base_fee for EIP-1559 blocks string base_fee = 1; diff --git a/proto/os/feemarket/v1/feemarket.proto b/proto/os/feemarket/v1/feemarket.proto index 2d1bb9bb..67145fa1 100644 --- a/proto/os/feemarket/v1/feemarket.proto +++ b/proto/os/feemarket/v1/feemarket.proto @@ -3,12 +3,15 @@ syntax = "proto3"; package os.feemarket.v1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/evmos/os/x/feemarket/types"; // Params defines the EVM module parameters message Params { + option (amino.name) = "os/x/feemarket/Params"; + // no_base_fee forces the EIP-1559 base fee to 0 (needed for 0 price calls) bool no_base_fee = 1; // base_fee_change_denominator bounds the amount the base fee can change @@ -26,18 +29,21 @@ message Params { // base_fee for EIP-1559 blocks. string base_fee = 6 [ (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; // min_gas_price defines the minimum gas price value for cosmos and eth // transactions string min_gas_price = 7 [ (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; // min_gas_multiplier bounds the minimum gas used to be charged // to senders based on gas limit string min_gas_multiplier = 8 [ (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; } diff --git a/proto/os/feemarket/v1/genesis.proto b/proto/os/feemarket/v1/genesis.proto index bd10b41d..751f6914 100644 --- a/proto/os/feemarket/v1/genesis.proto +++ b/proto/os/feemarket/v1/genesis.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package os.feemarket.v1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "os/feemarket/v1/feemarket.proto"; @@ -11,7 +12,8 @@ option go_package = "github.com/evmos/os/x/feemarket/types"; // GenesisState defines the feemarket module's genesis state. message GenesisState { // params defines all the parameters of the feemarket module. - Params params = 1 [ (gogoproto.nullable) = false ]; + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; // DEPRECATED: base fee is the exported value from previous software version. // Zero by default. reserved 2; diff --git a/proto/os/feemarket/v1/query.proto b/proto/os/feemarket/v1/query.proto index 17581469..8c2b606c 100644 --- a/proto/os/feemarket/v1/query.proto +++ b/proto/os/feemarket/v1/query.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package os.feemarket.v1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "os/feemarket/v1/feemarket.proto"; @@ -33,7 +34,8 @@ message QueryParamsRequest {} // QueryParamsResponse defines the response type for querying x/evm parameters. message QueryParamsResponse { // params define the evm module parameters. - Params params = 1 [ (gogoproto.nullable) = false ]; + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // QueryBaseFeeRequest defines the request type for querying the EIP1559 base diff --git a/proto/os/feemarket/v1/tx.proto b/proto/os/feemarket/v1/tx.proto index 3d6fc9c2..75f665dc 100644 --- a/proto/os/feemarket/v1/tx.proto +++ b/proto/os/feemarket/v1/tx.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package os.feemarket.v1; +import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; @@ -10,8 +11,9 @@ import "os/feemarket/v1/feemarket.proto"; option go_package = "github.com/evmos/os/x/feemarket/types"; -// Msg defines the erc20 Msg service. +// Msg defines the feemarket Msg service. service Msg { + option (cosmos.msg.v1.service) = true; // UpdateParams defined a governance operation for updating the x/feemarket // module parameters. The authority is hard-coded to the Cosmos SDK x/gov // module account @@ -21,11 +23,14 @@ service Msg { // MsgUpdateParams defines a Msg for updating the x/feemarket module parameters. message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "os/x/feemarket/MsgUpdateParams"; + // authority is the address of the governance account. string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // params defines the x/feemarket parameters to update. // NOTE: All parameters must be supplied. - Params params = 2 [ (gogoproto.nullable) = false ]; + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // MsgUpdateParamsResponse defines the response structure for executing a diff --git a/proto/os/types/v1/dynamic_fee.proto b/proto/os/types/v1/dynamic_fee.proto index 352abe05..0a912032 100644 --- a/proto/os/types/v1/dynamic_fee.proto +++ b/proto/os/types/v1/dynamic_fee.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package os.types.v1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/evmos/os/types"; @@ -14,6 +15,7 @@ message ExtensionOptionDynamicFeeTx { // spec string max_priority_price = 1 [ (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; } diff --git a/rpc/backend/account_info.go b/rpc/backend/account_info.go index 693481a4..c69c4c1e 100644 --- a/rpc/backend/account_info.go +++ b/rpc/backend/account_info.go @@ -10,6 +10,7 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/libs/bytes" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -99,7 +100,7 @@ func (b *Backend) GetProof(address common.Address, storageKeys []string, blockNr } // query account proofs - accountKey := authtypes.AddressStoreKey(sdk.AccAddress(address.Bytes())) + accountKey := bytes.HexBytes(append(authtypes.AddressStoreKeyPrefix, address.Bytes()...)) _, proof, err := b.queryClient.GetProof(clientCtx, authtypes.StoreKey, accountKey) if err != nil { return nil, err diff --git a/rpc/backend/account_info_test.go b/rpc/backend/account_info_test.go index 2c5e899e..515c3088 100644 --- a/rpc/backend/account_info_test.go +++ b/rpc/backend/account_info_test.go @@ -4,17 +4,16 @@ import ( "fmt" "math/big" - tmrpcclient "github.com/cometbft/cometbft/rpc/client" - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cometbft/cometbft/libs/bytes" + cmtrpcclient "github.com/cometbft/cometbft/rpc/client" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "google.golang.org/grpc/metadata" - "github.com/evmos/os/rpc/backend/mocks" rpctypes "github.com/evmos/os/rpc/types" utiltx "github.com/evmos/os/testutil/tx" evmtypes "github.com/evmos/os/x/evm/types" + "google.golang.org/grpc/metadata" ) func (suite *BackendTestSuite) TestGetCode() { @@ -138,14 +137,14 @@ func (suite *BackendTestSuite) TestGetProof() { bn.Int64(), "store/evm/key", evmtypes.StateKey(address1, common.HexToHash("0x0").Bytes()), - tmrpcclient.ABCIQueryOptions{Height: iavlHeight, Prove: true}, + cmtrpcclient.ABCIQueryOptions{Height: iavlHeight, Prove: true}, ) RegisterABCIQueryWithOptions( client, bn.Int64(), "store/acc/key", - authtypes.AddressStoreKey(sdk.AccAddress(address1.Bytes())), - tmrpcclient.ABCIQueryOptions{Height: iavlHeight, Prove: true}, + bytes.HexBytes(append(authtypes.AddressStoreKeyPrefix, address1.Bytes()...)), + cmtrpcclient.ABCIQueryOptions{Height: iavlHeight, Prove: true}, ) }, true, @@ -400,7 +399,7 @@ func (suite *BackendTestSuite) TestGetTransactionCount() { // RegisterABCIQueryAccount( // client, // requestMarshal, - // tmrpcclient.ABCIQueryOptions{Height: int64(1), Prove: false}, + // cmtrpcclient.ABCIQueryOptions{Height: int64(1), Prove: false}, // account, // ) // }, diff --git a/rpc/backend/backend.go b/rpc/backend/backend.go index 598b376b..e0db76be 100644 --- a/rpc/backend/backend.go +++ b/rpc/backend/backend.go @@ -7,8 +7,8 @@ import ( "math/big" "time" + "cosmossdk.io/log" "cosmossdk.io/math" - "github.com/cometbft/cometbft/libs/log" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/crypto/keyring" diff --git a/rpc/backend/backend_suite_test.go b/rpc/backend/backend_suite_test.go index 440b4369..54f6fde1 100644 --- a/rpc/backend/backend_suite_test.go +++ b/rpc/backend/backend_suite_test.go @@ -7,9 +7,8 @@ import ( "path/filepath" "testing" - dbm "github.com/cometbft/cometbft-db" - - tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" + cmtrpctypes "github.com/cometbft/cometbft/rpc/core/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/server" @@ -18,11 +17,11 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/evmos/os/crypto/hd" "github.com/evmos/os/encoding" - app "github.com/evmos/os/example_chain" "github.com/evmos/os/indexer" "github.com/evmos/os/rpc/backend/mocks" rpctypes "github.com/evmos/os/rpc/types" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/constants" + testnetwork "github.com/evmos/os/testutil/integration/os/network" utiltx "github.com/evmos/os/testutil/tx" evmtypes "github.com/evmos/os/x/evm/types" "github.com/stretchr/testify/suite" @@ -41,7 +40,7 @@ func TestBackendTestSuite(t *testing.T) { suite.Run(t, new(BackendTestSuite)) } -var ChainID = testutil.ExampleChainID +var ChainID = constants.ExampleChainID // SetupTest is executed before every BackendTestSuite test func (suite *BackendTestSuite) SetupTest() { @@ -70,7 +69,8 @@ func (suite *BackendTestSuite) SetupTest() { suite.signer = utiltx.NewSigner(priv) suite.Require().NoError(err) - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + nw := testnetwork.New() + encodingConfig := nw.GetEncodingConfig() clientCtx := client.Context{}.WithChainID(ChainID). WithHeight(1). WithTxConfig(encodingConfig.TxConfig). @@ -91,8 +91,7 @@ func (suite *BackendTestSuite) SetupTest() { suite.backend.ctx = rpctypes.ContextWithHeight(1) // Add codec - encCfg := encoding.MakeConfig(app.ModuleBasics) - suite.backend.clientCtx.Codec = encCfg.Codec + suite.backend.clientCtx.Codec = encodingConfig.Codec } // buildEthereumTx returns an example legacy Ethereum transaction @@ -121,16 +120,16 @@ func (suite *BackendTestSuite) buildEthereumTx() (*evmtypes.MsgEthereumTx, []byt // buildFormattedBlock returns a formatted block for testing func (suite *BackendTestSuite) buildFormattedBlock( - blockRes *tmrpctypes.ResultBlockResults, - resBlock *tmrpctypes.ResultBlock, + blockRes *cmtrpctypes.ResultBlockResults, + resBlock *cmtrpctypes.ResultBlock, fullTx bool, tx *evmtypes.MsgEthereumTx, validator sdk.AccAddress, baseFee *big.Int, ) map[string]interface{} { header := resBlock.Block.Header - gasLimit := int64(^uint32(0)) // for `MaxGas = -1` (DefaultConsensusParams) - gasUsed := new(big.Int).SetUint64(uint64(blockRes.TxsResults[0].GasUsed)) + gasLimit := int64(^uint32(0)) // for `MaxGas = -1` (DefaultConsensusParams) + gasUsed := new(big.Int).SetUint64(uint64(blockRes.TxsResults[0].GasUsed)) //nolint:gosec // G115 // won't exceed uint64 root := common.Hash{}.Bytes() receipt := ethtypes.NewReceipt(root, false, gasUsed.Uint64()) @@ -142,7 +141,7 @@ func (suite *BackendTestSuite) buildFormattedBlock( rpcTx, err := rpctypes.NewRPCTransaction( tx.AsTransaction(), common.BytesToHash(header.Hash()), - uint64(header.Height), + uint64(header.Height), //nolint:gosec // G115 // won't exceed uint64 uint64(0), baseFee, suite.backend.chainID, @@ -168,7 +167,7 @@ func (suite *BackendTestSuite) buildFormattedBlock( func (suite *BackendTestSuite) generateTestKeyring(clientDir string) (keyring.Keyring, error) { buf := bufio.NewReader(os.Stdin) - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeConfig() return keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, clientDir, buf, encCfg.Codec, []keyring.Option{hd.EthSecp256k1Option()}...) } diff --git a/rpc/backend/blocks.go b/rpc/backend/blocks.go index 2bd26991..6104221f 100644 --- a/rpc/backend/blocks.go +++ b/rpc/backend/blocks.go @@ -352,7 +352,7 @@ func (b *Backend) HeaderByHash(blockHash common.Hash) (*ethtypes.Header, error) // BlockBloom query block bloom filter from block results func (b *Backend) BlockBloom(blockRes *tmrpctypes.ResultBlockResults) (ethtypes.Bloom, error) { - for _, event := range blockRes.EndBlockEvents { + for _, event := range blockRes.FinalizeBlockEvents { if event.Type != evmtypes.EventTypeBlockBloom { continue } diff --git a/rpc/backend/blocks_test.go b/rpc/backend/blocks_test.go index fc8fbe91..51877268 100644 --- a/rpc/backend/blocks_test.go +++ b/rpc/backend/blocks_test.go @@ -5,21 +5,19 @@ import ( "math/big" "cosmossdk.io/math" - "github.com/cometbft/cometbft/abci/types" - tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtrpctypes "github.com/cometbft/cometbft/rpc/core/types" + cmttypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/trie" - "google.golang.org/grpc/metadata" - "github.com/evmos/os/rpc/backend/mocks" ethrpc "github.com/evmos/os/rpc/types" utiltx "github.com/evmos/os/testutil/tx" evmtypes "github.com/evmos/os/x/evm/types" + "google.golang.org/grpc/metadata" ) func (suite *BackendTestSuite) TestBlockNumber() { @@ -82,8 +80,8 @@ func (suite *BackendTestSuite) TestBlockNumber() { func (suite *BackendTestSuite) TestGetBlockByNumber() { var ( - blockRes *tmrpctypes.ResultBlockResults - resBlock *tmrpctypes.ResultBlock + blockRes *cmtrpctypes.ResultBlockResults + resBlock *cmtrpctypes.ResultBlock ) msgEthereumTx, bz := suite.buildEthereumTx() @@ -225,12 +223,12 @@ func (suite *BackendTestSuite) TestGetBlockByNumber() { func (suite *BackendTestSuite) TestGetBlockByHash() { var ( - blockRes *tmrpctypes.ResultBlockResults - resBlock *tmrpctypes.ResultBlock + blockRes *cmtrpctypes.ResultBlockResults + resBlock *cmtrpctypes.ResultBlock ) msgEthereumTx, bz := suite.buildEthereumTx() - block := tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil) + block := cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil) testCases := []struct { name string @@ -371,8 +369,8 @@ func (suite *BackendTestSuite) TestGetBlockByHash() { func (suite *BackendTestSuite) TestGetBlockTransactionCountByHash() { _, bz := suite.buildEthereumTx() - block := tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil) - emptyBlock := tmtypes.MakeBlock(1, []tmtypes.Tx{}, nil, nil) + block := cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil) + emptyBlock := cmttypes.MakeBlock(1, []cmttypes.Tx{}, nil, nil) testCases := []struct { name string @@ -450,8 +448,8 @@ func (suite *BackendTestSuite) TestGetBlockTransactionCountByHash() { func (suite *BackendTestSuite) TestGetBlockTransactionCountByNumber() { _, bz := suite.buildEthereumTx() - block := tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil) - emptyBlock := tmtypes.MakeBlock(1, []tmtypes.Tx{}, nil, nil) + block := cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil) + emptyBlock := cmttypes.MakeBlock(1, []cmttypes.Tx{}, nil, nil) testCases := []struct { name string @@ -529,7 +527,7 @@ func (suite *BackendTestSuite) TestGetBlockTransactionCountByNumber() { } func (suite *BackendTestSuite) TestTendermintBlockByNumber() { - var expResultBlock *tmrpctypes.ResultBlock + var expResultBlock *cmtrpctypes.ResultBlock testCases := []struct { name string @@ -636,7 +634,7 @@ func (suite *BackendTestSuite) TestTendermintBlockByNumber() { } func (suite *BackendTestSuite) TestTendermintBlockResultByNumber() { - var expBlockRes *tmrpctypes.ResultBlockResults + var expBlockRes *cmtrpctypes.ResultBlockResults testCases := []struct { name string @@ -660,9 +658,9 @@ func (suite *BackendTestSuite) TestTendermintBlockResultByNumber() { client := suite.backend.clientCtx.Client.(*mocks.Client) _, err := RegisterBlockResults(client, blockNum) suite.Require().NoError(err) - expBlockRes = &tmrpctypes.ResultBlockResults{ + expBlockRes = &cmtrpctypes.ResultBlockResults{ Height: blockNum, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, } }, true, @@ -686,10 +684,10 @@ func (suite *BackendTestSuite) TestTendermintBlockResultByNumber() { } func (suite *BackendTestSuite) TestBlockNumberFromTendermint() { - var resBlock *tmrpctypes.ResultBlock + var resBlock *cmtrpctypes.ResultBlock _, bz := suite.buildEthereumTx() - block := tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil) + block := cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil) blockNum := ethrpc.NewBlockNumber(big.NewInt(block.Height)) blockHash := common.BytesToHash(block.Hash()) @@ -763,11 +761,11 @@ func (suite *BackendTestSuite) TestBlockNumberFromTendermint() { } func (suite *BackendTestSuite) TestBlockNumberFromTendermintByHash() { - var resBlock *tmrpctypes.ResultBlock + var resBlock *cmtrpctypes.ResultBlock _, bz := suite.buildEthereumTx() - block := tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil) - emptyBlock := tmtypes.MakeBlock(1, []tmtypes.Tx{}, nil, nil) + block := cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil) + emptyBlock := cmttypes.MakeBlock(1, []cmttypes.Tx{}, nil, nil) testCases := []struct { name string @@ -823,28 +821,28 @@ func (suite *BackendTestSuite) TestBlockNumberFromTendermintByHash() { func (suite *BackendTestSuite) TestBlockBloom() { testCases := []struct { name string - blockRes *tmrpctypes.ResultBlockResults + blockRes *cmtrpctypes.ResultBlockResults expBlockBloom ethtypes.Bloom expPass bool }{ { "fail - empty block result", - &tmrpctypes.ResultBlockResults{}, + &cmtrpctypes.ResultBlockResults{}, ethtypes.Bloom{}, false, }, { "fail - non block bloom event type", - &tmrpctypes.ResultBlockResults{ - EndBlockEvents: []types.Event{{Type: evmtypes.EventTypeEthereumTx}}, + &cmtrpctypes.ResultBlockResults{ + FinalizeBlockEvents: []types.Event{{Type: evmtypes.EventTypeEthereumTx}}, }, ethtypes.Bloom{}, false, }, { "fail - nonblock bloom attribute key", - &tmrpctypes.ResultBlockResults{ - EndBlockEvents: []types.Event{ + &cmtrpctypes.ResultBlockResults{ + FinalizeBlockEvents: []types.Event{ { Type: evmtypes.EventTypeBlockBloom, Attributes: []types.EventAttribute{ @@ -858,8 +856,8 @@ func (suite *BackendTestSuite) TestBlockBloom() { }, { "pass - block bloom attribute key", - &tmrpctypes.ResultBlockResults{ - EndBlockEvents: []types.Event{ + &cmtrpctypes.ResultBlockResults{ + FinalizeBlockEvents: []types.Event{ { Type: evmtypes.EventTypeBlockBloom, Attributes: []types.EventAttribute{ @@ -888,15 +886,15 @@ func (suite *BackendTestSuite) TestBlockBloom() { func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { msgEthereumTx, bz := suite.buildEthereumTx() - emptyBlock := tmtypes.MakeBlock(1, []tmtypes.Tx{}, nil, nil) + emptyBlock := cmttypes.MakeBlock(1, []cmttypes.Tx{}, nil, nil) testCases := []struct { name string baseFee *big.Int validator sdk.AccAddress height int64 - resBlock *tmrpctypes.ResultBlock - blockRes *tmrpctypes.ResultBlockResults + resBlock *cmtrpctypes.ResultBlock + blockRes *cmtrpctypes.ResultBlockResults fullTx bool registerMock func(math.Int, sdk.AccAddress, int64) expTxs bool @@ -907,10 +905,10 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { math.NewInt(1).BigInt(), sdk.AccAddress(common.Address{}.Bytes()), int64(1), - &tmrpctypes.ResultBlock{Block: emptyBlock}, - &tmrpctypes.ResultBlockResults{ + &cmtrpctypes.ResultBlock{Block: emptyBlock}, + &cmtrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, false, func(baseFee math.Int, validator sdk.AccAddress, height int64) { @@ -929,12 +927,12 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { nil, sdk.AccAddress(utiltx.GenerateAddress().Bytes()), int64(1), - &tmrpctypes.ResultBlock{ - Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), + &cmtrpctypes.ResultBlock{ + Block: cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil), }, - &tmrpctypes.ResultBlockResults{ + &cmtrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, true, func(_ math.Int, validator sdk.AccAddress, height int64) { @@ -953,12 +951,12 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { math.NewInt(1).BigInt(), sdk.AccAddress(common.Address{}.Bytes()), int64(1), - &tmrpctypes.ResultBlock{ - Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), + &cmtrpctypes.ResultBlock{ + Block: cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil), }, - &tmrpctypes.ResultBlockResults{ + &cmtrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, true, func(baseFee math.Int, _ sdk.AccAddress, height int64) { @@ -977,12 +975,12 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { math.NewInt(1).BigInt(), sdk.AccAddress(utiltx.GenerateAddress().Bytes()), int64(1), - &tmrpctypes.ResultBlock{ - Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), + &cmtrpctypes.ResultBlock{ + Block: cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil), }, - &tmrpctypes.ResultBlockResults{ + &cmtrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, true, func(baseFee math.Int, validator sdk.AccAddress, height int64) { @@ -1001,12 +999,12 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { math.NewInt(1).BigInt(), sdk.AccAddress(utiltx.GenerateAddress().Bytes()), int64(1), - &tmrpctypes.ResultBlock{ - Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), + &cmtrpctypes.ResultBlock{ + Block: cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil), }, - &tmrpctypes.ResultBlockResults{ + &cmtrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{ + TxsResults: []*types.ExecTxResult{ { Code: 11, GasUsed: 0, @@ -1031,12 +1029,12 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { math.NewInt(1).BigInt(), sdk.AccAddress(utiltx.GenerateAddress().Bytes()), int64(1), - &tmrpctypes.ResultBlock{ - Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), + &cmtrpctypes.ResultBlock{ + Block: cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil), }, - &tmrpctypes.ResultBlockResults{ + &cmtrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, false, func(baseFee math.Int, validator sdk.AccAddress, height int64) { @@ -1055,12 +1053,12 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { math.NewInt(1).BigInt(), sdk.AccAddress(utiltx.GenerateAddress().Bytes()), int64(1), - &tmrpctypes.ResultBlock{ - Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), + &cmtrpctypes.ResultBlock{ + Block: cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil), }, - &tmrpctypes.ResultBlockResults{ + &cmtrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, true, func(baseFee math.Int, validator sdk.AccAddress, height int64) { @@ -1084,8 +1082,8 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { var expBlock map[string]interface{} header := tc.resBlock.Block.Header - gasLimit := int64(^uint32(0)) // for `MaxGas = -1` (DefaultConsensusParams) - gasUsed := new(big.Int).SetUint64(uint64(tc.blockRes.TxsResults[0].GasUsed)) + gasLimit := int64(^uint32(0)) // for `MaxGas = -1` (DefaultConsensusParams) + gasUsed := new(big.Int).SetUint64(uint64(tc.blockRes.TxsResults[0].GasUsed)) //nolint:gosec // G115 // won't exceed uint64 root := common.Hash{}.Bytes() receipt := ethtypes.NewReceipt(root, false, gasUsed.Uint64()) @@ -1098,7 +1096,7 @@ func (suite *BackendTestSuite) TestGetEthBlockFromTendermint() { rpcTx, err := ethrpc.NewRPCTransaction( msgEthereumTx.AsTransaction(), common.BytesToHash(header.Hash()), - uint64(header.Height), + uint64(header.Height), //nolint:gosec // G115 // won't exceed uint64 uint64(0), tc.baseFee, suite.backend.chainID, @@ -1136,17 +1134,17 @@ func (suite *BackendTestSuite) TestEthMsgsFromTendermintBlock() { testCases := []struct { name string - resBlock *tmrpctypes.ResultBlock - blockRes *tmrpctypes.ResultBlockResults + resBlock *cmtrpctypes.ResultBlock + blockRes *cmtrpctypes.ResultBlockResults expMsgs []*evmtypes.MsgEthereumTx }{ { "tx in not included in block - unsuccessful tx without ExceedBlockGasLimit error", - &tmrpctypes.ResultBlock{ - Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), + &cmtrpctypes.ResultBlock{ + Block: cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil), }, - &tmrpctypes.ResultBlockResults{ - TxsResults: []*types.ResponseDeliverTx{ + &cmtrpctypes.ResultBlockResults{ + TxsResults: []*types.ExecTxResult{ { Code: 1, }, @@ -1156,11 +1154,11 @@ func (suite *BackendTestSuite) TestEthMsgsFromTendermintBlock() { }, { "tx included in block - unsuccessful tx with ExceedBlockGasLimit error", - &tmrpctypes.ResultBlock{ - Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), + &cmtrpctypes.ResultBlock{ + Block: cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil), }, - &tmrpctypes.ResultBlockResults{ - TxsResults: []*types.ResponseDeliverTx{ + &cmtrpctypes.ResultBlockResults{ + TxsResults: []*types.ExecTxResult{ { Code: 1, Log: ethrpc.ExceedBlockGasLimitError, @@ -1171,11 +1169,11 @@ func (suite *BackendTestSuite) TestEthMsgsFromTendermintBlock() { }, { "pass", - &tmrpctypes.ResultBlock{ - Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), + &cmtrpctypes.ResultBlock{ + Block: cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil), }, - &tmrpctypes.ResultBlockResults{ - TxsResults: []*types.ResponseDeliverTx{ + &cmtrpctypes.ResultBlockResults{ + TxsResults: []*types.ExecTxResult{ { Code: 0, Log: ethrpc.ExceedBlockGasLimitError, @@ -1196,7 +1194,7 @@ func (suite *BackendTestSuite) TestEthMsgsFromTendermintBlock() { } func (suite *BackendTestSuite) TestHeaderByNumber() { - var expResultBlock *tmrpctypes.ResultBlock + var expResultBlock *cmtrpctypes.ResultBlock _, bz := suite.buildEthereumTx() @@ -1308,11 +1306,11 @@ func (suite *BackendTestSuite) TestHeaderByNumber() { } func (suite *BackendTestSuite) TestHeaderByHash() { - var expResultBlock *tmrpctypes.ResultBlock + var expResultBlock *cmtrpctypes.ResultBlock _, bz := suite.buildEthereumTx() - block := tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil) - emptyBlock := tmtypes.MakeBlock(1, []tmtypes.Tx{}, nil, nil) + block := cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil) + emptyBlock := cmttypes.MakeBlock(1, []cmttypes.Tx{}, nil, nil) testCases := []struct { name string @@ -1420,7 +1418,7 @@ func (suite *BackendTestSuite) TestHeaderByHash() { func (suite *BackendTestSuite) TestEthBlockByNumber() { msgEthereumTx, bz := suite.buildEthereumTx() - emptyBlock := tmtypes.MakeBlock(1, []tmtypes.Tx{}, nil, nil) + emptyBlock := cmttypes.MakeBlock(1, []cmttypes.Tx{}, nil, nil) testCases := []struct { name string @@ -1533,13 +1531,13 @@ func (suite *BackendTestSuite) TestEthBlockByNumber() { func (suite *BackendTestSuite) TestEthBlockFromTendermintBlock() { msgEthereumTx, bz := suite.buildEthereumTx() - emptyBlock := tmtypes.MakeBlock(1, []tmtypes.Tx{}, nil, nil) + emptyBlock := cmttypes.MakeBlock(1, []cmttypes.Tx{}, nil, nil) testCases := []struct { name string baseFee *big.Int - resBlock *tmrpctypes.ResultBlock - blockRes *tmrpctypes.ResultBlockResults + resBlock *cmtrpctypes.ResultBlock + blockRes *cmtrpctypes.ResultBlockResults registerMock func(math.Int, int64) expEthBlock *ethtypes.Block expPass bool @@ -1547,12 +1545,12 @@ func (suite *BackendTestSuite) TestEthBlockFromTendermintBlock() { { "pass - block without tx", math.NewInt(1).BigInt(), - &tmrpctypes.ResultBlock{ + &cmtrpctypes.ResultBlock{ Block: emptyBlock, }, - &tmrpctypes.ResultBlockResults{ + &cmtrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, }, func(baseFee math.Int, _ int64) { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) @@ -1574,13 +1572,13 @@ func (suite *BackendTestSuite) TestEthBlockFromTendermintBlock() { { "pass - block with tx", math.NewInt(1).BigInt(), - &tmrpctypes.ResultBlock{ - Block: tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil), + &cmtrpctypes.ResultBlock{ + Block: cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil), }, - &tmrpctypes.ResultBlockResults{ + &cmtrpctypes.ResultBlockResults{ Height: 1, - TxsResults: []*types.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, - EndBlockEvents: []types.Event{ + TxsResults: []*types.ExecTxResult{{Code: 0, GasUsed: 0}}, + FinalizeBlockEvents: []types.Event{ { Type: evmtypes.EventTypeBlockBloom, Attributes: []types.EventAttribute{ diff --git a/rpc/backend/call_tx_test.go b/rpc/backend/call_tx_test.go index 2748e309..1ee19309 100644 --- a/rpc/backend/call_tx_test.go +++ b/rpc/backend/call_tx_test.go @@ -12,7 +12,7 @@ import ( "github.com/ethereum/go-ethereum/rlp" "github.com/evmos/os/rpc/backend/mocks" rpctypes "github.com/evmos/os/rpc/types" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/constants" utiltx "github.com/evmos/os/testutil/tx" evmtypes "github.com/evmos/os/x/evm/types" "google.golang.org/grpc/metadata" @@ -296,7 +296,7 @@ func (suite *BackendTestSuite) TestSendRawTransaction() { suite.Require().NoError(err) rlpEncodedBz, _ := rlp.EncodeToBytes(ethTx.AsTransaction()) - cosmosTx, _ := ethTx.BuildTx(suite.backend.clientCtx.TxConfig.NewTxBuilder(), testutil.ExampleAttoDenom) + cosmosTx, _ := ethTx.BuildTx(suite.backend.clientCtx.TxConfig.NewTxBuilder(), constants.ExampleAttoDenom) txBytes, _ := suite.backend.clientCtx.TxConfig.TxEncoder()(cosmosTx) testCases := []struct { diff --git a/rpc/backend/chain_info.go b/rpc/backend/chain_info.go index ba2059ea..67373c6f 100644 --- a/rpc/backend/chain_info.go +++ b/rpc/backend/chain_info.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package backend import ( @@ -8,8 +9,8 @@ import ( "strconv" "cosmossdk.io/math" - tmrpcclient "github.com/cometbft/cometbft/rpc/client" - tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" + cmtrpcclient "github.com/cometbft/cometbft/rpc/client" + cmtrpctypes "github.com/cometbft/cometbft/rpc/core/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -65,15 +66,15 @@ func (b *Backend) GlobalMinGasPrice() (math.LegacyDec, error) { // If the base fee is not enabled globally, the query returns nil. // If the London hard fork is not activated at the current height, the query will // return nil. -func (b *Backend) BaseFee(blockRes *tmrpctypes.ResultBlockResults) (*big.Int, error) { +func (b *Backend) BaseFee(blockRes *cmtrpctypes.ResultBlockResults) (*big.Int, error) { // return BaseFee if London hard fork is activated and feemarket is enabled res, err := b.queryClient.BaseFee(rpctypes.ContextWithHeight(blockRes.Height), &evmtypes.QueryBaseFeeRequest{}) if err != nil || res.BaseFee == nil { // we can't tell if it's london HF not enabled or the state is pruned, // in either case, we'll fallback to parsing from begin blocker event, // faster to iterate reversely - for i := len(blockRes.BeginBlockEvents) - 1; i >= 0; i-- { - evt := blockRes.BeginBlockEvents[i] + for i := len(blockRes.FinalizeBlockEvents) - 1; i >= 0; i-- { + evt := blockRes.FinalizeBlockEvents[i] if evt.Type == feemarkettypes.EventTypeFeeMarket && len(evt.Attributes) > 0 { baseFee, err := strconv.ParseInt(evt.Attributes[0].Value, 10, 64) if err == nil { @@ -102,7 +103,7 @@ func (b *Backend) CurrentHeader() (*ethtypes.Header, error) { // PendingTransactions returns the transactions that are in the transaction pool // and have a from address that is one of the accounts this node manages. func (b *Backend) PendingTransactions() ([]*sdk.Tx, error) { - mc, ok := b.clientCtx.Client.(tmrpcclient.MempoolClient) + mc, ok := b.clientCtx.Client.(cmtrpcclient.MempoolClient) if !ok { return nil, errors.New("invalid rpc client") } diff --git a/rpc/backend/chain_info_test.go b/rpc/backend/chain_info_test.go index 874100cb..d88815d6 100644 --- a/rpc/backend/chain_info_test.go +++ b/rpc/backend/chain_info_test.go @@ -46,7 +46,7 @@ func (suite *BackendTestSuite) TestBaseFee() { "fail - grpc BaseFee error - with non feemarket block event", &tmrpctypes.ResultBlockResults{ Height: 1, - BeginBlockEvents: []types.Event{ + FinalizeBlockEvents: []types.Event{ { Type: evmtypes.EventTypeBlockBloom, }, @@ -63,7 +63,7 @@ func (suite *BackendTestSuite) TestBaseFee() { "fail - grpc BaseFee error - with feemarket block event", &tmrpctypes.ResultBlockResults{ Height: 1, - BeginBlockEvents: []types.Event{ + FinalizeBlockEvents: []types.Event{ { Type: feemarkettypes.EventTypeFeeMarket, }, @@ -80,7 +80,7 @@ func (suite *BackendTestSuite) TestBaseFee() { "fail - grpc BaseFee error - with feemarket block event with wrong attribute value", &tmrpctypes.ResultBlockResults{ Height: 1, - BeginBlockEvents: []types.Event{ + FinalizeBlockEvents: []types.Event{ { Type: feemarkettypes.EventTypeFeeMarket, Attributes: []types.EventAttribute{ @@ -100,7 +100,7 @@ func (suite *BackendTestSuite) TestBaseFee() { "fail - grpc baseFee error - with feemarket block event with baseFee attribute value", &tmrpctypes.ResultBlockResults{ Height: 1, - BeginBlockEvents: []types.Event{ + FinalizeBlockEvents: []types.Event{ { Type: feemarkettypes.EventTypeFeeMarket, Attributes: []types.EventAttribute{ diff --git a/rpc/backend/client_test.go b/rpc/backend/client_test.go index af7ec8bf..f1feb816 100644 --- a/rpc/backend/client_test.go +++ b/rpc/backend/client_test.go @@ -4,21 +4,20 @@ import ( "context" "testing" - "github.com/cosmos/cosmos-sdk/client" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - errortypes "github.com/cosmos/cosmos-sdk/types/errors" - abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/bytes" - tmrpcclient "github.com/cometbft/cometbft/rpc/client" - tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" + cmtrpcclient "github.com/cometbft/cometbft/rpc/client" + cmtrpctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/client" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + errortypes "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/rpc/backend/mocks" rpc "github.com/evmos/os/rpc/types" evmtypes "github.com/evmos/os/x/evm/types" - mock "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) @@ -27,18 +26,18 @@ import ( // Tendermint RPC Client server. // // To use a mock method it has to be registered in a given test. -var _ tmrpcclient.Client = &mocks.Client{} +var _ cmtrpcclient.Client = &mocks.Client{} // Tx Search func RegisterTxSearch(client *mocks.Client, query string, txBz []byte) { - resulTxs := []*tmrpctypes.ResultTx{{Tx: txBz}} + resulTxs := []*cmtrpctypes.ResultTx{{Tx: txBz}} client.On("TxSearch", rpc.ContextWithHeight(1), query, false, (*int)(nil), (*int)(nil), ""). - Return(&tmrpctypes.ResultTxSearch{Txs: resulTxs, TotalCount: 1}, nil) + Return(&cmtrpctypes.ResultTxSearch{Txs: resulTxs, TotalCount: 1}, nil) } func RegisterTxSearchEmpty(client *mocks.Client, query string) { client.On("TxSearch", rpc.ContextWithHeight(1), query, false, (*int)(nil), (*int)(nil), ""). - Return(&tmrpctypes.ResultTxSearch{}, nil) + Return(&cmtrpctypes.ResultTxSearch{}, nil) } func RegisterTxSearchError(client *mocks.Client, query string) { @@ -49,7 +48,7 @@ func RegisterTxSearchError(client *mocks.Client, query string) { // Broadcast Tx func RegisterBroadcastTx(client *mocks.Client, tx types.Tx) { client.On("BroadcastTxSync", context.Background(), tx). - Return(&tmrpctypes.ResultBroadcastTx{}, nil) + Return(&cmtrpctypes.ResultBroadcastTx{}, nil) } func RegisterBroadcastTxError(client *mocks.Client, tx types.Tx) { @@ -60,12 +59,12 @@ func RegisterBroadcastTxError(client *mocks.Client, tx types.Tx) { // Unconfirmed Transactions func RegisterUnconfirmedTxs(client *mocks.Client, limit *int, txs []types.Tx) { client.On("UnconfirmedTxs", rpc.ContextWithHeight(1), limit). - Return(&tmrpctypes.ResultUnconfirmedTxs{Txs: txs}, nil) + Return(&cmtrpctypes.ResultUnconfirmedTxs{Txs: txs}, nil) } func RegisterUnconfirmedTxsEmpty(client *mocks.Client, limit *int) { client.On("UnconfirmedTxs", rpc.ContextWithHeight(1), limit). - Return(&tmrpctypes.ResultUnconfirmedTxs{ + Return(&cmtrpctypes.ResultUnconfirmedTxs{ Txs: make([]types.Tx, 2), }, nil) } @@ -78,7 +77,7 @@ func RegisterUnconfirmedTxsError(client *mocks.Client, limit *int) { // Status func RegisterStatus(client *mocks.Client) { client.On("Status", rpc.ContextWithHeight(1)). - Return(&tmrpctypes.ResultStatus{}, nil) + Return(&cmtrpctypes.ResultStatus{}, nil) } func RegisterStatusError(client *mocks.Client) { @@ -91,10 +90,10 @@ func RegisterBlockMultipleTxs( client *mocks.Client, height int64, txs []types.Tx, -) (*tmrpctypes.ResultBlock, error) { +) (*cmtrpctypes.ResultBlock, error) { block := types.MakeBlock(height, txs, nil, nil) block.ChainID = ChainID - resBlock := &tmrpctypes.ResultBlock{Block: block} + resBlock := &cmtrpctypes.ResultBlock{Block: block} client.On("Block", rpc.ContextWithHeight(height), mock.AnythingOfType("*int64")).Return(resBlock, nil) return resBlock, nil } @@ -103,12 +102,12 @@ func RegisterBlock( client *mocks.Client, height int64, tx []byte, -) (*tmrpctypes.ResultBlock, error) { +) (*cmtrpctypes.ResultBlock, error) { // without tx if tx == nil { emptyBlock := types.MakeBlock(height, []types.Tx{}, nil, nil) emptyBlock.ChainID = ChainID - resBlock := &tmrpctypes.ResultBlock{Block: emptyBlock} + resBlock := &cmtrpctypes.ResultBlock{Block: emptyBlock} client.On("Block", rpc.ContextWithHeight(height), mock.AnythingOfType("*int64")).Return(resBlock, nil) return resBlock, nil } @@ -116,7 +115,7 @@ func RegisterBlock( // with tx block := types.MakeBlock(height, []types.Tx{tx}, nil, nil) block.ChainID = ChainID - resBlock := &tmrpctypes.ResultBlock{Block: block} + resBlock := &cmtrpctypes.ResultBlock{Block: block} client.On("Block", rpc.ContextWithHeight(height), mock.AnythingOfType("*int64")).Return(resBlock, nil) return resBlock, nil } @@ -131,11 +130,11 @@ func RegisterBlockError(client *mocks.Client, height int64) { func RegisterBlockNotFound( client *mocks.Client, height int64, -) (*tmrpctypes.ResultBlock, error) { +) (*cmtrpctypes.ResultBlock, error) { client.On("Block", rpc.ContextWithHeight(height), mock.AnythingOfType("*int64")). - Return(&tmrpctypes.ResultBlock{Block: nil}, nil) + Return(&cmtrpctypes.ResultBlock{Block: nil}, nil) - return &tmrpctypes.ResultBlock{Block: nil}, nil + return &cmtrpctypes.ResultBlock{Block: nil}, nil } func TestRegisterBlock(t *testing.T) { @@ -148,7 +147,7 @@ func TestRegisterBlock(t *testing.T) { emptyBlock := types.MakeBlock(height, []types.Tx{}, nil, nil) emptyBlock.ChainID = ChainID - resBlock := &tmrpctypes.ResultBlock{Block: emptyBlock} + resBlock := &cmtrpctypes.ResultBlock{Block: emptyBlock} require.Equal(t, resBlock, res) require.NoError(t, err) } @@ -157,7 +156,7 @@ func TestRegisterBlock(t *testing.T) { func RegisterConsensusParams(client *mocks.Client, height int64) { consensusParams := types.DefaultConsensusParams() client.On("ConsensusParams", rpc.ContextWithHeight(height), mock.AnythingOfType("*int64")). - Return(&tmrpctypes.ResultConsensusParams{ConsensusParams: *consensusParams}, nil) + Return(&cmtrpctypes.ResultConsensusParams{ConsensusParams: *consensusParams}, nil) } func RegisterConsensusParamsError(client *mocks.Client, height int64) { @@ -172,16 +171,16 @@ func TestRegisterConsensusParams(t *testing.T) { res, err := client.ConsensusParams(rpc.ContextWithHeight(height), &height) consensusParams := types.DefaultConsensusParams() - require.Equal(t, &tmrpctypes.ResultConsensusParams{ConsensusParams: *consensusParams}, res) + require.Equal(t, &cmtrpctypes.ResultConsensusParams{ConsensusParams: *consensusParams}, res) require.NoError(t, err) } // BlockResults -func RegisterBlockResultsWithEventLog(client *mocks.Client, height int64) (*tmrpctypes.ResultBlockResults, error) { - res := &tmrpctypes.ResultBlockResults{ +func RegisterBlockResultsWithEventLog(client *mocks.Client, height int64) (*cmtrpctypes.ResultBlockResults, error) { + res := &cmtrpctypes.ResultBlockResults{ Height: height, - TxsResults: []*abci.ResponseDeliverTx{ + TxsResults: []*abci.ExecTxResult{ {Code: 0, GasUsed: 0, Events: []abci.Event{{ Type: evmtypes.EventTypeTxLog, Attributes: []abci.EventAttribute{{ @@ -200,10 +199,10 @@ func RegisterBlockResultsWithEventLog(client *mocks.Client, height int64) (*tmrp func RegisterBlockResults( client *mocks.Client, height int64, -) (*tmrpctypes.ResultBlockResults, error) { - res := &tmrpctypes.ResultBlockResults{ +) (*cmtrpctypes.ResultBlockResults, error) { + res := &cmtrpctypes.ResultBlockResults{ Height: height, - TxsResults: []*abci.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*abci.ExecTxResult{{Code: 0, GasUsed: 0}}, } client.On("BlockResults", rpc.ContextWithHeight(height), mock.AnythingOfType("*int64")). @@ -223,9 +222,9 @@ func TestRegisterBlockResults(t *testing.T) { require.NoError(t, err) res, err := client.BlockResults(rpc.ContextWithHeight(height), &height) - expRes := &tmrpctypes.ResultBlockResults{ + expRes := &cmtrpctypes.ResultBlockResults{ Height: height, - TxsResults: []*abci.ResponseDeliverTx{{Code: 0, GasUsed: 0}}, + TxsResults: []*abci.ExecTxResult{{Code: 0, GasUsed: 0}}, } require.Equal(t, expRes, res) require.NoError(t, err) @@ -236,9 +235,9 @@ func RegisterBlockByHash( client *mocks.Client, _ common.Hash, tx []byte, -) (*tmrpctypes.ResultBlock, error) { +) (*cmtrpctypes.ResultBlock, error) { block := types.MakeBlock(1, []types.Tx{tx}, nil, nil) - resBlock := &tmrpctypes.ResultBlock{Block: block} + resBlock := &cmtrpctypes.ResultBlock{Block: block} client.On("BlockByHash", rpc.ContextWithHeight(1), []byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}). Return(resBlock, nil) @@ -255,9 +254,9 @@ func RegisterBlockByHashNotFound(client *mocks.Client, _ common.Hash, _ []byte) Return(nil, nil) } -func RegisterABCIQueryWithOptions(client *mocks.Client, height int64, path string, data bytes.HexBytes, opts tmrpcclient.ABCIQueryOptions) { +func RegisterABCIQueryWithOptions(client *mocks.Client, height int64, path string, data bytes.HexBytes, opts cmtrpcclient.ABCIQueryOptions) { client.On("ABCIQueryWithOptions", context.Background(), path, data, opts). - Return(&tmrpctypes.ResultABCIQuery{ + Return(&cmtrpctypes.ResultABCIQuery{ Response: abci.ResponseQuery{ Value: []byte{2}, // TODO replace with data.Bytes(), Height: height, @@ -265,18 +264,18 @@ func RegisterABCIQueryWithOptions(client *mocks.Client, height int64, path strin }, nil) } -func RegisterABCIQueryWithOptionsError(clients *mocks.Client, path string, data bytes.HexBytes, opts tmrpcclient.ABCIQueryOptions) { +func RegisterABCIQueryWithOptionsError(clients *mocks.Client, path string, data bytes.HexBytes, opts cmtrpcclient.ABCIQueryOptions) { clients.On("ABCIQueryWithOptions", context.Background(), path, data, opts). Return(nil, errortypes.ErrInvalidRequest) } -func RegisterABCIQueryAccount(clients *mocks.Client, data bytes.HexBytes, opts tmrpcclient.ABCIQueryOptions, acc client.Account) { +func RegisterABCIQueryAccount(clients *mocks.Client, data bytes.HexBytes, opts cmtrpcclient.ABCIQueryOptions, acc client.Account) { baseAccount := authtypes.NewBaseAccount(acc.GetAddress(), acc.GetPubKey(), acc.GetAccountNumber(), acc.GetSequence()) accAny, _ := codectypes.NewAnyWithValue(baseAccount) accResponse := authtypes.QueryAccountResponse{Account: accAny} respBz, _ := accResponse.Marshal() clients.On("ABCIQueryWithOptions", context.Background(), "/cosmos.auth.v1beta1.Query/Account", data, opts). - Return(&tmrpctypes.ResultABCIQuery{ + Return(&cmtrpctypes.ResultABCIQuery{ Response: abci.ResponseQuery{ Value: respBz, Height: 1, diff --git a/rpc/backend/evm_query_client_test.go b/rpc/backend/evm_query_client_test.go index 357956c5..b73e93a0 100644 --- a/rpc/backend/evm_query_client_test.go +++ b/rpc/backend/evm_query_client_test.go @@ -7,6 +7,8 @@ import ( "strconv" "testing" + "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" @@ -14,7 +16,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/rpc/backend/mocks" rpc "github.com/evmos/os/rpc/types" - "github.com/evmos/os/testutil" utiltx "github.com/evmos/os/testutil/tx" evmtypes "github.com/evmos/os/x/evm/types" mock "github.com/stretchr/testify/mock" @@ -79,7 +80,7 @@ func RegisterParams(queryClient *mocks.EVMQueryClient, header *metadata.MD, heig func RegisterParamsWithoutHeader(queryClient *mocks.EVMQueryClient, height int64) { // NOTE: we need to register the EVM denomination for the example chain - evmParams := evmtypes.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom) + evmParams := evmtypes.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom) queryClient.On("Params", rpc.ContextWithHeight(height), &evmtypes.QueryParamsRequest{}). Return(&evmtypes.QueryParamsResponse{Params: evmParams}, nil) diff --git a/rpc/backend/filters_test.go b/rpc/backend/filters_test.go index b853ab53..a8b909fb 100644 --- a/rpc/backend/filters_test.go +++ b/rpc/backend/filters_test.go @@ -3,7 +3,7 @@ package backend import ( "encoding/json" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/evmos/os/rpc/backend/mocks" @@ -13,7 +13,7 @@ import ( func (suite *BackendTestSuite) TestGetLogs() { _, bz := suite.buildEthereumTx() - block := tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil) + block := cmttypes.MakeBlock(1, []cmttypes.Tx{bz}, nil, nil) logs := make([]*evmtypes.Log, 0, 1) var log evmtypes.Log err := json.Unmarshal([]byte("{\"test\": \"hello\"}"), &log) // TODO refactor this to unmarshall to a log struct successfully diff --git a/rpc/backend/mocks/client.go b/rpc/backend/mocks/client.go index 2fabaa11..3b45f960 100644 --- a/rpc/backend/mocks/client.go +++ b/rpc/backend/mocks/client.go @@ -652,6 +652,9 @@ func (_m *Client) Reset() error { } // SetLogger provides a mock function with given fields: _a0 +// +// NOTE: here we have to keep the Comet logger, instead of the Cosmos SDK +// one because it has to implement the Client interface. func (_m *Client) SetLogger(_a0 log.Logger) { _m.Called(_a0) } diff --git a/rpc/backend/node_info.go b/rpc/backend/node_info.go index 5ace48bf..1785b890 100644 --- a/rpc/backend/node_info.go +++ b/rpc/backend/node_info.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package backend import ( @@ -7,9 +8,11 @@ import ( "math/big" "time" + "github.com/evmos/os/testutil/constants" + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdkcrypto "github.com/cosmos/cosmos-sdk/crypto" @@ -21,11 +24,9 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" - "github.com/evmos/os/crypto/ethsecp256k1" rpctypes "github.com/evmos/os/rpc/types" "github.com/evmos/os/server/config" - "github.com/evmos/os/testutil" evmtypes "github.com/evmos/os/x/evm/types" ) @@ -73,8 +74,8 @@ func (b *Backend) Syncing() (interface{}, error) { } return map[string]interface{}{ - "startingBlock": hexutil.Uint64(status.SyncInfo.EarliestBlockHeight), - "currentBlock": hexutil.Uint64(status.SyncInfo.LatestBlockHeight), + "startingBlock": hexutil.Uint64(status.SyncInfo.EarliestBlockHeight), //nolint:gosec // G115 // won't exceed uint64 + "currentBlock": hexutil.Uint64(status.SyncInfo.LatestBlockHeight), //nolint:gosec // G115 // won't exceed uint64 // "highestBlock": nil, // NA // "pulledStates": nil, // NA // "knownStates": nil, // NA @@ -97,11 +98,6 @@ func (b *Backend) SetEtherbase(etherbase common.Address) bool { withdrawAddr := sdk.AccAddress(etherbase.Bytes()) msg := distributiontypes.NewMsgSetWithdrawAddress(delAddr, withdrawAddr) - if err := msg.ValidateBasic(); err != nil { - b.logger.Debug("tx failed basic validation", "error", err.Error()) - return false - } - // Assemble transaction from fields builder, ok := b.clientCtx.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder) if !ok { @@ -158,7 +154,7 @@ func (b *Backend) SetEtherbase(etherbase common.Address) bool { return false } - if err := tx.Sign(txFactory, keyInfo.Name, builder, false); err != nil { + if err := tx.Sign(b.clientCtx.CmdContext, txFactory, keyInfo.Name, builder, false); err != nil { b.logger.Debug("failed to sign tx", "error", err.Error()) return false } @@ -171,7 +167,7 @@ func (b *Backend) SetEtherbase(etherbase common.Address) bool { return false } - tmHash := common.BytesToHash(tmtypes.Tx(txBytes).Hash()) + tmHash := common.BytesToHash(cmttypes.Tx(txBytes).Hash()) // Broadcast transaction in sync mode (default) // NOTE: If error is encountered on the node, the broadcast will not return an error @@ -344,13 +340,13 @@ func (b *Backend) RPCBlockRangeCap() int32 { func (b *Backend) RPCMinGasPrice() int64 { evmParams, err := b.queryClient.Params(b.ctx, &evmtypes.QueryParamsRequest{}) if err != nil { - return testutil.DefaultGasPrice + return constants.DefaultGasPrice } minGasPrice := b.cfg.GetMinGasPrices() amt := minGasPrice.AmountOf(evmParams.Params.EvmDenom).TruncateInt64() if amt == 0 { - return testutil.DefaultGasPrice + return constants.DefaultGasPrice } return amt diff --git a/rpc/backend/node_info_test.go b/rpc/backend/node_info_test.go index 4f0829fb..b0b5182c 100644 --- a/rpc/backend/node_info_test.go +++ b/rpc/backend/node_info_test.go @@ -4,6 +4,8 @@ import ( "fmt" "math/big" + "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" tmrpcclient "github.com/cometbft/cometbft/rpc/client" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,7 +14,6 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/evmos/os/crypto/ethsecp256k1" "github.com/evmos/os/rpc/backend/mocks" - "github.com/evmos/os/testutil" "github.com/spf13/viper" "google.golang.org/grpc/metadata" ) @@ -30,7 +31,7 @@ func (suite *BackendTestSuite) TestRPCMinGasPrice() { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterParamsWithoutHeaderError(queryClient, 1) }, - testutil.DefaultGasPrice, + constants.DefaultGasPrice, true, }, { @@ -39,7 +40,7 @@ func (suite *BackendTestSuite) TestRPCMinGasPrice() { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) RegisterParamsWithoutHeader(queryClient, 1) }, - testutil.DefaultGasPrice, + constants.DefaultGasPrice, true, }, } @@ -255,7 +256,7 @@ func (suite *BackendTestSuite) TestSetEtherbase() { RegisterStatus(client) RegisterValidatorAccount(queryClient, suite.acc) RegisterParams(queryClient, &header, 1) - c := sdk.NewDecCoin(testutil.ExampleAttoDenom, math.NewIntFromBigInt(big.NewInt(1))) + c := sdk.NewDecCoin(constants.ExampleAttoDenom, math.NewIntFromBigInt(big.NewInt(1))) suite.backend.cfg.SetMinGasPrices(sdk.DecCoins{c}) delAddr, _ := suite.backend.GetCoinbase() // account, _ := suite.backend.clientCtx.AccountRetriever.GetAccount(suite.backend.clientCtx, delAddr) @@ -280,7 +281,7 @@ func (suite *BackendTestSuite) TestSetEtherbase() { // queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) // RegisterStatus(client) // RegisterValidatorAccount(queryClient, suite.acc) - // c := sdk.NewDecCoin(testutil.ExampleAttoDenom, math.NewIntFromBigInt(big.NewInt(1))) + // c := sdk.NewDecCoin(testconstants.ExampleAttoDenom, math.NewIntFromBigInt(big.NewInt(1))) // suite.backend.cfg.SetMinGasPrices(sdk.DecCoins{c}) // delAddr, _ := suite.backend.GetCoinbase() // account, _ := suite.backend.clientCtx.AccountRetriever.GetAccount(suite.backend.clientCtx, delAddr) diff --git a/rpc/backend/sign_tx.go b/rpc/backend/sign_tx.go index 6c34fb6c..dbe583f3 100644 --- a/rpc/backend/sign_tx.go +++ b/rpc/backend/sign_tx.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package backend import ( @@ -7,6 +8,8 @@ import ( "fmt" "math/big" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,7 +19,6 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" - evmtypes "github.com/evmos/os/x/evm/types" ) @@ -125,7 +127,7 @@ func (b *Backend) Sign(address common.Address, data hexutil.Bytes) (hexutil.Byte } // Sign the requested hash with the wallet - signature, _, err := b.clientCtx.Keyring.SignByAddress(from, data) + signature, _, err := b.clientCtx.Keyring.SignByAddress(from, data, signingtypes.SignMode_SIGN_MODE_TEXTUAL) if err != nil { b.logger.Error("keyring.SignByAddress failed", "address", address.Hex()) return nil, err @@ -151,7 +153,7 @@ func (b *Backend) SignTypedData(address common.Address, typedData apitypes.Typed } // Sign the requested hash with the wallet - signature, _, err := b.clientCtx.Keyring.SignByAddress(from, sigHash) + signature, _, err := b.clientCtx.Keyring.SignByAddress(from, sigHash, signingtypes.SignMode_SIGN_MODE_TEXTUAL) if err != nil { b.logger.Error("keyring.SignByAddress failed", "address", address.Hex()) return nil, err diff --git a/rpc/backend/sign_tx_test.go b/rpc/backend/sign_tx_test.go index cf9b91cc..229de568 100644 --- a/rpc/backend/sign_tx_test.go +++ b/rpc/backend/sign_tx_test.go @@ -3,6 +3,9 @@ package backend import ( "fmt" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/crypto" sdk "github.com/cosmos/cosmos-sdk/types" @@ -13,7 +16,6 @@ import ( "github.com/ethereum/go-ethereum/signer/core/apitypes" "github.com/evmos/os/crypto/ethsecp256k1" "github.com/evmos/os/rpc/backend/mocks" - "github.com/evmos/os/testutil" utiltx "github.com/evmos/os/testutil/tx" evmtypes "github.com/evmos/os/x/evm/types" "google.golang.org/grpc/metadata" @@ -179,7 +181,7 @@ func (suite *BackendTestSuite) TestSign() { responseBz, err := suite.backend.Sign(tc.fromAddr, tc.inputBz) if tc.expPass { - signature, _, err := suite.backend.clientCtx.Keyring.SignByAddress((sdk.AccAddress)(from.Bytes()), tc.inputBz) + signature, _, err := suite.backend.clientCtx.Keyring.SignByAddress((sdk.AccAddress)(from.Bytes()), tc.inputBz, signingtypes.SignMode_SIGN_MODE_TEXTUAL) signature[goethcrypto.RecoveryIDOffset] += 27 suite.Require().NoError(err) suite.Require().Equal((hexutil.Bytes)(signature), responseBz) @@ -229,7 +231,7 @@ func (suite *BackendTestSuite) TestSignTypedData() { if tc.expPass { sigHash, _, _ := apitypes.TypedDataAndHash(tc.inputTypedData) - signature, _, err := suite.backend.clientCtx.Keyring.SignByAddress((sdk.AccAddress)(from.Bytes()), sigHash) + signature, _, err := suite.backend.clientCtx.Keyring.SignByAddress((sdk.AccAddress)(from.Bytes()), sigHash, signingtypes.SignMode_SIGN_MODE_TEXTUAL) signature[goethcrypto.RecoveryIDOffset] += 27 suite.Require().NoError(err) suite.Require().Equal((hexutil.Bytes)(signature), responseBz) @@ -257,7 +259,7 @@ func broadcastTx(suite *BackendTestSuite, priv *ethsecp256k1.PrivKey, baseFee ma msg := callArgsDefault.ToTransaction() err = msg.Sign(ethSigner, suite.backend.clientCtx.Keyring) suite.Require().NoError(err) - tx, _ := msg.BuildTx(suite.backend.clientCtx.TxConfig.NewTxBuilder(), testutil.ExampleAttoDenom) + tx, _ := msg.BuildTx(suite.backend.clientCtx.TxConfig.NewTxBuilder(), constants.ExampleAttoDenom) txEncoder := suite.backend.clientCtx.TxConfig.TxEncoder() txBytes, _ = txEncoder(tx) return client, txBytes diff --git a/rpc/backend/tracing_test.go b/rpc/backend/tracing_test.go index 6578c2dc..27c1051d 100644 --- a/rpc/backend/tracing_test.go +++ b/rpc/backend/tracing_test.go @@ -3,18 +3,19 @@ package backend import ( "fmt" - dbm "github.com/cometbft/cometbft-db" + "github.com/evmos/os/testutil/constants" + + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - tmlog "github.com/cometbft/cometbft/libs/log" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/crypto" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/evmos/os/crypto/ethsecp256k1" "github.com/evmos/os/indexer" "github.com/evmos/os/rpc/backend/mocks" - "github.com/evmos/os/testutil" evmtypes "github.com/evmos/os/x/evm/types" ) @@ -41,20 +42,20 @@ func (suite *BackendTestSuite) TestTraceTransaction() { msgEthereumTx.From = from.String() _ = msgEthereumTx.Sign(ethSigner, suite.signer) - tx, _ := msgEthereumTx.BuildTx(suite.backend.clientCtx.TxConfig.NewTxBuilder(), testutil.ExampleAttoDenom) + tx, _ := msgEthereumTx.BuildTx(suite.backend.clientCtx.TxConfig.NewTxBuilder(), constants.ExampleAttoDenom) txBz, _ := txEncoder(tx) msgEthereumTx2.From = from.String() _ = msgEthereumTx2.Sign(ethSigner, suite.signer) - tx2, _ := msgEthereumTx.BuildTx(suite.backend.clientCtx.TxConfig.NewTxBuilder(), testutil.ExampleAttoDenom) + tx2, _ := msgEthereumTx.BuildTx(suite.backend.clientCtx.TxConfig.NewTxBuilder(), constants.ExampleAttoDenom) txBz2, _ := txEncoder(tx2) testCases := []struct { name string registerMock func() block *types.Block - responseBlock []*abci.ResponseDeliverTx + responseBlock []*abci.ExecTxResult expResult interface{} expPass bool }{ @@ -62,7 +63,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() { "fail - tx not found", func() {}, &types.Block{Header: types.Header{Height: 1}, Data: types.Data{Txs: []types.Tx{}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -88,7 +89,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() { RegisterBlockError(client, 1) }, &types.Block{Header: types.Header{Height: 1}, Data: types.Data{Txs: []types.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -120,7 +121,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() { RegisterConsensusParams(client, height) }, &types.Block{Header: types.Header{Height: 1, ChainID: ChainID}, Data: types.Data{Txs: []types.Tx{txBz, txBz2}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -165,7 +166,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() { RegisterConsensusParams(client, height) }, &types.Block{Header: types.Header{Height: 1}, Data: types.Data{Txs: []types.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -191,7 +192,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() { tc.registerMock() db := dbm.NewMemDB() - suite.backend.indexer = indexer.NewKVIndexer(db, tmlog.NewNopLogger(), suite.backend.clientCtx) + suite.backend.indexer = indexer.NewKVIndexer(db, log.NewNopLogger(), suite.backend.clientCtx) err := suite.backend.indexer.IndexBlock(tc.block, tc.responseBlock) suite.Require().NoError(err) diff --git a/rpc/backend/tx_info.go b/rpc/backend/tx_info.go index 90e33c80..3339f199 100644 --- a/rpc/backend/tx_info.go +++ b/rpc/backend/tx_info.go @@ -231,8 +231,8 @@ func (b *Backend) GetTransactionReceipt(hash common.Hash) (map[string]interface{ // Inclusion information: These fields provide information about the inclusion of the // transaction corresponding to this receipt. "blockHash": common.BytesToHash(resBlock.Block.Header.Hash()).Hex(), - "blockNumber": hexutil.Uint64(res.Height), - "transactionIndex": hexutil.Uint64(res.EthTxIndex), + "blockNumber": hexutil.Uint64(res.Height), //nolint:gosec // G115 // won't exceed uint64 + "transactionIndex": hexutil.Uint64(res.EthTxIndex), //nolint:gosec // G115 // no int overflow expected here // sender and receiver (contract or EOA) addreses "from": from, diff --git a/rpc/backend/tx_info_test.go b/rpc/backend/tx_info_test.go index 5b495dd9..6bb56621 100644 --- a/rpc/backend/tx_info_test.go +++ b/rpc/backend/tx_info_test.go @@ -4,12 +4,12 @@ import ( "fmt" "math/big" + "cosmossdk.io/log" "cosmossdk.io/math" - dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" - tmlog "github.com/cometbft/cometbft/libs/log" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/evmos/os/indexer" @@ -26,7 +26,7 @@ func (suite *BackendTestSuite) TestGetTransactionByHash() { txBz := suite.signAndEncodeEthTx(msgEthereumTx) block := &types.Block{Header: types.Header{Height: 1, ChainID: "test"}, Data: types.Data{Txs: []types.Tx{txBz}}} - responseDeliver := []*abci.ResponseDeliverTx{ + responseDeliver := []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -111,7 +111,7 @@ func (suite *BackendTestSuite) TestGetTransactionByHash() { tc.registerMock() db := dbm.NewMemDB() - suite.backend.indexer = indexer.NewKVIndexer(db, tmlog.NewNopLogger(), suite.backend.clientCtx) + suite.backend.indexer = indexer.NewKVIndexer(db, log.NewNopLogger(), suite.backend.clientCtx) err := suite.backend.indexer.IndexBlock(block, responseDeliver) suite.Require().NoError(err) @@ -284,7 +284,7 @@ func (suite *BackendTestSuite) TestGetTransactionByBlockAndIndex() { msgEthTx, bz := suite.buildEthereumTx() defaultBlock := types.MakeBlock(1, []types.Tx{bz}, nil, nil) - defaultResponseDeliverTx := []*abci.ResponseDeliverTx{ + defaultExecTxResult := []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -348,10 +348,10 @@ func (suite *BackendTestSuite) TestGetTransactionByBlockAndIndex() { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) client := suite.backend.clientCtx.Client.(*mocks.Client) db := dbm.NewMemDB() - suite.backend.indexer = indexer.NewKVIndexer(db, tmlog.NewNopLogger(), suite.backend.clientCtx) + suite.backend.indexer = indexer.NewKVIndexer(db, log.NewNopLogger(), suite.backend.clientCtx) txBz := suite.signAndEncodeEthTx(msgEthTx) block := &types.Block{Header: types.Header{Height: 1, ChainID: "test"}, Data: types.Data{Txs: []types.Tx{txBz}}} - err := suite.backend.indexer.IndexBlock(block, defaultResponseDeliverTx) + err := suite.backend.indexer.IndexBlock(block, defaultExecTxResult) suite.Require().NoError(err) _, err = RegisterBlockResults(client, 1) suite.Require().NoError(err) @@ -553,7 +553,7 @@ func (suite *BackendTestSuite) TestGetTransactionReceipt() { registerMock func() tx *evmtypes.MsgEthereumTx block *types.Block - blockResult []*abci.ResponseDeliverTx + blockResult []*abci.ExecTxResult expTxReceipt map[string]interface{} expPass bool }{ @@ -572,7 +572,7 @@ func (suite *BackendTestSuite) TestGetTransactionReceipt() { }, msgEthereumTx, &types.Block{Header: types.Header{Height: 1}, Data: types.Data{Txs: []types.Tx{txBz}}}, - []*abci.ResponseDeliverTx{ + []*abci.ExecTxResult{ { Code: 0, Events: []abci.Event{ @@ -598,7 +598,7 @@ func (suite *BackendTestSuite) TestGetTransactionReceipt() { tc.registerMock() db := dbm.NewMemDB() - suite.backend.indexer = indexer.NewKVIndexer(db, tmlog.NewNopLogger(), suite.backend.clientCtx) + suite.backend.indexer = indexer.NewKVIndexer(db, log.NewNopLogger(), suite.backend.clientCtx) err := suite.backend.indexer.IndexBlock(tc.block, tc.blockResult) suite.Require().NoError(err) diff --git a/rpc/backend/utils.go b/rpc/backend/utils.go index b865e5ad..20f6353c 100644 --- a/rpc/backend/utils.go +++ b/rpc/backend/utils.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package backend import ( @@ -9,23 +10,20 @@ import ( "sort" "strings" + "cosmossdk.io/log" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/proto/tendermint/crypto" + cmtrpctypes "github.com/cometbft/cometbft/rpc/core/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/consensus/misc" ethtypes "github.com/ethereum/go-ethereum/core/types" - - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" - tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" - - "github.com/cometbft/cometbft/proto/tendermint/crypto" "github.com/evmos/os/rpc/types" evmtypes "github.com/evmos/os/x/evm/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) type txGasAndReward struct { @@ -61,7 +59,7 @@ func (b *Backend) getAccountNonce(accAddr common.Address, pending bool, height i } return 0, err } - var acc authtypes.AccountI + var acc sdk.AccountI if err := b.clientCtx.InterfaceRegistry.UnpackAny(res.Account, &acc); err != nil { return 0, err } @@ -105,10 +103,10 @@ func (b *Backend) getAccountNonce(accAddr common.Address, pending bool, height i // output: targetOneFeeHistory func (b *Backend) processBlock( - tendermintBlock *tmrpctypes.ResultBlock, + tendermintBlock *cmtrpctypes.ResultBlock, ethBlock *map[string]interface{}, rewardPercentiles []float64, - tendermintBlockResult *tmrpctypes.ResultBlockResults, + tendermintBlockResult *cmtrpctypes.ResultBlockResults, targetOneFeeHistory *types.OneFeeHistory, ) error { blockHeight := tendermintBlock.Block.Height @@ -254,24 +252,24 @@ func ParseTxLogsFromEvent(event abci.Event) ([]*ethtypes.Log, error) { continue } - var log evmtypes.Log - if err := json.Unmarshal([]byte(attr.Value), &log); err != nil { + var txLog evmtypes.Log + if err := json.Unmarshal([]byte(attr.Value), &txLog); err != nil { return nil, err } - logs = append(logs, &log) + logs = append(logs, &txLog) } return evmtypes.LogsToEthereum(logs), nil } // ShouldIgnoreGasUsed returns true if the gasUsed in result should be ignored // workaround for issue: https://github.com/cosmos/cosmos-sdk/issues/10832 -func ShouldIgnoreGasUsed(res *abci.ResponseDeliverTx) bool { +func ShouldIgnoreGasUsed(res *abci.ExecTxResult) bool { return res.GetCode() == 11 && strings.Contains(res.GetLog(), "no block gas left to run tx: out of gas") } // GetLogsFromBlockResults returns the list of event logs from the tendermint block result response -func GetLogsFromBlockResults(blockRes *tmrpctypes.ResultBlockResults) ([][]*ethtypes.Log, error) { +func GetLogsFromBlockResults(blockRes *cmtrpctypes.ResultBlockResults) ([][]*ethtypes.Log, error) { blockLogs := [][]*ethtypes.Log{} for _, txResult := range blockRes.TxsResults { logs, err := AllTxLogsFromEvents(txResult.Events) diff --git a/rpc/namespaces/ethereum/debug/api.go b/rpc/namespaces/ethereum/debug/api.go index 1f537ed9..833cb9f1 100644 --- a/rpc/namespaces/ethereum/debug/api.go +++ b/rpc/namespaces/ethereum/debug/api.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package debug import ( @@ -14,22 +15,17 @@ import ( "sync" "time" - "github.com/davecgh/go-spew/spew" - - evmtypes "github.com/evmos/os/x/evm/types" - - stderrors "github.com/pkg/errors" - + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/server" - - "github.com/cometbft/cometbft/libs/log" + "github.com/davecgh/go-spew/spew" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/rlp" - "github.com/evmos/os/rpc/backend" rpctypes "github.com/evmos/os/rpc/types" + evmtypes "github.com/evmos/os/x/evm/types" + stderrors "github.com/pkg/errors" ) // HandlerT keeps track of the cpu profiler and trace execution diff --git a/rpc/namespaces/ethereum/debug/utils.go b/rpc/namespaces/ethereum/debug/utils.go index 9669775f..ccf127bb 100644 --- a/rpc/namespaces/ethereum/debug/utils.go +++ b/rpc/namespaces/ethereum/debug/utils.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package debug import ( @@ -9,7 +10,7 @@ import ( "runtime/pprof" "strings" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/server" ) diff --git a/rpc/namespaces/ethereum/eth/api.go b/rpc/namespaces/ethereum/eth/api.go index cbe1a6ce..895350a2 100644 --- a/rpc/namespaces/ethereum/eth/api.go +++ b/rpc/namespaces/ethereum/eth/api.go @@ -1,18 +1,17 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package eth import ( "context" - "github.com/cometbft/cometbft/libs/log" - + "cosmossdk.io/log" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/signer/core/apitypes" - "github.com/evmos/os/rpc/backend" rpctypes "github.com/evmos/os/rpc/types" "github.com/evmos/os/types" diff --git a/rpc/namespaces/ethereum/eth/filters/api.go b/rpc/namespaces/ethereum/eth/filters/api.go index cbd7f4cc..31207fd4 100644 --- a/rpc/namespaces/ethereum/eth/filters/api.go +++ b/rpc/namespaces/ethereum/eth/filters/api.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package filters import ( @@ -8,20 +9,16 @@ import ( "sync" "time" - "github.com/cosmos/cosmos-sdk/client" - "github.com/evmos/os/rpc/types" - - "github.com/cometbft/cometbft/libs/log" - + "cosmossdk.io/log" coretypes "github.com/cometbft/cometbft/rpc/core/types" rpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client" - tmtypes "github.com/cometbft/cometbft/types" - + cmttypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/rpc" - + "github.com/evmos/os/rpc/types" evmtypes "github.com/evmos/os/x/evm/types" ) @@ -159,7 +156,7 @@ func (api *PublicFilterAPI) NewPendingTransactionFilter() rpc.ID { return } - data, ok := ev.Data.(tmtypes.EventDataTx) + data, ok := ev.Data.(cmttypes.EventDataTx) if !ok { api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) continue @@ -225,7 +222,7 @@ func (api *PublicFilterAPI) NewPendingTransactions(ctx context.Context) (*rpc.Su return } - data, ok := ev.Data.(tmtypes.EventDataTx) + data, ok := ev.Data.(cmttypes.EventDataTx) if !ok { api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) continue @@ -289,7 +286,7 @@ func (api *PublicFilterAPI) NewBlockFilter() rpc.ID { return } - data, ok := ev.Data.(tmtypes.EventDataNewBlockHeader) + data, ok := ev.Data.(cmttypes.EventDataNewBlockHeader) if !ok { api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) continue @@ -338,16 +335,16 @@ func (api *PublicFilterAPI) NewHeads(ctx context.Context) (*rpc.Subscription, er return } - data, ok := ev.Data.(tmtypes.EventDataNewBlockHeader) + data, ok := ev.Data.(cmttypes.EventDataNewBlock) if !ok { api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) continue } - baseFee := types.BaseFeeFromEvents(data.ResultBeginBlock.Events) + baseFee := types.BaseFeeFromEvents(data.ResultFinalizeBlock.Events) // TODO: fetch bloom from events - header := types.EthHeaderFromTendermint(data.Header, ethtypes.Bloom{}, baseFee) + header := types.EthHeaderFromTendermint(data.Block.Header, ethtypes.Bloom{}, baseFee) _ = notifier.Notify(rpcSub.ID, header) // #nosec G703 case <-rpcSub.Err(): headersSub.Unsubscribe(api.events) @@ -397,7 +394,7 @@ func (api *PublicFilterAPI) Logs(ctx context.Context, crit filters.FilterCriteri } // get transaction result data - dataTx, ok := ev.Data.(tmtypes.EventDataTx) + dataTx, ok := ev.Data.(cmttypes.EventDataTx) if !ok { api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) continue @@ -480,7 +477,7 @@ func (api *PublicFilterAPI) NewFilter(criteria filters.FilterCriteria) (rpc.ID, api.filtersMu.Unlock() return } - dataTx, ok := ev.Data.(tmtypes.EventDataTx) + dataTx, ok := ev.Data.(cmttypes.EventDataTx) if !ok { api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) continue diff --git a/rpc/namespaces/ethereum/eth/filters/filter_system.go b/rpc/namespaces/ethereum/eth/filters/filter_system.go index f3ed1a6f..8523f2dd 100644 --- a/rpc/namespaces/ethereum/eth/filters/filter_system.go +++ b/rpc/namespaces/ethereum/eth/filters/filter_system.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package filters import ( @@ -8,34 +9,30 @@ import ( "sync" "time" - "github.com/pkg/errors" - - tmjson "github.com/cometbft/cometbft/libs/json" - "github.com/cometbft/cometbft/libs/log" - tmquery "github.com/cometbft/cometbft/libs/pubsub/query" + "cosmossdk.io/log" + cmtjson "github.com/cometbft/cometbft/libs/json" + cmtquery "github.com/cometbft/cometbft/libs/pubsub/query" coretypes "github.com/cometbft/cometbft/rpc/core/types" rpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client" - tmtypes "github.com/cometbft/cometbft/types" - + cmttypes "github.com/cometbft/cometbft/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/rpc" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/evmos/os/rpc/ethereum/pubsub" evmtypes "github.com/evmos/os/x/evm/types" + "github.com/pkg/errors" ) var ( - txEvents = tmtypes.QueryForEvent(tmtypes.EventTx).String() - evmEvents = tmquery.MustParse(fmt.Sprintf("%s='%s' AND %s.%s='%s'", - tmtypes.EventTypeKey, - tmtypes.EventTx, + txEvents = cmttypes.QueryForEvent(cmttypes.EventTx).String() + evmEvents = cmtquery.MustCompile(fmt.Sprintf("%s='%s' AND %s.%s='%s'", + cmttypes.EventTypeKey, + cmttypes.EventTx, sdk.EventTypeMessage, sdk.AttributeKeyModule, evmtypes.ModuleName)).String() - headerEvents = tmtypes.QueryForEvent(tmtypes.EventNewBlockHeader).String() + headerEvents = cmttypes.QueryForEvent(cmttypes.EventNewBlockHeader).String() ) // EventSystem creates subscriptions, processes events and broadcasts them to the @@ -279,7 +276,7 @@ func (es *EventSystem) consumeEvents() { if rpcResp.Error != nil { time.Sleep(5 * time.Second) continue - } else if err := tmjson.Unmarshal(rpcResp.Result, &ev); err != nil { + } else if err := cmtjson.Unmarshal(rpcResp.Result, &ev); err != nil { es.logger.Error("failed to JSON unmarshal ResponsesCh result event", "error", err.Error()) continue } diff --git a/rpc/namespaces/ethereum/eth/filters/filter_system_test.go b/rpc/namespaces/ethereum/eth/filters/filter_system_test.go index 925073f4..05a0fee9 100644 --- a/rpc/namespaces/ethereum/eth/filters/filter_system_test.go +++ b/rpc/namespaces/ethereum/eth/filters/filter_system_test.go @@ -2,12 +2,11 @@ package filters import ( "context" - "os" "sync" "testing" "time" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" coretypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -37,7 +36,7 @@ func TestFilterSystem(t *testing.T) { index[i] = make(map[rpc.ID]*Subscription) } es := &EventSystem{ - logger: log.NewTMLogger(log.NewSyncWriter(os.Stdout)), + logger: log.NewTestLogger(t), ctx: context.Background(), lightMode: false, index: index, diff --git a/rpc/namespaces/ethereum/eth/filters/filters.go b/rpc/namespaces/ethereum/eth/filters/filters.go index 49f72f11..172dce32 100644 --- a/rpc/namespaces/ethereum/eth/filters/filters.go +++ b/rpc/namespaces/ethereum/eth/filters/filters.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package filters import ( @@ -8,17 +9,15 @@ import ( "fmt" "math/big" - "github.com/evmos/os/rpc/backend" - "github.com/evmos/os/rpc/types" - - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" - "github.com/pkg/errors" - "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth/filters" + "github.com/evmos/os/rpc/backend" + "github.com/evmos/os/rpc/types" + "github.com/pkg/errors" ) // BloomIV represents the bit indexes and value inside the bloom filter that belong diff --git a/rpc/namespaces/ethereum/miner/api.go b/rpc/namespaces/ethereum/miner/api.go index 57151abf..88c72f71 100644 --- a/rpc/namespaces/ethereum/miner/api.go +++ b/rpc/namespaces/ethereum/miner/api.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" ) // API is the private miner prefixed set of APIs in the Miner JSON-RPC spec. diff --git a/rpc/namespaces/ethereum/personal/api.go b/rpc/namespaces/ethereum/personal/api.go index e739f0cb..04181b3f 100644 --- a/rpc/namespaces/ethereum/personal/api.go +++ b/rpc/namespaces/ethereum/personal/api.go @@ -13,7 +13,7 @@ import ( "github.com/evmos/os/crypto/hd" "github.com/evmos/os/types" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/rpc/namespaces/ethereum/txpool/api.go b/rpc/namespaces/ethereum/txpool/api.go index 57804311..d4888649 100644 --- a/rpc/namespaces/ethereum/txpool/api.go +++ b/rpc/namespaces/ethereum/txpool/api.go @@ -3,7 +3,7 @@ package txpool import ( - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/ethereum/go-ethereum/common/hexutil" diff --git a/rpc/types/events.go b/rpc/types/events.go index 81db73a1..721a17c4 100644 --- a/rpc/types/events.go +++ b/rpc/types/events.go @@ -76,7 +76,7 @@ type ParsedTxs struct { // ParseTxResult parse eth tx infos from cosmos-sdk events. // It supports two event formats, the formats are described in the comments of the format constants. -func ParseTxResult(result *abci.ResponseDeliverTx, tx sdk.Tx) (*ParsedTxs, error) { +func ParseTxResult(result *abci.ExecTxResult, tx sdk.Tx) (*ParsedTxs, error) { format := eventFormatUnknown // the index of current ethereum_tx event in format 1 or the second part of format 2 eventIndex := -1 diff --git a/rpc/types/events_test.go b/rpc/types/events_test.go index 87cb349d..3fa80c6f 100644 --- a/rpc/types/events_test.go +++ b/rpc/types/events_test.go @@ -17,12 +17,12 @@ func TestParseTxResult(t *testing.T) { testCases := []struct { name string - response abci.ResponseDeliverTx + response abci.ExecTxResult expTxs []*ParsedTx // expected parse result, nil means expect error. }{ { "format 1 events", - abci.ResponseDeliverTx{ + abci.ExecTxResult{ GasUsed: 21000, Events: []abci.Event{ {Type: "coin_received", Attributes: []abci.EventAttribute{ @@ -78,7 +78,7 @@ func TestParseTxResult(t *testing.T) { }, { "format 2 events", - abci.ResponseDeliverTx{ + abci.ExecTxResult{ GasUsed: 21000, Events: []abci.Event{ {Type: "coin_received", Attributes: []abci.EventAttribute{ @@ -121,7 +121,7 @@ func TestParseTxResult(t *testing.T) { }, { "format 1 events, failed", - abci.ResponseDeliverTx{ + abci.ExecTxResult{ GasUsed: 21000, Events: []abci.Event{ {Type: evmtypes.EventTypeEthereumTx, Attributes: []abci.EventAttribute{ @@ -148,7 +148,7 @@ func TestParseTxResult(t *testing.T) { }, { "format 2 events failed", - abci.ResponseDeliverTx{ + abci.ExecTxResult{ GasUsed: 21000, Events: []abci.Event{ {Type: evmtypes.EventTypeEthereumTx, Attributes: []abci.EventAttribute{ diff --git a/rpc/types/types.go b/rpc/types/types.go index 6863384e..e0ea6dc5 100644 --- a/rpc/types/types.go +++ b/rpc/types/types.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package types import ( diff --git a/rpc/types/utils.go b/rpc/types/utils.go index d7e6ebbf..16a2cafc 100644 --- a/rpc/types/utils.go +++ b/rpc/types/utils.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package types import ( @@ -10,8 +11,8 @@ import ( errorsmod "cosmossdk.io/errors" abci "github.com/cometbft/cometbft/abci/types" - tmrpcclient "github.com/cometbft/cometbft/rpc/client" - tmtypes "github.com/cometbft/cometbft/types" + cmtrpcclient "github.com/cometbft/cometbft/rpc/client" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/client" errortypes "github.com/cosmos/cosmos-sdk/types/errors" "github.com/ethereum/go-ethereum/common" @@ -33,7 +34,7 @@ const ExceedBlockGasLimitError = "out of gas in location: block gas meter; gasWa const StateDBCommitError = "failed to commit stateDB" // RawTxToEthTx returns a evm MsgEthereum transaction from raw tx bytes. -func RawTxToEthTx(clientCtx client.Context, txBz tmtypes.Tx) ([]*evmtypes.MsgEthereumTx, error) { +func RawTxToEthTx(clientCtx client.Context, txBz cmttypes.Tx) ([]*evmtypes.MsgEthereumTx, error) { tx, err := clientCtx.TxConfig.TxDecoder()(txBz) if err != nil { return nil, errorsmod.Wrap(errortypes.ErrJSONUnmarshal, err.Error()) @@ -53,13 +54,13 @@ func RawTxToEthTx(clientCtx client.Context, txBz tmtypes.Tx) ([]*evmtypes.MsgEth // EthHeaderFromTendermint is an util function that returns an Ethereum Header // from a tendermint Header. -func EthHeaderFromTendermint(header tmtypes.Header, bloom ethtypes.Bloom, baseFee *big.Int) *ethtypes.Header { +func EthHeaderFromTendermint(header cmttypes.Header, bloom ethtypes.Bloom, baseFee *big.Int) *ethtypes.Header { txHash := ethtypes.EmptyRootHash if len(header.DataHash) == 0 { txHash = common.BytesToHash(header.DataHash) } - time := uint64(header.Time.UTC().Unix()) // #nosec G115 + time := uint64(header.Time.UTC().Unix()) //nolint:gosec // G115 // won't exceed uint64 return ðtypes.Header{ ParentHash: common.BytesToHash(header.LastBlockID.Hash.Bytes()), UncleHash: ethtypes.EmptyUncleHash, @@ -82,7 +83,7 @@ func EthHeaderFromTendermint(header tmtypes.Header, bloom ethtypes.Bloom, baseFe // BlockMaxGasFromConsensusParams returns the gas limit for the current block from the chain consensus params. func BlockMaxGasFromConsensusParams(goCtx context.Context, clientCtx client.Context, blockHeight int64) (int64, error) { - tmrpcClient, ok := clientCtx.Client.(tmrpcclient.Client) + tmrpcClient, ok := clientCtx.Client.(cmtrpcclient.Client) if !ok { panic("incorrect tm rpc client") } @@ -106,7 +107,7 @@ func BlockMaxGasFromConsensusParams(goCtx context.Context, clientCtx client.Cont // FormatBlock creates an ethereum block from a tendermint header and ethereum-formatted // transactions. func FormatBlock( - header tmtypes.Header, size int, gasLimit int64, + header cmttypes.Header, size int, gasLimit int64, gasUsed *big.Int, transactions []interface{}, bloom ethtypes.Bloom, validatorAddr common.Address, baseFee *big.Int, ) map[string]interface{} { @@ -118,7 +119,7 @@ func FormatBlock( } result := map[string]interface{}{ - "number": hexutil.Uint64(header.Height), + "number": hexutil.Uint64(header.Height), //nolint:gosec // G115 // won't exceed uint64 "hash": hexutil.Bytes(header.Hash()), "parentHash": common.BytesToHash(header.LastBlockID.Hash.Bytes()), "nonce": ethtypes.BlockNonce{}, // PoW specific @@ -129,10 +130,10 @@ func FormatBlock( "mixHash": common.Hash{}, "difficulty": (*hexutil.Big)(big.NewInt(0)), "extraData": "0x", - "size": hexutil.Uint64(size), - "gasLimit": hexutil.Uint64(gasLimit), // Static gas limit + "size": hexutil.Uint64(size), //nolint:gosec // G115 // size won't exceed uint64 + "gasLimit": hexutil.Uint64(gasLimit), //nolint:gosec // G115 // gas limit won't exceed uint64 "gasUsed": (*hexutil.Big)(gasUsed), - "timestamp": hexutil.Uint64(header.Time.Unix()), + "timestamp": hexutil.Uint64(header.Time.Unix()), //nolint:gosec // G115 // won't exceed uint64 "transactionsRoot": transactionsRoot, "receiptsRoot": ethtypes.EmptyRootHash, @@ -264,17 +265,17 @@ func CheckTxFee(gasPrice *big.Int, gas uint64, cap float64) error { } // TxExceedBlockGasLimit returns true if the tx exceeds block gas limit. -func TxExceedBlockGasLimit(res *abci.ResponseDeliverTx) bool { +func TxExceedBlockGasLimit(res *abci.ExecTxResult) bool { return strings.Contains(res.Log, ExceedBlockGasLimitError) } // TxStateDBCommitError returns true if the evm tx commit error. -func TxStateDBCommitError(res *abci.ResponseDeliverTx) bool { +func TxStateDBCommitError(res *abci.ExecTxResult) bool { return strings.Contains(res.Log, StateDBCommitError) } // TxSucessOrExpectedFailure returns true if the transaction was successful // or if it failed with an ExceedBlockGasLimit error or TxStateDBCommitError error -func TxSucessOrExpectedFailure(res *abci.ResponseDeliverTx) bool { +func TxSucessOrExpectedFailure(res *abci.ExecTxResult) bool { return res.Code == 0 || TxExceedBlockGasLimit(res) || TxStateDBCommitError(res) } diff --git a/rpc/websockets.go b/rpc/websockets.go index 2f14c85d..df04092e 100644 --- a/rpc/websockets.go +++ b/rpc/websockets.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package rpc import ( @@ -14,9 +15,9 @@ import ( "strconv" "sync" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" rpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/client" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -397,7 +398,7 @@ func (api *pubSubAPI) subscribeNewHeads(wsConn *wsConn, subID rpc.ID) (pubsub.Un return } - data, ok := event.Data.(tmtypes.EventDataNewBlockHeader) + data, ok := event.Data.(cmttypes.EventDataNewBlockHeader) if !ok { api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", event.Data)) continue @@ -570,7 +571,7 @@ func (api *pubSubAPI) subscribeLogs(wsConn *wsConn, subID rpc.ID, extra interfac return } - dataTx, ok := event.Data.(tmtypes.EventDataTx) + dataTx, ok := event.Data.(cmttypes.EventDataTx) if !ok { api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", event.Data)) continue @@ -630,7 +631,7 @@ func (api *pubSubAPI) subscribePendingTransactions(wsConn *wsConn, subID rpc.ID) for { select { case ev := <-txsCh: - data, ok := ev.Data.(tmtypes.EventDataTx) + data, ok := ev.Data.(cmttypes.EventDataTx) if !ok { api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) continue diff --git a/scripts/compile_smart_contracts/compile_smart_contracts.py b/scripts/compile_smart_contracts/compile_smart_contracts.py index 0f088710..82923215 100644 --- a/scripts/compile_smart_contracts/compile_smart_contracts.py +++ b/scripts/compile_smart_contracts/compile_smart_contracts.py @@ -316,11 +316,11 @@ def compile_files(repo_path: Path, added_contract: Union[str, None] = None): clean_up_hardhat_project(CONTRACTS_TARGET.parent) elif sys.argv[1] == "--add": - added_contract = sys.argv[2] - if not added_contract.endswith(".sol"): + ADDED_CONTRACT = sys.argv[2] + if not ADDED_CONTRACT.endswith(".sol"): raise ValueError("Provided contract is not a Solidity file.") - compile_files(REPO_PATH, added_contract=added_contract) + compile_files(REPO_PATH, added_contract=ADDED_CONTRACT) else: raise ValueError( diff --git a/scripts/compile_smart_contracts/test_compile_smart_contracts.py b/scripts/compile_smart_contracts/test_compile_smart_contracts.py index df262eed..26aa8fc3 100644 --- a/scripts/compile_smart_contracts/test_compile_smart_contracts.py +++ b/scripts/compile_smart_contracts/test_compile_smart_contracts.py @@ -85,11 +85,11 @@ def test_copy_to_contracts_directory( tmp_path, ): target = tmp_path - wd = Path(os.getcwd()) + current_dir = Path(os.getcwd()) assert is_os_repo( - wd + current_dir ), "This test should be executed from the top level of the Evmos repo" - contracts = find_solidity_contracts(wd) + contracts = find_solidity_contracts(current_dir) assert os.listdir(target) == [] assert copy_to_contracts_directory(target, contracts) is True diff --git a/scripts/generate_protos_pulsar.sh b/scripts/generate_protos_pulsar.sh new file mode 100755 index 00000000..2478a607 --- /dev/null +++ b/scripts/generate_protos_pulsar.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# this script is for generating protobuf files for the new google.golang.org/protobuf API +set -eo pipefail + +echo "Cleaning API directory" +( + cd api + find ./ -type f \( -iname \*.pulsar.go -o -iname \*.pb.go -o -iname \*.cosmos_orm.go -o -iname \*.pb.gw.go \) -delete + find . -empty -type d -delete + cd .. +) + +echo "Generating API module" +( + cd proto + buf generate --template buf.gen.pulsar.yaml +) diff --git a/server/config/config.go b/server/config/config.go index 159c06eb..49bc28e9 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -19,6 +19,10 @@ import ( ) const ( + // ServerStartTime defines the time duration that the server need to stay running after startup + // for the startup be considered successful + ServerStartTime = 5 * time.Second + // DefaultAPIEnable is the default value for the parameter that defines if the cosmos REST API server is enabled DefaultAPIEnable = false @@ -305,7 +309,6 @@ func DefaultConfig() *Config { defaultSDKConfig.API.Enable = DefaultAPIEnable defaultSDKConfig.GRPC.Enable = DefaultGRPCEnable defaultSDKConfig.GRPCWeb.Enable = DefaultGRPCWebEnable - defaultSDKConfig.Rosetta.Enable = DefaultRosettaEnable defaultSDKConfig.Telemetry.Enabled = DefaultTelemetryEnable return &Config{ diff --git a/server/config/config_test.go b/server/config/config_test.go index 5adb1124..7819d1c5 100644 --- a/server/config/config_test.go +++ b/server/config/config_test.go @@ -5,8 +5,9 @@ import ( "reflect" "testing" + "github.com/evmos/os/testutil/constants" + serverconfig "github.com/evmos/os/server/config" - "github.com/evmos/os/testutil" "github.com/spf13/viper" "github.com/stretchr/testify/require" ) @@ -29,12 +30,12 @@ func TestGetConfig(t *testing.T) { "test unmarshal embedded structs", func() *viper.Viper { v := viper.New() - v.Set("minimum-gas-prices", fmt.Sprintf("100%s", testutil.ExampleAttoDenom)) + v.Set("minimum-gas-prices", fmt.Sprintf("100%s", constants.ExampleAttoDenom)) return v }, func() serverconfig.Config { cfg := serverconfig.DefaultConfig() - cfg.MinGasPrices = fmt.Sprintf("100%s", testutil.ExampleAttoDenom) + cfg.MinGasPrices = fmt.Sprintf("100%s", constants.ExampleAttoDenom) return *cfg }, false, diff --git a/server/config/migration/migration.go b/server/config/migration/migration.go new file mode 100644 index 00000000..e0150998 --- /dev/null +++ b/server/config/migration/migration.go @@ -0,0 +1,127 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package migration + +import ( + "context" + "embed" + "fmt" + "strings" + + "cosmossdk.io/tools/confix" + "github.com/creachadair/tomledit" + "github.com/creachadair/tomledit/parser" + "github.com/creachadair/tomledit/transform" + "golang.org/x/text/cases" + "golang.org/x/text/language" +) + +// This package includes the logic to migrate the app.toml file with the +// changes introduced in Cosmos-SDK v0.50 + +//go:embed v0.50-app.toml +var f embed.FS + +func init() { + confix.Migrations["v0.50"] = PlanBuilder +} + +// PlanBuilder is a function that returns a transformation plan for a given diff between two files. +func PlanBuilder(from *tomledit.Document, _ string) transform.Plan { + plan := transform.Plan{} + deletedSections := map[string]bool{} + + target, err := LoadLocalConfig() + if err != nil { + panic(fmt.Errorf("failed to parse file: %w. This file should have been valid", err)) + } + + diffs := confix.DiffKeys(from, target) + for _, diff := range diffs { + diff := diff + kv := diff.KV + + var step transform.Step + keys := strings.Split(kv.Key, ".") + + if !diff.Deleted { + switch diff.Type { + case confix.Section: + step = transform.Step{ + Desc: fmt.Sprintf("add %s section", kv.Key), + T: transform.Func(func(_ context.Context, doc *tomledit.Document) error { + americanTitle := cases.Title(language.AmericanEnglish).String(kv.Key) + title := fmt.Sprintf("### %s Configuration ###", americanTitle) + doc.Sections = append(doc.Sections, &tomledit.Section{ + Heading: &parser.Heading{ + Block: parser.Comments{ + strings.Repeat("#", len(title)), + title, + strings.Repeat("#", len(title)), + }, + Name: keys, + }, + }) + return nil + }), + } + case confix.Mapping: + if len(keys) == 1 { // top-level key + step = transform.Step{ + Desc: fmt.Sprintf("add %s key", kv.Key), + T: transform.EnsureKey(nil, &parser.KeyValue{ + Block: kv.Block, + Name: parser.Key{keys[0]}, + Value: parser.MustValue(kv.Value), + }), + } + } else if len(keys) > 1 { + step = transform.Step{ + Desc: fmt.Sprintf("add %s key", kv.Key), + T: transform.EnsureKey(keys[0:len(keys)-1], &parser.KeyValue{ + Block: kv.Block, + Name: parser.Key{keys[len(keys)-1]}, + Value: parser.MustValue(kv.Value), + }), + } + } + default: + panic(fmt.Errorf("unknown diff type: %s", diff.Type)) + } + } else { + if diff.Type == confix.Section { + deletedSections[kv.Key] = true + step = transform.Step{ + Desc: fmt.Sprintf("remove %s section", kv.Key), + T: transform.Remove(keys), + } + } else { + // when the whole section is deleted we don't need to remove the keys + if len(keys) > 1 && deletedSections[keys[0]] { + continue + } + + step = transform.Step{ + Desc: fmt.Sprintf("remove %s key", kv.Key), + T: transform.Remove(keys), + } + } + } + + plan = append(plan, step) + } + + return plan +} + +// LoadConfig loads and parses the TOML document from confix data +func LoadLocalConfig() (*tomledit.Document, error) { + f, err := f.Open("v0.50-app.toml") + if err != nil { + panic(fmt.Errorf("failed to read file: %w. This file should have been included in confix", err)) + } + defer f.Close() + + return tomledit.Parse(f) +} diff --git a/server/config/migration/v0.50-app.toml b/server/config/migration/v0.50-app.toml new file mode 100644 index 00000000..b9a010bf --- /dev/null +++ b/server/config/migration/v0.50-app.toml @@ -0,0 +1,375 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Base Configuration ### +############################################################################### + +# The minimum gas prices a validator is willing to accept for processing a +# transaction. A transaction's fees must meet the minimum of any denomination +# specified in this config (e.g. 0.25token1,0.0001token2). +minimum-gas-prices = "0aevmos" + +# The maximum gas a query coming over rest/grpc may consume. +# If this is set to zero, the query can consume an unbounded amount of gas. +query-gas-limit = "0" + +# default: the last 362880 states are kept, pruning at 10 block intervals +# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) +# everything: 2 latest states will be kept; pruning at 10 block intervals. +# custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval' +pruning = "default" + +# These are applied if and only if the pruning strategy is custom. +pruning-keep-recent = "0" +pruning-interval = "0" + +# HaltHeight contains a non-zero block height at which a node will gracefully +# halt and shutdown that can be used to assist upgrades and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-height = 0 + +# HaltTime contains a non-zero minimum block time (in Unix seconds) at which +# a node will gracefully halt and shutdown that can be used to assist upgrades +# and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-time = 0 + +# MinRetainBlocks defines the minimum block height offset from the current +# block being committed, such that all blocks past this offset are pruned +# from CometBFT. It is used as part of the process of determining the +# ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates +# that no blocks should be pruned. +# +# This configuration value is only responsible for pruning CometBFT blocks. +# It has no bearing on application state pruning which is determined by the +# "pruning-*" configurations. +# +# Note: CometBFT block pruning is dependant on this parameter in conjunction +# with the unbonding (safety threshold) period, state pruning and state sync +# snapshot parameters to determine the correct minimum value of +# ResponseCommit.RetainHeight. +min-retain-blocks = 0 + +# InterBlockCache enables inter-block caching. +inter-block-cache = true + +# IndexEvents defines the set of events in the form {eventType}.{attributeKey}, +# which informs CometBFT what to index. If empty, all events will be indexed. +# +# Example: +# ["message.sender", "message.recipient"] +index-events = [] + +# IavlCacheSize set the size of the iavl tree cache (in number of nodes). +iavl-cache-size = 781250 + +# IAVLDisableFastNode enables or disables the fast node feature of IAVL. +# Default is false. +iavl-disable-fastnode = false + +# AppDBBackend defines the database backend type to use for the application and snapshots DBs. +# An empty string indicates that a fallback will be used. +# The fallback is the db_backend value set in CometBFT's config.toml. +app-db-backend = "" + +############################################################################### +### Telemetry Configuration ### +############################################################################### + +[telemetry] + +# Prefixed with keys to separate services. +service-name = "" + +# Enabled enables the application telemetry functionality. When enabled, +# an in-memory sink is also enabled by default. Operators may also enabled +# other sinks such as Prometheus. +enabled = false + +# Enable prefixing gauge values with hostname. +enable-hostname = false + +# Enable adding hostname to labels. +enable-hostname-label = false + +# Enable adding service to labels. +enable-service-label = false + +# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. +prometheus-retention-time = 0 + +# GlobalLabels defines a global set of name/value label tuples applied to all +# metrics emitted using the wrapper functions defined in telemetry package. +# +# Example: +# [["chain_id", "cosmoshub-1"]] +global-labels = [ +] + +# MetricsSink defines the type of metrics sink to use. +metrics-sink = "" + +# StatsdAddr defines the address of a statsd server to send metrics to. +# Only utilized if MetricsSink is set to "statsd" or "dogstatsd". +statsd-addr = "" + +# DatadogHostname defines the hostname to use when emitting metrics to +# Datadog. Only utilized if MetricsSink is set to "dogstatsd". +datadog-hostname = "" + +############################################################################### +### API Configuration ### +############################################################################### + +[api] + +# Enable defines if the API server should be enabled. +enable = false + +# Swagger defines if swagger documentation should automatically be registered. +swagger = false + +# Address defines the API server to listen on. +address = "tcp://localhost:1317" + +# MaxOpenConnections defines the number of maximum open connections. +max-open-connections = 1000 + +# RPCReadTimeout defines the CometBFT RPC read timeout (in seconds). +rpc-read-timeout = 10 + +# RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds). +rpc-write-timeout = 0 + +# RPCMaxBodyBytes defines the CometBFT maximum request body (in bytes). +rpc-max-body-bytes = 1000000 + +# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). +enabled-unsafe-cors = false + +############################################################################### +### gRPC Configuration ### +############################################################################### + +[grpc] + +# Enable defines if the gRPC server should be enabled. +enable = false + +# Address defines the gRPC server address to bind to. +address = "localhost:9090" + +# MaxRecvMsgSize defines the max message size in bytes the server can receive. +# The default value is 10MB. +max-recv-msg-size = "10485760" + +# MaxSendMsgSize defines the max message size in bytes the server can send. +# The default value is math.MaxInt32. +max-send-msg-size = "2147483647" + +############################################################################### +### gRPC Web Configuration ### +############################################################################### + +[grpc-web] + +# GRPCWebEnable defines if the gRPC-web should be enabled. +# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op. +# NOTE: gRPC-Web uses the same address as the API server. +enable = false + +############################################################################### +### State Sync Configuration ### +############################################################################### + +# State sync snapshots allow other nodes to rapidly join the network without replaying historical +# blocks, instead downloading and applying a snapshot of the application state at a given height. +[state-sync] + +# snapshot-interval specifies the block interval at which local state sync snapshots are +# taken (0 to disable). +snapshot-interval = 5000 + +# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). +snapshot-keep-recent = 2 + +############################################################################### +### State Streaming ### +############################################################################### + +# Streaming allows nodes to stream state to external systems. +[streaming] + +# streaming.abci specifies the configuration for the ABCI Listener streaming service. +[streaming.abci] + +# List of kv store keys to stream out via gRPC. +# The store key names MUST match the module's StoreKey name. +# +# Example: +# ["acc", "bank", "gov", "staking", "mint"[,...]] +# ["*"] to expose all keys. +keys = [] + +# The plugin name used for streaming via gRPC. +# Streaming is only enabled if this is set. +# Supported plugins: abci +plugin = "" + +# stop-node-on-err specifies whether to stop the node on message delivery error. +stop-node-on-err = true + +############################################################################### +### Mempool ### +############################################################################### + +[mempool] +# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). +# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. +# +# Note, this configuration only applies to SDK built-in app-side mempool +# implementations. +max-txs = -1 + +############################################################################### +### EVM Configuration ### +############################################################################### + +[evm] + +# Tracer defines the 'vm.Tracer' type that the EVM will use when the node is run in +# debug mode. To enable tracing use the '--evm.tracer' flag when starting your node. +# Valid types are: json|struct|access_list|markdown +tracer = "" + +# MaxTxGasWanted defines the gas wanted for each eth tx returned in ante handler in check tx mode. +max-tx-gas-wanted = 0 + +############################################################################### +### JSON RPC Configuration ### +############################################################################### + +[json-rpc] + +# Enable defines if the JSONRPC server should be enabled. +enable = false + +# Address defines the EVM RPC HTTP server address to bind to. +address = "127.0.0.1:8545" + +# Address defines the EVM WebSocket server address to bind to. +ws-address = "127.0.0.1:8546" + +# API defines a list of JSON-RPC namespaces that should be enabled +# Example: "eth,txpool,personal,net,debug,web3" +api = "eth,net,web3" + +# GasCap sets a cap on gas that can be used in eth_call/estimateGas (0=infinite). Default: 25,000,000. +gas-cap = 25000000 + +# Allow insecure account unlocking when account-related RPCs are exposed by http +allow-insecure-unlock = true + +# EVMTimeout is the global timeout for eth_call. Default: 5s. +evm-timeout = "5s" + +# TxFeeCap is the global tx-fee cap for send transaction. Default: 1eth. +txfee-cap = 1 + +# FilterCap sets the global cap for total number of filters that can be created +filter-cap = 200 + +# FeeHistoryCap sets the global cap for total number of blocks that can be fetched +feehistory-cap = 100 + +# LogsCap defines the max number of results can be returned from single 'eth_getLogs' query. +logs-cap = 10000 + +# BlockRangeCap defines the max block range allowed for 'eth_getLogs' query. +block-range-cap = 10000 + +# HTTPTimeout is the read/write timeout of http json-rpc server. +http-timeout = "30s" + +# HTTPIdleTimeout is the idle timeout of http json-rpc server. +http-idle-timeout = "2m0s" + +# AllowUnprotectedTxs restricts unprotected (non EIP155 signed) transactions to be submitted via +# the node's RPC when the global parameter is disabled. +allow-unprotected-txs = false + +# MaxOpenConnections sets the maximum number of simultaneous connections +# for the server listener. +max-open-connections = 0 + +# EnableIndexer enables the custom transaction indexer for the EVM (ethereum transactions). +enable-indexer = false + +# MetricsAddress defines the EVM Metrics server address to bind to. Pass --metrics in CLI to enable +# Prometheus metrics path: /debug/metrics/prometheus +metrics-address = "127.0.0.1:6065" + +# Upgrade height for fix of revert gas refund logic when transaction reverted. +fix-revert-gas-refund-height = 0 + +############################################################################### +### TLS Configuration ### +############################################################################### + +[tls] + +# Certificate path defines the cert.pem file path for the TLS configuration. +certificate-path = "" + +# Key path defines the key.pem file path for the TLS configuration. +key-path = "" + +############################################################################### +### Rosetta Configuration ### +############################################################################### + +[rosetta] + +# Enable defines if the Rosetta API server should be enabled. +enable = false + +# Address defines the Rosetta API server to listen on. +address = ":8080" + +# Network defines the name of the blockchain that will be returned by Rosetta. +blockchain = "os" + +# Network defines the name of the network that will be returned by Rosetta. +network = "os" + +# TendermintRPC defines the endpoint to connect to CometBFT RPC, +# specifying 'tcp://' before is not required, usually it's at port 26657 +tendermint-rpc = "localhost:26657" + +# GRPCEndpoint defines the cosmos application gRPC endpoint +# usually it is located at 9090 port +grpc-endpoint = "localhost:9090" + +# Retries defines the number of retries when connecting to the node before failing. +retries = 5 + +# Offline defines if Rosetta server should run in offline mode. +offline = false + +# EnableFeeSuggestion indicates to use fee suggestion when 'construction/metadata' is called without gas limit and price. +enable-fee-suggestion = false + +# GasToSuggest defines gas limit when calculating the fee +gas-to-suggest = 300000 + +# DenomToSuggest defines the defult denom for fee suggestion. +# Price must be in minimum-gas-prices. +denom-to-suggest = "aevmos" + +# GasPrices defines the gas prices for fee suggestion +gas-prices = "4000000.000000000000000000aevmos" + diff --git a/server/flags/flags.go b/server/flags/flags.go index 8dcd06b7..319a2289 100644 --- a/server/flags/flags.go +++ b/server/flags/flags.go @@ -11,11 +11,11 @@ import ( // Tendermint/cosmos-sdk full-node start flags const ( - WithTendermint = "with-tendermint" - Address = "address" - Transport = "transport" - TraceStore = "trace-store" - CPUProfile = "cpu-profile" + WithCometBFT = "with-cometbft" + Address = "address" + Transport = "transport" + TraceStore = "trace-store" + CPUProfile = "cpu-profile" // The type of database for application and snapshots databases AppDBBackend = "app-db-backend" ) diff --git a/server/indexer_cmd.go b/server/indexer_cmd.go index 5a65b590..b9698f4e 100644 --- a/server/indexer_cmd.go +++ b/server/indexer_cmd.go @@ -6,9 +6,9 @@ package server import ( "fmt" - tmnode "github.com/cometbft/cometbft/node" + cmtconfig "github.com/cometbft/cometbft/config" sm "github.com/cometbft/cometbft/state" - tmstore "github.com/cometbft/cometbft/store" + cmtstore "github.com/cometbft/cometbft/store" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" "github.com/evmos/os/indexer" @@ -50,13 +50,13 @@ func NewIndexTxCmd() *cobra.Command { idxer := indexer.NewKVIndexer(idxDB, logger.With("module", "evmindex"), clientCtx) // open local tendermint db, because the local rpc won't be available. - tmdb, err := tmnode.DefaultDBProvider(&tmnode.DBContext{ID: "blockstore", Config: cfg}) + tmdb, err := cmtconfig.DefaultDBProvider(&cmtconfig.DBContext{ID: "blockstore", Config: cfg}) if err != nil { return err } - blockStore := tmstore.NewBlockStore(tmdb) + blockStore := cmtstore.NewBlockStore(tmdb) - stateDB, err := tmnode.DefaultDBProvider(&tmnode.DBContext{ID: "state", Config: cfg}) + stateDB, err := cmtconfig.DefaultDBProvider(&cmtconfig.DBContext{ID: "state", Config: cfg}) if err != nil { return err } @@ -69,11 +69,11 @@ func NewIndexTxCmd() *cobra.Command { if blk == nil { return fmt.Errorf("block not found %d", height) } - resBlk, err := stateStore.LoadABCIResponses(height) + resBlk, err := stateStore.LoadFinalizeBlockResponse(height) if err != nil { return err } - if err := idxer.IndexBlock(blk, resBlk.DeliverTxs); err != nil { + if err := idxer.IndexBlock(blk, resBlk.TxResults); err != nil { return err } fmt.Println(height) diff --git a/server/json_rpc.go b/server/json_rpc.go index 0eac1350..e48f48bf 100644 --- a/server/json_rpc.go +++ b/server/json_rpc.go @@ -9,11 +9,10 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/server/types" ethlog "github.com/ethereum/go-ethereum/log" ethrpc "github.com/ethereum/go-ethereum/rpc" "github.com/evmos/os/rpc" - "github.com/evmos/os/server/config" + serverconfig "github.com/evmos/os/server/config" evmostypes "github.com/evmos/os/types" "github.com/gorilla/mux" "github.com/rs/cors" @@ -24,7 +23,7 @@ func StartJSONRPC(ctx *server.Context, clientCtx client.Context, tmRPCAddr, tmEndpoint string, - config *config.Config, + config *serverconfig.Config, indexer evmostypes.EVMTxIndexer, ) (*http.Server, chan struct{}, error) { tmWsClient := ConnectTmWS(tmRPCAddr, tmEndpoint, ctx.Logger) @@ -101,7 +100,7 @@ func StartJSONRPC(ctx *server.Context, case err := <-errCh: ctx.Logger.Error("failed to boot JSON-RPC server", "error", err.Error()) return nil, nil, err - case <-time.After(types.ServerStartTime): // assume JSON RPC server started successfully + case <-time.After(serverconfig.ServerStartTime): // assume JSON RPC server started successfully } ctx.Logger.Info("Starting JSON WebSocket server", "address", config.JSONRPC.WsAddress) diff --git a/server/start.go b/server/start.go index 6132b732..673e39f8 100644 --- a/server/start.go +++ b/server/start.go @@ -14,28 +14,19 @@ import ( "runtime/pprof" "time" - "github.com/spf13/cobra" - - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - - dbm "github.com/cometbft/cometbft-db" + errorsmod "cosmossdk.io/errors" + pruningtypes "cosmossdk.io/store/pruning/types" abciserver "github.com/cometbft/cometbft/abci/server" tcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" - tmos "github.com/cometbft/cometbft/libs/os" + cmtcfg "github.com/cometbft/cometbft/config" "github.com/cometbft/cometbft/node" "github.com/cometbft/cometbft/p2p" pvm "github.com/cometbft/cometbft/privval" "github.com/cometbft/cometbft/proxy" rpcclient "github.com/cometbft/cometbft/rpc/client" "github.com/cometbft/cometbft/rpc/client/local" - - ethmetricsexp "github.com/ethereum/go-ethereum/metrics/exp" - - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/tools/rosetta" - crgserver "cosmossdk.io/tools/rosetta/lib/server" - + cmttypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" @@ -44,17 +35,21 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servergrpc "github.com/cosmos/cosmos-sdk/server/grpc" + servercmtlog "github.com/cosmos/cosmos-sdk/server/log" "github.com/cosmos/cosmos-sdk/server/types" - pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" - + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + ethmetricsexp "github.com/ethereum/go-ethereum/metrics/exp" "github.com/evmos/os/cmd/config" "github.com/evmos/os/indexer" ethdebug "github.com/evmos/os/rpc/namespaces/ethereum/debug" evmosserverconfig "github.com/evmos/os/server/config" srvflags "github.com/evmos/os/server/flags" evmostypes "github.com/evmos/os/types" + "github.com/spf13/cobra" + "golang.org/x/sync/errgroup" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) // DBOpener is a function to open `application.db`, potentially with customized options. @@ -77,13 +72,13 @@ func NewDefaultStartOptions(appCreator types.AppCreator, defaultNodeHome string) } // StartCmd runs the service passed in, either stand-alone or in-process with -// Tendermint. +// CometBFT. func StartCmd(opts StartOptions) *cobra.Command { cmd := &cobra.Command{ Use: "start", Short: "Run the full node", - Long: `Run the full node application with Tendermint in or out of process. By -default, the application will run with Tendermint in process. + Long: `Run the full node application with CometBFT in or out of process. By +default, the application will run with CometBFT in process. Pruning options can be provided via the '--pruning' flag or alternatively with '--pruning-keep-recent', 'pruning-keep-every', and 'pruning-interval' together. @@ -124,7 +119,7 @@ which accepts a path for the resulting pprof file. return err } - withTM, _ := cmd.Flags().GetBool(srvflags.WithTendermint) + withTM, _ := cmd.Flags().GetBool(srvflags.WithCometBFT) if !withTM { serverCtx.Logger.Info("starting ABCI without Tendermint") return startStandAlone(serverCtx, opts) @@ -141,22 +136,25 @@ which accepts a path for the resulting pprof file. } } - serverCtx.Logger.Info("starting ABCI with Tendermint") + serverCtx.Logger.Info("starting ABCI with CometBFT") // amino is needed here for backwards compatibility of REST routes - err = startInProcess(serverCtx, clientCtx, opts) - errCode, ok := err.(server.ErrorCode) - if !ok { + if err := startInProcess(serverCtx, clientCtx, opts); err != nil { return err } - serverCtx.Logger.Debug(fmt.Sprintf("received quit signal: %d", errCode.Code)) + serverCtx.Logger.Debug("received quit signal") + // TODO: why is this check here? Should not make sense since err is checked above + if err != nil { + serverCtx.Logger.Error(fmt.Sprintf("error on quit: %s", err.Error())) + } + return nil }, } cmd.Flags().String(flags.FlagHome, opts.DefaultNodeHome, "The application home directory") - cmd.Flags().Bool(srvflags.WithTendermint, true, "Run abci app embedded in-process with tendermint") + cmd.Flags().Bool(srvflags.WithCometBFT, true, "Run abci app embedded in-process with CometBFT") cmd.Flags().String(srvflags.Address, "tcp://0.0.0.0:26658", "Listen address") cmd.Flags().String(srvflags.Transport, "socket", "Transport protocol: socket, grpc") cmd.Flags().String(srvflags.TraceStore, "", "Enable KVStore tracing to an output file") @@ -171,14 +169,14 @@ which accepts a path for the resulting pprof file. cmd.Flags().Uint64(server.FlagPruningKeepRecent, 0, "Number of recent heights to keep on disk (ignored if pruning is not 'custom')") cmd.Flags().Uint64(server.FlagPruningInterval, 0, "Height interval at which pruned heights are removed from disk (ignored if pruning is not 'custom')") //nolint:lll cmd.Flags().Uint(server.FlagInvCheckPeriod, 0, "Assert registered invariants every N blocks") - cmd.Flags().Uint64(server.FlagMinRetainBlocks, 0, "Minimum block height offset during ABCI commit to prune Tendermint blocks") + cmd.Flags().Uint64(server.FlagMinRetainBlocks, 0, "Minimum block height offset during ABCI commit to prune CometBFT blocks") cmd.Flags().String(srvflags.AppDBBackend, "", "The type of database for application and snapshots databases") - cmd.Flags().Bool(srvflags.GRPCOnly, false, "Start the node in gRPC query only mode without Tendermint process") + cmd.Flags().Bool(srvflags.GRPCOnly, false, "Start the node in gRPC query only mode without CometBFT process") cmd.Flags().Bool(srvflags.GRPCEnable, evmosserverconfig.DefaultGRPCEnable, "Define if the gRPC server should be enabled") cmd.Flags().String(srvflags.GRPCAddress, serverconfig.DefaultGRPCAddress, "the gRPC server address to listen on") cmd.Flags().Bool(srvflags.GRPCWebEnable, evmosserverconfig.DefaultGRPCWebEnable, "Define if the gRPC-Web server should be enabled. (Note: gRPC must also be enabled.)") - cmd.Flags().String(srvflags.GRPCWebAddress, serverconfig.DefaultGRPCWebAddress, "The gRPC-Web server address to listen on") + cmd.Flags().String(srvflags.GRPCWebAddress, evmosserverconfig.DefaultGRPCAddress, "The gRPC-Web server address to listen on") cmd.Flags().Bool(srvflags.RPCEnable, evmosserverconfig.DefaultAPIEnable, "Defines if Cosmos-sdk REST server should be enabled") cmd.Flags().Bool(srvflags.EnabledUnsafeCors, false, "Defines if CORS should be enabled (unsafe - use it at your own risk)") @@ -210,43 +208,43 @@ which accepts a path for the resulting pprof file. cmd.Flags().Uint64(server.FlagStateSyncSnapshotInterval, 0, "State sync snapshot interval") cmd.Flags().Uint32(server.FlagStateSyncSnapshotKeepRecent, 2, "State sync snapshot to keep") - // add support for all Tendermint-specific command line options + // add support for all CometBFT-specific command line options tcmd.AddNodeFlags(cmd) return cmd } -func startStandAlone(ctx *server.Context, opts StartOptions) error { - addr := ctx.Viper.GetString(srvflags.Address) - transport := ctx.Viper.GetString(srvflags.Transport) - home := ctx.Viper.GetString(flags.FlagHome) +func startStandAlone(svrCtx *server.Context, opts StartOptions) error { + addr := svrCtx.Viper.GetString(srvflags.Address) + transport := svrCtx.Viper.GetString(srvflags.Transport) + home := svrCtx.Viper.GetString(flags.FlagHome) - db, err := opts.DBOpener(ctx.Viper, home, server.GetAppDBBackend(ctx.Viper)) + db, err := opts.DBOpener(svrCtx.Viper, home, server.GetAppDBBackend(svrCtx.Viper)) if err != nil { return err } defer func() { if err := db.Close(); err != nil { - ctx.Logger.Error("error closing db", "error", err.Error()) + svrCtx.Logger.Error("error closing db", "error", err.Error()) } }() - traceWriterFile := ctx.Viper.GetString(srvflags.TraceStore) + traceWriterFile := svrCtx.Viper.GetString(srvflags.TraceStore) traceWriter, err := openTraceWriter(traceWriterFile) if err != nil { return err } - app := opts.AppCreator(ctx.Logger, db, traceWriter, ctx.Viper) + app := opts.AppCreator(svrCtx.Logger, db, traceWriter, svrCtx.Viper) - config, err := evmosserverconfig.GetConfig(ctx.Viper) + config, err := evmosserverconfig.GetConfig(svrCtx.Viper) if err != nil { - ctx.Logger.Error("failed to get server config", "error", err.Error()) + svrCtx.Logger.Error("failed to get server config", "error", err.Error()) return err } if err := config.ValidateBasic(); err != nil { - ctx.Logger.Error("invalid server config", "error", err.Error()) + svrCtx.Logger.Error("invalid server config", "error", err.Error()) return err } @@ -255,38 +253,42 @@ func startStandAlone(ctx *server.Context, opts StartOptions) error { return err } - svr, err := abciserver.NewServer(addr, transport, app) + cmtApp := server.NewCometABCIWrapper(app) + svr, err := abciserver.NewServer(addr, transport, cmtApp) if err != nil { return fmt.Errorf("error creating listener: %v", err) } - svr.SetLogger(ctx.Logger.With("server", "abci")) + svr.SetLogger(servercmtlog.CometLoggerWrapper{Logger: svrCtx.Logger.With("server", "abci")}) + g, ctx := getCtx(svrCtx, false) - err = svr.Start() - if err != nil { - tmos.Exit(err.Error()) - } - - defer func() { - if err = svr.Stop(); err != nil { - tmos.Exit(err.Error()) + g.Go(func() error { + if err := svr.Start(); err != nil { + svrCtx.Logger.Error("failed to start out-of-process ABCI server", "err", err) + return err } - }() - // Wait for SIGINT or SIGTERM signal - return server.WaitForQuitSignals() + // Wait for the calling process to be canceled or close the provided context, + // so we can gracefully stop the ABCI server. + <-ctx.Done() + svrCtx.Logger.Info("stopping the ABCI server...") + return svr.Stop() + }) + + return g.Wait() } // legacyAminoCdc is used for the legacy REST API -func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOptions) (err error) { - cfg := ctx.Config +func startInProcess(svrCtx *server.Context, clientCtx client.Context, opts StartOptions) (err error) { + cfg := svrCtx.Config home := cfg.RootDir - logger := ctx.Logger + logger := svrCtx.Logger + g, ctx := getCtx(svrCtx, true) - if cpuProfile := ctx.Viper.GetString(srvflags.CPUProfile); cpuProfile != "" { + if cpuProfile := svrCtx.Viper.GetString(srvflags.CPUProfile); cpuProfile != "" { fp, err := ethdebug.ExpandHome(cpuProfile) if err != nil { - ctx.Logger.Debug("failed to get filepath for the CPU profile file", "error", err.Error()) + svrCtx.Logger.Debug("failed to get filepath for the CPU profile file", "error", err.Error()) return err } @@ -295,13 +297,13 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt return err } - ctx.Logger.Info("starting CPU profiler", "profile", cpuProfile) + svrCtx.Logger.Info("starting CPU profiler", "profile", cpuProfile) if err := pprof.StartCPUProfile(f); err != nil { return err } defer func() { - ctx.Logger.Info("stopping CPU profiler", "profile", cpuProfile) + svrCtx.Logger.Info("stopping CPU profiler", "profile", cpuProfile) pprof.StopCPUProfile() if err := f.Close(); err != nil { logger.Error("failed to close CPU profiler file", "error", err.Error()) @@ -309,7 +311,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt }() } - db, err := opts.DBOpener(ctx.Viper, home, server.GetAppDBBackend(ctx.Viper)) + db, err := opts.DBOpener(svrCtx.Viper, home, server.GetAppDBBackend(svrCtx.Viper)) if err != nil { logger.Error("failed to open DB", "error", err.Error()) return err @@ -317,18 +319,18 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt defer func() { if err := db.Close(); err != nil { - ctx.Logger.With("error", err).Error("error closing db") + svrCtx.Logger.With("error", err).Error("error closing db") } }() - traceWriterFile := ctx.Viper.GetString(srvflags.TraceStore) + traceWriterFile := svrCtx.Viper.GetString(srvflags.TraceStore) traceWriter, err := openTraceWriter(traceWriterFile) if err != nil { logger.Error("failed to open trace writer", "error", err.Error()) return err } - config, err := evmosserverconfig.GetConfig(ctx.Viper) + config, err := evmosserverconfig.GetConfig(svrCtx.Viper) if err != nil { logger.Error("failed to get server config", "error", err.Error()) return err @@ -339,7 +341,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt return err } - app := opts.AppCreator(ctx.Logger, db, traceWriter, ctx.Viper) + app := opts.AppCreator(svrCtx.Logger, db, traceWriter, svrCtx.Viper) nodeKey, err := p2p.LoadOrGenNodeKey(cfg.NodeKeyFile()) if err != nil { @@ -347,29 +349,30 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt return err } - genDocProvider := node.DefaultGenesisDocProviderFunc(cfg) + genDocProvider := GenDocProvider(cfg) var ( tmNode *node.Node - gRPCOnly = ctx.Viper.GetBool(srvflags.GRPCOnly) + gRPCOnly = svrCtx.Viper.GetBool(srvflags.GRPCOnly) ) if gRPCOnly { - logger.Info("starting node in query only mode; Tendermint is disabled") + logger.Info("starting node in query only mode; CometBFT is disabled") config.GRPC.Enable = true config.JSONRPC.EnableIndexer = false } else { - logger.Info("starting node with ABCI Tendermint in-process") + logger.Info("starting node with ABCI CometBFT in-process") + cmtApp := server.NewCometABCIWrapper(app) tmNode, err = node.NewNode( cfg, pvm.LoadOrGenFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()), nodeKey, - proxy.NewLocalClientCreator(app), + proxy.NewLocalClientCreator(cmtApp), genDocProvider, - node.DefaultDBProvider, + cmtcfg.DefaultDBProvider, node.DefaultMetricsProvider(cfg.Instrumentation), - ctx.Logger.With("server", "node"), + servercmtlog.CometLoggerWrapper{Logger: svrCtx.Logger.With("server", "node")}, ) if err != nil { logger.Error("failed init node", "error", err.Error()) @@ -377,7 +380,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt } if err := tmNode.Start(); err != nil { - logger.Error("failed start tendermint server", "error", err.Error()) + logger.Error("failed start CometBFT server", "error", err.Error()) return err } @@ -390,13 +393,13 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt // Add the tx service to the gRPC router. We only need to register this // service if API or gRPC or JSONRPC is enabled, and avoid doing so in the general - // case, because it spawns a new local tendermint RPC client. + // case, because it spawns a new local CometBFT RPC client. if (config.API.Enable || config.GRPC.Enable || config.JSONRPC.Enable || config.JSONRPC.EnableIndexer) && tmNode != nil { clientCtx = clientCtx.WithClient(local.New(tmNode)) app.RegisterTxService(clientCtx) app.RegisterTendermintService(clientCtx) - app.RegisterNodeService(clientCtx) + app.RegisterNodeService(clientCtx, config.Config) } metrics, err := startTelemetry(config) @@ -406,35 +409,26 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt // Enable metrics if JSONRPC is enabled and --metrics is passed // Flag not added in config to avoid user enabling in config without passing in CLI - if config.JSONRPC.Enable && ctx.Viper.GetBool(srvflags.JSONRPCEnableMetrics) { + if config.JSONRPC.Enable && svrCtx.Viper.GetBool(srvflags.JSONRPCEnableMetrics) { ethmetricsexp.Setup(config.JSONRPC.MetricsAddress) } var idxer evmostypes.EVMTxIndexer if config.JSONRPC.EnableIndexer { - idxDB, err := OpenIndexerDB(home, server.GetAppDBBackend(ctx.Viper)) + idxDB, err := OpenIndexerDB(home, server.GetAppDBBackend(svrCtx.Viper)) if err != nil { logger.Error("failed to open evm indexer DB", "error", err.Error()) return err } - idxLogger := ctx.Logger.With("indexer", "evm") + idxLogger := svrCtx.Logger.With("indexer", "evm") idxer = indexer.NewKVIndexer(idxDB, idxLogger, clientCtx) indexerService := NewEVMIndexerService(idxer, clientCtx.Client.(rpcclient.Client)) - indexerService.SetLogger(idxLogger) - - errCh := make(chan error) - go func() { - if err := indexerService.Start(); err != nil { - errCh <- err - } - }() + indexerService.SetLogger(servercmtlog.CometLoggerWrapper{Logger: idxLogger}) - select { - case err := <-errCh: - return err - case <-time.After(types.ServerStartTime): // assume server started successfully - } + g.Go(func() error { + return indexerService.Start() + }) } if config.API.Enable || config.JSONRPC.Enable { @@ -446,116 +440,24 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt clientCtx = clientCtx. WithHomeDir(home). WithChainID(genDoc.ChainID) - - // Set `GRPCClient` to `clientCtx` to enjoy concurrent grpc query. - // only use it if gRPC server is enabled. - if config.GRPC.Enable { - _, port, err := net.SplitHostPort(config.GRPC.Address) - if err != nil { - return errorsmod.Wrapf(err, "invalid grpc address %s", config.GRPC.Address) - } - - maxSendMsgSize := config.GRPC.MaxSendMsgSize - if maxSendMsgSize == 0 { - maxSendMsgSize = serverconfig.DefaultGRPCMaxSendMsgSize - } - - maxRecvMsgSize := config.GRPC.MaxRecvMsgSize - if maxRecvMsgSize == 0 { - maxRecvMsgSize = serverconfig.DefaultGRPCMaxRecvMsgSize - } - - grpcAddress := fmt.Sprintf("127.0.0.1:%s", port) - - // If grpc is enabled, configure grpc client for grpc gateway and json-rpc. - grpcClient, err := grpc.NewClient( - grpcAddress, - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithDefaultCallOptions( - grpc.ForceCodec(codec.NewProtoCodec(clientCtx.InterfaceRegistry).GRPCCodec()), - grpc.MaxCallRecvMsgSize(maxRecvMsgSize), - grpc.MaxCallSendMsgSize(maxSendMsgSize), - ), - ) - if err != nil { - return err - } - - clientCtx = clientCtx.WithGRPCClient(grpcClient) - ctx.Logger.Debug("gRPC client assigned to client context", "address", grpcAddress) - } } - var apiSrv *api.Server - if config.API.Enable { - apiSrv = api.New(clientCtx, ctx.Logger.With("server", "api")) - app.RegisterAPIRoutes(apiSrv, config.API) - - if config.Telemetry.Enabled { - apiSrv.SetTelemetry(metrics) - } - - errCh := make(chan error) - go func() { - if err := apiSrv.Start(config.Config); err != nil { - errCh <- err - } - }() - - select { - case err := <-errCh: - return err - case <-time.After(types.ServerStartTime): // assume server started successfully - } - - defer apiSrv.Close() + grpcSrv, clientCtx, err := startGrpcServer(ctx, svrCtx, clientCtx, g, config.GRPC, app) + if err != nil { + return err } - - var ( - grpcSrv *grpc.Server - grpcWebSrv *http.Server - ) - - if config.GRPC.Enable { - grpcSrv, err = servergrpc.StartGRPCServer(clientCtx, app, config.GRPC) - if err != nil { - return err - } - defer grpcSrv.Stop() - if config.GRPCWeb.Enable { - grpcWebSrv, err = servergrpc.StartGRPCWeb(grpcSrv, config.Config) - if err != nil { - ctx.Logger.Error("failed to start grpc-web http server", "error", err.Error()) - return err - } - - defer func() { - if err := grpcWebSrv.Close(); err != nil { - logger.Error("failed to close the grpc-web http server", "error", err.Error()) - } - }() - } + if grpcSrv != nil { + defer grpcSrv.GracefulStop() } - var ( - httpSrv *http.Server - httpSrvDone chan struct{} - ) + apiSrv := startAPIServer(ctx, svrCtx, clientCtx, g, config.Config, app, grpcSrv, metrics) - if config.JSONRPC.Enable { - genDoc, err := genDocProvider() - if err != nil { - return err - } - - clientCtx := clientCtx.WithChainID(genDoc.ChainID) + if apiSrv != nil { + defer apiSrv.Close() + } - tmEndpoint := "/websocket" - tmRPCAddr := cfg.RPC.ListenAddress - httpSrv, httpSrvDone, err = StartJSONRPC(ctx, clientCtx, tmRPCAddr, tmEndpoint, &config, idxer) - if err != nil { - return err - } + clientCtx, httpSrv, httpSrvDone, err := startJSONRPCServer(svrCtx, clientCtx, g, config, genDocProvider, cfg.RPC.ListenAddress, idxer) + if httpSrv != nil { defer func() { shutdownCtx, cancelFn := context.WithTimeout(context.Background(), 10*time.Second) defer cancelFn() @@ -572,63 +474,16 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt } // At this point it is safe to block the process if we're in query only mode as - // we do not need to start Rosetta or handle any Tendermint related processes. + // we do not need to start Rosetta or handle any CometBFT related processes. if gRPCOnly { // wait for signal capture and gracefully return - return server.WaitForQuitSignals() + // we are guaranteed to be waiting for the "ListenForQuitSignals" goroutine. + return g.Wait() } - var rosettaSrv crgserver.Server - if config.Rosetta.Enable { - offlineMode := config.Rosetta.Offline - - // If GRPC is not enabled rosetta cannot work in online mode, so it works in - // offline mode. - if !config.GRPC.Enable { - offlineMode = true - } - - minGasPrices, err := sdk.ParseDecCoins(config.MinGasPrices) - if err != nil { - ctx.Logger.Error("failed to parse minimum-gas-prices", "error", err.Error()) - return err - } - - conf := &rosetta.Config{ - Blockchain: config.Rosetta.Blockchain, - Network: config.Rosetta.Network, - TendermintRPC: ctx.Config.RPC.ListenAddress, - GRPCEndpoint: config.GRPC.Address, - Addr: config.Rosetta.Address, - Retries: config.Rosetta.Retries, - Offline: offlineMode, - GasToSuggest: config.Rosetta.GasToSuggest, - EnableFeeSuggestion: config.Rosetta.EnableFeeSuggestion, - GasPrices: minGasPrices.Sort(), - Codec: clientCtx.Codec.(*codec.ProtoCodec), - InterfaceRegistry: clientCtx.InterfaceRegistry, - } - - rosettaSrv, err = rosetta.ServerFromConfig(conf) - if err != nil { - return err - } - - errCh := make(chan error) - go func() { - if err := rosettaSrv.Start(); err != nil { - errCh <- err - } - }() - - select { - case err := <-errCh: - return err - case <-time.After(types.ServerStartTime): // assume server started successfully - } - } - // Wait for SIGINT or SIGTERM signal - return server.WaitForQuitSignals() + // wait for signal capture and gracefully return + // we are guaranteed to be waiting for the "ListenForQuitSignals" goroutine. + return g.Wait() } // OpenIndexerDB opens the custom eth indexer db, using the same db backend as the main app @@ -656,3 +511,136 @@ func startTelemetry(cfg evmosserverconfig.Config) (*telemetry.Metrics, error) { } return telemetry.New(cfg.Telemetry) } + +func getCtx(svrCtx *server.Context, block bool) (*errgroup.Group, context.Context) { + ctx, cancelFn := context.WithCancel(context.Background()) + g, ctx := errgroup.WithContext(ctx) + // listen for quit signals so the calling parent process can gracefully exit + server.ListenForQuitSignals(g, block, cancelFn, svrCtx.Logger) + return g, ctx +} + +func startGrpcServer( + ctx context.Context, + svrCtx *server.Context, + clientCtx client.Context, + g *errgroup.Group, + config serverconfig.GRPCConfig, + app types.Application, +) (*grpc.Server, client.Context, error) { + if !config.Enable { + // return grpcServer as nil if gRPC is disabled + return nil, clientCtx, nil + } + _, _, err := net.SplitHostPort(config.Address) + if err != nil { + return nil, clientCtx, errorsmod.Wrapf(err, "invalid grpc address %s", config.Address) + } + + maxSendMsgSize := config.MaxSendMsgSize + if maxSendMsgSize == 0 { + maxSendMsgSize = serverconfig.DefaultGRPCMaxSendMsgSize + } + + maxRecvMsgSize := config.MaxRecvMsgSize + if maxRecvMsgSize == 0 { + maxRecvMsgSize = serverconfig.DefaultGRPCMaxRecvMsgSize + } + + // if gRPC is enabled, configure gRPC client for gRPC gateway and json-rpc + grpcClient, err := grpc.NewClient( + config.Address, + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithDefaultCallOptions( + grpc.ForceCodec(codec.NewProtoCodec(clientCtx.InterfaceRegistry).GRPCCodec()), + grpc.MaxCallRecvMsgSize(maxRecvMsgSize), + grpc.MaxCallSendMsgSize(maxSendMsgSize), + ), + ) + if err != nil { + return nil, clientCtx, err + } + // Set `GRPCClient` to `clientCtx` to enjoy concurrent grpc query. + // only use it if gRPC server is enabled. + clientCtx = clientCtx.WithGRPCClient(grpcClient) + svrCtx.Logger.Debug("gRPC client assigned to client context", "address", config.Address) + + grpcSrv, err := servergrpc.NewGRPCServer(clientCtx, app, config) + if err != nil { + return nil, clientCtx, err + } + + // Start the gRPC server in a goroutine. Note, the provided ctx will ensure + // that the server is gracefully shut down. + g.Go(func() error { + return servergrpc.StartGRPCServer(ctx, svrCtx.Logger.With("module", "grpc-server"), config, grpcSrv) + }) + return grpcSrv, clientCtx, nil +} + +func startAPIServer( + ctx context.Context, + svrCtx *server.Context, + clientCtx client.Context, + g *errgroup.Group, + svrCfg serverconfig.Config, + app types.Application, + grpcSrv *grpc.Server, + metrics *telemetry.Metrics, +) *api.Server { + if !svrCfg.API.Enable { + return nil + } + + apiSrv := api.New(clientCtx, svrCtx.Logger.With("server", "api"), grpcSrv) + app.RegisterAPIRoutes(apiSrv, svrCfg.API) + + if svrCfg.Telemetry.Enabled { + apiSrv.SetTelemetry(metrics) + } + + g.Go(func() error { + return apiSrv.Start(ctx, svrCfg) + }) + return apiSrv +} + +func startJSONRPCServer( + svrCtx *server.Context, + clientCtx client.Context, + g *errgroup.Group, + config evmosserverconfig.Config, + genDocProvider node.GenesisDocProvider, + cmtRPCAddr string, + idxer evmostypes.EVMTxIndexer, +) (ctx client.Context, httpSrv *http.Server, httpSrvDone chan struct{}, err error) { + ctx = clientCtx + if !config.JSONRPC.Enable { + return + } + + genDoc, err := genDocProvider() + if err != nil { + return ctx, httpSrv, httpSrvDone, err + } + + ctx = clientCtx.WithChainID(genDoc.ChainID) + cmtEndpoint := "/websocket" + g.Go(func() error { + httpSrv, httpSrvDone, err = StartJSONRPC(svrCtx, clientCtx, cmtRPCAddr, cmtEndpoint, &config, idxer) + return err + }) + return +} + +// GenDocProvider returns a function which returns the genesis doc from the genesis file. +func GenDocProvider(cfg *cmtcfg.Config) func() (*cmttypes.GenesisDoc, error) { + return func() (*cmttypes.GenesisDoc, error) { + appGenesis, err := genutiltypes.AppGenesisFromFile(cfg.GenesisFile()) + if err != nil { + return nil, err + } + + return appGenesis.ToGenesisDoc() + } +} diff --git a/server/util.go b/server/util.go index f970980d..b3c9f52d 100644 --- a/server/util.go +++ b/server/util.go @@ -18,8 +18,8 @@ import ( "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/version" + "cosmossdk.io/log" tmcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" - tmlog "github.com/cometbft/cometbft/libs/log" rpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client" ) @@ -60,7 +60,7 @@ func AddCommands( ) } -func ConnectTmWS(tmRPCAddr, tmEndpoint string, logger tmlog.Logger) *rpcclient.WSClient { +func ConnectTmWS(tmRPCAddr, tmEndpoint string, logger log.Logger) *rpcclient.WSClient { tmWsClient, err := rpcclient.NewWS(tmRPCAddr, tmEndpoint, rpcclient.MaxReconnectAttempts(256), rpcclient.ReadWait(120*time.Second), @@ -92,7 +92,7 @@ func MountGRPCWebServices( router *mux.Router, grpcWeb *grpcweb.WrappedGrpcServer, grpcResources []string, - logger tmlog.Logger, + logger log.Logger, ) { for _, res := range grpcResources { logger.Info("[GRPC Web] HTTP POST mounted", "resource", res) diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..5f900400 --- /dev/null +++ b/shell.nix @@ -0,0 +1,12 @@ +{ pkgs ? import {} }: + +pkgs.mkShell { + buildInputs = [ + pkgs.nodejs + pkgs.yarn + ]; + + shellHook = '' + echo "Node and Yarn are ready for Solidity tests." + ''; +} \ No newline at end of file diff --git a/tests/integration/ledger/evmosd_suite_test.go b/tests/integration/ledger/evmosd_suite_test.go index 4dac8343..31da6016 100644 --- a/tests/integration/ledger/evmosd_suite_test.go +++ b/tests/integration/ledger/evmosd_suite_test.go @@ -8,7 +8,6 @@ import ( "testing" "time" - "cosmossdk.io/simapp/params" "github.com/cometbft/cometbft/crypto/tmhash" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmversion "github.com/cometbft/cometbft/proto/tendermint/version" @@ -22,13 +21,14 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" + sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/ethereum/go-ethereum/common" clientkeys "github.com/evmos/os/client/keys" "github.com/evmos/os/crypto/hd" evmoskeyring "github.com/evmos/os/crypto/keyring" - example_app "github.com/evmos/os/example_chain" + exampleapp "github.com/evmos/os/example_chain" "github.com/evmos/os/tests/integration/ledger/mocks" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/constants" utiltx "github.com/evmos/os/testutil/tx" "github.com/spf13/cobra" "github.com/stretchr/testify/suite" @@ -44,7 +44,7 @@ var s *LedgerTestSuite type LedgerTestSuite struct { suite.Suite - app *example_app.ExampleChain + app *exampleapp.ExampleChain ctx sdk.Context ledger *mocks.SECP256K1 @@ -84,9 +84,9 @@ func (suite *LedgerTestSuite) SetupEvmosApp() { consAddress := sdk.ConsAddress(utiltx.GenerateAddress().Bytes()) // init app - chainID := testutil.ExampleChainID - suite.app = example_app.Setup(suite.T(), false, chainID) - suite.ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{ + chainID := constants.ExampleChainID + suite.app = exampleapp.Setup(suite.T(), chainID) + suite.ctx = suite.app.BaseApp.NewContextLegacy(false, tmproto.Header{ Height: 1, ChainID: chainID, Time: time.Now().UTC(), @@ -112,7 +112,7 @@ func (suite *LedgerTestSuite) SetupEvmosApp() { }) } -func (suite *LedgerTestSuite) NewKeyringAndCtxs(krHome string, input io.Reader, encCfg params.EncodingConfig) (keyring.Keyring, client.Context, context.Context) { +func (suite *LedgerTestSuite) NewKeyringAndCtxs(krHome string, input io.Reader, encCfg sdktestutil.TestEncodingConfig) (keyring.Keyring, client.Context, context.Context) { kr, err := keyring.New( sdk.KeyringServiceName(), keyring.BackendTest, @@ -132,8 +132,9 @@ func (suite *LedgerTestSuite) NewKeyringAndCtxs(krHome string, input io.Reader, WithLedgerHasProtobuf(true). WithUseLedger(true). WithKeyring(kr). - WithClient(mocks.MockTendermintRPC{Client: rpcclientmock.Client{}}). - WithChainID(testutil.ExampleChainIDPrefix + "-13") + WithClient(mocks.MockCometRPC{Client: rpcclientmock.Client{}}). + WithChainID(constants.ExampleChainIDPrefix + "-13"). + WithSignModeStr(flags.SignModeLegacyAminoJSON) srvCtx := server.NewDefaultContext() ctx := context.Background() @@ -152,7 +153,7 @@ func (suite *LedgerTestSuite) evmosAddKeyCmd() *cobra.Command { err := algoFlag.Value.Set(string(hd.EthSecp256k1Type)) suite.Require().NoError(err) - cmd.Flags().AddFlagSet(keys.Commands("home").PersistentFlags()) + cmd.Flags().AddFlagSet(keys.Commands().PersistentFlags()) cmd.RunE = func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd).WithKeyringOptions(hd.EthSecp256k1Option()) diff --git a/tests/integration/ledger/ledger_test.go b/tests/integration/ledger/ledger_test.go index 2e013f13..e306921a 100644 --- a/tests/integration/ledger/ledger_test.go +++ b/tests/integration/ledger/ledger_test.go @@ -5,19 +5,19 @@ import ( "context" "cosmossdk.io/math" - "cosmossdk.io/simapp/params" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdktestutil "github.com/cosmos/cosmos-sdk/testutil" sdktestutilcli "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" + sdktestutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" bankcli "github.com/cosmos/cosmos-sdk/x/bank/client/cli" "github.com/evmos/os/crypto/hd" "github.com/evmos/os/encoding" - example_app "github.com/evmos/os/example_chain" - chainutil "github.com/evmos/os/example_chain/testutil" "github.com/evmos/os/tests/integration/ledger/mocks" + "github.com/evmos/os/testutil" utiltx "github.com/evmos/os/testutil/tx" "github.com/spf13/cobra" @@ -38,7 +38,7 @@ var ( var _ = Describe("Ledger CLI and keyring functionality: ", func() { var ( receiverAccAddr sdk.AccAddress - encCfg params.EncodingConfig + encCfg sdktestutilmod.TestEncodingConfig kr keyring.Keyring mockedIn sdktestutil.BufferReader clientCtx client.Context @@ -56,7 +56,7 @@ var _ = Describe("Ledger CLI and keyring functionality: ", func() { Describe("Adding a key from ledger using the CLI", func() { BeforeEach(func() { krHome = s.T().TempDir() - encCfg = encoding.MakeConfig(example_app.ModuleBasics) + encCfg = encoding.MakeConfig() cmd = s.evmosAddKeyCmd() @@ -101,7 +101,7 @@ var _ = Describe("Ledger CLI and keyring functionality: ", func() { Describe("Singing a transactions", func() { BeforeEach(func() { krHome = s.T().TempDir() - encCfg = encoding.MakeConfig(example_app.ModuleBasics) + encCfg = encoding.MakeConfig() var err error @@ -143,7 +143,7 @@ var _ = Describe("Ledger CLI and keyring functionality: ", func() { msg := []byte("test message") - signed, _, err := kr.SignByAddress(ledgerAddr, msg) + signed, _, err := kr.SignByAddress(ledgerAddr, msg, signingtypes.SignMode_SIGN_MODE_TEXTUAL) s.Require().NoError(err, "failed to sign message") valid := s.pubKey.VerifySignature(msg, signed) @@ -157,7 +157,7 @@ var _ = Describe("Ledger CLI and keyring functionality: ", func() { msg := []byte("test message") - _, _, err = kr.SignByAddress(ledgerAddr, msg) + _, _, err = kr.SignByAddress(ledgerAddr, msg, signingtypes.SignMode_SIGN_MODE_TEXTUAL) s.Require().Error(err, "false positive result, error expected") @@ -168,7 +168,7 @@ var _ = Describe("Ledger CLI and keyring functionality: ", func() { BeforeEach(func() { s.ledger = mocks.NewSECP256K1(s.T()) - err := chainutil.FundAccount( + err := testutil.FundAccount( s.ctx, s.app.BankKeeper, s.accAddr, @@ -180,7 +180,7 @@ var _ = Describe("Ledger CLI and keyring functionality: ", func() { receiverAccAddr = sdk.AccAddress(utiltx.GenerateAddress().Bytes()) - cmd = bankcli.NewSendTxCmd() + cmd = bankcli.NewSendTxCmd(s.app.AccountKeeper.AddressCodec()) mockedIn = sdktestutil.ApplyMockIODiscardOutErr(cmd) kr, clientCtx, ctx = s.NewKeyringAndCtxs(krHome, mockedIn, encCfg) diff --git a/tests/integration/ledger/mocks/SECP256K1.go b/tests/integration/ledger/mocks/SECP256K1.go index 32ff3900..51b462d7 100644 --- a/tests/integration/ledger/mocks/SECP256K1.go +++ b/tests/integration/ledger/mocks/SECP256K1.go @@ -82,7 +82,7 @@ func (_m *SECP256K1) GetPublicKeySECP256K1(_a0 []uint32) ([]byte, error) { return r0, r1 } -func (_m *SECP256K1) SignSECP256K1(_a0 []uint32, _a1 []byte) ([]byte, error) { +func (_m *SECP256K1) SignSECP256K1(_a0 []uint32, _a1 []byte, _a2 byte) ([]byte, error) { args := _m.Called(_a0, _a1) e := args.Get(1) err, _ := e.(error) diff --git a/tests/integration/ledger/mocks/tendermint.go b/tests/integration/ledger/mocks/tendermint.go index dc5d77c0..aef300b8 100644 --- a/tests/integration/ledger/mocks/tendermint.go +++ b/tests/integration/ledger/mocks/tendermint.go @@ -11,26 +11,26 @@ import ( rpcclient "github.com/cometbft/cometbft/rpc/client" rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" coretypes "github.com/cometbft/cometbft/rpc/core/types" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" ) -type MockTendermintRPC struct { +type MockCometRPC struct { rpcclientmock.Client responseQuery abci.ResponseQuery } -// NewMockTendermintRPC returns a mock TendermintRPC implementation. +// NewMockCometRPC returns a mock CometRPC implementation. // It is used for CLI testing. -func NewMockTendermintRPC(respQuery abci.ResponseQuery) MockTendermintRPC { - return MockTendermintRPC{responseQuery: respQuery} +func NewMockCometRPC(respQuery abci.ResponseQuery) MockCometRPC { + return MockCometRPC{responseQuery: respQuery} } -func (MockTendermintRPC) BroadcastTxSync(context.Context, tmtypes.Tx) (*coretypes.ResultBroadcastTx, error) { +func (MockCometRPC) BroadcastTxSync(context.Context, cmttypes.Tx) (*coretypes.ResultBroadcastTx, error) { return &coretypes.ResultBroadcastTx{Code: 0}, nil } -func (m MockTendermintRPC) ABCIQueryWithOptions( +func (m MockCometRPC) ABCIQueryWithOptions( _ context.Context, _ string, _ tmbytes.HexBytes, diff --git a/tests/solidity/init-node.sh b/tests/solidity/init-node.sh index 3c94a1a8..a3b56cbf 100755 --- a/tests/solidity/init-node.sh +++ b/tests/solidity/init-node.sh @@ -19,10 +19,13 @@ TMP_GENESIS="$CHAINDIR/config/tmp_genesis.json" APP_TOML="$CHAINDIR/config/app.toml" CONFIG_TOML="$CHAINDIR/config/config.toml" +# make sure to reset chain directory before test +rm -rf "$CHAINDIR" + # validate dependencies are installed command -v jq >/dev/null 2>&1 || { - echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/" - exit 1 + echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/" + exit 1 } # used to exit on first error (any non-zero exit code) @@ -31,6 +34,10 @@ set -e # feemarket params basefee BASEFEE=1000000000 +# Set client config +osd config set client chain-id "$CHAINID" --home "$CHAINDIR" +osd config set client keyring-backend "$KEYRING" --home "$CHAINDIR" + # myKey address 0x7cb61d4117ae31a12e393a1cfa3bac666481d02e VAL_KEY="mykey" VAL_MNEMONIC="gesture inject test cycle original hollow east ridge hen combine junk child bacon zero hope comfort vacuum milk pitch cage oppose unhappy lunar seat" @@ -51,21 +58,11 @@ USER3_MNEMONIC="will wear settle write dance topic tape sea glory hotel oppose r USER4_KEY="user4" USER4_MNEMONIC="doll midnight silk carpet brush boring pluck office gown inquiry duck chief aim exit gain never tennis crime fragile ship cloud surface exotic patch" -# Set client config -osd config keyring-backend "$KEYRING" --home "$CHAINDIR" -osd config chain-id "$CHAINID" --home "$CHAINDIR" - # Import keys from mnemonics -echo "Adding val key" -echo "adding mnemonic: $VAL_MNEMONIC" echo "$VAL_MNEMONIC" | osd keys add "$VAL_KEY" --recover --keyring-backend "$KEYRING" --algo "$KEYALGO" --home "$CHAINDIR" -echo "Adding user1 key" echo "$USER1_MNEMONIC" | osd keys add "$USER1_KEY" --recover --keyring-backend "$KEYRING" --algo "$KEYALGO" --home "$CHAINDIR" -echo "Adding user2 key" echo "$USER2_MNEMONIC" | osd keys add "$USER2_KEY" --recover --keyring-backend "$KEYRING" --algo "$KEYALGO" --home "$CHAINDIR" -echo "Adding user3 key" echo "$USER3_MNEMONIC" | osd keys add "$USER3_KEY" --recover --keyring-backend "$KEYRING" --algo "$KEYALGO" --home "$CHAINDIR" -echo "Adding user4 key" echo "$USER4_MNEMONIC" | osd keys add "$USER4_KEY" --recover --keyring-backend "$KEYRING" --algo "$KEYALGO" --home "$CHAINDIR" # Set moniker and chain-id for Evmos (Moniker can be anything, chain-id must be an integer) @@ -81,17 +78,10 @@ jq '.app_state["mint"]["params"]["mint_denom"]="aevmos"' "$GENESIS" >"$TMP_GENES # Enable precompiles in EVM params jq '.app_state["evm"]["params"]["active_static_precompiles"]=["0x0000000000000000000000000000000000000100","0x0000000000000000000000000000000000000400","0x0000000000000000000000000000000000000800","0x0000000000000000000000000000000000000801","0x0000000000000000000000000000000000000802","0x0000000000000000000000000000000000000803","0x0000000000000000000000000000000000000804"]' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" -# set gov proposing && voting period -jq '.app_state.gov.deposit_params.max_deposit_period="10s"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" -jq '.app_state.gov.voting_params.voting_period="10s"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" - -# When upgrade to cosmos-sdk v0.47, use gov.params to edit the deposit params -# check if the 'params' field exists in the genesis file -if jq '.app_state.gov.params != null' "$GENESIS" | grep -q "true"; then - jq '.app_state.gov.params.min_deposit[0].denom="aevmos"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" - jq '.app_state.gov.params.max_deposit_period="10s"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" - jq '.app_state.gov.params.voting_period="10s"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" -fi +# Change proposal periods to pass within a reasonable time for local testing +sed -i.bak 's/"max_deposit_period": "172800s"/"max_deposit_period": "30s"/g' "$GENESIS" +sed -i.bak 's/"voting_period": "172800s"/"voting_period": "30s"/g' "$GENESIS" +sed -i.bak 's/"expedited_voting_period": "86400s"/"expedited_voting_period": "15s"/g' "$GENESIS" # Set gas limit in genesis jq '.consensus_params.block.max_gas="10000000"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" @@ -111,9 +101,9 @@ osd genesis add-genesis-account "$(osd keys show "$USER4_KEY" -a --keyring-backe # set custom pruning settings if [ "$PRUNING" = "custom" ]; then - sed -i.bak 's/pruning = "default"/pruning = "custom"/g' "$APP_TOML" - sed -i.bak 's/pruning-keep-recent = "0"/pruning-keep-recent = "2"/g' "$APP_TOML" - sed -i.bak 's/pruning-interval = "0"/pruning-interval = "10"/g' "$APP_TOML" + sed -i.bak 's/pruning = "default"/pruning = "custom"/g' "$APP_TOML" + sed -i.bak 's/pruning-keep-recent = "0"/pruning-keep-recent = "2"/g' "$APP_TOML" + sed -i.bak 's/pruning-interval = "0"/pruning-interval = "10"/g' "$APP_TOML" fi # make sure the localhost IP is 0.0.0.0 @@ -146,8 +136,8 @@ osd genesis validate-genesis --home "$CHAINDIR" # Start the node osd start "$TRACE" \ - --log_level $LOGLEVEL \ - --minimum-gas-prices=0.0001aevmos \ - --json-rpc.api eth,txpool,personal,net,debug,web3 \ - --chain-id "$CHAINID" \ - --home "$CHAINDIR" + --log_level $LOGLEVEL \ + --minimum-gas-prices=0.0001aevmos \ + --json-rpc.api eth,txpool,personal,net,debug,web3 \ + --chain-id "$CHAINID" \ + --home "$CHAINDIR" diff --git a/tests/solidity/test-helper.js b/tests/solidity/test-helper.js index d6e140c0..841b190e 100644 --- a/tests/solidity/test-helper.js +++ b/tests/solidity/test-helper.js @@ -246,6 +246,12 @@ async function main () { console.log(`Running Tests: ${allTests.join()}`) const proc = await setupNetwork({ runConfig, timeout: 50000 }) + + // sleep for 20s to wait blocks being produced + // + // TODO: this should be handled more gracefully, i.e. check for block height + await new Promise((resolve) => setTimeout(resolve, 20000)) + await performTests({ allTests, runConfig }) if (proc) { diff --git a/testutil/ante.go b/testutil/ante.go index a0a10976..9b5d8f47 100644 --- a/testutil/ante.go +++ b/testutil/ante.go @@ -1,12 +1,9 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package testutil -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/evmos/os/encoding" - exampleapp "github.com/evmos/os/example_chain" -) +import sdk "github.com/cosmos/cosmos-sdk/types" // NoOpNextFn is a no-op function that returns the context and no error in order to mock // the next function in the AnteHandler chain. @@ -16,21 +13,3 @@ import ( func NoOpNextFn(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.Context, error) { return ctx, nil } - -// ValidateAnteForMsgs is a helper function, which takes in an AnteDecorator as well as 1 or -// more messages, builds a transaction containing these messages, and returns any error that -// the AnteHandler might return. -func ValidateAnteForMsgs(ctx sdk.Context, dec sdk.AnteDecorator, msgs ...sdk.Msg) error { - encodingConfig := encoding.MakeConfig(exampleapp.ModuleBasics) - txBuilder := encodingConfig.TxConfig.NewTxBuilder() - err := txBuilder.SetMsgs(msgs...) - if err != nil { - return err - } - - tx := txBuilder.GetTx() - - // Call Ante decorator - _, err = dec.AnteHandle(ctx, tx, false, NoOpNextFn) - return err -} diff --git a/testutil/constants.go b/testutil/constants/constants.go similarity index 98% rename from testutil/constants.go rename to testutil/constants/constants.go index da86409b..7f3dc2a4 100644 --- a/testutil/constants.go +++ b/testutil/constants/constants.go @@ -1,7 +1,7 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) -package testutil +package constants import "fmt" diff --git a/testutil/constants_test.go b/testutil/constants/constants_test.go similarity index 80% rename from testutil/constants_test.go rename to testutil/constants/constants_test.go index 36dc3dff..8495f0a3 100644 --- a/testutil/constants_test.go +++ b/testutil/constants/constants_test.go @@ -1,17 +1,18 @@ -package testutil_test +package constants_test import ( "testing" + "github.com/evmos/os/testutil/constants" + "github.com/evmos/os/example_chain" chainconfig "github.com/evmos/os/example_chain/osd/config" - "github.com/evmos/os/testutil" "github.com/stretchr/testify/require" ) func TestRequireSameTestDenom(t *testing.T) { require.Equal(t, - testutil.ExampleAttoDenom, + constants.ExampleAttoDenom, example_chain.ExampleChainDenom, "test denoms should be the same across the repo", ) @@ -19,7 +20,7 @@ func TestRequireSameTestDenom(t *testing.T) { func TestRequireSameTestBech32Prefix(t *testing.T) { require.Equal(t, - testutil.ExampleBech32Prefix, + constants.ExampleBech32Prefix, chainconfig.Bech32Prefix, "bech32 prefixes should be the same across the repo", ) @@ -27,7 +28,7 @@ func TestRequireSameTestBech32Prefix(t *testing.T) { func TestRequireSameWEVMOSMainnet(t *testing.T) { require.Equal(t, - testutil.WEVMOSContractMainnet, + constants.WEVMOSContractMainnet, example_chain.WEVMOSContractMainnet, "wevmos contract addresses should be the same across the repo", ) diff --git a/testutil/fund.go b/testutil/fund.go new file mode 100644 index 00000000..5d3c53b4 --- /dev/null +++ b/testutil/fund.go @@ -0,0 +1,41 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package testutil + +import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/evmos/os/testutil/constants" +) + +// FundAccount is a utility function that funds an account by minting and +// sending the coins to the address. +func FundAccount(ctx sdk.Context, bankKeeper bankkeeper.Keeper, addr sdk.AccAddress, amounts sdk.Coins) error { + if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil { + return err + } + + return bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, amounts) +} + +// FundAccountWithBaseDenom is a utility function that uses the FundAccount function +// to fund an account with the default Evmos denomination. +func FundAccountWithBaseDenom(ctx sdk.Context, bankKeeper bankkeeper.Keeper, addr sdk.AccAddress, amount int64) error { + coins := sdk.NewCoins( + sdk.NewCoin(constants.ExampleAttoDenom, math.NewInt(amount)), + ) + return FundAccount(ctx, bankKeeper, addr, coins) +} + +// FundModuleAccount is a utility function that funds a module account by +// minting and sending the coins to the address. +func FundModuleAccount(ctx sdk.Context, bankKeeper bankkeeper.Keeper, recipientMod string, amounts sdk.Coins) error { + if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil { + return err + } + + return bankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, recipientMod, amounts) +} diff --git a/testutil/integration/common/factory/base.go b/testutil/integration/common/factory/base.go new file mode 100644 index 00000000..98194214 --- /dev/null +++ b/testutil/integration/common/factory/base.go @@ -0,0 +1,119 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package factory + +import ( + "fmt" + + errorsmod "cosmossdk.io/errors" + abcitypes "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/cosmos-sdk/client" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdktypes "github.com/cosmos/cosmos-sdk/types" + testutiltypes "github.com/cosmos/cosmos-sdk/types/module/testutil" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + "github.com/evmos/os/testutil/integration/os/grpc" + "github.com/evmos/os/testutil/integration/os/network" +) + +// BaseTxFactory is the interface that wraps the common methods to build and broadcast transactions +// within cosmos chains +type BaseTxFactory interface { + // BuildCosmosTx builds a Cosmos tx with the provided private key and txArgs + BuildCosmosTx(privKey cryptotypes.PrivKey, txArgs CosmosTxArgs) (authsigning.Tx, error) + // SignCosmosTx signs a Cosmos transaction with the provided + // private key and tx builder + SignCosmosTx(privKey cryptotypes.PrivKey, txBuilder client.TxBuilder) error + // ExecuteCosmosTx builds, signs and broadcasts a Cosmos tx with the provided private key and txArgs + ExecuteCosmosTx(privKey cryptotypes.PrivKey, txArgs CosmosTxArgs) (abcitypes.ExecTxResult, error) + // EncodeTx encodes the provided transaction + EncodeTx(tx sdktypes.Tx) ([]byte, error) + // CommitCosmosTx creates, signs and commits a cosmos tx + // (produces a block with the specified transaction) + CommitCosmosTx(privKey cryptotypes.PrivKey, txArgs CosmosTxArgs) (abcitypes.ExecTxResult, error) +} + +// baseTxFactory is the struct of the basic tx factory +// to build and broadcast transactions. +// This is to simulate the behavior of a real user. +type baseTxFactory struct { + grpcHandler grpc.Handler + network network.Network + ec testutiltypes.TestEncodingConfig +} + +// newBaseTxFactory instantiates a new baseTxFactory +func newBaseTxFactory( + network network.Network, + grpcHandler grpc.Handler, +) BaseTxFactory { + return &baseTxFactory{ + grpcHandler: grpcHandler, + network: network, + ec: network.GetEncodingConfig(), + } +} + +func (tf *baseTxFactory) BuildCosmosTx(privKey cryptotypes.PrivKey, txArgs CosmosTxArgs) (authsigning.Tx, error) { + txBuilder, err := tf.buildTx(privKey, txArgs) + if err != nil { + return nil, errorsmod.Wrap(err, "failed to build tx") + } + return txBuilder.GetTx(), nil +} + +// ExecuteCosmosTx creates, signs and broadcasts a Cosmos transaction +func (tf *baseTxFactory) ExecuteCosmosTx(privKey cryptotypes.PrivKey, txArgs CosmosTxArgs) (abcitypes.ExecTxResult, error) { + signedTx, err := tf.BuildCosmosTx(privKey, txArgs) + if err != nil { + return abcitypes.ExecTxResult{}, errorsmod.Wrap(err, "failed to build tx") + } + + txBytes, err := tf.EncodeTx(signedTx) + if err != nil { + return abcitypes.ExecTxResult{}, errorsmod.Wrap(err, "failed to encode tx") + } + + return tf.network.BroadcastTxSync(txBytes) +} + +// CommitCosmosTx creates and signs a Cosmos transaction, and then includes it in +// a block and commits the state changes on the chain +func (tf *baseTxFactory) CommitCosmosTx(privKey cryptotypes.PrivKey, txArgs CosmosTxArgs) (abcitypes.ExecTxResult, error) { + signedTx, err := tf.BuildCosmosTx(privKey, txArgs) + if err != nil { + return abcitypes.ExecTxResult{}, errorsmod.Wrap(err, "failed to build tx") + } + + txBytes, err := tf.EncodeTx(signedTx) + if err != nil { + return abcitypes.ExecTxResult{}, errorsmod.Wrap(err, "failed to encode tx") + } + + blockRes, err := tf.network.NextBlockWithTxs(txBytes) + if err != nil { + return abcitypes.ExecTxResult{}, errorsmod.Wrap(err, "failed to include the tx in a block") + } + txResCount := len(blockRes.TxResults) + if txResCount != 1 { + return abcitypes.ExecTxResult{}, fmt.Errorf("expected to receive only one tx result, but got %d", txResCount) + } + return *blockRes.TxResults[0], nil +} + +// SignCosmosTx is a helper function that signs a Cosmos transaction +// with the provided private key and transaction builder +func (tf *baseTxFactory) SignCosmosTx(privKey cryptotypes.PrivKey, txBuilder client.TxBuilder) error { + txConfig := tf.ec.TxConfig + signMode, err := authsigning.APISignModeToInternal(txConfig.SignModeHandler().DefaultMode()) + if err != nil { + return errorsmod.Wrap(err, "invalid sign mode") + } + signerData, err := tf.setSignatures(privKey, txBuilder, signMode) + if err != nil { + return errorsmod.Wrap(err, "failed to set tx signatures") + } + + return tf.signWithPrivKey(privKey, txBuilder, signerData, signMode) +} diff --git a/testutil/integration/common/factory/distribution.go b/testutil/integration/common/factory/distribution.go new file mode 100644 index 00000000..392a2418 --- /dev/null +++ b/testutil/integration/common/factory/distribution.go @@ -0,0 +1,88 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package factory + +import ( + "fmt" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" +) + +type DistributionTxFactory interface { + // SetWithdrawAddress is a method to create and broadcast a MsgSetWithdrawAddress + SetWithdrawAddress(delegatorPriv cryptotypes.PrivKey, withdrawerAddr sdk.AccAddress) error + // WithdrawDelegationRewards is a method to create and broadcast a MsgWithdrawDelegationRewards + WithdrawDelegationRewards(delegatorPriv cryptotypes.PrivKey, validatorAddr string) error + // WithdrawValidatorCommission is a method to create and broadcast a MsgWithdrawValidatorCommission + WithdrawValidatorCommission(validatorPriv cryptotypes.PrivKey) error +} + +type distributionTxFactory struct { + BaseTxFactory +} + +func newDistrTxFactory(bf BaseTxFactory) DistributionTxFactory { + return &distributionTxFactory{bf} +} + +func (tf *distributionTxFactory) SetWithdrawAddress(delegatorPriv cryptotypes.PrivKey, withdrawerAddr sdk.AccAddress) error { + delegatorAccAddr := sdk.AccAddress(delegatorPriv.PubKey().Address()) + + msg := distrtypes.NewMsgSetWithdrawAddress( + delegatorAccAddr, + withdrawerAddr, + ) + + resp, err := tf.ExecuteCosmosTx(delegatorPriv, CosmosTxArgs{ + Msgs: []sdk.Msg{msg}, + }) + + if resp.Code != 0 { + err = fmt.Errorf("received error code %d on SetWithdrawAddress transaction. Logs: %s", resp.Code, resp.Log) + } + + return err +} + +// WithdrawDelegationRewards will withdraw any unclaimed staking rewards for the delegator associated with +// the given private key from the validator. +// The validator address should be in the format `evmosvaloper1...`. +func (tf *distributionTxFactory) WithdrawDelegationRewards(delegatorPriv cryptotypes.PrivKey, validatorAddr string) error { + delegatorAccAddr := sdk.AccAddress(delegatorPriv.PubKey().Address()) + + msg := distrtypes.NewMsgWithdrawDelegatorReward( + delegatorAccAddr.String(), + validatorAddr, + ) + + resp, err := tf.ExecuteCosmosTx(delegatorPriv, CosmosTxArgs{ + Msgs: []sdk.Msg{msg}, + }) + + if resp.Code != 0 { + err = fmt.Errorf("received error code %d on WithdrawDelegationRewards transaction. Logs: %s", resp.Code, resp.Log) + } + + return err +} + +func (tf *distributionTxFactory) WithdrawValidatorCommission(validatorPriv cryptotypes.PrivKey) error { + validatorAddr := sdk.ValAddress(validatorPriv.PubKey().Address()) + + msg := distrtypes.NewMsgWithdrawValidatorCommission( + validatorAddr.String(), + ) + + resp, err := tf.ExecuteCosmosTx(validatorPriv, CosmosTxArgs{ + Msgs: []sdk.Msg{msg}, + }) + + if resp.Code != 0 { + err = fmt.Errorf("received error code %d on WithdrawValidatorCommission transaction. Logs: %s", resp.Code, resp.Log) + } + + return err +} diff --git a/testutil/integration/common/factory/factory.go b/testutil/integration/common/factory/factory.go index ba51902a..2a1370b3 100644 --- a/testutil/integration/common/factory/factory.go +++ b/testutil/integration/common/factory/factory.go @@ -4,71 +4,45 @@ package factory import ( - abcitypes "github.com/cometbft/cometbft/abci/types" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - testutiltypes "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/evmos/os/testutil/integration/os/grpc" "github.com/evmos/os/testutil/integration/os/network" - - errorsmod "cosmossdk.io/errors" ) const ( GasAdjustment = float64(1.7) ) -// TxFactory is the interface that wraps the common methods to build and broadcast transactions -// within cosmos chains -type TxFactory interface { - // BuildCosmosTx builds a Cosmos tx with the provided private key and txArgs - BuildCosmosTx(privKey cryptotypes.PrivKey, txArgs CosmosTxArgs) (signing.Tx, error) - // ExecuteCosmosTx builds, signs and broadcasts a Cosmos tx with the provided private key and txArgs - ExecuteCosmosTx(privKey cryptotypes.PrivKey, txArgs CosmosTxArgs) (abcitypes.ResponseDeliverTx, error) +// CoreTxFactory is the interface that wraps the methods +// to build and broadcast cosmos transactions, and also +// includes module-specific transactions +type CoreTxFactory interface { + BaseTxFactory + DistributionTxFactory + StakingTxFactory + FundTxFactory } -var _ TxFactory = (*IntegrationTxFactory)(nil) +var _ CoreTxFactory = (*IntegrationTxFactory)(nil) // IntegrationTxFactory is a helper struct to build and broadcast transactions // to the network on integration tests. This is to simulate the behavior of a real user. type IntegrationTxFactory struct { - grpcHandler grpc.Handler - network network.Network - ec *testutiltypes.TestEncodingConfig + BaseTxFactory + DistributionTxFactory + StakingTxFactory + FundTxFactory } // New creates a new IntegrationTxFactory instance func New( network network.Network, grpcHandler grpc.Handler, - ec *testutiltypes.TestEncodingConfig, -) *IntegrationTxFactory { +) CoreTxFactory { + bf := newBaseTxFactory(network, grpcHandler) return &IntegrationTxFactory{ - grpcHandler: grpcHandler, - network: network, - ec: ec, - } -} - -func (tf *IntegrationTxFactory) BuildCosmosTx(privKey cryptotypes.PrivKey, txArgs CosmosTxArgs) (signing.Tx, error) { - txBuilder, err := tf.buildTx(privKey, txArgs) - if err != nil { - return nil, errorsmod.Wrap(err, "failed to build tx") - } - return txBuilder.GetTx(), nil -} - -// ExecuteCosmosTx creates, signs and broadcasts a Cosmos transaction -func (tf *IntegrationTxFactory) ExecuteCosmosTx(privKey cryptotypes.PrivKey, txArgs CosmosTxArgs) (abcitypes.ResponseDeliverTx, error) { - signedTx, err := tf.BuildCosmosTx(privKey, txArgs) - if err != nil { - return abcitypes.ResponseDeliverTx{}, errorsmod.Wrap(err, "failed to generate tx") + bf, + newDistrTxFactory(bf), + newStakingTxFactory(bf), + newFundTxFactory(bf), } - - txBytes, err := tf.encodeTx(signedTx) - if err != nil { - return abcitypes.ResponseDeliverTx{}, errorsmod.Wrap(err, "failed to encode tx") - } - - return tf.network.BroadcastTxSync(txBytes) } diff --git a/testutil/integration/common/factory/fund.go b/testutil/integration/common/factory/fund.go new file mode 100644 index 00000000..0a2b56fa --- /dev/null +++ b/testutil/integration/common/factory/fund.go @@ -0,0 +1,51 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package factory + +import ( + "fmt" + + sdktypes "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/evmos/os/testutil/integration/os/keyring" +) + +// FundTxFactory is the interface that wraps the common methods to fund accounts +// via a bank send transaction +type FundTxFactory interface { + // FundAccount funds the given account with the given amount. + FundAccount(sender keyring.Key, receiver sdktypes.AccAddress, amount sdktypes.Coins) error +} + +// baseTxFactory is the struct of the basic tx factory +// to build and broadcast transactions. +// This is to simulate the behavior of a real user. +type fundTxFactory struct { + BaseTxFactory +} + +// newBaseTxFactory instantiates a new baseTxFactory +func newFundTxFactory(bf BaseTxFactory) FundTxFactory { + return &fundTxFactory{bf} +} + +// FundAccount funds the given account with the given amount of coins. +func (tf *fundTxFactory) FundAccount(sender keyring.Key, receiver sdktypes.AccAddress, coins sdktypes.Coins) error { + bankmsg := banktypes.NewMsgSend( + sender.AccAddr, + receiver, + coins, + ) + txArgs := CosmosTxArgs{Msgs: []sdktypes.Msg{bankmsg}} + txRes, err := tf.ExecuteCosmosTx(sender.Priv, txArgs) + if err != nil { + return err + } + + if txRes.Code != 0 { + return fmt.Errorf("transaction returned non-zero code %d", txRes.Code) + } + + return nil +} diff --git a/testutil/integration/common/factory/helper.go b/testutil/integration/common/factory/helper.go index 08df47c5..6950bd01 100644 --- a/testutil/integration/common/factory/helper.go +++ b/testutil/integration/common/factory/helper.go @@ -6,22 +6,26 @@ package factory import ( "math/big" - "github.com/cosmos/cosmos-sdk/client" - cosmostx "github.com/cosmos/cosmos-sdk/client/tx" - + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" - + "github.com/cosmos/cosmos-sdk/client" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/types/tx/signing" - xauthsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - sdktypes "github.com/cosmos/cosmos-sdk/types" - - errorsmod "cosmossdk.io/errors" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" ) +// EncodeTx encodes the tx using the txConfig's encoder. +func (tf *baseTxFactory) EncodeTx(tx sdktypes.Tx) ([]byte, error) { + txConfig := tf.ec.TxConfig + txBytes, err := txConfig.TxEncoder()(tx) + if err != nil { + return nil, errorsmod.Wrap(err, "failed to encode tx") + } + return txBytes, nil +} + // buildTx builds a tx with the provided private key and txArgs -func (tf *IntegrationTxFactory) buildTx(privKey cryptotypes.PrivKey, txArgs CosmosTxArgs) (client.TxBuilder, error) { +func (tf *baseTxFactory) buildTx(privKey cryptotypes.PrivKey, txArgs CosmosTxArgs) (client.TxBuilder, error) { txConfig := tf.ec.TxConfig txBuilder := txConfig.NewTxBuilder() @@ -34,85 +38,64 @@ func (tf *IntegrationTxFactory) buildTx(privKey cryptotypes.PrivKey, txArgs Cosm } senderAddress := sdktypes.AccAddress(privKey.PubKey().Address().Bytes()) - account, err := tf.grpcHandler.GetAccount(senderAddress.String()) - if err != nil { - return nil, errorsmod.Wrapf(err, "failed to get account: %s", senderAddress.String()) - } - sequence := account.GetSequence() - signMode := txConfig.SignModeHandler().DefaultMode() - signerData := xauthsigning.SignerData{ - ChainID: tf.network.GetChainID(), - AccountNumber: account.GetAccountNumber(), - Sequence: sequence, - Address: senderAddress.String(), + if txArgs.FeeGranter != nil { + txBuilder.SetFeeGranter(txArgs.FeeGranter) } - // sign tx - sigsV2 := signing.SignatureV2{ - PubKey: privKey.PubKey(), - Data: &signing.SingleSignatureData{ - SignMode: signMode, - Signature: nil, - }, - Sequence: sequence, - } + txBuilder.SetFeePayer(senderAddress) - err = txBuilder.SetSignatures(sigsV2) + // need to sign the tx to simulate the tx to get the gas estimation + signMode, err := authsigning.APISignModeToInternal(txConfig.SignModeHandler().DefaultMode()) if err != nil { - return nil, errorsmod.Wrap(err, "failed to set tx signatures") + return nil, errorsmod.Wrap(err, "invalid sign mode") } - - if txArgs.FeeGranter != nil { - txBuilder.SetFeeGranter(txArgs.FeeGranter) + signerData, err := tf.setSignatures(privKey, txBuilder, signMode) + if err != nil { + return nil, errorsmod.Wrap(err, "failed to set tx signatures") } - txBuilder.SetFeePayer(senderAddress) - gasLimit, err := tf.estimateGas(txArgs, txBuilder) if err != nil { return nil, errorsmod.Wrap(err, "failed to estimate gas") } txBuilder.SetGasLimit(gasLimit) - fees, err := tf.calculateFees(txArgs.GasPrice, gasLimit) - if err != nil { - return nil, errorsmod.Wrap(err, "failed to calculate fees") + fees := txArgs.Fees + if fees.IsZero() { + fees, err = tf.calculateFees(txArgs.GasPrice, gasLimit) + if err != nil { + return nil, errorsmod.Wrap(err, "failed to calculate fees") + } } txBuilder.SetFeeAmount(fees) - signature, err := cosmostx.SignWithPrivKey(signMode, signerData, txBuilder, privKey, txConfig, sequence) - if err != nil { - return nil, errorsmod.Wrap(err, "failed to sign tx") - } - - err = txBuilder.SetSignatures(signature) - if err != nil { - return nil, errorsmod.Wrap(err, "failed to set tx signatures") + if err := tf.signWithPrivKey(privKey, txBuilder, signerData, signMode); err != nil { + return nil, errorsmod.Wrap(err, "failed to sign Cosmos Tx") } return txBuilder, nil } // calculateFees calculates the fees for the transaction. -func (tf *IntegrationTxFactory) calculateFees(gasPrice *sdkmath.Int, gasLimit uint64) (sdktypes.Coins, error) { +func (tf *baseTxFactory) calculateFees(gasPrice *sdkmath.Int, gasLimit uint64) (sdktypes.Coins, error) { denom := tf.network.GetDenom() var fees sdktypes.Coins if gasPrice != nil { - fees = sdktypes.Coins{{Denom: denom, Amount: gasPrice.MulRaw(int64(gasLimit))}} //#nosec G115 -- int overflow is not a concern here -- block number is not likely to exceed int64 max value + fees = sdktypes.Coins{{Denom: denom, Amount: gasPrice.MulRaw(int64(gasLimit))}} //#nosec G115 } else { - baseFee, err := tf.grpcHandler.GetBaseFee() + resp, err := tf.grpcHandler.GetBaseFee() if err != nil { return sdktypes.Coins{}, errorsmod.Wrap(err, "failed to get base fee") } - price := baseFee.BaseFee - fees = sdktypes.Coins{{Denom: denom, Amount: price.MulRaw(int64(gasLimit))}} //#nosec G115 -- int overflow is not a concern here -- gas limit is not going to exceed int64 max value + price := resp.BaseFee + fees = sdktypes.Coins{{Denom: denom, Amount: price.MulRaw(int64(gasLimit))}} //#nosec G115 } return fees, nil } // estimateGas estimates the gas needed for the transaction. -func (tf *IntegrationTxFactory) estimateGas(txArgs CosmosTxArgs, txBuilder client.TxBuilder) (uint64, error) { +func (tf *baseTxFactory) estimateGas(txArgs CosmosTxArgs, txBuilder client.TxBuilder) (uint64, error) { txConfig := tf.ec.TxConfig simulateBytes, err := txConfig.TxEncoder()(txBuilder.GetTx()) if err != nil { @@ -120,7 +103,7 @@ func (tf *IntegrationTxFactory) estimateGas(txArgs CosmosTxArgs, txBuilder clien } var gasLimit uint64 - if txArgs.Gas == 0 { + if txArgs.Gas == nil { simulateRes, err := tf.network.Simulate(simulateBytes) if err != nil { return 0, errorsmod.Wrap(err, "failed to simulate tx") @@ -130,17 +113,7 @@ func (tf *IntegrationTxFactory) estimateGas(txArgs CosmosTxArgs, txBuilder clien gasUsed := new(big.Float).SetUint64(simulateRes.GasInfo.GasUsed) gasLimit, _ = gasAdj.Mul(gasAdj, gasUsed).Uint64() } else { - gasLimit = txArgs.Gas + gasLimit = *txArgs.Gas } return gasLimit, nil } - -// encodeTx encodes the tx using the txConfig's encoder. -func (tf *IntegrationTxFactory) encodeTx(tx sdktypes.Tx) ([]byte, error) { - txConfig := tf.ec.TxConfig - txBytes, err := txConfig.TxEncoder()(tx) - if err != nil { - return nil, errorsmod.Wrap(err, "failed to encode tx") - } - return txBytes, nil -} diff --git a/testutil/integration/common/factory/sign.go b/testutil/integration/common/factory/sign.go new file mode 100644 index 00000000..6686dfe0 --- /dev/null +++ b/testutil/integration/common/factory/sign.go @@ -0,0 +1,58 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package factory + +import ( + "context" + + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/client" + cosmostx "github.com/cosmos/cosmos-sdk/client/tx" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdktypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" +) + +// setSignatures is a helper function that sets the signature for +// the transaction in the tx builder. It returns the signerData to be used +// when signing the transaction (e.g. when calling signWithPrivKey) +func (tf *baseTxFactory) setSignatures(privKey cryptotypes.PrivKey, txBuilder client.TxBuilder, signMode signing.SignMode) (signerData authsigning.SignerData, err error) { + senderAddress := sdktypes.AccAddress(privKey.PubKey().Address().Bytes()) + account, err := tf.grpcHandler.GetAccount(senderAddress.String()) + if err != nil { + return signerData, err + } + sequence := account.GetSequence() + signerData = authsigning.SignerData{ + ChainID: tf.network.GetChainID(), + AccountNumber: account.GetAccountNumber(), + Sequence: sequence, + Address: senderAddress.String(), + PubKey: privKey.PubKey(), + } + + sigsV2 := signing.SignatureV2{ + PubKey: privKey.PubKey(), + Data: &signing.SingleSignatureData{ + SignMode: signMode, + Signature: nil, + }, + Sequence: sequence, + } + + return signerData, txBuilder.SetSignatures(sigsV2) +} + +// signWithPrivKey is a helper function that signs a transaction +// with the provided private key +func (tf *baseTxFactory) signWithPrivKey(privKey cryptotypes.PrivKey, txBuilder client.TxBuilder, signerData authsigning.SignerData, signMode signing.SignMode) error { + txConfig := tf.ec.TxConfig + signature, err := cosmostx.SignWithPrivKey(context.TODO(), signMode, signerData, txBuilder, privKey, txConfig, signerData.Sequence) + if err != nil { + return errorsmod.Wrap(err, "failed to sign tx") + } + + return txBuilder.SetSignatures(signature) +} diff --git a/testutil/integration/common/factory/staking.go b/testutil/integration/common/factory/staking.go new file mode 100644 index 00000000..72799a4d --- /dev/null +++ b/testutil/integration/common/factory/staking.go @@ -0,0 +1,88 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package factory + +import ( + "fmt" + + "cosmossdk.io/math" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +type StakingTxFactory interface { + // Delegate is a method to create and execute a MsgDelegate paying always the same fee amount + // The tx is included in a block and committed in the chain state + Delegate(delegatorPriv cryptotypes.PrivKey, validatorAddr string, amount sdk.Coin) error + // CreateValidator is a method to create and broadcast a MsgCreateValidator + CreateValidator(operatorPriv cryptotypes.PrivKey, pubKey cryptotypes.PubKey, selfDelegation sdk.Coin, description stakingtypes.Description, commission stakingtypes.CommissionRates, minSelfDelegation math.Int) error +} + +type stakingTxFactory struct { + BaseTxFactory +} + +func newStakingTxFactory(bf BaseTxFactory) StakingTxFactory { + return &stakingTxFactory{bf} +} + +// Delegate on behalf of the account associated with the given private key. +// The defined amount will delegated to the specified validator. +// The validator address should be in the format `evmosvaloper1...`. +func (tf *stakingTxFactory) Delegate(delegatorPriv cryptotypes.PrivKey, validatorAddr string, amount sdk.Coin) error { + delegatorAccAddr := sdk.AccAddress(delegatorPriv.PubKey().Address()) + + msgDelegate := stakingtypes.NewMsgDelegate( + delegatorAccAddr.String(), + validatorAddr, + amount, + ) + + // set gas and gas prices to pay the same fees + // every time this function is called + feesToPay := math.NewInt(1e16) + gas := uint64(400_000) + gasPrice := feesToPay.QuoRaw(int64(gas)) //#nosec G115 -- gas will not exceed int64 + + res, err := tf.CommitCosmosTx(delegatorPriv, CosmosTxArgs{ + Msgs: []sdk.Msg{msgDelegate}, + Gas: &gas, + GasPrice: &gasPrice, + }) + + if res.IsErr() { + return fmt.Errorf("tx result with code %d. Logs: %s", res.Code, res.Log) + } + + return err +} + +// CreateValidator executes the transaction to create a validator +// with the parameters specified +func (tf *stakingTxFactory) CreateValidator(operatorPriv cryptotypes.PrivKey, pubKey cryptotypes.PubKey, selfDelegation sdk.Coin, description stakingtypes.Description, commission stakingtypes.CommissionRates, minSelfDelegation math.Int) error { + operatorAccAddr := sdk.ValAddress(operatorPriv.PubKey().Address()) + + msgCreateValidator, err := stakingtypes.NewMsgCreateValidator( + operatorAccAddr.String(), + pubKey, + selfDelegation, + description, + commission, + minSelfDelegation, + ) + if err != nil { + return err + } + + resp, err := tf.ExecuteCosmosTx(operatorPriv, CosmosTxArgs{ + Msgs: []sdk.Msg{msgCreateValidator}, + }) + + if resp.Code != 0 { + err = fmt.Errorf("received error code %d on CreateValidator transaction. Logs: %s", resp.Code, resp.Log) + } + + return err +} diff --git a/testutil/integration/common/factory/types.go b/testutil/integration/common/factory/types.go index ca13426c..abd35161 100644 --- a/testutil/integration/common/factory/types.go +++ b/testutil/integration/common/factory/types.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package factory import ( @@ -12,7 +13,7 @@ type CosmosTxArgs struct { // ChainID is the chain's id in cosmos format, e.g. 'evmos_9000-1' ChainID string // Gas to be used on the tx - Gas uint64 + Gas *uint64 // GasPrice to use on tx GasPrice *sdkmath.Int // Fees is the fee to be used on the tx (amount and denom) diff --git a/testutil/integration/common/grpc/account.go b/testutil/integration/common/grpc/account.go index 7291baa6..38777290 100644 --- a/testutil/integration/common/grpc/account.go +++ b/testutil/integration/common/grpc/account.go @@ -1,17 +1,17 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package grpc import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/evmos/os/encoding" - exampleapp "github.com/evmos/os/example_chain" ) // GetAccount returns the account for the given address. -func (gqh *IntegrationHandler) GetAccount(address string) (authtypes.AccountI, error) { +func (gqh *IntegrationHandler) GetAccount(address string) (sdk.AccountI, error) { authClient := gqh.network.GetAuthClient() res, err := authClient.Account(context.Background(), &authtypes.QueryAccountRequest{ Address: address, @@ -20,8 +20,8 @@ func (gqh *IntegrationHandler) GetAccount(address string) (authtypes.AccountI, e return nil, err } - encodingCgf := encoding.MakeConfig(exampleapp.ModuleBasics) - var acc authtypes.AccountI + encodingCgf := gqh.network.GetEncodingConfig() + var acc sdk.AccountI if err = encodingCgf.InterfaceRegistry.UnpackAny(res.Account, &acc); err != nil { return nil, err } diff --git a/testutil/integration/common/grpc/authz.go b/testutil/integration/common/grpc/authz.go index 80f1951d..bd60044e 100644 --- a/testutil/integration/common/grpc/authz.go +++ b/testutil/integration/common/grpc/authz.go @@ -7,8 +7,6 @@ import ( "context" "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/evmos/os/encoding" - exampleapp "github.com/evmos/os/example_chain" ) // GetGrants returns the grants for the given grantee and granter combination. @@ -59,7 +57,7 @@ func (gqh *IntegrationHandler) GetGrantsByGranter(granter string) ([]*authz.Gran // GetAuthorizations returns the concrete authorizations for the given grantee and granter combination. func (gqh *IntegrationHandler) GetAuthorizations(grantee, granter string) ([]authz.Authorization, error) { - encodingCfg := encoding.MakeConfig(exampleapp.ModuleBasics) + encodingCfg := gqh.network.GetEncodingConfig() grants, err := gqh.GetGrants(grantee, granter) if err != nil { @@ -87,7 +85,7 @@ func (gqh *IntegrationHandler) GetAuthorizationsByGrantee(grantee string) ([]aut return nil, err } - return unpackGrantAuthzs(grants) + return gqh.unpackGrantAuthzs(grants) } // GetAuthorizationsByGranter returns the concrete authorizations for the given granter. @@ -97,12 +95,12 @@ func (gqh *IntegrationHandler) GetAuthorizationsByGranter(granter string) ([]aut return nil, err } - return unpackGrantAuthzs(grants) + return gqh.unpackGrantAuthzs(grants) } // unpackGrantAuthzs unpacks the given grant authorization. -func unpackGrantAuthzs(grantAuthzs []*authz.GrantAuthorization) ([]authz.Authorization, error) { - encodingCfg := encoding.MakeConfig(exampleapp.ModuleBasics) +func (gqh *IntegrationHandler) unpackGrantAuthzs(grantAuthzs []*authz.GrantAuthorization) ([]authz.Authorization, error) { + encodingCfg := gqh.network.GetEncodingConfig() auths := make([]authz.Authorization, 0, len(grantAuthzs)) for _, grantAuthz := range grantAuthzs { diff --git a/testutil/integration/common/grpc/bank.go b/testutil/integration/common/grpc/bank.go index cc988f85..2d6675e9 100644 --- a/testutil/integration/common/grpc/bank.go +++ b/testutil/integration/common/grpc/bank.go @@ -26,3 +26,15 @@ func (gqh *IntegrationHandler) GetAllBalances(address sdktypes.AccAddress) (*ban Address: address.String(), }) } + +// GetTotalSupply returns all the balances for the given address. +func (gqh *IntegrationHandler) GetTotalSupply() (*banktypes.QueryTotalSupplyResponse, error) { + bankClient := gqh.network.GetBankClient() + return bankClient.TotalSupply(context.Background(), &banktypes.QueryTotalSupplyRequest{}) +} + +// GetSpendableBalance returns the spendable balance for the given denomination. +func (gqh *IntegrationHandler) GetSpendableBalance(address sdktypes.AccAddress, denom string) (*banktypes.QuerySpendableBalanceByDenomResponse, error) { + bankClient := gqh.network.GetBankClient() + return bankClient.SpendableBalanceByDenom(context.Background(), &banktypes.QuerySpendableBalanceByDenomRequest{Address: address.String(), Denom: denom}) +} diff --git a/testutil/integration/common/grpc/distribution.go b/testutil/integration/common/grpc/distribution.go new file mode 100644 index 00000000..6b67be85 --- /dev/null +++ b/testutil/integration/common/grpc/distribution.go @@ -0,0 +1,57 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package grpc + +import ( + "context" + + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" +) + +// GetDelegationTotalRewards returns the total delegation rewards for the given delegator. +func (gqh *IntegrationHandler) GetDelegationTotalRewards(delegatorAddress string) (*distrtypes.QueryDelegationTotalRewardsResponse, error) { + distrClient := gqh.network.GetDistrClient() + return distrClient.DelegationTotalRewards(context.Background(), &distrtypes.QueryDelegationTotalRewardsRequest{ + DelegatorAddress: delegatorAddress, + }) +} + +// GetDelegationRewards returns the delegation rewards for the given delegator and validator. +func (gqh *IntegrationHandler) GetDelegationRewards(delegatorAddress string, validatorAddress string) (*distrtypes.QueryDelegationRewardsResponse, error) { + distrClient := gqh.network.GetDistrClient() + return distrClient.DelegationRewards(context.Background(), &distrtypes.QueryDelegationRewardsRequest{ + DelegatorAddress: delegatorAddress, + ValidatorAddress: validatorAddress, + }) +} + +// GetDelegatorWithdrawAddr returns the withdraw address the given delegator. +func (gqh *IntegrationHandler) GetDelegatorWithdrawAddr(delegatorAddress string) (*distrtypes.QueryDelegatorWithdrawAddressResponse, error) { + distrClient := gqh.network.GetDistrClient() + return distrClient.DelegatorWithdrawAddress(context.Background(), &distrtypes.QueryDelegatorWithdrawAddressRequest{ + DelegatorAddress: delegatorAddress, + }) +} + +// GetValidatorCommission returns the commission for the given validator. +func (gqh *IntegrationHandler) GetValidatorCommission(validatorAddress string) (*distrtypes.QueryValidatorCommissionResponse, error) { + distrClient := gqh.network.GetDistrClient() + return distrClient.ValidatorCommission(context.Background(), &distrtypes.QueryValidatorCommissionRequest{ + ValidatorAddress: validatorAddress, + }) +} + +// GetValidatorOutstandingRewards returns the delegation rewards for the given delegator and validator. +func (gqh *IntegrationHandler) GetValidatorOutstandingRewards(validatorAddress string) (*distrtypes.QueryValidatorOutstandingRewardsResponse, error) { + distrClient := gqh.network.GetDistrClient() + return distrClient.ValidatorOutstandingRewards(context.Background(), &distrtypes.QueryValidatorOutstandingRewardsRequest{ + ValidatorAddress: validatorAddress, + }) +} + +// GetCommunityPool queries the community pool coins. +func (gqh *IntegrationHandler) GetCommunityPool() (*distrtypes.QueryCommunityPoolResponse, error) { + distrClient := gqh.network.GetDistrClient() + return distrClient.CommunityPool(context.Background(), &distrtypes.QueryCommunityPoolRequest{}) +} diff --git a/testutil/integration/common/grpc/grpc.go b/testutil/integration/common/grpc/grpc.go index f2a5eaac..1d0ba86e 100644 --- a/testutil/integration/common/grpc/grpc.go +++ b/testutil/integration/common/grpc/grpc.go @@ -4,10 +4,10 @@ package grpc import ( - sdktypes "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/evmos/os/testutil/integration/common/network" ) @@ -16,7 +16,7 @@ import ( // the network's modules via gRPC. type Handler interface { // Account methods - GetAccount(address string) (authtypes.AccountI, error) + GetAccount(address string) (sdk.AccountI, error) // Authz methods GetAuthorizations(grantee, granter string) ([]authz.Authorization, error) @@ -27,11 +27,26 @@ type Handler interface { GetGrantsByGranter(granter string) ([]*authz.GrantAuthorization, error) // Bank methods - GetBalance(address sdktypes.AccAddress, denom string) (*banktypes.QueryBalanceResponse, error) - GetAllBalances(address sdktypes.AccAddress) (*banktypes.QueryAllBalancesResponse, error) + GetBalance(address sdk.AccAddress, denom string) (*banktypes.QueryBalanceResponse, error) + GetSpendableBalance(address sdk.AccAddress, denom string) (*banktypes.QuerySpendableBalanceByDenomResponse, error) + GetAllBalances(address sdk.AccAddress) (*banktypes.QueryAllBalancesResponse, error) + GetTotalSupply() (*banktypes.QueryTotalSupplyResponse, error) // Staking methods GetDelegation(delegatorAddress string, validatorAddress string) (*stakingtypes.QueryDelegationResponse, error) + GetDelegatorDelegations(delegatorAddress string) (*stakingtypes.QueryDelegatorDelegationsResponse, error) + GetValidatorDelegations(validatorAddress string) (*stakingtypes.QueryValidatorDelegationsResponse, error) + GetRedelegations(delegatorAddress, srcValidator, dstValidator string) (*stakingtypes.QueryRedelegationsResponse, error) + GetValidatorUnbondingDelegations(validatorAddress string) (*stakingtypes.QueryValidatorUnbondingDelegationsResponse, error) + GetDelegatorUnbondingDelegations(delegatorAddress string) (*stakingtypes.QueryDelegatorUnbondingDelegationsResponse, error) + + // Distribution methods + GetDelegationTotalRewards(delegatorAddress string) (*distrtypes.QueryDelegationTotalRewardsResponse, error) + GetDelegationRewards(delegatorAddress string, validatorAddress string) (*distrtypes.QueryDelegationRewardsResponse, error) + GetDelegatorWithdrawAddr(delegatorAddress string) (*distrtypes.QueryDelegatorWithdrawAddressResponse, error) + GetValidatorCommission(validatorAddress string) (*distrtypes.QueryValidatorCommissionResponse, error) + GetValidatorOutstandingRewards(validatorAddress string) (*distrtypes.QueryValidatorOutstandingRewardsResponse, error) + GetCommunityPool() (*distrtypes.QueryCommunityPoolResponse, error) GetBondedValidators() (*stakingtypes.QueryValidatorsResponse, error) } diff --git a/testutil/integration/common/grpc/staking.go b/testutil/integration/common/grpc/staking.go index 003e22bd..0d959346 100644 --- a/testutil/integration/common/grpc/staking.go +++ b/testutil/integration/common/grpc/staking.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package grpc import ( @@ -8,7 +9,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) -// GetBalance returns the balance for the given address. +// GetDelegation returns the delegation for the given delegator and validator addresses. func (gqh *IntegrationHandler) GetDelegation(delegatorAddress string, validatorAddress string) (*stakingtypes.QueryDelegationResponse, error) { stakingClient := gqh.network.GetStakingClient() return stakingClient.Delegation(context.Background(), &stakingtypes.QueryDelegationRequest{ @@ -17,6 +18,48 @@ func (gqh *IntegrationHandler) GetDelegation(delegatorAddress string, validatorA }) } +// GetValidatorDelegations returns the delegations to a given validator. +func (gqh *IntegrationHandler) GetValidatorDelegations(validatorAddress string) (*stakingtypes.QueryValidatorDelegationsResponse, error) { + stakingClient := gqh.network.GetStakingClient() + return stakingClient.ValidatorDelegations(context.Background(), &stakingtypes.QueryValidatorDelegationsRequest{ + ValidatorAddr: validatorAddress, + }) +} + +// GetDelegatorDelegations returns the delegations to a given delegator. +func (gqh *IntegrationHandler) GetDelegatorDelegations(delegatorAddress string) (*stakingtypes.QueryDelegatorDelegationsResponse, error) { + stakingClient := gqh.network.GetStakingClient() + return stakingClient.DelegatorDelegations(context.Background(), &stakingtypes.QueryDelegatorDelegationsRequest{ + DelegatorAddr: delegatorAddress, + }) +} + +// GetRedelegations returns the redelegations to a given delegator and validators. +func (gqh *IntegrationHandler) GetRedelegations(delegatorAddress, srcValidator, dstValidator string) (*stakingtypes.QueryRedelegationsResponse, error) { + stakingClient := gqh.network.GetStakingClient() + return stakingClient.Redelegations(context.Background(), &stakingtypes.QueryRedelegationsRequest{ + DelegatorAddr: delegatorAddress, + SrcValidatorAddr: srcValidator, + DstValidatorAddr: dstValidator, + }) +} + +// GetValidatorUnbondingDelegations returns the unbonding delegations to a given validator. +func (gqh *IntegrationHandler) GetValidatorUnbondingDelegations(validatorAddress string) (*stakingtypes.QueryValidatorUnbondingDelegationsResponse, error) { + stakingClient := gqh.network.GetStakingClient() + return stakingClient.ValidatorUnbondingDelegations(context.Background(), &stakingtypes.QueryValidatorUnbondingDelegationsRequest{ + ValidatorAddr: validatorAddress, + }) +} + +// GetDelegatorUnbondingDelegations returns all the unbonding delegations for given delegator. +func (gqh *IntegrationHandler) GetDelegatorUnbondingDelegations(delegatorAddress string) (*stakingtypes.QueryDelegatorUnbondingDelegationsResponse, error) { + stakingClient := gqh.network.GetStakingClient() + return stakingClient.DelegatorUnbondingDelegations(context.Background(), &stakingtypes.QueryDelegatorUnbondingDelegationsRequest{ + DelegatorAddr: delegatorAddress, + }) +} + // GetValidators returns the list of all bonded validators. func (gqh *IntegrationHandler) GetBondedValidators() (*stakingtypes.QueryValidatorsResponse, error) { stakingClient := gqh.network.GetStakingClient() diff --git a/testutil/integration/common/network/network.go b/testutil/integration/common/network/network.go index 52c77ba1..b75cf2c8 100644 --- a/testutil/integration/common/network/network.go +++ b/testutil/integration/common/network/network.go @@ -9,12 +9,14 @@ import ( abcitypes "github.com/cometbft/cometbft/abci/types" sdktypes "github.com/cosmos/cosmos-sdk/types" + sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" txtypes "github.com/cosmos/cosmos-sdk/types/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/authz" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + ibctesting "github.com/cosmos/ibc-go/v8/testing" ) // Network is the interface that wraps the common methods to interact with integration test network. @@ -25,22 +27,27 @@ type Network interface { GetContext() sdktypes.Context GetChainID() string GetDenom() string + GetOtherDenoms() []string GetValidators() []stakingtypes.Validator NextBlock() error NextBlockAfter(duration time.Duration) error + NextBlockWithTxs(txBytes ...[]byte) (*abcitypes.ResponseFinalizeBlock, error) // Clients GetAuthClient() authtypes.QueryClient GetAuthzClient() authz.QueryClient GetBankClient() banktypes.QueryClient GetStakingClient() stakingtypes.QueryClient + GetDistrClient() distrtypes.QueryClient - BroadcastTxSync(txBytes []byte) (abcitypes.ResponseDeliverTx, error) + BroadcastTxSync(txBytes []byte) (abcitypes.ExecTxResult, error) Simulate(txBytes []byte) (*txtypes.SimulateResponse, error) + CheckTx(txBytes []byte) (*abcitypes.ResponseCheckTx, error) // GetIBCChain returns the IBC test chain. // NOTE: this is only used for testing IBC related functionality. // The idea is to deprecate this eventually. GetIBCChain(t *testing.T, coord *ibctesting.Coordinator) *ibctesting.TestChain + GetEncodingConfig() sdktestutil.TestEncodingConfig } diff --git a/testutil/integration/ibc/chain/chain.go b/testutil/integration/ibc/chain/chain.go index 7f750877..1c88773d 100644 --- a/testutil/integration/ibc/chain/chain.go +++ b/testutil/integration/ibc/chain/chain.go @@ -1,19 +1,21 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package chain import ( "time" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" sdktypes "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" - "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - "github.com/cosmos/ibc-go/v7/testing/simapp" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + // For now, we'll keep this. Pending to review if we can remove it. + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types" + "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" + ibctesting "github.com/cosmos/ibc-go/v8/testing" + "github.com/cosmos/ibc-go/v8/testing/simapp" ) // Chain defines the required methods needed for a testing IBC chain that complies @@ -54,7 +56,7 @@ type Chain interface { GetConsensusState(clientID string, height exported.Height) (exported.ConsensusState, bool) // GetValsAtHeight will return the trusted validator set of the chain for the given trusted height. It will return // a success boolean depending on if the validator set exists or not at that height. - GetValsAtHeight(trustedHeight int64) (*tmtypes.ValidatorSet, bool) + GetValsAtHeight(trustedHeight int64) (*cmttypes.ValidatorSet, bool) // GetAcknowledgement retrieves an acknowledgement for the provided packet. If the // acknowledgement does not exist then testing will fail. GetAcknowledgement(packet exported.PacketI) []byte @@ -74,7 +76,7 @@ type Chain interface { // GetChannelCapability returns the channel capability for the given portID and channelID. // The capability must exist, otherwise testing will fail. GetChannelCapability(portID, channelID string) *capabilitytypes.Capability - // GetTimeoutHeight is a convenience function which returns a IBC packet timeout height + // GetTimeoutHeight is a convenience function which returns an IBC packet timeout height // to be used for testing. It returns the current IBC height + 100 blocks GetTimeoutHeight() clienttypes.Height } diff --git a/testutil/integration/ibc/coordinator/coordinator.go b/testutil/integration/ibc/coordinator/coordinator.go index 227e7e1a..7ea68b6d 100644 --- a/testutil/integration/ibc/coordinator/coordinator.go +++ b/testutil/integration/ibc/coordinator/coordinator.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package coordinator import ( @@ -7,8 +8,8 @@ import ( "time" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + sdk "github.com/cosmos/cosmos-sdk/types" + ibctesting "github.com/cosmos/ibc-go/v8/testing" evmosibc "github.com/evmos/os/ibc/testing" "github.com/evmos/os/testutil/integration/common/network" ibcchain "github.com/evmos/os/testutil/integration/ibc/chain" @@ -28,8 +29,12 @@ type Coordinator interface { GetChain(chainID string) ibcchain.Chain // GetDummyChainsIDs returns the chainIDs for all dummy chains. GetDummyChainsIDs() []string + // GetPath returns the transfer path for the chain ids 'a' and 'b' + GetPath(a, b string) *evmosibc.Path + // GetChainSenderAcc returns the sender account for the specified chain + GetChainSenderAcc(chainID string) sdk.AccountI // SetDefaultSignerForChain sets the default signer for the chain with the given chainID. - SetDefaultSignerForChain(chainID string, priv cryptotypes.PrivKey, acc authtypes.AccountI) + SetDefaultSignerForChain(chainID string, priv cryptotypes.PrivKey, acc sdk.AccountI) // Setup constructs a TM client, connection, and channel on both chains provided. It will // fail if any error occurs. The clientID's, TestConnections, and TestChannels are returned // for both chains. The channels created are connected to the ibc-transfer application. @@ -85,6 +90,19 @@ func (c *IntegrationCoordinator) GetDummyChainsIDs() []string { return c.dummyChainsIDs } +// GetPath returns the transfer path for the chain ids 'a' and 'b' +func (c *IntegrationCoordinator) GetPath(a, b string) *evmosibc.Path { + chainA := c.coord.GetChain(a) + chainB := c.coord.GetChain(b) + + return evmosibc.NewTransferPath(chainA, chainB) +} + +// GetChain returns the TestChain for a given chainID. +func (c *IntegrationCoordinator) GetChainSenderAcc(chainID string) sdk.AccountI { + return c.coord.Chains[chainID].SenderAccount +} + // IncrementTime iterates through all the TestChain's and increments their current header time // by 5 seconds. func (c *IntegrationCoordinator) IncrementTime() { @@ -103,7 +121,7 @@ func (c *IntegrationCoordinator) UpdateTimeForChain(chainID string) { } // SetDefaultSignerForChain sets the default signer for the chain with the given chainID. -func (c *IntegrationCoordinator) SetDefaultSignerForChain(chainID string, priv cryptotypes.PrivKey, acc authtypes.AccountI) { +func (c *IntegrationCoordinator) SetDefaultSignerForChain(chainID string, priv cryptotypes.PrivKey, acc sdk.AccountI) { chain := c.coord.GetChain(chainID) chain.SenderPrivKey = priv chain.SenderAccount = acc @@ -114,10 +132,7 @@ func (c *IntegrationCoordinator) SetDefaultSignerForChain(chainID string, priv c // fail if any error occurs. The clientID's, TestConnections, and TestChannels are returned // for both chains. The channels created are connected to the ibc-transfer application. func (c *IntegrationCoordinator) Setup(a, b string) IBCConnection { - chainA := c.coord.GetChain(a) - chainB := c.coord.GetChain(b) - - path := evmosibc.NewTransferPath(chainA, chainB) + path := c.GetPath(a, b) evmosibc.SetupPath(c.coord, path) return IBCConnection{ diff --git a/testutil/integration/ibc/coordinator/utils.go b/testutil/integration/ibc/coordinator/utils.go index 8722be6d..e828bf31 100644 --- a/testutil/integration/ibc/coordinator/utils.go +++ b/testutil/integration/ibc/coordinator/utils.go @@ -1,12 +1,14 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package coordinator import ( "strconv" "testing" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + sdk "github.com/cosmos/cosmos-sdk/types" + ibctesting "github.com/cosmos/ibc-go/v8/testing" "github.com/evmos/os/testutil/integration/common/network" ) @@ -23,11 +25,22 @@ func getIBCChains(t *testing.T, coord *ibctesting.Coordinator, chains []network. func generateDummyChains(t *testing.T, coord *ibctesting.Coordinator, numberOfChains int) (map[string]*ibctesting.TestChain, []string) { ibcChains := make(map[string]*ibctesting.TestChain) ids := make([]string, numberOfChains) + // dummy chains use the ibc testing chain setup + // that uses the default sdk address prefix ('cosmos') + // Update the prefix configs to use that prefix + cfg := sdk.GetConfig() + cfg.SetBech32PrefixForAccount(sdk.Bech32PrefixAccAddr, sdk.Bech32PrefixAccPub) + cfg.SetBech32PrefixForValidator(sdk.Bech32PrefixValAddr, sdk.Bech32PrefixValPub) + cfg.SetBech32PrefixForConsensusNode(sdk.Bech32PrefixConsAddr, sdk.Bech32PrefixConsPub) + // Also need to disable address cache to avoid using modules + // accounts with 'evmos' addresses (because Evmos chain setup is first) + sdk.SetAddrCacheEnabled(false) for i := 1; i <= numberOfChains; i++ { chainID := "dummychain-" + strconv.Itoa(i) ids[i-1] = chainID ibcChains[chainID] = ibctesting.NewTestChain(t, coord, chainID) } + return ibcChains, ids } diff --git a/testutil/integration/os/factory/broadcast.go b/testutil/integration/os/factory/broadcast.go index ea0f30be..81531ea4 100644 --- a/testutil/integration/os/factory/broadcast.go +++ b/testutil/integration/os/factory/broadcast.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package factory import ( @@ -17,20 +18,20 @@ import ( func (tf *IntegrationTxFactory) ExecuteEthTx( priv cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs, -) (abcitypes.ResponseDeliverTx, error) { +) (abcitypes.ExecTxResult, error) { signedMsg, err := tf.GenerateSignedEthTx(priv, txArgs) if err != nil { - return abcitypes.ResponseDeliverTx{}, errorsmod.Wrap(err, "failed to generate signed ethereum tx") + return abcitypes.ExecTxResult{}, errorsmod.Wrap(err, "failed to generate signed ethereum tx") } txBytes, err := tf.encodeTx(signedMsg) if err != nil { - return abcitypes.ResponseDeliverTx{}, errorsmod.Wrap(err, "failed to encode ethereum tx") + return abcitypes.ExecTxResult{}, errorsmod.Wrap(err, "failed to encode ethereum tx") } res, err := tf.network.BroadcastTxSync(txBytes) if err != nil { - return abcitypes.ResponseDeliverTx{}, errorsmod.Wrap(err, "failed to broadcast ethereum tx") + return abcitypes.ExecTxResult{}, errorsmod.Wrap(err, "failed to broadcast ethereum tx") } if err := tf.checkEthTxResponse(&res); err != nil { @@ -40,10 +41,10 @@ func (tf *IntegrationTxFactory) ExecuteEthTx( } // ExecuteContractCall executes a contract call with the provided private key. -func (tf *IntegrationTxFactory) ExecuteContractCall(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs, callArgs CallArgs) (abcitypes.ResponseDeliverTx, error) { +func (tf *IntegrationTxFactory) ExecuteContractCall(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs, callArgs CallArgs) (abcitypes.ExecTxResult, error) { completeTxArgs, err := tf.GenerateContractCallArgs(txArgs, callArgs) if err != nil { - return abcitypes.ResponseDeliverTx{}, errorsmod.Wrap(err, "failed to generate contract call args") + return abcitypes.ExecTxResult{}, errorsmod.Wrap(err, "failed to generate contract call args") } return tf.ExecuteEthTx(privKey, completeTxArgs) @@ -81,18 +82,18 @@ func (tf *IntegrationTxFactory) CallContractAndCheckLogs( txArgs evmtypes.EvmTxArgs, callArgs CallArgs, logCheckArgs testutil.LogCheckArgs, -) (abcitypes.ResponseDeliverTx, *evmtypes.MsgEthereumTxResponse, error) { +) (abcitypes.ExecTxResult, *evmtypes.MsgEthereumTxResponse, error) { res, err := tf.ExecuteContractCall(priv, txArgs, callArgs) logCheckArgs.Res = res if err != nil { // NOTE: here we are still passing the response to the log check function, // because we want to check the logs and expected error in case of a VM error. - return abcitypes.ResponseDeliverTx{}, nil, CheckError(err, logCheckArgs) + return res, nil, CheckError(err, logCheckArgs) } ethRes, err := evmtypes.DecodeTxResponse(res.Data) if err != nil { - return abcitypes.ResponseDeliverTx{}, nil, err + return res, nil, err } return res, ethRes, testutil.CheckLogs(logCheckArgs) diff --git a/testutil/integration/os/factory/build.go b/testutil/integration/os/factory/build.go index 25558e39..7f9fc8e7 100644 --- a/testutil/integration/os/factory/build.go +++ b/testutil/integration/os/factory/build.go @@ -55,19 +55,15 @@ func (tf *IntegrationTxFactory) EstimateGasLimit(from *common.Address, txArgs *e return 0, errorsmod.Wrap(err, "failed to estimate gas") } gas := res.Gas + return gas, nil } // GenerateSignedEthTx generates an Ethereum tx with the provided private key and txArgs but does not broadcast it. func (tf *IntegrationTxFactory) GenerateSignedEthTx(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs) (signing.Tx, error) { - msgEthereumTx, err := tf.GenerateMsgEthereumTx(privKey, txArgs) - if err != nil { - return nil, errorsmod.Wrap(err, "failed to create ethereum tx") - } - - signedMsg, err := tf.SignMsgEthereumTx(privKey, msgEthereumTx) + signedMsg, err := tf.GenerateSignedMsgEthereumTx(privKey, txArgs) if err != nil { - return nil, errorsmod.Wrap(err, "failed to sign ethereum tx") + return nil, errorsmod.Wrap(err, "failed to generate signed MsgEthereumTx") } // Validate the transaction to avoid unrealistic behavior @@ -78,6 +74,16 @@ func (tf *IntegrationTxFactory) GenerateSignedEthTx(privKey cryptotypes.PrivKey, return tf.buildSignedTx(signedMsg) } +// GenerateSignedMsgEthereumTx generates an MsgEthereumTx signed with the provided private key and txArgs. +func (tf *IntegrationTxFactory) GenerateSignedMsgEthereumTx(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs) (evmtypes.MsgEthereumTx, error) { + msgEthereumTx, err := tf.GenerateMsgEthereumTx(privKey, txArgs) + if err != nil { + return evmtypes.MsgEthereumTx{}, errorsmod.Wrap(err, "failed to create ethereum tx") + } + + return tf.SignMsgEthereumTx(privKey, msgEthereumTx) +} + // GenerateMsgEthereumTx creates a new MsgEthereumTx with the provided arguments. // If any of the arguments are not provided, they will be populated with default values. func (tf *IntegrationTxFactory) GenerateMsgEthereumTx( diff --git a/testutil/integration/os/factory/factory.go b/testutil/integration/os/factory/factory.go index ab222399..b27ab5af 100644 --- a/testutil/integration/os/factory/factory.go +++ b/testutil/integration/os/factory/factory.go @@ -6,6 +6,7 @@ package factory import ( "fmt" "math/big" + "strings" errorsmod "cosmossdk.io/errors" abcitypes "github.com/cometbft/cometbft/abci/types" @@ -16,12 +17,11 @@ import ( "github.com/cosmos/gogoproto/proto" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" - exampleapp "github.com/evmos/os/example_chain" "github.com/evmos/os/precompiles/testutil" commonfactory "github.com/evmos/os/testutil/integration/common/factory" "github.com/evmos/os/testutil/integration/os/grpc" "github.com/evmos/os/testutil/integration/os/network" - "github.com/evmos/os/types" + "github.com/evmos/os/x/evm/core/vm" evmtypes "github.com/evmos/os/x/evm/types" ) @@ -29,21 +29,23 @@ import ( // network. // Methods are organized by build sign and broadcast type methods. type TxFactory interface { - commonfactory.TxFactory + commonfactory.CoreTxFactory // GenerateDefaultTxTypeArgs generates a default ETH tx args for the desired tx type GenerateDefaultTxTypeArgs(sender common.Address, txType int) (evmtypes.EvmTxArgs, error) // GenerateSignedEthTx generates an Ethereum tx with the provided private key and txArgs but does not broadcast it. GenerateSignedEthTx(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs) (signing.Tx, error) + // GenerateSignedMsgEthereumTx generates an MsgEthereumTx signed with the provided private key and txArgs. + GenerateSignedMsgEthereumTx(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs) (evmtypes.MsgEthereumTx, error) // SignMsgEthereumTx signs a MsgEthereumTx with the provided private key. SignMsgEthereumTx(privKey cryptotypes.PrivKey, msgEthereumTx evmtypes.MsgEthereumTx) (evmtypes.MsgEthereumTx, error) // ExecuteEthTx builds, signs and broadcasts an Ethereum tx with the provided private key and txArgs. // If the txArgs are not provided, they will be populated with default values or gas estimations. - ExecuteEthTx(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs) (abcitypes.ResponseDeliverTx, error) + ExecuteEthTx(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs) (abcitypes.ExecTxResult, error) // ExecuteContractCall executes a contract call with the provided private key - ExecuteContractCall(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs, callArgs CallArgs) (abcitypes.ResponseDeliverTx, error) + ExecuteContractCall(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs, callArgs CallArgs) (abcitypes.ExecTxResult, error) // DeployContract deploys a contract with the provided private key, // compiled contract data and constructor arguments DeployContract(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs, deploymentData ContractDeploymentData) (common.Address, error) @@ -52,7 +54,7 @@ type TxFactory interface { // // It returns the Cosmos Tx response, the decoded Ethereum Tx response and an error. This error value // is nil, if the expected logs are found and the VM error is the expected one, should one be expected. - CallContractAndCheckLogs(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs, callArgs CallArgs, logCheckArgs testutil.LogCheckArgs) (abcitypes.ResponseDeliverTx, *evmtypes.MsgEthereumTxResponse, error) + CallContractAndCheckLogs(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs, callArgs CallArgs, logCheckArgs testutil.LogCheckArgs) (abcitypes.ExecTxResult, *evmtypes.MsgEthereumTxResponse, error) // GenerateDeployContractArgs generates the txArgs for a contract deployment. GenerateDeployContractArgs(from common.Address, txArgs evmtypes.EvmTxArgs, deploymentData ContractDeploymentData) (evmtypes.EvmTxArgs, error) // GenerateContractCallArgs generates the txArgs for a contract call. @@ -61,10 +63,10 @@ type TxFactory interface { GenerateMsgEthereumTx(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs) (evmtypes.MsgEthereumTx, error) // GenerateGethCoreMsg creates a new GethCoreMsg with the provided arguments. GenerateGethCoreMsg(privKey cryptotypes.PrivKey, txArgs evmtypes.EvmTxArgs) (core.Message, error) - // EstimateGasLimit estimates the gas limit for a tx with the provided address and txArgs. + // EstimateGasLimit estimates the gas limit for a tx with the provided address and txArgs EstimateGasLimit(from *common.Address, txArgs *evmtypes.EvmTxArgs) (uint64, error) - // GetEvmTxResponseFromTxResult returns the MsgEthereumTxResponse from the provided txResult. - GetEvmTxResponseFromTxResult(txResult abcitypes.ResponseDeliverTx) (*evmtypes.MsgEthereumTxResponse, error) + // GetEvmTransactionResponseFromTxResult returns the MsgEthereumTxResponse from the provided txResult + GetEvmTransactionResponseFromTxResult(txResult abcitypes.ExecTxResult) (*evmtypes.MsgEthereumTxResponse, error) } var _ TxFactory = (*IntegrationTxFactory)(nil) @@ -72,10 +74,11 @@ var _ TxFactory = (*IntegrationTxFactory)(nil) // IntegrationTxFactory is a helper struct to build and broadcast transactions // to the network on integration tests. This is to simulate the behavior of a real user. type IntegrationTxFactory struct { - *commonfactory.IntegrationTxFactory + commonfactory.CoreTxFactory + grpcHandler grpc.Handler network network.Network - ec *testutiltypes.TestEncodingConfig + ec testutiltypes.TestEncodingConfig } // New creates a new IntegrationTxFactory instance @@ -83,20 +86,34 @@ func New( network network.Network, grpcHandler grpc.Handler, ) TxFactory { - ec := makeConfig(exampleapp.ModuleBasics) + cf := commonfactory.New(network, grpcHandler) return &IntegrationTxFactory{ - IntegrationTxFactory: commonfactory.New(network, grpcHandler, &ec), - grpcHandler: grpcHandler, - network: network, - ec: &ec, + CoreTxFactory: cf, + grpcHandler: grpcHandler, + network: network, + ec: network.GetEncodingConfig(), } } -// GetEvmTxResponseFromTxResult returns the MsgEthereumTxResponse from the provided txResult. -func (tf *IntegrationTxFactory) GetEvmTxResponseFromTxResult( - txResult abcitypes.ResponseDeliverTx, +// GetEvmTransactionResponseFromTxResult returns the MsgEthereumTxResponse from the provided txResult. +func (tf *IntegrationTxFactory) GetEvmTransactionResponseFromTxResult( + txResult abcitypes.ExecTxResult, ) (*evmtypes.MsgEthereumTxResponse, error) { - return evmtypes.DecodeTxResponse(txResult.Data) + var txData sdktypes.TxMsgData + if err := tf.ec.Codec.Unmarshal(txResult.Data, &txData); err != nil { + return nil, errorsmod.Wrap(err, "failed to unmarshal tx data") + } + + if len(txData.MsgResponses) != 1 { + return nil, fmt.Errorf("expected 1 message response, got %d", len(txData.MsgResponses)) + } + + var evmRes evmtypes.MsgEthereumTxResponse + if err := proto.Unmarshal(txData.MsgResponses[0].Value, &evmRes); err != nil { + return nil, errorsmod.Wrap(err, "failed to unmarshal evm tx response") + } + + return &evmRes, nil } // populateEvmTxArgsWithDefault populates the missing fields in the provided EvmTxArgs with default values. @@ -106,11 +123,7 @@ func (tf *IntegrationTxFactory) populateEvmTxArgsWithDefault( txArgs evmtypes.EvmTxArgs, ) (evmtypes.EvmTxArgs, error) { if txArgs.ChainID == nil { - ethChainID, err := types.ParseChainID(tf.network.GetChainID()) - if err != nil { - return evmtypes.EvmTxArgs{}, errorsmod.Wrapf(err, "failed to parse chain id: %v", tf.network.GetChainID()) - } - txArgs.ChainID = ethChainID + txArgs.ChainID = tf.network.GetEIP155ChainID() } if txArgs.Nonce == 0 { @@ -165,7 +178,7 @@ func (tf *IntegrationTxFactory) buildSignedTx(msg evmtypes.MsgEthereumTx) (signi } // checkEthTxResponse checks if the response is valid and returns the MsgEthereumTxResponse -func (tf *IntegrationTxFactory) checkEthTxResponse(res *abcitypes.ResponseDeliverTx) error { +func (tf *IntegrationTxFactory) checkEthTxResponse(res *abcitypes.ExecTxResult) error { var txData sdktypes.TxMsgData if !res.IsOK() { return fmt.Errorf("tx failed with Code: %d, Logs: %s", res.Code, res.Log) @@ -185,6 +198,10 @@ func (tf *IntegrationTxFactory) checkEthTxResponse(res *abcitypes.ResponseDelive return errorsmod.Wrap(err, "failed to unmarshal evm tx response") } + if strings.Contains(evmRes.VmError, vm.ErrOutOfGas.Error()) { + return fmt.Errorf("eth tx ran out of gas; gas used: %d", evmRes.GasUsed) + } + if evmRes.Failed() { return fmt.Errorf("tx failed with VmError: %v, Logs: %s", evmRes.VmError, res.GetLog()) } diff --git a/testutil/integration/os/factory/helpers.go b/testutil/integration/os/factory/helpers.go index 5bcfe74c..7ff4ad35 100644 --- a/testutil/integration/os/factory/helpers.go +++ b/testutil/integration/os/factory/helpers.go @@ -1,21 +1,15 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package factory import ( "strings" - "github.com/ethereum/go-ethereum/common" - evmtypes "github.com/evmos/os/x/evm/types" - errorsmod "cosmossdk.io/errors" - amino "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/types/module" - testutiltypes "github.com/cosmos/cosmos-sdk/types/module/testutil" - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - enccodec "github.com/evmos/os/encoding/codec" + "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/precompiles/testutil" + evmtypes "github.com/evmos/os/x/evm/types" ) // buildMsgEthereumTx builds an Ethereum transaction from the given arguments and populates the From field. @@ -25,26 +19,6 @@ func buildMsgEthereumTx(txArgs evmtypes.EvmTxArgs, fromAddr common.Address) evmt return *msgEthereumTx } -// makeConfig creates an EncodingConfig for testing -func makeConfig(mb module.BasicManager) testutiltypes.TestEncodingConfig { - cdc := amino.NewLegacyAmino() - interfaceRegistry := codectypes.NewInterfaceRegistry() - codec := amino.NewProtoCodec(interfaceRegistry) - - encodingConfig := testutiltypes.TestEncodingConfig{ - InterfaceRegistry: interfaceRegistry, - Codec: codec, - TxConfig: authtx.NewTxConfig(codec, authtx.DefaultSignModes), - Amino: cdc, - } - - enccodec.RegisterLegacyAminoCodec(encodingConfig.Amino) - mb.RegisterLegacyAminoCodec(encodingConfig.Amino) - enccodec.RegisterInterfaces(encodingConfig.InterfaceRegistry) - mb.RegisterInterfaces(encodingConfig.InterfaceRegistry) - return encodingConfig -} - // CheckError is a helper function to check if the error is the expected one. func CheckError(err error, logCheckArgs testutil.LogCheckArgs) error { switch { @@ -57,6 +31,8 @@ func CheckError(err error, logCheckArgs testutil.LogCheckArgs) error { case logCheckArgs.ErrContains == "": // NOTE: if err contains is empty, we return the error as it is return errorsmod.Wrap(err, "ErrContains needs to be filled") + case err == nil: + panic("unexpected state: err is nil; this should not happen") case !strings.Contains(err.Error(), logCheckArgs.ErrContains): return errorsmod.Wrapf(err, "expected different error; wanted %q", logCheckArgs.ErrContains) } diff --git a/testutil/integration/os/keyring/keyring.go b/testutil/integration/os/keyring/keyring.go index 58d1c465..29b9b6fd 100644 --- a/testutil/integration/os/keyring/keyring.go +++ b/testutil/integration/os/keyring/keyring.go @@ -1,14 +1,14 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package keyring import ( "fmt" - "github.com/ethereum/go-ethereum/common" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdktypes "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" utiltx "github.com/evmos/os/testutil/tx" ) @@ -38,6 +38,8 @@ type Keyring interface { GetAllAccAddrs() []sdktypes.AccAddress // GetKey returns the key at the given keyring index GetKey(index int) Key + // GetKeys returns all the keys + GetKeys() []Key // AddKey adds a new account to the keyring AddKey() int @@ -89,16 +91,22 @@ func (kr *IntegrationKeyring) GetAllAccAddrs() []sdktypes.AccAddress { return accs } -// GetKey returns the key specified by index +// GetKey returns the key specified by index. func (kr *IntegrationKeyring) GetKey(index int) Key { return kr.keys[index] } -// AddKey adds a new account to the keyring. It returns the index for the key +// GetKeys returns all keys from the keyring. +func (kr *IntegrationKeyring) GetKeys() []Key { + return kr.keys +} + +// AddKey adds a new account to the keyring. It returns the index for the key. func (kr *IntegrationKeyring) AddKey() int { acc := NewKey() index := len(kr.keys) kr.keys = append(kr.keys, acc) + return index } diff --git a/testutil/integration/os/network/abci.go b/testutil/integration/os/network/abci.go index efca125d..b1cd2069 100644 --- a/testutil/integration/os/network/abci.go +++ b/testutil/integration/os/network/abci.go @@ -1,12 +1,15 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package network import ( "time" - abci "github.com/cometbft/cometbft/abci/types" - sdktypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" + abcitypes "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" ) // NextBlock is a private helper function that runs the EndBlocker logic, commits the changes, @@ -15,34 +18,84 @@ func (n *IntegrationNetwork) NextBlock() error { return n.NextBlockAfter(time.Second) } -// NextBlockAfter is a private helper function that runs the EndBlocker logic, commits the changes, -// updates the header to have a block time after the given duration and runs the BeginBlocker. +// NextBlockAfter is a private helper function that runs the FinalizeBlock logic, updates the context and +// commits the changes to have a block time after the given duration. func (n *IntegrationNetwork) NextBlockAfter(duration time.Duration) error { - // End block and commit - header := n.ctx.BlockHeader() - n.app.EndBlocker(n.ctx, abci.RequestEndBlock{Height: header.Height}) - n.app.Commit() + _, err := n.finalizeBlockAndCommit(duration) + return err +} - // Calculate new block time after duration - newBlockTime := header.Time.Add(duration) +// NextBlockWithTxs is a helper function that runs the FinalizeBlock logic +// with the provided tx bytes, updates the context and +// commits the changes to have a block time after the given duration. +func (n *IntegrationNetwork) NextBlockWithTxs(txBytes ...[]byte) (*abcitypes.ResponseFinalizeBlock, error) { + return n.finalizeBlockAndCommit(time.Second, txBytes...) +} +// finalizeBlockAndCommit is a private helper function that runs the FinalizeBlock logic +// with the provided txBytes, updates the context and +// commits the changes to have a block time after the given duration. +func (n *IntegrationNetwork) finalizeBlockAndCommit(duration time.Duration, txBytes ...[]byte) (*abcitypes.ResponseFinalizeBlock, error) { + header := n.ctx.BlockHeader() // Update block header and BeginBlock header.Height++ header.AppHash = n.app.LastCommitID().Hash + // Calculate new block time after duration + newBlockTime := header.Time.Add(duration) header.Time = newBlockTime - n.app.BeginBlock(abci.RequestBeginBlock{ - Header: header, - }) + + // FinalizeBlock to run endBlock, deliverTx & beginBlock logic + req := buildFinalizeBlockReq(header, n.valSet.Validators, txBytes...) + + res, err := n.app.FinalizeBlock(req) + if err != nil { + return nil, err + } + + newCtx := n.app.BaseApp.NewContextLegacy(false, header) // Update context header - newCtx := n.app.BaseApp.NewContext(false, header) newCtx = newCtx.WithMinGasPrices(n.ctx.MinGasPrices()) newCtx = newCtx.WithKVGasConfig(n.ctx.KVGasConfig()) newCtx = newCtx.WithTransientKVGasConfig(n.ctx.TransientKVGasConfig()) newCtx = newCtx.WithConsensusParams(n.ctx.ConsensusParams()) // This might have to be changed with time if we want to test gas limits - newCtx = newCtx.WithBlockGasMeter(sdktypes.NewInfiniteGasMeter()) - + newCtx = newCtx.WithBlockGasMeter(storetypes.NewInfiniteGasMeter()) + newCtx = newCtx.WithVoteInfos(req.DecidedLastCommit.GetVotes()) n.ctx = newCtx - return nil + + // commit changes + _, err = n.app.Commit() + + return res, err +} + +// buildFinalizeBlockReq is a helper function to build +// properly the FinalizeBlock request +func buildFinalizeBlockReq(header cmtproto.Header, validators []*cmttypes.Validator, txs ...[]byte) *abcitypes.RequestFinalizeBlock { + // add validator's commit info to allocate corresponding tokens to validators + ci := getCommitInfo(validators) + return &abcitypes.RequestFinalizeBlock{ + Height: header.Height, + DecidedLastCommit: ci, + Hash: header.AppHash, + NextValidatorsHash: header.ValidatorsHash, + ProposerAddress: header.ProposerAddress, + Time: header.Time, + Txs: txs, + } +} + +func getCommitInfo(validators []*cmttypes.Validator) abcitypes.CommitInfo { + voteInfos := make([]abcitypes.VoteInfo, len(validators)) + for i, val := range validators { + voteInfos[i] = abcitypes.VoteInfo{ + Validator: abcitypes.Validator{ + Address: val.Address, + Power: val.VotingPower, + }, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + } + } + return abcitypes.CommitInfo{Votes: voteInfos} } diff --git a/testutil/integration/os/network/clients.go b/testutil/integration/os/network/clients.go index 5f32a0eb..9aa66893 100644 --- a/testutil/integration/os/network/clients.go +++ b/testutil/integration/os/network/clients.go @@ -1,25 +1,30 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package network import ( "github.com/cosmos/cosmos-sdk/baseapp" sdktypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module/testutil" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/authz" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/evmos/os/encoding" - exampleapp "github.com/evmos/os/example_chain" erc20types "github.com/evmos/os/x/erc20/types" evmtypes "github.com/evmos/os/x/evm/types" feemarkettypes "github.com/evmos/os/x/feemarket/types" ) -func getQueryHelper(ctx sdktypes.Context) *baseapp.QueryServiceTestHelper { - encCfg := encoding.MakeConfig(exampleapp.ModuleBasics) +func getQueryHelper(ctx sdktypes.Context, encCfg testutil.TestEncodingConfig) *baseapp.QueryServiceTestHelper { interfaceRegistry := encCfg.InterfaceRegistry // This is needed so that state changes are not committed in precompiles // simulations. @@ -27,51 +32,62 @@ func getQueryHelper(ctx sdktypes.Context) *baseapp.QueryServiceTestHelper { return baseapp.NewQueryServerTestHelper(cacheCtx, interfaceRegistry) } -// TODO: remove Evmos specific stuff func (n *IntegrationNetwork) GetERC20Client() erc20types.QueryClient { - queryHelper := getQueryHelper(n.GetContext()) + queryHelper := getQueryHelper(n.GetContext(), n.GetEncodingConfig()) erc20types.RegisterQueryServer(queryHelper, n.app.Erc20Keeper) return erc20types.NewQueryClient(queryHelper) } func (n *IntegrationNetwork) GetEvmClient() evmtypes.QueryClient { - queryHelper := getQueryHelper(n.GetContext()) + queryHelper := getQueryHelper(n.GetContext(), n.GetEncodingConfig()) evmtypes.RegisterQueryServer(queryHelper, n.app.EVMKeeper) return evmtypes.NewQueryClient(queryHelper) } func (n *IntegrationNetwork) GetGovClient() govtypes.QueryClient { - queryHelper := getQueryHelper(n.GetContext()) - govtypes.RegisterQueryServer(queryHelper, n.app.GovKeeper) + queryHelper := getQueryHelper(n.GetContext(), n.GetEncodingConfig()) + govtypes.RegisterQueryServer(queryHelper, govkeeper.NewQueryServer(&n.app.GovKeeper)) return govtypes.NewQueryClient(queryHelper) } func (n *IntegrationNetwork) GetBankClient() banktypes.QueryClient { - queryHelper := getQueryHelper(n.GetContext()) + queryHelper := getQueryHelper(n.GetContext(), n.GetEncodingConfig()) banktypes.RegisterQueryServer(queryHelper, n.app.BankKeeper) return banktypes.NewQueryClient(queryHelper) } func (n *IntegrationNetwork) GetFeeMarketClient() feemarkettypes.QueryClient { - queryHelper := getQueryHelper(n.GetContext()) + queryHelper := getQueryHelper(n.GetContext(), n.GetEncodingConfig()) feemarkettypes.RegisterQueryServer(queryHelper, n.app.FeeMarketKeeper) return feemarkettypes.NewQueryClient(queryHelper) } func (n *IntegrationNetwork) GetAuthClient() authtypes.QueryClient { - queryHelper := getQueryHelper(n.GetContext()) - authtypes.RegisterQueryServer(queryHelper, n.app.AccountKeeper) + queryHelper := getQueryHelper(n.GetContext(), n.GetEncodingConfig()) + authtypes.RegisterQueryServer(queryHelper, authkeeper.NewQueryServer(n.app.AccountKeeper)) return authtypes.NewQueryClient(queryHelper) } func (n *IntegrationNetwork) GetAuthzClient() authz.QueryClient { - queryHelper := getQueryHelper(n.GetContext()) + queryHelper := getQueryHelper(n.GetContext(), n.GetEncodingConfig()) authz.RegisterQueryServer(queryHelper, n.app.AuthzKeeper) return authz.NewQueryClient(queryHelper) } func (n *IntegrationNetwork) GetStakingClient() stakingtypes.QueryClient { - queryHelper := getQueryHelper(n.GetContext()) + queryHelper := getQueryHelper(n.GetContext(), n.GetEncodingConfig()) stakingtypes.RegisterQueryServer(queryHelper, stakingkeeper.Querier{Keeper: n.app.StakingKeeper}) return stakingtypes.NewQueryClient(queryHelper) } + +func (n *IntegrationNetwork) GetDistrClient() distrtypes.QueryClient { + queryHelper := getQueryHelper(n.GetContext(), n.GetEncodingConfig()) + distrtypes.RegisterQueryServer(queryHelper, distrkeeper.Querier{Keeper: n.app.DistrKeeper}) + return distrtypes.NewQueryClient(queryHelper) +} + +func (n *IntegrationNetwork) GetMintClient() minttypes.QueryClient { + queryHelper := getQueryHelper(n.GetContext(), n.GetEncodingConfig()) + minttypes.RegisterQueryServer(queryHelper, mintkeeper.NewQueryServerImpl(n.app.MintKeeper)) + return minttypes.NewQueryClient(queryHelper) +} diff --git a/testutil/integration/os/network/config.go b/testutil/integration/os/network/config.go index c721d4d8..21276337 100644 --- a/testutil/integration/os/network/config.go +++ b/testutil/integration/os/network/config.go @@ -4,12 +4,15 @@ package network import ( + "fmt" "math/big" + "github.com/cosmos/cosmos-sdk/baseapp" sdktypes "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/evmos/os/testutil" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/evmos/os/testutil/constants" testtx "github.com/evmos/os/testutil/tx" evmostypes "github.com/evmos/os/types" ) @@ -25,6 +28,9 @@ type Config struct { balances []banktypes.Balance denom string customGenesisState CustomGenesisState + otherCoinDenom []string + operatorsAddrs []sdktypes.AccAddress + customBaseAppOpts []func(*baseapp.BaseApp) } type CustomGenesisState map[string]interface{} @@ -34,14 +40,14 @@ func DefaultConfig() Config { account, _ := testtx.NewAccAddressAndKey() return Config{ - chainID: testutil.ExampleChainID, - eip155ChainID: big.NewInt(testutil.ExampleEIP155ChainID), + chainID: constants.ExampleChainID, + eip155ChainID: big.NewInt(constants.ExampleEIP155ChainID), amountOfValidators: 3, // No funded accounts besides the validators by default preFundedAccounts: []sdktypes.AccAddress{account}, // NOTE: Per default, the balances are left empty, and the pre-funded accounts are used. balances: nil, - denom: testutil.ExampleAttoDenom, + denom: constants.ExampleAttoDenom, customGenesisState: nil, } } @@ -50,17 +56,27 @@ func DefaultConfig() Config { // genesis accounts and balances. // // NOTE: If the balances are set, the pre-funded accounts are ignored. -func getGenAccountsAndBalances(cfg Config) (genAccounts []authtypes.GenesisAccount, balances []banktypes.Balance) { +func getGenAccountsAndBalances(cfg Config, validators []stakingtypes.Validator) (genAccounts []authtypes.GenesisAccount, balances []banktypes.Balance) { if len(cfg.balances) > 0 { balances = cfg.balances accounts := getAccAddrsFromBalances(balances) genAccounts = createGenesisAccounts(accounts) } else { - coin := sdktypes.NewCoin(cfg.denom, PrefundedAccountInitialBalance) genAccounts = createGenesisAccounts(cfg.preFundedAccounts) - balances = createBalances(cfg.preFundedAccounts, coin) + balances = createBalances(cfg.preFundedAccounts, append(cfg.otherCoinDenom, cfg.denom)) } + // append validators to genesis accounts and balances + valAccs := make([]sdktypes.AccAddress, len(validators)) + for i, v := range validators { + valAddr, err := sdktypes.ValAddressFromBech32(v.OperatorAddress) + if err != nil { + panic(fmt.Sprintf("failed to derive validator address from %q: %s", v.OperatorAddress, err.Error())) + } + valAccs[i] = sdktypes.AccAddress(valAddr.Bytes()) + } + genAccounts = append(genAccounts, createGenesisAccounts(valAccs)...) + return } @@ -116,3 +132,24 @@ func WithCustomGenesis(customGenesis CustomGenesisState) ConfigOption { cfg.customGenesisState = customGenesis } } + +// WithOtherDenoms sets other possible coin denominations for the network. +func WithOtherDenoms(otherDenoms []string) ConfigOption { + return func(cfg *Config) { + cfg.otherCoinDenom = otherDenoms + } +} + +// WithValidatorOperators overwrites the used operator address for the network instantiation. +func WithValidatorOperators(keys []sdktypes.AccAddress) ConfigOption { + return func(cfg *Config) { + cfg.operatorsAddrs = keys + } +} + +// WithCustomBaseAppOpts sets custom base app options for the network. +func WithCustomBaseAppOpts(opts ...func(*baseapp.BaseApp)) ConfigOption { + return func(cfg *Config) { + cfg.customBaseAppOpts = opts + } +} diff --git a/testutil/integration/os/network/config_test.go b/testutil/integration/os/network/config_test.go index 849d569e..194c9b87 100644 --- a/testutil/integration/os/network/config_test.go +++ b/testutil/integration/os/network/config_test.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/constants" grpchandler "github.com/evmos/os/testutil/integration/os/grpc" testkeyring "github.com/evmos/os/testutil/integration/os/keyring" "github.com/evmos/os/testutil/integration/os/network" @@ -16,9 +16,9 @@ import ( ) func TestWithBalances(t *testing.T) { - key1Balance := sdk.NewCoins(sdk.NewInt64Coin(testutil.ExampleAttoDenom, 1e18)) + key1Balance := sdk.NewCoins(sdk.NewInt64Coin(constants.ExampleAttoDenom, 1e18)) key2Balance := sdk.NewCoins( - sdk.NewInt64Coin(testutil.ExampleAttoDenom, 2e18), + sdk.NewInt64Coin(constants.ExampleAttoDenom, 2e18), sdk.NewInt64Coin("other", 3e18), ) diff --git a/testutil/integration/os/network/ibc.go b/testutil/integration/os/network/ibc.go index 94e2e2d9..2297be90 100644 --- a/testutil/integration/os/network/ibc.go +++ b/testutil/integration/os/network/ibc.go @@ -1,11 +1,12 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package network import ( "testing" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + ibctesting "github.com/cosmos/ibc-go/v8/testing" ) // GetIBCChain returns a TestChain instance for the given network. @@ -13,7 +14,7 @@ import ( // The keyring should be used instead. func (n *IntegrationNetwork) GetIBCChain(t *testing.T, coord *ibctesting.Coordinator) *ibctesting.TestChain { return &ibctesting.TestChain{ - T: t, + TB: t, Coordinator: coord, ChainID: n.GetChainID(), App: n.app, diff --git a/testutil/integration/os/network/network.go b/testutil/integration/os/network/network.go index 1fd0a3f1..1583ac1d 100644 --- a/testutil/integration/os/network/network.go +++ b/testutil/integration/os/network/network.go @@ -4,21 +4,26 @@ package network import ( - "encoding/json" + "fmt" "math" "math/big" "time" + sdkmath "cosmossdk.io/math" abcitypes "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtjson "github.com/cometbft/cometbft/libs/json" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmversion "github.com/cometbft/cometbft/proto/tendermint/version" + cmttypes "github.com/cometbft/cometbft/types" + "github.com/cometbft/cometbft/version" sdktypes "github.com/cosmos/cosmos-sdk/types" + sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" txtypes "github.com/cosmos/cosmos-sdk/types/tx" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" gethparams "github.com/ethereum/go-ethereum/params" - exampleapp "github.com/evmos/os/example_chain" + app "github.com/evmos/os/example_chain" chainutil "github.com/evmos/os/example_chain/testutil" commonnetwork "github.com/evmos/os/testutil/integration/common/network" "github.com/evmos/os/types" @@ -42,12 +47,7 @@ type Network interface { GetEvmClient() evmtypes.QueryClient GetGovClient() govtypes.QueryClient GetFeeMarketClient() feemarkettypes.QueryClient - - // Because to update the module params on a conventional manner governance - // would be required, we should provide an easier way to update the params - UpdateEvmParams(params evmtypes.Params) error - UpdateGovParams(params govtypes.Params) error - UpdateFeeMarketParams(params feemarkettypes.Params) error + GetMintClient() minttypes.QueryClient } var _ Network = (*IntegrationNetwork)(nil) @@ -57,11 +57,11 @@ type IntegrationNetwork struct { cfg Config ctx sdktypes.Context validators []stakingtypes.Validator - app *exampleapp.ExampleChain + app *app.ExampleChain // This is only needed for IBC chain testing setup - valSet *tmtypes.ValidatorSet - valSigners map[string]tmtypes.PrivValidator + valSet *cmttypes.ValidatorSet + valSigners map[string]cmttypes.PrivValidator } // New configures and initializes a new integration Network instance with @@ -91,45 +91,53 @@ func New(opts ...ConfigOption) *IntegrationNetwork { } var ( - // bondedAmt is the amount of tokens that each validator will have initially bonded - bondedAmt = sdktypes.TokensFromConsensusPower(1, types.AttoPowerReduction) + // DefaultBondedAmount is the amount of tokens that each validator will have initially bonded + DefaultBondedAmount = sdktypes.TokensFromConsensusPower(1, types.AttoPowerReduction) // PrefundedAccountInitialBalance is the amount of tokens that each prefunded account has at genesis - PrefundedAccountInitialBalance = sdktypes.NewInt(int64(math.Pow10(18) * 4)) + PrefundedAccountInitialBalance, _ = sdkmath.NewIntFromString("100000000000000000000000") // 100k ) // configureAndInitChain initializes the network with the given configuration. // It creates the genesis state and starts the network. func (n *IntegrationNetwork) configureAndInitChain() error { - // Create funded accounts based on the config and - // create genesis accounts - genAccounts, fundedAccountBalances := getGenAccountsAndBalances(n.cfg) - // Create validator set with the amount of validators specified in the config // with the default power of 1. valSet, valSigners := createValidatorSetAndSigners(n.cfg.amountOfValidators) - totalBonded := bondedAmt.Mul(sdktypes.NewInt(int64(n.cfg.amountOfValidators))) + totalBonded := DefaultBondedAmount.Mul(sdkmath.NewInt(int64(n.cfg.amountOfValidators))) // Build staking type validators and delegations - validators, err := createStakingValidators(valSet.Validators, bondedAmt) + validators, err := createStakingValidators(valSet.Validators, DefaultBondedAmount, n.cfg.operatorsAddrs) if err != nil { return err } + // Create genesis accounts and funded balances based on the config + genAccounts, fundedAccountBalances := getGenAccountsAndBalances(n.cfg, validators) + fundedAccountBalances = addBondedModuleAccountToFundedBalances( fundedAccountBalances, sdktypes.NewCoin(n.cfg.denom, totalBonded), ) - delegations := createDelegations(valSet.Validators, genAccounts[0].GetAddress()) + delegations := createDelegations(validators, genAccounts[0].GetAddress()) - // Create a new evmOS app with the following params - exampleApp := createExampleApp(n.cfg.chainID) + // Create a new EvmosApp with the following params + exampleApp := createTestingApp(n.cfg.chainID, n.cfg.customBaseAppOpts...) stakingParams := StakingCustomGenesisState{ denom: n.cfg.denom, validators: validators, delegations: delegations, } + govParams := GovCustomGenesisState{ + denom: n.cfg.denom, + } + + mintParams := MintCustomGenesisState{ + denom: n.cfg.denom, + inflationMax: sdkmath.LegacyNewDecWithPrec(0, 1), + inflationMin: sdkmath.LegacyNewDecWithPrec(0, 1), + } totalSupply := calculateTotalSupply(fundedAccountBalances) bankParams := BankCustomGenesisState{ @@ -137,6 +145,13 @@ func (n *IntegrationNetwork) configureAndInitChain() error { balances: fundedAccountBalances, } + // Get the corresponding slashing info and missed block info + // for the created validators + slashingParams, err := getValidatorsSlashingGen(validators, exampleApp.StakingKeeper) + if err != nil { + return err + } + // Configure Genesis state genesisState := newDefaultGenesisState( exampleApp, @@ -144,6 +159,9 @@ func (n *IntegrationNetwork) configureAndInitChain() error { genAccounts: genAccounts, staking: stakingParams, bank: bankParams, + slashing: slashingParams, + gov: govParams, + mint: mintParams, }, ) @@ -155,69 +173,66 @@ func (n *IntegrationNetwork) configureAndInitChain() error { } // Init chain - stateBytes, err := json.MarshalIndent(genesisState, "", " ") + stateBytes, err := cmtjson.MarshalIndent(genesisState, "", " ") if err != nil { return err } consensusParams := chainutil.DefaultConsensusParams now := time.Now() - exampleApp.InitChain( - abcitypes.RequestInitChain{ + + if _, err = exampleApp.InitChain( + &abcitypes.RequestInitChain{ Time: now, ChainId: n.cfg.chainID, Validators: []abcitypes.ValidatorUpdate{}, ConsensusParams: consensusParams, AppStateBytes: stateBytes, }, - ) - // Commit genesis changes - exampleApp.Commit() + ); err != nil { + return err + } - header := tmproto.Header{ + header := cmtproto.Header{ ChainID: n.cfg.chainID, Height: exampleApp.LastBlockHeight() + 1, - Time: now, AppHash: exampleApp.LastCommitID().Hash, + Time: now, ValidatorsHash: valSet.Hash(), NextValidatorsHash: valSet.Hash(), ProposerAddress: valSet.Proposer.Address, + Version: tmversion.Consensus{ + Block: version.BlockProtocol, + }, + } + + req := buildFinalizeBlockReq(header, valSet.Validators) + if _, err := exampleApp.FinalizeBlock(req); err != nil { + return err + } + + // TODO - this might not be the best way to initilize the context + n.ctx = exampleApp.BaseApp.NewContextLegacy(false, header) + + // Commit genesis changes + if _, err := exampleApp.Commit(); err != nil { + return err } - exampleApp.BeginBlock(abcitypes.RequestBeginBlock{Header: header}) // Set networks global parameters + var blockMaxGas uint64 = math.MaxUint64 + if consensusParams.Block != nil && consensusParams.Block.MaxGas > 0 { + blockMaxGas = uint64(consensusParams.Block.MaxGas) //#nosec G115 -- max gas will not exceed uint64 + } + n.app = exampleApp - // TODO - this might not be the best way to initialize the context - n.ctx = exampleApp.BaseApp.NewContext(false, header) - n.ctx = n.ctx.WithConsensusParams(consensusParams) - n.ctx = n.ctx.WithBlockGasMeter(sdktypes.NewInfiniteGasMeter()) + n.ctx = n.ctx.WithConsensusParams(*consensusParams) + n.ctx = n.ctx.WithBlockGasMeter(types.NewInfiniteGasMeterWithLimit(blockMaxGas)) n.validators = validators n.valSet = valSet n.valSigners = valSigners - // Register EVMOS in denom metadata - evmosMetadata := banktypes.Metadata{ - Description: "The native token of Evmos", - Base: n.cfg.denom, - // NOTE: Denom units MUST be increasing - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: n.cfg.denom, - Exponent: 0, - Aliases: []string{n.cfg.denom}, - }, - { - Denom: n.cfg.denom, - Exponent: 18, - }, - }, - Name: "Evmos", - Symbol: "EVMOS", - Display: n.cfg.denom, - } - exampleApp.BankKeeper.SetDenomMetaData(n.ctx, evmosMetadata) - return nil } @@ -226,17 +241,23 @@ func (n *IntegrationNetwork) GetContext() sdktypes.Context { return n.ctx } +// WithIsCheckTxCtx switches the network's checkTx property +func (n *IntegrationNetwork) WithIsCheckTxCtx(isCheckTx bool) sdktypes.Context { + n.ctx = n.ctx.WithIsCheckTx(isCheckTx) + return n.ctx +} + // GetChainID returns the network's chainID func (n *IntegrationNetwork) GetChainID() string { return n.cfg.chainID } -// GetEIP155ChainID returns the network EIp-155 chainID number +// GetEIP155ChainID returns the network EIP-155 chainID number func (n *IntegrationNetwork) GetEIP155ChainID() *big.Int { return n.cfg.eip155ChainID } -// GetChainConfig returns the network's chain config +// GetEVMChainConfig returns the network's EVM chain config func (n *IntegrationNetwork) GetEVMChainConfig() *gethparams.ChainConfig { params := n.app.EVMKeeper.GetParams(n.ctx) return params.ChainConfig.EthereumConfig(n.cfg.eip155ChainID) @@ -247,16 +268,52 @@ func (n *IntegrationNetwork) GetDenom() string { return n.cfg.denom } +// GetOtherDenoms returns network's other supported denoms +func (n *IntegrationNetwork) GetOtherDenoms() []string { + return n.cfg.otherCoinDenom +} + // GetValidators returns the network's validators func (n *IntegrationNetwork) GetValidators() []stakingtypes.Validator { return n.validators } +// GetEncodingConfig returns the network's encoding configuration +func (n *IntegrationNetwork) GetEncodingConfig() sdktestutil.TestEncodingConfig { + return sdktestutil.TestEncodingConfig{ + InterfaceRegistry: n.app.InterfaceRegistry(), + Codec: n.app.AppCodec(), + TxConfig: n.app.GetTxConfig(), + Amino: n.app.LegacyAmino(), + } +} + // BroadcastTxSync broadcasts the given txBytes to the network and returns the response. // TODO - this should be change to gRPC -func (n *IntegrationNetwork) BroadcastTxSync(txBytes []byte) (abcitypes.ResponseDeliverTx, error) { - req := abcitypes.RequestDeliverTx{Tx: txBytes} - return n.app.BaseApp.DeliverTx(req), nil +func (n *IntegrationNetwork) BroadcastTxSync(txBytes []byte) (abcitypes.ExecTxResult, error) { + header := n.ctx.BlockHeader() + // Update block header and BeginBlock + header.Height++ + header.AppHash = n.app.LastCommitID().Hash + // Calculate new block time after duration + newBlockTime := header.Time.Add(time.Second) + header.Time = newBlockTime + + req := buildFinalizeBlockReq(header, n.valSet.Validators, txBytes) + + // dont include the DecidedLastCommit because we're not committing the changes + // here, is just for broadcasting the tx. To persist the changes, use the + // NextBlock or NextBlockAfter functions + req.DecidedLastCommit = abcitypes.CommitInfo{} + + blockRes, err := n.app.BaseApp.FinalizeBlock(req) + if err != nil { + return abcitypes.ExecTxResult{}, err + } + if len(blockRes.TxResults) != 1 { + return abcitypes.ExecTxResult{}, fmt.Errorf("unexpected number of tx results. Expected 1, got: %d", len(blockRes.TxResults)) + } + return *blockRes.TxResults[0], nil } // Simulate simulates the given txBytes to the network and returns the simulated response. @@ -271,3 +328,13 @@ func (n *IntegrationNetwork) Simulate(txBytes []byte) (*txtypes.SimulateResponse Result: result, }, nil } + +// CheckTx calls the BaseApp's CheckTx method with the given txBytes to the network and returns the response. +func (n *IntegrationNetwork) CheckTx(txBytes []byte) (*abcitypes.ResponseCheckTx, error) { + req := &abcitypes.RequestCheckTx{Tx: txBytes} + res, err := n.app.BaseApp.CheckTx(req) + if err != nil { + return nil, err + } + return res, nil +} diff --git a/testutil/integration/os/network/params.go b/testutil/integration/os/network/params.go deleted file mode 100644 index 53a426e4..00000000 --- a/testutil/integration/os/network/params.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright Tharsis Labs Ltd.(Evmos) -// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) - -package network - -import ( - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - evmtypes "github.com/evmos/os/x/evm/types" - feemarketypes "github.com/evmos/os/x/feemarket/types" -) - -func (n *IntegrationNetwork) UpdateEvmParams(params evmtypes.Params) error { - return n.app.EVMKeeper.SetParams(n.ctx, params) -} - -func (n *IntegrationNetwork) UpdateFeeMarketParams(params feemarketypes.Params) error { - return n.app.FeeMarketKeeper.SetParams(n.ctx, params) -} - -func (n *IntegrationNetwork) UpdateGovParams(params govtypes.Params) error { - return n.app.GovKeeper.SetParams(n.ctx, params) -} diff --git a/testutil/integration/os/network/setup.go b/testutil/integration/os/network/setup.go index 77c4b2c5..f2c2679b 100644 --- a/testutil/integration/os/network/setup.go +++ b/testutil/integration/os/network/setup.go @@ -5,13 +5,13 @@ package network import ( "fmt" + "slices" "time" + "cosmossdk.io/log" sdkmath "cosmossdk.io/math" - "cosmossdk.io/simapp" - dbm "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -20,33 +20,86 @@ import ( sdktypes "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/gogoproto/proto" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" exampleapp "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" + evmostypes "github.com/evmos/os/types" erc20types "github.com/evmos/os/x/erc20/types" evmtypes "github.com/evmos/os/x/evm/types" + feemarkettypes "github.com/evmos/os/x/feemarket/types" ) +// genSetupFn is the type for the module genesis setup functions +type genSetupFn func(evmosApp *exampleapp.ExampleChain, genesisState evmostypes.GenesisState, customGenesis interface{}) (evmostypes.GenesisState, error) + +// defaultGenesisParams contains the params that are needed to +// setup the default genesis for the testing setup +type defaultGenesisParams struct { + genAccounts []authtypes.GenesisAccount + staking StakingCustomGenesisState + slashing SlashingCustomGenesisState + bank BankCustomGenesisState + gov GovCustomGenesisState + mint MintCustomGenesisState +} + +// genesisSetupFunctions contains the available genesis setup functions +// that can be used to customize the network genesis +var genesisSetupFunctions = map[string]genSetupFn{ + evmtypes.ModuleName: genStateSetter[*evmtypes.GenesisState](evmtypes.ModuleName), + erc20types.ModuleName: genStateSetter[*erc20types.GenesisState](erc20types.ModuleName), + govtypes.ModuleName: genStateSetter[*govtypesv1.GenesisState](govtypes.ModuleName), + feemarkettypes.ModuleName: genStateSetter[*feemarkettypes.GenesisState](feemarkettypes.ModuleName), + distrtypes.ModuleName: genStateSetter[*distrtypes.GenesisState](distrtypes.ModuleName), + minttypes.ModuleName: genStateSetter[*minttypes.GenesisState](minttypes.ModuleName), + banktypes.ModuleName: setBankGenesisState, + authtypes.ModuleName: setAuthGenesisState, + consensustypes.ModuleName: func(_ *exampleapp.ExampleChain, genesisState evmostypes.GenesisState, _ interface{}) (evmostypes.GenesisState, error) { + // no-op. Consensus does not have a genesis state on the application + // but the params are used on it + // (e.g. block max gas, max bytes). + // This is handled accordingly on chain and context initialization + return genesisState, nil + }, + capabilitytypes.ModuleName: genStateSetter[*capabilitytypes.GenesisState](capabilitytypes.ModuleName), +} + +// genStateSetter is a generic function to set module-specific genesis state +func genStateSetter[T proto.Message](moduleName string) genSetupFn { + return func(evmosApp *exampleapp.ExampleChain, genesisState evmostypes.GenesisState, customGenesis interface{}) (evmostypes.GenesisState, error) { + moduleGenesis, ok := customGenesis.(T) + if !ok { + return nil, fmt.Errorf("invalid type %T for %s module genesis state", customGenesis, moduleName) + } + + genesisState[moduleName] = evmosApp.AppCodec().MustMarshalJSON(moduleGenesis) + return genesisState, nil + } +} + // createValidatorSetAndSigners creates validator set with the amount of validators specified // with the default power of 1. -func createValidatorSetAndSigners(numberOfValidators int) (*tmtypes.ValidatorSet, map[string]tmtypes.PrivValidator) { +func createValidatorSetAndSigners(numberOfValidators int) (*cmttypes.ValidatorSet, map[string]cmttypes.PrivValidator) { // Create validator set - tmValidators := make([]*tmtypes.Validator, 0, numberOfValidators) - signers := make(map[string]tmtypes.PrivValidator, numberOfValidators) + tmValidators := make([]*cmttypes.Validator, 0, numberOfValidators) + signers := make(map[string]cmttypes.PrivValidator, numberOfValidators) for i := 0; i < numberOfValidators; i++ { privVal := mock.NewPV() pubKey, _ := privVal.GetPubKey() - validator := tmtypes.NewValidator(pubKey, 1) + validator := cmttypes.NewValidator(pubKey, 1) tmValidators = append(tmValidators, validator) signers[pubKey.Address().String()] = privVal } - return tmtypes.NewValidatorSet(tmValidators), signers + return cmttypes.NewValidatorSet(tmValidators), signers } // createGenesisAccounts returns a slice of genesis accounts from the given @@ -68,19 +121,24 @@ func getAccAddrsFromBalances(balances []banktypes.Balance) []sdktypes.AccAddress numberOfBalances := len(balances) genAccounts := make([]sdktypes.AccAddress, 0, numberOfBalances) for _, balance := range balances { - genAccounts = append(genAccounts, balance.GetAddress()) + genAccounts = append(genAccounts, sdktypes.AccAddress(balance.Address)) } return genAccounts } // createBalances creates balances for the given accounts and coin -func createBalances(accounts []sdktypes.AccAddress, coin sdktypes.Coin) []banktypes.Balance { +func createBalances(accounts []sdktypes.AccAddress, denoms []string) []banktypes.Balance { + slices.Sort(denoms) numberOfAccounts := len(accounts) + coins := make([]sdktypes.Coin, len(denoms)) + for i, denom := range denoms { + coins[i] = sdktypes.NewCoin(denom, PrefundedAccountInitialBalance) + } fundedAccountBalances := make([]banktypes.Balance, 0, numberOfAccounts) for _, acc := range accounts { balance := banktypes.Balance{ Address: acc.String(), - Coins: sdktypes.NewCoins(coin), + Coins: coins, } fundedAccountBalances = append(fundedAccountBalances, balance) @@ -88,14 +146,14 @@ func createBalances(accounts []sdktypes.AccAddress, coin sdktypes.Coin) []bankty return fundedAccountBalances } -// createExampleApp creates an exemplary evmOS based application -func createExampleApp(chainID string) *exampleapp.ExampleChain { +// createTestingApp creates an evmos app +func createTestingApp(chainID string, customBaseAppOptions ...func(*baseapp.BaseApp)) *exampleapp.ExampleChain { // Create evmos app db := dbm.NewMemDB() logger := log.NewNopLogger() loadLatest := true appOptions := simutils.NewAppOptionsWithFlagHome(exampleapp.DefaultNodeHome) - baseAppOptions := []func(*baseapp.BaseApp){baseapp.SetChainID(chainID)} + baseAppOptions := append(customBaseAppOptions, baseapp.SetChainID(chainID)) //nolint:gocritic return exampleapp.NewExampleApp( logger, @@ -108,8 +166,8 @@ func createExampleApp(chainID string) *exampleapp.ExampleChain { } // createStakingValidator creates a staking validator from the given tm validator and bonded -func createStakingValidator(val *tmtypes.Validator, bondedAmt sdkmath.Int) (stakingtypes.Validator, error) { - pk, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) +func createStakingValidator(val *cmttypes.Validator, bondedAmt sdkmath.Int, operatorAddr *sdktypes.AccAddress) (stakingtypes.Validator, error) { + pk, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) //nolint:staticcheck if err != nil { return stakingtypes.Validator{}, err } @@ -119,30 +177,44 @@ func createStakingValidator(val *tmtypes.Validator, bondedAmt sdkmath.Int) (stak return stakingtypes.Validator{}, err } - commission := stakingtypes.NewCommission(sdktypes.ZeroDec(), sdktypes.ZeroDec(), sdktypes.ZeroDec()) + opAddr := sdktypes.ValAddress(val.Address).String() + if operatorAddr != nil { + opAddr = sdktypes.ValAddress(operatorAddr.Bytes()).String() + } + + // Default to 5% commission + commission := stakingtypes.NewCommission(sdkmath.LegacyNewDecWithPrec(5, 2), sdkmath.LegacyNewDecWithPrec(2, 1), sdkmath.LegacyNewDecWithPrec(5, 2)) validator := stakingtypes.Validator{ - OperatorAddress: sdktypes.ValAddress(val.Address).String(), + OperatorAddress: opAddr, ConsensusPubkey: pkAny, Jailed: false, Status: stakingtypes.Bonded, Tokens: bondedAmt, - DelegatorShares: sdktypes.OneDec(), + DelegatorShares: sdkmath.LegacyOneDec(), Description: stakingtypes.Description{}, UnbondingHeight: int64(0), UnbondingTime: time.Unix(0, 0).UTC(), Commission: commission, - MinSelfDelegation: sdktypes.ZeroInt(), + MinSelfDelegation: sdkmath.ZeroInt(), } return validator, nil } // createStakingValidators creates staking validators from the given tm validators and bonded // amounts -func createStakingValidators(tmValidators []*tmtypes.Validator, bondedAmt sdkmath.Int) ([]stakingtypes.Validator, error) { +func createStakingValidators(tmValidators []*cmttypes.Validator, bondedAmt sdkmath.Int, operatorsAddresses []sdktypes.AccAddress) ([]stakingtypes.Validator, error) { + if len(operatorsAddresses) == 0 { + return createStakingValidatorsWithRandomOperator(tmValidators, bondedAmt) + } + return createStakingValidatorsWithSpecificOperator(tmValidators, bondedAmt, operatorsAddresses) +} + +// createStakingValidatorsWithRandomOperator creates staking validators with non-specified operator addresses. +func createStakingValidatorsWithRandomOperator(tmValidators []*cmttypes.Validator, bondedAmt sdkmath.Int) ([]stakingtypes.Validator, error) { amountOfValidators := len(tmValidators) stakingValidators := make([]stakingtypes.Validator, 0, amountOfValidators) for _, val := range tmValidators { - validator, err := createStakingValidator(val, bondedAmt) + validator, err := createStakingValidator(val, bondedAmt, nil) if err != nil { return nil, err } @@ -151,17 +223,66 @@ func createStakingValidators(tmValidators []*tmtypes.Validator, bondedAmt sdkmat return stakingValidators, nil } -// createDelegations creates delegations for the given validators and account -func createDelegations(tmValidators []*tmtypes.Validator, fromAccount sdktypes.AccAddress) []stakingtypes.Delegation { +// createStakingValidatorsWithSpecificOperator creates staking validators with the given operator addresses. +func createStakingValidatorsWithSpecificOperator(tmValidators []*cmttypes.Validator, bondedAmt sdkmath.Int, operatorsAddresses []sdktypes.AccAddress) ([]stakingtypes.Validator, error) { amountOfValidators := len(tmValidators) + stakingValidators := make([]stakingtypes.Validator, 0, amountOfValidators) + operatorsCount := len(operatorsAddresses) + if operatorsCount != amountOfValidators { + panic(fmt.Sprintf("provided %d validator operator keys but need %d!", operatorsCount, amountOfValidators)) + } + for i, val := range tmValidators { + validator, err := createStakingValidator(val, bondedAmt, &operatorsAddresses[i]) + if err != nil { + return nil, err + } + stakingValidators = append(stakingValidators, validator) + } + return stakingValidators, nil +} + +// createDelegations creates delegations for the given validators and account +func createDelegations(validators []stakingtypes.Validator, fromAccount sdktypes.AccAddress) []stakingtypes.Delegation { + amountOfValidators := len(validators) delegations := make([]stakingtypes.Delegation, 0, amountOfValidators) - for _, val := range tmValidators { - delegation := stakingtypes.NewDelegation(fromAccount, val.Address.Bytes(), sdktypes.OneDec()) + for _, val := range validators { + delegation := stakingtypes.NewDelegation(fromAccount.String(), val.OperatorAddress, sdkmath.LegacyOneDec()) delegations = append(delegations, delegation) } return delegations } +// getValidatorsSlashingGen creates the validators signingInfos and missedBlocks +// records necessary for the slashing module genesis +func getValidatorsSlashingGen(validators []stakingtypes.Validator, sk slashingtypes.StakingKeeper) (SlashingCustomGenesisState, error) { + valCount := len(validators) + signInfo := make([]slashingtypes.SigningInfo, valCount) + missedBlocks := make([]slashingtypes.ValidatorMissedBlocks, valCount) + for i, val := range validators { + consAddrBz, err := val.GetConsAddr() + if err != nil { + return SlashingCustomGenesisState{}, err + } + consAddr, err := sk.ConsensusAddressCodec().BytesToString(consAddrBz) + if err != nil { + return SlashingCustomGenesisState{}, err + } + signInfo[i] = slashingtypes.SigningInfo{ + Address: consAddr, + ValidatorSigningInfo: slashingtypes.ValidatorSigningInfo{ + Address: consAddr, + }, + } + missedBlocks[i] = slashingtypes.ValidatorMissedBlocks{ + Address: consAddr, + } + } + return SlashingCustomGenesisState{ + signingInfo: signInfo, + missedBlocks: missedBlocks, + }, nil +} + // StakingCustomGenesisState defines the staking genesis state type StakingCustomGenesisState struct { denom string @@ -170,8 +291,8 @@ type StakingCustomGenesisState struct { delegations []stakingtypes.Delegation } -// setDefaultStakingGenesisState sets the staking genesis state -func setDefaultStakingGenesisState(exampleApp *exampleapp.ExampleChain, genesisState simapp.GenesisState, overwriteParams StakingCustomGenesisState) simapp.GenesisState { +// setDefaultStakingGenesisState sets the default staking genesis state +func setDefaultStakingGenesisState(evmosApp *exampleapp.ExampleChain, genesisState evmostypes.GenesisState, overwriteParams StakingCustomGenesisState) evmostypes.GenesisState { // Set staking params stakingParams := stakingtypes.DefaultParams() stakingParams.BondDenom = overwriteParams.denom @@ -181,7 +302,7 @@ func setDefaultStakingGenesisState(exampleApp *exampleapp.ExampleChain, genesisS overwriteParams.validators, overwriteParams.delegations, ) - genesisState[stakingtypes.ModuleName] = exampleApp.AppCodec().MustMarshalJSON(stakingGenesis) + genesisState[stakingtypes.ModuleName] = evmosApp.AppCodec().MustMarshalJSON(stakingGenesis) return genesisState } @@ -190,12 +311,8 @@ type BankCustomGenesisState struct { balances []banktypes.Balance } -// setDefaultBankGenesisState sets the bank genesis state -func setDefaultBankGenesisState( - exampleApp *exampleapp.ExampleChain, - genesisState simapp.GenesisState, - overwriteParams BankCustomGenesisState, -) simapp.GenesisState { +// setDefaultBankGenesisState sets the default bank genesis state +func setDefaultBankGenesisState(evmosApp *exampleapp.ExampleChain, genesisState evmostypes.GenesisState, overwriteParams BankCustomGenesisState) evmostypes.GenesisState { bankGenesis := banktypes.NewGenesisState( banktypes.DefaultGenesisState().Params, overwriteParams.balances, @@ -203,118 +320,175 @@ func setDefaultBankGenesisState( []banktypes.Metadata{}, []banktypes.SendEnabled{}, ) - genesisState[banktypes.ModuleName] = exampleApp.AppCodec().MustMarshalJSON(bankGenesis) + genesisState[banktypes.ModuleName] = evmosApp.AppCodec().MustMarshalJSON(bankGenesis) return genesisState } -// genSetupFn is the type for the module genesis setup functions -type genSetupFn func( - exampleApp *exampleapp.ExampleChain, - genesisState simapp.GenesisState, - customGenesis interface{}, -) (simapp.GenesisState, error) +// SlashingCustomGenesisState defines the corresponding +// validators signing info and missed blocks for the genesis state +type SlashingCustomGenesisState struct { + signingInfo []slashingtypes.SigningInfo + missedBlocks []slashingtypes.ValidatorMissedBlocks +} -// defaultGenesisParams contains the params that are needed to -// setup the default genesis for the testing setup -type defaultGenesisParams struct { - genAccounts []authtypes.GenesisAccount - staking StakingCustomGenesisState - bank BankCustomGenesisState +// setDefaultSlashingGenesisState sets the default slashing genesis state +func setDefaultSlashingGenesisState(evmosApp *exampleapp.ExampleChain, genesisState evmostypes.GenesisState, overwriteParams SlashingCustomGenesisState) evmostypes.GenesisState { + slashingGen := slashingtypes.DefaultGenesisState() + slashingGen.SigningInfos = overwriteParams.signingInfo + slashingGen.MissedBlocks = overwriteParams.missedBlocks + + genesisState[slashingtypes.ModuleName] = evmosApp.AppCodec().MustMarshalJSON(slashingGen) + return genesisState } -// genStateSetter is a generic function to set module-specific genesis state -func genStateSetter[T proto.Message](moduleName string) genSetupFn { - return func( - exampleApp *exampleapp.ExampleChain, - genesisState simapp.GenesisState, - customGenesis interface{}, - ) (simapp.GenesisState, error) { - moduleGenesis, ok := customGenesis.(T) - if !ok { - return nil, fmt.Errorf("invalid type %T for %s module genesis state", customGenesis, moduleName) +// setBankGenesisState updates the bank genesis state with custom genesis state +func setBankGenesisState(evmosApp *exampleapp.ExampleChain, genesisState evmostypes.GenesisState, customGenesis interface{}) (evmostypes.GenesisState, error) { + customGen, ok := customGenesis.(*banktypes.GenesisState) + if !ok { + return nil, fmt.Errorf("invalid type %T for bank module genesis state", customGenesis) + } + + bankGen := &banktypes.GenesisState{} + evmosApp.AppCodec().MustUnmarshalJSON(genesisState[banktypes.ModuleName], bankGen) + + if len(customGen.Balances) > 0 { + coins := sdktypes.NewCoins() + bankGen.Balances = append(bankGen.Balances, customGen.Balances...) + for _, b := range customGen.Balances { + coins = append(coins, b.Coins...) } + bankGen.Supply = bankGen.Supply.Add(coins...) + } + if len(customGen.DenomMetadata) > 0 { + bankGen.DenomMetadata = append(bankGen.DenomMetadata, customGen.DenomMetadata...) + } - genesisState[moduleName] = exampleApp.AppCodec().MustMarshalJSON(moduleGenesis) - return genesisState, nil + if len(customGen.SendEnabled) > 0 { + bankGen.SendEnabled = append(bankGen.SendEnabled, customGen.SendEnabled...) } + + bankGen.Params = customGen.Params + + genesisState[banktypes.ModuleName] = evmosApp.AppCodec().MustMarshalJSON(bankGen) + return genesisState, nil } -// genesisSetupFunctions contains the available genesis setup functions -// that can be used to customize the network genesis -var genesisSetupFunctions = map[string]genSetupFn{ - authtypes.ModuleName: genStateSetter[*authtypes.GenesisState](authtypes.ModuleName), - evmtypes.ModuleName: genStateSetter[*evmtypes.GenesisState](evmtypes.ModuleName), - govtypes.ModuleName: genStateSetter[*govtypesv1.GenesisState](govtypes.ModuleName), - minttypes.ModuleName: genStateSetter[*minttypes.GenesisState](minttypes.ModuleName), - erc20types.ModuleName: genStateSetter[*erc20types.GenesisState](erc20types.ModuleName), +// calculateTotalSupply calculates the total supply from the given balances +func calculateTotalSupply(fundedAccountsBalances []banktypes.Balance) sdktypes.Coins { + totalSupply := sdktypes.NewCoins() + for _, balance := range fundedAccountsBalances { + totalSupply = totalSupply.Add(balance.Coins...) + } + return totalSupply +} + +// addBondedModuleAccountToFundedBalances adds bonded amount to bonded pool module account and include it on funded accounts +func addBondedModuleAccountToFundedBalances( + fundedAccountsBalances []banktypes.Balance, + totalBonded sdktypes.Coin, +) []banktypes.Balance { + return append(fundedAccountsBalances, banktypes.Balance{ + Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), + Coins: sdktypes.Coins{totalBonded}, + }) } // setDefaultAuthGenesisState sets the default auth genesis state -func setDefaultAuthGenesisState( - exampleApp *exampleapp.ExampleChain, - genesisState simapp.GenesisState, - genAccs []authtypes.GenesisAccount, -) simapp.GenesisState { +func setDefaultAuthGenesisState(evmosApp *exampleapp.ExampleChain, genesisState evmostypes.GenesisState, genAccs []authtypes.GenesisAccount) evmostypes.GenesisState { defaultAuthGen := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) - genesisState[authtypes.ModuleName] = exampleApp.AppCodec().MustMarshalJSON(defaultAuthGen) + genesisState[authtypes.ModuleName] = evmosApp.AppCodec().MustMarshalJSON(defaultAuthGen) return genesisState } +// setAuthGenesisState updates the bank genesis state with custom genesis state +func setAuthGenesisState(evmosApp *exampleapp.ExampleChain, genesisState evmostypes.GenesisState, customGenesis interface{}) (evmostypes.GenesisState, error) { + customGen, ok := customGenesis.(*authtypes.GenesisState) + if !ok { + return nil, fmt.Errorf("invalid type %T for auth module genesis state", customGenesis) + } + + authGen := &authtypes.GenesisState{} + evmosApp.AppCodec().MustUnmarshalJSON(genesisState[authtypes.ModuleName], authGen) + + if len(customGen.Accounts) > 0 { + authGen.Accounts = append(authGen.Accounts, customGen.Accounts...) + } + + authGen.Params = customGen.Params + + genesisState[authtypes.ModuleName] = evmosApp.AppCodec().MustMarshalJSON(authGen) + return genesisState, nil +} + +// GovCustomGenesisState defines the gov genesis state +type GovCustomGenesisState struct { + denom string +} + // setDefaultGovGenesisState sets the default gov genesis state -func setDefaultGovGenesisState(exampleApp *exampleapp.ExampleChain, genesisState simapp.GenesisState) simapp.GenesisState { +func setDefaultGovGenesisState(evmosApp *exampleapp.ExampleChain, genesisState evmostypes.GenesisState, overwriteParams GovCustomGenesisState) evmostypes.GenesisState { govGen := govtypesv1.DefaultGenesisState() updatedParams := govGen.Params - - // set desired chain denomination as deposit denom - updatedParams.MinDeposit = sdktypes.NewCoins(sdktypes.NewCoin(testutil.ExampleAttoDenom, sdkmath.NewInt(1e18))) - + minDepositAmt := sdkmath.NewInt(1e18) + updatedParams.MinDeposit = sdktypes.NewCoins(sdktypes.NewCoin(overwriteParams.denom, minDepositAmt)) + updatedParams.ExpeditedMinDeposit = sdktypes.NewCoins(sdktypes.NewCoin(overwriteParams.denom, minDepositAmt)) govGen.Params = updatedParams - genesisState[govtypes.ModuleName] = exampleApp.AppCodec().MustMarshalJSON(govGen) + genesisState[govtypes.ModuleName] = evmosApp.AppCodec().MustMarshalJSON(govGen) return genesisState } -func setDefaultErc20GenesisState(exampleApp *exampleapp.ExampleChain, genesisState simapp.GenesisState) simapp.GenesisState { - // TODO: add test case to ensure that this is the same as the default genesis for the example app - erc20Gen := exampleapp.NewErc20GenesisState() +// MintCustomGenesisState defines the gov genesis state +type MintCustomGenesisState struct { + denom string + inflationMin sdkmath.LegacyDec + inflationMax sdkmath.LegacyDec +} - genesisState[erc20types.ModuleName] = exampleApp.AppCodec().MustMarshalJSON(erc20Gen) +// setDefaultGovGenesisState sets the default gov genesis state +// +// NOTE: for the testing network we don't want to have any minting +func setDefaultMintGenesisState(evmosApp *exampleapp.ExampleChain, genesisState evmostypes.GenesisState, overwriteParams MintCustomGenesisState) evmostypes.GenesisState { + mintGen := minttypes.DefaultGenesisState() + updatedParams := mintGen.Params + updatedParams.MintDenom = overwriteParams.denom + updatedParams.InflationMin = overwriteParams.inflationMin + updatedParams.InflationMax = overwriteParams.inflationMax + + mintGen.Params = updatedParams + genesisState[minttypes.ModuleName] = evmosApp.AppCodec().MustMarshalJSON(mintGen) return genesisState } -func setDefaultEVMGenesisState(exampleApp *exampleapp.ExampleChain, genesisState simapp.GenesisState) simapp.GenesisState { - // TODO: add test case to ensure that this is the same as the default genesis for the example app - evmGen := exampleapp.NewEVMGenesisState() - - genesisState[evmtypes.ModuleName] = exampleApp.AppCodec().MustMarshalJSON(evmGen) +func setDefaultErc20GenesisState(evmosApp *exampleapp.ExampleChain, genesisState evmostypes.GenesisState) evmostypes.GenesisState { + // NOTE: here we are using the setup from the example chain + erc20Gen := exampleapp.NewErc20GenesisState() + genesisState[erc20types.ModuleName] = evmosApp.AppCodec().MustMarshalJSON(erc20Gen) return genesisState } // defaultAuthGenesisState sets the default genesis state // for the testing setup -func newDefaultGenesisState(exampleApp *exampleapp.ExampleChain, params defaultGenesisParams) simapp.GenesisState { - genesisState := exampleapp.NewDefaultGenesisState() +func newDefaultGenesisState(evmosApp *exampleapp.ExampleChain, params defaultGenesisParams) evmostypes.GenesisState { + genesisState := evmosApp.DefaultGenesis() - genesisState = setDefaultAuthGenesisState(exampleApp, genesisState, params.genAccounts) - genesisState = setDefaultStakingGenesisState(exampleApp, genesisState, params.staking) - genesisState = setDefaultBankGenesisState(exampleApp, genesisState, params.bank) - genesisState = setDefaultGovGenesisState(exampleApp, genesisState) - genesisState = setDefaultErc20GenesisState(exampleApp, genesisState) - genesisState = setDefaultEVMGenesisState(exampleApp, genesisState) + genesisState = setDefaultAuthGenesisState(evmosApp, genesisState, params.genAccounts) + genesisState = setDefaultStakingGenesisState(evmosApp, genesisState, params.staking) + genesisState = setDefaultBankGenesisState(evmosApp, genesisState, params.bank) + genesisState = setDefaultGovGenesisState(evmosApp, genesisState, params.gov) + genesisState = setDefaultSlashingGenesisState(evmosApp, genesisState, params.slashing) + genesisState = setDefaultMintGenesisState(evmosApp, genesisState, params.mint) + genesisState = setDefaultErc20GenesisState(evmosApp, genesisState) return genesisState } -// customizeGenesis modifies genesis state if there're any custom genesis state +// customizeGenesis modifies genesis state if there are any custom genesis state // for specific modules -func customizeGenesis( - exampleApp *exampleapp.ExampleChain, - customGen CustomGenesisState, - genesisState simapp.GenesisState, -) (simapp.GenesisState, error) { +func customizeGenesis(evmosApp *exampleapp.ExampleChain, customGen CustomGenesisState, genesisState evmostypes.GenesisState) (evmostypes.GenesisState, error) { var err error for mod, modGenState := range customGen { if fn, found := genesisSetupFunctions[mod]; found { - genesisState, err = fn(exampleApp, genesisState, modGenState) + genesisState, err = fn(evmosApp, genesisState, modGenState) if err != nil { return genesisState, err } @@ -324,23 +498,3 @@ func customizeGenesis( } return genesisState, err } - -// calculateTotalSupply calculates the total supply from the given balances -func calculateTotalSupply(fundedAccountsBalances []banktypes.Balance) sdktypes.Coins { - totalSupply := sdktypes.NewCoins() - for _, balance := range fundedAccountsBalances { - totalSupply = totalSupply.Add(balance.Coins...) - } - return totalSupply -} - -// addBondedModuleAccountToFundedBalances adds bonded amount to bonded pool module account and include it on funded accounts -func addBondedModuleAccountToFundedBalances( - fundedAccountsBalances []banktypes.Balance, - totalBonded sdktypes.Coin, -) []banktypes.Balance { - return append(fundedAccountsBalances, banktypes.Balance{ - Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), - Coins: sdktypes.Coins{totalBonded}, - }) -} diff --git a/testutil/integration/os/network/unit_network.go b/testutil/integration/os/network/unit_network.go index 5d834ff5..dcb6c283 100644 --- a/testutil/integration/os/network/unit_network.go +++ b/testutil/integration/os/network/unit_network.go @@ -41,7 +41,7 @@ func (n *UnitTestNetwork) GetStateDB() *statedb.StateDB { return statedb.New( n.GetContext(), n.app.EVMKeeper, - statedb.NewEmptyTxConfig(common.BytesToHash(headerHash.Bytes())), + statedb.NewEmptyTxConfig(common.BytesToHash(headerHash)), ) } diff --git a/testutil/integration/os/utils/bank.go b/testutil/integration/os/utils/bank.go index 4768a700..36cc2c3c 100644 --- a/testutil/integration/os/utils/bank.go +++ b/testutil/integration/os/utils/bank.go @@ -4,24 +4,35 @@ package utils import ( + "context" "fmt" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/evmos/os/testutil/integration/common/grpc" + cmnfactory "github.com/evmos/os/testutil/integration/common/factory" + cmnnet "github.com/evmos/os/testutil/integration/common/network" + "github.com/evmos/os/testutil/integration/os/keyring" ) +// FundAccountWithBaseDenom funds the given account with the given amount of the network's +// base denomination. +func FundAccountWithBaseDenom(tf cmnfactory.CoreTxFactory, nw cmnnet.Network, sender keyring.Key, receiver sdk.AccAddress, amount math.Int) error { + return tf.FundAccount(sender, receiver, sdk.NewCoins(sdk.NewCoin(nw.GetDenom(), amount))) +} + // CheckBalances checks that the given accounts have the expected balances and // returns an error if that is not the case. -func CheckBalances(handler grpc.Handler, balances []banktypes.Balance) error { +func CheckBalances(ctx context.Context, client banktypes.QueryClient, balances []banktypes.Balance) error { for _, balance := range balances { addr := balance.GetAddress() for _, coin := range balance.GetCoins() { - balance, err := handler.GetBalance(addr, coin.Denom) + balance, err := client.Balance(ctx, &banktypes.QueryBalanceRequest{Address: addr, Denom: coin.Denom}) if err != nil { return err } - if !balance.Balance.IsEqual(coin) { + if !balance.Balance.Equal(coin) { return fmt.Errorf( "expected balance %s, got %s for address %s", coin, balance.Balance, addr, diff --git a/testutil/integration/os/utils/bank_test.go b/testutil/integration/os/utils/bank_test.go index e469fa99..2afc8495 100644 --- a/testutil/integration/os/utils/bank_test.go +++ b/testutil/integration/os/utils/bank_test.go @@ -6,7 +6,6 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - grpchandler "github.com/evmos/os/testutil/integration/os/grpc" testkeyring "github.com/evmos/os/testutil/integration/os/keyring" "github.com/evmos/os/testutil/integration/os/network" "github.com/evmos/os/testutil/integration/os/utils" @@ -20,7 +19,6 @@ func TestCheckBalances(t *testing.T) { network.WithDenom(testDenom), network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), ) - handler := grpchandler.NewIntegrationHandler(nw) testcases := []struct { name string @@ -38,7 +36,7 @@ func TestCheckBalances(t *testing.T) { { name: "fail - wrong amount", address: keyring.GetAccAddr(0).String(), - expAmount: sdk.NewInt(1), + expAmount: math.NewInt(1), errContains: "expected balance", }, } @@ -53,7 +51,7 @@ func TestCheckBalances(t *testing.T) { ), }} - err := utils.CheckBalances(handler, balances) + err := utils.CheckBalances(nw.GetContext(), nw.GetBankClient(), balances) if tc.expPass { require.NoError(t, err, "unexpected error checking balances") } else { diff --git a/testutil/integration/os/utils/contracts.go b/testutil/integration/os/utils/contracts.go index 34d67a4e..4c314a1e 100644 --- a/testutil/integration/os/utils/contracts.go +++ b/testutil/integration/os/utils/contracts.go @@ -1,20 +1,20 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package utils import ( "fmt" "slices" - "github.com/evmos/os/testutil/integration/os/factory" - abcitypes "github.com/cometbft/cometbft/abci/types" + "github.com/evmos/os/testutil/integration/os/factory" evmtypes "github.com/evmos/os/x/evm/types" ) // CheckTxTopics checks if all expected topics are present in the transaction response -func CheckTxTopics(res abcitypes.ResponseDeliverTx, expectedTopics []string) error { - msgEthResponse, err := DecodeResponseDeliverTx(res) +func CheckTxTopics(res abcitypes.ExecTxResult, expectedTopics []string) error { + msgEthResponse, err := DecodeExecTxResult(res) if err != nil { return err } @@ -35,8 +35,8 @@ func CheckTxTopics(res abcitypes.ResponseDeliverTx, expectedTopics []string) err } // DecodeContractCallResponse decodes the response of a contract call query -func DecodeContractCallResponse(response interface{}, callArgs factory.CallArgs, res abcitypes.ResponseDeliverTx) error { - msgEthResponse, err := DecodeResponseDeliverTx(res) +func DecodeContractCallResponse(response interface{}, callArgs factory.CallArgs, res abcitypes.ExecTxResult) error { + msgEthResponse, err := DecodeExecTxResult(res) if err != nil { return err } @@ -48,7 +48,7 @@ func DecodeContractCallResponse(response interface{}, callArgs factory.CallArgs, return nil } -func DecodeResponseDeliverTx(res abcitypes.ResponseDeliverTx) (*evmtypes.MsgEthereumTxResponse, error) { +func DecodeExecTxResult(res abcitypes.ExecTxResult) (*evmtypes.MsgEthereumTxResponse, error) { msgEthResponse, err := evmtypes.DecodeTxResponse(res.Data) if err != nil { return nil, err diff --git a/testutil/integration/os/utils/erc20.go b/testutil/integration/os/utils/erc20.go index f43653fc..bfbe6c30 100644 --- a/testutil/integration/os/utils/erc20.go +++ b/testutil/integration/os/utils/erc20.go @@ -8,7 +8,7 @@ import ( errorsmod "cosmossdk.io/errors" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/testutil/integration/os/factory" "github.com/evmos/os/testutil/integration/os/network" @@ -17,10 +17,8 @@ import ( // ERC20RegistrationData is the necessary data to provide in order to register an ERC20 token. type ERC20RegistrationData struct { - // Address is the address of the ERC20 token. - Address common.Address - // Denom is the ERC20 token denom. - Denom string + // Addresses are the addresses of the ERC20 tokens. + Addresses []string // ProposerPriv is the private key used to sign the proposal and voting transactions. ProposerPriv cryptotypes.PrivKey } @@ -28,12 +26,19 @@ type ERC20RegistrationData struct { // ValidateBasic does stateless validation of the data for the ERC20 registration. func (ed ERC20RegistrationData) ValidateBasic() error { emptyAddr := common.Address{} - if ed.Address.Hex() == emptyAddr.Hex() { - return fmt.Errorf("address cannot be empty") + + if len(ed.Addresses) == 0 { + return fmt.Errorf("addresses cannot be empty") } - if ed.Denom == "" { - return fmt.Errorf("denom cannot be empty") + for _, a := range ed.Addresses { + if ok := common.IsHexAddress(a); !ok { + return fmt.Errorf("invalid address %s", a) + } + hexAddr := common.HexToAddress(a) + if hexAddr.Hex() == emptyAddr.Hex() { + return fmt.Errorf("address cannot be empty") + } } if ed.ProposerPriv == nil { @@ -46,69 +51,65 @@ func (ed ERC20RegistrationData) ValidateBasic() error { // RegisterERC20 is a helper function to register ERC20 token through // submitting a governance proposal and having it pass. // It returns the registered token pair. -func RegisterERC20(tf factory.TxFactory, network network.Network, data ERC20RegistrationData) (erc20types.TokenPair, error) { - err := data.ValidateBasic() +func RegisterERC20(tf factory.TxFactory, network network.Network, data ERC20RegistrationData) (res []erc20types.TokenPair, err error) { + err = data.ValidateBasic() if err != nil { - return erc20types.TokenPair{}, errorsmod.Wrap(err, "failed to validate erc20 registration data") + return nil, errorsmod.Wrap(err, "failed to validate erc20 registration data") } - proposal := erc20types.RegisterERC20Proposal{ - Title: fmt.Sprintf("Register %s Token", data.Denom), - Description: fmt.Sprintf("This proposal registers the ERC20 token at address: %s", data.Address.Hex()), - Erc20Addresses: []string{data.Address.Hex()}, + proposal := erc20types.MsgRegisterERC20{ + Authority: authtypes.NewModuleAddress("gov").String(), + Erc20Addresses: data.Addresses, } // Submit the proposal - proposalID, err := SubmitProposal(tf, network, data.ProposerPriv, &proposal) + proposalID, err := SubmitProposal(tf, network, data.ProposerPriv, fmt.Sprintf("Register %d Token", len(data.Addresses)), &proposal) if err != nil { - return erc20types.TokenPair{}, errorsmod.Wrap(err, "failed to submit proposal") + return nil, errorsmod.Wrap(err, "failed to submit proposal") } err = network.NextBlock() if err != nil { - return erc20types.TokenPair{}, errorsmod.Wrap(err, "failed to commit block after proposal") + return nil, errorsmod.Wrap(err, "failed to commit block after proposal") } - // Vote on proposal - err = VoteOnProposal(tf, data.ProposerPriv, proposalID, govtypes.OptionYes) + // vote 'yes' and wait till proposal passes + err = ApproveProposal(tf, network, data.ProposerPriv, proposalID) if err != nil { - return erc20types.TokenPair{}, errorsmod.Wrap(err, "failed to vote on proposal") + return nil, errorsmod.Wrap(err, "failed to approve proposal") } - gq := network.GetGovClient() - params, err := gq.Params(network.GetContext(), &govtypes.QueryParamsRequest{ParamsType: "voting"}) - if err != nil { - return erc20types.TokenPair{}, errorsmod.Wrap(err, "failed to query voting params") + // Check if token pair is registered + eq := network.GetERC20Client() + for _, a := range data.Addresses { + tokenPairRes, err := eq.TokenPair(network.GetContext(), &erc20types.QueryTokenPairRequest{Token: a}) + if err != nil { + return nil, errorsmod.Wrap(err, "failed to query token pair") + } + res = append(res, tokenPairRes.TokenPair) } - err = network.NextBlockAfter(*params.Params.VotingPeriod) // commit after voting period is over - if err != nil { - return erc20types.TokenPair{}, errorsmod.Wrap(err, "failed to commit block after voting period ends") - } + return res, nil +} - err = network.NextBlock() - if err != nil { - return erc20types.TokenPair{}, errorsmod.Wrap(err, "failed to commit block after votes") +// ToggleTokenConversion is a helper function to toggle an ERC20 token pair conversion through +// submitting a governance proposal and having it pass. +func ToggleTokenConversion(tf factory.TxFactory, network network.Network, privKey cryptotypes.PrivKey, token string) error { + proposal := erc20types.MsgToggleConversion{ + Authority: authtypes.NewModuleAddress("gov").String(), + Token: token, } - // NOTE: it's necessary to instantiate a new gov client here, because the previous one has now an outdated - // context. - gq = network.GetGovClient() - proposalRes, err := gq.Proposal(network.GetContext(), &govtypes.QueryProposalRequest{ProposalId: proposalID}) + // Submit the proposal + proposalID, err := SubmitProposal(tf, network, privKey, fmt.Sprintf("Toggle %s Token", token), &proposal) if err != nil { - return erc20types.TokenPair{}, errorsmod.Wrap(err, "failed to query proposal") - } - - if proposalRes.Proposal.Status != govtypes.StatusPassed { - return erc20types.TokenPair{}, fmt.Errorf("proposal did not pass; got status: %s", proposalRes.Proposal.Status.String()) + return errorsmod.Wrap(err, "failed to submit proposal") } - // Check if token pair is registered - eq := network.GetERC20Client() - tokenPairRes, err := eq.TokenPair(network.GetContext(), &erc20types.QueryTokenPairRequest{Token: data.Address.Hex()}) + err = network.NextBlock() if err != nil { - return erc20types.TokenPair{}, errorsmod.Wrap(err, "failed to query token pair") + return errorsmod.Wrap(err, "failed to commit block after proposal") } - return tokenPairRes.TokenPair, nil + return ApproveProposal(tf, network, privKey, proposalID) } diff --git a/testutil/integration/os/utils/events.go b/testutil/integration/os/utils/events.go new file mode 100644 index 00000000..bea28f58 --- /dev/null +++ b/testutil/integration/os/utils/events.go @@ -0,0 +1,55 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package utils + +import ( + "errors" + "fmt" + + abcitypes "github.com/cometbft/cometbft/abci/types" + sdktypes "github.com/cosmos/cosmos-sdk/types" +) + +// ContainsEventType returns true if the given events contain the given eventType. +func ContainsEventType(events []abcitypes.Event, eventType string) bool { + event := GetEventType(events, eventType) + return event != nil +} + +// GetEventType returns the given events if found +// Otherwise returns nil +func GetEventType(events []abcitypes.Event, eventType string) *abcitypes.Event { + for _, event := range events { + if event.Type == eventType { + return &event + } + } + return nil +} + +// GetEventAttributeValue returns the value for the required +// attribute key +func GetEventAttributeValue(event abcitypes.Event, attrKey string) string { + for _, attr := range event.Attributes { + if attr.Key == attrKey { + return attr.Value + } + } + return "" +} + +// GetFeesFromEvents returns the fees value for the +// specified events +func GetFeesFromEvents(events []abcitypes.Event) (sdktypes.DecCoins, error) { + event := GetEventType(events, sdktypes.EventTypeTx) + if event == nil { + return sdktypes.DecCoins{}, errors.New("tx event not found") + } + feeStr := GetEventAttributeValue(*event, sdktypes.AttributeKeyFee) + feeCoins, err := sdktypes.ParseDecCoins(feeStr) + if err != nil { + return sdktypes.DecCoins{}, fmt.Errorf("invalid fees: %v. got %s", err, feeStr) + } + return feeCoins, nil +} diff --git a/testutil/integration/os/utils/evm.go b/testutil/integration/os/utils/evm.go index 234feeda..0897ca8d 100644 --- a/testutil/integration/os/utils/evm.go +++ b/testutil/integration/os/utils/evm.go @@ -5,6 +5,7 @@ package utils import ( "encoding/json" + "fmt" "math/big" "github.com/ethereum/go-ethereum/common" @@ -43,6 +44,10 @@ func GetERC20Balance(nw network.Network, tokenAddress, accountAddress common.Add return nil, err } + fmt.Println("got ret: ", ethRes.Ret) + fmt.Println("got eth call logs: ", ethRes.Logs) + fmt.Println("got eth call error: ", ethRes.VmError) + var balance *big.Int err = contracts.ERC20MinterBurnerDecimalsContract.ABI.UnpackIntoInterface(&balance, "balanceOf", ethRes.Ret) if err != nil { diff --git a/testutil/integration/os/utils/genesis.go b/testutil/integration/os/utils/genesis.go index 32a9a411..6d73196d 100644 --- a/testutil/integration/os/utils/genesis.go +++ b/testutil/integration/os/utils/genesis.go @@ -7,31 +7,37 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" exampleapp "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/constants" testkeyring "github.com/evmos/os/testutil/integration/os/keyring" "github.com/evmos/os/testutil/integration/os/network" + utiltx "github.com/evmos/os/testutil/tx" erc20types "github.com/evmos/os/x/erc20/types" ) -const ( - // erc20TokenPairHex is the string representation of the ERC-20 token pair address. - erc20TokenPairHex = "0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd" //#nosec G101 -- these are not hardcoded credentials #gitleaks:allow -) - -func CreateGenesisWithTokenPairs(keyring testkeyring.Keyring) network.CustomGenesisState { +// CreateGenesisWithTokenPairs creates a genesis that includes +// the WEVMOS and the provided denoms. +// If no denoms provided, creates only one dynamic precompile with the 'xmpl' denom. +func CreateGenesisWithTokenPairs(keyring testkeyring.Keyring, denoms ...string) network.CustomGenesisState { // Add all keys from the keyring to the genesis accounts as well. // // NOTE: This is necessary to enable the account to send EVM transactions, // because the Mono ante handler checks the account balance by querying the // account from the account keeper first. If these accounts are not in the genesis // state, the ante handler finds a zero balance because of the missing account. + + // if denom not provided, defaults to create only one dynamic erc20 + // precompile with the 'xmpl' denom + if len(denoms) == 0 { + denoms = []string{"xmpl"} + } + accs := keyring.GetAllAccAddrs() genesisAccounts := make([]*authtypes.BaseAccount, len(accs)) for i, addr := range accs { genesisAccounts[i] = &authtypes.BaseAccount{ Address: addr.String(), PubKey: nil, - AccountNumber: uint64(i + 1), + AccountNumber: uint64(i + 1), //nolint:gosec // G115 Sequence: 1, } } @@ -44,21 +50,31 @@ func CreateGenesisWithTokenPairs(keyring testkeyring.Keyring) network.CustomGene } // Add token pairs to genesis - erc20GenesisState := exampleapp.NewErc20GenesisState() - erc20GenesisState.TokenPairs = append(erc20GenesisState.TokenPairs, - erc20types.TokenPair{ - Erc20Address: erc20TokenPairHex, - Denom: "xmpl", - Enabled: true, - ContractOwner: erc20types.OWNER_MODULE, // NOTE: Owner is the module account since it's a native token and was registered through governance - }, - erc20types.TokenPair{ - Erc20Address: testutil.WEVMOSContractTestnet, - Denom: testutil.ExampleAttoDenom, + tokenPairs := make([]erc20types.TokenPair, 0, len(denoms)+1) + tokenPairs = append(tokenPairs, + // NOTE: the example token pairs are being added in the integration test utils + exampleapp.ExampleTokenPairs..., + ) + + dynPrecAddr := make([]string, 0, len(denoms)) + for _, denom := range denoms { + addr := utiltx.GenerateAddress().Hex() + tp := erc20types.TokenPair{ + Erc20Address: addr, + Denom: denom, Enabled: true, ContractOwner: erc20types.OWNER_MODULE, // NOTE: Owner is the module account since it's a native token and was registered through governance - }, - ) + } + tokenPairs = append(tokenPairs, tp) + dynPrecAddr = append(dynPrecAddr, addr) + } + + // STR v2: update the NativePrecompiles and DynamicPrecompiles + // with the WEVMOS (default is mainnet) and 'xmpl' tokens in the erc20 params + erc20GenesisState := exampleapp.NewErc20GenesisState() + erc20GenesisState.TokenPairs = tokenPairs + erc20GenesisState.Params.NativePrecompiles = []string{constants.WEVMOSContractMainnet} + erc20GenesisState.Params.DynamicPrecompiles = dynPrecAddr // Combine module genesis states return network.CustomGenesisState{ diff --git a/testutil/integration/os/utils/gov.go b/testutil/integration/os/utils/gov.go index 49e1b1ed..e3d75ffc 100644 --- a/testutil/integration/os/utils/gov.go +++ b/testutil/integration/os/utils/gov.go @@ -23,53 +23,52 @@ import ( // SubmitProposal is a helper function to submit a governance proposal and // return the proposal ID. -func SubmitProposal(tf factory.TxFactory, network network.Network, proposerPriv cryptotypes.PrivKey, proposal govv1beta1.Content) (uint64, error) { - proposerAccAddr := sdk.AccAddress(proposerPriv.PubKey().Address()) - - msgSubmitProposal, err := govv1beta1.NewMsgSubmitProposal( - proposal, +func SubmitProposal(tf factory.TxFactory, network network.Network, proposerPriv cryptotypes.PrivKey, title string, msgs ...sdk.Msg) (uint64, error) { + proposerAccAddr := sdk.AccAddress(proposerPriv.PubKey().Address()).String() + proposal, err := govv1.NewMsgSubmitProposal( + msgs, sdk.NewCoins(sdk.NewCoin(network.GetDenom(), math.NewInt(1e18))), proposerAccAddr, + "", + title, + title, + false, ) if err != nil { return 0, err } txArgs := commonfactory.CosmosTxArgs{ - Msgs: []sdk.Msg{msgSubmitProposal}, + Msgs: []sdk.Msg{proposal}, } - res, err := tf.ExecuteCosmosTx(proposerPriv, txArgs) - if err != nil { - return 0, err - } - - proposalID, err := getProposalIDFromEvents(res.Events) - if err != nil { - return 0, errorsmod.Wrap(err, "failed to get proposal ID from events") - } + return submitProposal(tf, network, proposerPriv, txArgs) +} - err = network.NextBlock() - if err != nil { - return 0, errorsmod.Wrap(err, "failed to commit block after proposal") - } +// SubmitLegacyProposal is a helper function to submit a governance proposal and +// return the proposal ID. +func SubmitLegacyProposal(tf factory.TxFactory, network network.Network, proposerPriv cryptotypes.PrivKey, proposal govv1beta1.Content) (uint64, error) { + proposerAccAddr := sdk.AccAddress(proposerPriv.PubKey().Address()) - gq := network.GetGovClient() - proposalRes, err := gq.Proposal(network.GetContext(), &govv1.QueryProposalRequest{ProposalId: proposalID}) + msgSubmitProposal, err := govv1beta1.NewMsgSubmitProposal( + proposal, + sdk.NewCoins(sdk.NewCoin(network.GetDenom(), math.NewInt(1e18))), + proposerAccAddr, + ) if err != nil { - return 0, errorsmod.Wrap(err, "failed to query proposal") + return 0, err } - if proposalRes.Proposal.Status != govv1.StatusVotingPeriod { - return 0, fmt.Errorf("expected proposal to be in voting period; got: %s", proposalRes.Proposal.Status.String()) + txArgs := commonfactory.CosmosTxArgs{ + Msgs: []sdk.Msg{msgSubmitProposal}, } - return proposalRes.Proposal.GetId(), nil + return submitProposal(tf, network, proposerPriv, txArgs) } // VoteOnProposal is a helper function to vote on a governance proposal given the private key of the voter and // the option to vote. -func VoteOnProposal(tf factory.TxFactory, voterPriv cryptotypes.PrivKey, proposalID uint64, option govv1.VoteOption) error { +func VoteOnProposal(tf factory.TxFactory, voterPriv cryptotypes.PrivKey, proposalID uint64, option govv1.VoteOption) (abcitypes.ExecTxResult, error) { voterAccAddr := sdk.AccAddress(voterPriv.PubKey().Address()) msgVote := govv1.NewMsgVote( @@ -79,11 +78,26 @@ func VoteOnProposal(tf factory.TxFactory, voterPriv cryptotypes.PrivKey, proposa "", ) - _, err := tf.ExecuteCosmosTx(voterPriv, commonfactory.CosmosTxArgs{ + res, err := tf.CommitCosmosTx(voterPriv, commonfactory.CosmosTxArgs{ Msgs: []sdk.Msg{msgVote}, }) - return err + return res, err +} + +// ApproveProposal is a helper function to vote 'yes' +// for it and wait till it passes. +func ApproveProposal(tf factory.TxFactory, network network.Network, proposerPriv cryptotypes.PrivKey, proposalID uint64) error { + // Vote on proposal + if _, err := VoteOnProposal(tf, proposerPriv, proposalID, govv1.OptionYes); err != nil { + return errorsmod.Wrap(err, "failed to vote on proposal") + } + + if err := waitVotingPeriod(network); err != nil { + return errorsmod.Wrap(err, "failed to wait for voting period to pass") + } + + return checkProposalStatus(network, proposalID, govv1.StatusPassed) } // getProposalIDFromEvents returns the proposal ID from the events in @@ -125,3 +139,57 @@ func getProposalIDFromEvents(events []abcitypes.Event) (uint64, error) { return proposalID, nil } + +func submitProposal(tf factory.TxFactory, network network.Network, proposerPriv cryptotypes.PrivKey, txArgs commonfactory.CosmosTxArgs) (uint64, error) { + res, err := tf.CommitCosmosTx(proposerPriv, txArgs) + if err != nil { + return 0, err + } + + proposalID, err := getProposalIDFromEvents(res.Events) + if err != nil { + return 0, errorsmod.Wrap(err, "failed to get proposal ID from events") + } + + err = network.NextBlock() + if err != nil { + return 0, errorsmod.Wrap(err, "failed to commit block after proposal") + } + + if err := checkProposalStatus(network, proposalID, govv1.StatusVotingPeriod); err != nil { + return 0, errorsmod.Wrap(err, "error while checking proposal") + } + + return proposalID, nil +} + +// waitVotingPeriod is a helper function that waits for the current voting period +// defined in the gov module params to pass +func waitVotingPeriod(n network.Network) error { + gq := n.GetGovClient() + params, err := gq.Params(n.GetContext(), &govv1.QueryParamsRequest{ParamsType: "voting"}) + if err != nil { + return errorsmod.Wrap(err, "failed to query voting params") + } + + err = n.NextBlockAfter(*params.Params.VotingPeriod) // commit after voting period is over + if err != nil { + return errorsmod.Wrap(err, "failed to commit block after voting period ends") + } + + return n.NextBlock() +} + +// checkProposalStatus is a helper function to check for a specific proposal status +func checkProposalStatus(n network.Network, proposalID uint64, expStatus govv1.ProposalStatus) error { + gq := n.GetGovClient() + proposalRes, err := gq.Proposal(n.GetContext(), &govv1.QueryProposalRequest{ProposalId: proposalID}) + if err != nil { + return errorsmod.Wrap(err, "failed to query proposal") + } + + if proposalRes.Proposal.Status != expStatus { + return fmt.Errorf("proposal status different than expected. Expected %s; got: %s", expStatus.String(), proposalRes.Proposal.Status.String()) + } + return nil +} diff --git a/testutil/integration/os/utils/params.go b/testutil/integration/os/utils/params.go new file mode 100644 index 00000000..6419c192 --- /dev/null +++ b/testutil/integration/os/utils/params.go @@ -0,0 +1,87 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package utils + +import ( + "fmt" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + "github.com/evmos/os/testutil/integration/os/factory" + "github.com/evmos/os/testutil/integration/os/network" + erc20types "github.com/evmos/os/x/erc20/types" + evmtypes "github.com/evmos/os/x/evm/types" + feemarkettypes "github.com/evmos/os/x/feemarket/types" +) + +type UpdateParamsInput struct { + Tf factory.TxFactory + Network network.Network + Pk cryptotypes.PrivKey + Params interface{} +} + +var authority = authtypes.NewModuleAddress(govtypes.ModuleName).String() + +// UpdateEvmParams helper function to update the EVM module parameters +// It submits an update params proposal, votes for it, and waits till it passes +func UpdateEvmParams(input UpdateParamsInput) error { + return updateModuleParams[evmtypes.Params](input, evmtypes.ModuleName) +} + +// UpdateGovParams helper function to update the governance module parameters +// It submits an update params proposal, votes for it, and waits till it passes +func UpdateGovParams(input UpdateParamsInput) error { + return updateModuleParams[govv1types.Params](input, govtypes.ModuleName) +} + +// UpdateFeeMarketParams helper function to update the feemarket module parameters +// It submits an update params proposal, votes for it, and waits till it passes +func UpdateFeeMarketParams(input UpdateParamsInput) error { + return updateModuleParams[feemarkettypes.Params](input, feemarkettypes.ModuleName) +} + +// UpdateERC20Params helper function to update the erc20 module parameters +// It submits an update params proposal, votes for it, and waits till it passes +func UpdateERC20Params(input UpdateParamsInput) error { + return updateModuleParams[erc20types.Params](input, erc20types.ModuleName) +} + +// updateModuleParams helper function to update module parameters +// It submits an update params proposal, votes for it, and waits till it passes +func updateModuleParams[T interface{}](input UpdateParamsInput, moduleName string) error { + newParams, ok := input.Params.(T) + if !ok { + return fmt.Errorf("invalid params type %T for module %s", input.Params, moduleName) + } + + proposalMsg := createProposalMsg(newParams, moduleName) + + title := fmt.Sprintf("Update %s params", moduleName) + proposalID, err := SubmitProposal(input.Tf, input.Network, input.Pk, title, proposalMsg) + if err != nil { + return err + } + + return ApproveProposal(input.Tf, input.Network, input.Pk, proposalID) +} + +// createProposalMsg creates the module-specific update params message +func createProposalMsg(params interface{}, name string) sdk.Msg { + switch name { + case evmtypes.ModuleName: + return &evmtypes.MsgUpdateParams{Authority: authority, Params: params.(evmtypes.Params)} + case govtypes.ModuleName: + return &govv1types.MsgUpdateParams{Authority: authority, Params: params.(govv1types.Params)} + case feemarkettypes.ModuleName: + return &feemarkettypes.MsgUpdateParams{Authority: authority, Params: params.(feemarkettypes.Params)} + case erc20types.ModuleName: + return &erc20types.MsgUpdateParams{Authority: authority, Params: params.(erc20types.Params)} + default: + return nil + } +} diff --git a/testutil/integration/os/utils/staking.go b/testutil/integration/os/utils/staking.go new file mode 100644 index 00000000..74d6a253 --- /dev/null +++ b/testutil/integration/os/utils/staking.go @@ -0,0 +1,111 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package utils + +import ( + "errors" + "time" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/evmos/os/testutil/integration/os/grpc" + "github.com/evmos/os/testutil/integration/os/network" +) + +// WaitToAccrueRewards is a helper function that waits for rewards to +// accumulate up to a specified expected amount +func WaitToAccrueRewards(n network.Network, gh grpc.Handler, delegatorAddr string, expRewards sdk.DecCoins) (sdk.DecCoins, error) { + var ( + err error + lapse = time.Hour * 24 * 7 // one week + rewards = sdk.DecCoins{} + ) + + if err = checkNonZeroInflation(n); err != nil { + return nil, err + } + + expAmt := expRewards.AmountOf(n.GetDenom()) + for rewards.AmountOf(n.GetDenom()).LT(expAmt) { + rewards, err = checkRewardsAfter(n, gh, delegatorAddr, lapse) + if err != nil { + return nil, errorsmod.Wrap(err, "error checking rewards") + } + } + + return rewards, err +} + +// checkRewardsAfter is a helper function that checks the accrued rewards +// after the provided timelapse +func checkRewardsAfter(n network.Network, gh grpc.Handler, delegatorAddr string, lapse time.Duration) (sdk.DecCoins, error) { + err := n.NextBlockAfter(lapse) + if err != nil { + return nil, errorsmod.Wrap(err, "failed to commit block after voting period ends") + } + + res, err := gh.GetDelegationTotalRewards(delegatorAddr) + if err != nil { + return nil, errorsmod.Wrapf(err, "error while querying for delegation rewards") + } + + return res.Total, nil +} + +// WaitToAccrueCommission is a helper function that waits for commission to +// accumulate up to a specified expected amount +func WaitToAccrueCommission(n network.Network, gh grpc.Handler, validatorAddr string, expCommission sdk.DecCoins) (sdk.DecCoins, error) { + var ( + err error + lapse = time.Hour * 24 * 7 // one week + commission = sdk.DecCoins{} + ) + + if err := checkNonZeroInflation(n); err != nil { + return nil, err + } + + expAmt := expCommission.AmountOf(n.GetDenom()) + for commission.AmountOf(n.GetDenom()).LT(expAmt) { + commission, err = checkCommissionAfter(n, gh, validatorAddr, lapse) + if err != nil { + return nil, errorsmod.Wrap(err, "error checking commission") + } + } + + return commission, err +} + +// checkCommissionAfter is a helper function that checks the accrued commission +// after the provided time lapse +func checkCommissionAfter(n network.Network, gh grpc.Handler, valAddr string, lapse time.Duration) (sdk.DecCoins, error) { + err := n.NextBlockAfter(lapse) + if err != nil { + return nil, errorsmod.Wrap(err, "failed to commit block after voting period ends") + } + + res, err := gh.GetValidatorCommission(valAddr) + if err != nil { + return nil, errorsmod.Wrapf(err, "error while querying for delegation rewards") + } + + return res.Commission.Commission, nil +} + +// checkNonZeroInflation is a helper function that checks if the network's +// inflation is non-zero. +// This is required to ensure that rewards and commission are accrued. +func checkNonZeroInflation(n network.Network) error { + res, err := n.GetMintClient().Inflation(n.GetContext(), &minttypes.QueryInflationRequest{}) + if err != nil { + return errorsmod.Wrap(err, "failed to get inflation") + } + + if res.Inflation.IsZero() { + return errors.New("inflation is zero; must be non-zero for rewards or commission to be distributed") + } + + return nil +} diff --git a/testutil/integration/os/utils/types.go b/testutil/integration/os/utils/types.go new file mode 100644 index 00000000..96f17deb --- /dev/null +++ b/testutil/integration/os/utils/types.go @@ -0,0 +1,15 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package utils + +import ( + "github.com/ethereum/go-ethereum/common" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func ValidatorConsAddressToHex(valAddress string) common.Address { + coinbaseAddressBytes := sdk.ConsAddress(valAddress).Bytes() + return common.BytesToAddress(coinbaseAddressBytes) +} diff --git a/testutil/integration/os/utils/unit.go b/testutil/integration/os/utils/unit.go index b8efbed2..e714527c 100644 --- a/testutil/integration/os/utils/unit.go +++ b/testutil/integration/os/utils/unit.go @@ -3,17 +3,18 @@ // // This file contains all utility function that require the access to the unit // test network and should only be used in unit tests. + package utils import ( "fmt" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - "github.com/evmos/os/testutil" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" "github.com/evmos/os/testutil/integration/os/network" erc20types "github.com/evmos/os/x/erc20/types" ) @@ -30,10 +31,13 @@ func RegisterEvmosERC20Coins( network network.UnitTestNetwork, tokenReceiver sdk.AccAddress, ) (erc20types.TokenPair, error) { - bondDenom := network.App.StakingKeeper.BondDenom(network.GetContext()) + bondDenom, err := network.App.StakingKeeper.BondDenom(network.GetContext()) + if err != nil { + return erc20types.TokenPair{}, err + } - coin := sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(TokenToMint)) - err := network.App.BankKeeper.MintCoins( + coin := sdk.NewCoin(bondDenom, math.NewInt(TokenToMint)) + err = network.App.BankKeeper.MintCoins( network.GetContext(), minttypes.ModuleName, sdk.NewCoins(coin), @@ -51,7 +55,7 @@ func RegisterEvmosERC20Coins( return erc20types.TokenPair{}, err } - evmosMetadata, found := network.App.BankKeeper.GetDenomMetaData(network.GetContext(), testutil.ExampleAttoDenom) + evmosMetadata, found := network.App.BankKeeper.GetDenomMetaData(network.GetContext(), bondDenom) if !found { return erc20types.TokenPair{}, fmt.Errorf("expected evmos denom metadata") } @@ -74,6 +78,8 @@ func RegisterEvmosERC20Coins( // ERC20 token. The function performs all the required steps for the registration // like registering the denom trace in the transfer keeper and minting the token // with the bank. Returns the TokenPair or an error. +// +// TODO: why is this not yet used func RegisterIBCERC20Coins( network *network.UnitTestNetwork, tokenReceiver sdk.AccAddress, diff --git a/testutil/network/network.go b/testutil/network/network.go index 5e7a4054..a376c5ec 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -12,21 +12,23 @@ import ( "net/http" "net/url" "os" + "os/signal" "path/filepath" "strings" "sync" + "syscall" "testing" "time" + testconstants "github.com/evmos/os/testutil/constants" + + "cosmossdk.io/log" "cosmossdk.io/math" - "cosmossdk.io/simapp" - dbm "github.com/cometbft/cometbft-db" - tmcfg "github.com/cometbft/cometbft/config" - tmflags "github.com/cometbft/cometbft/libs/cli/flags" - "github.com/cometbft/cometbft/libs/log" - tmrand "github.com/cometbft/cometbft/libs/rand" + pruningtypes "cosmossdk.io/store/pruning/types" + cmtrand "github.com/cometbft/cometbft/libs/rand" "github.com/cometbft/cometbft/node" - tmclient "github.com/cometbft/cometbft/rpc/client" + cmtclient "github.com/cometbft/cometbft/rpc/client" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" @@ -38,8 +40,7 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" srvconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" - cosmostestutil "github.com/cosmos/cosmos-sdk/testutil" + "github.com/cosmos/cosmos-sdk/testutil" simutils "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -50,17 +51,18 @@ import ( "github.com/evmos/os/crypto/hd" exampleapp "github.com/evmos/os/example_chain" chaincmd "github.com/evmos/os/example_chain/osd/cmd" - "github.com/evmos/os/testutil" - "github.com/spf13/cobra" - "google.golang.org/grpc" - - "github.com/evmos/os/encoding" "github.com/evmos/os/server/config" evmostypes "github.com/evmos/os/types" + "github.com/spf13/cobra" + "golang.org/x/sync/errgroup" + "google.golang.org/grpc" ) // package-wide network lock to only allow one test network at a time -var lock = new(sync.Mutex) +var ( + lock = new(sync.Mutex) + portPool = make(chan string, 200) +) // AppConstructor defines a function which accepts a network configuration and // creates an ABCI Application to provide to Tendermint. @@ -75,45 +77,51 @@ type Config struct { InterfaceRegistry codectypes.InterfaceRegistry TxConfig client.TxConfig AccountRetriever client.AccountRetriever - AppConstructor AppConstructor // the ABCI application constructor - GenesisState simapp.GenesisState // custom gensis state to provide - TimeoutCommit time.Duration // the consensus commitment timeout - AccountTokens math.Int // the amount of unique validator tokens (e.g. 1000node0) - StakingTokens math.Int // the amount of tokens each validator has available to stake - BondedTokens math.Int // the amount of tokens each validator stakes - NumValidators int // the total number of validators to create and bond - ChainID string // the network chain-id - BondDenom string // the staking bond denomination - MinGasPrices string // the minimum gas prices each validator will accept - PruningStrategy string // the pruning strategy each validator will have - SigningAlgo string // signing algorithm for keys - RPCAddress string // RPC listen address (including port) - JSONRPCAddress string // JSON-RPC listen address (including port) - APIAddress string // REST API listen address (including port) - GRPCAddress string // GRPC server listen address (including port) - EnableTMLogging bool // enable Tendermint logging to STDOUT - CleanupDir bool // remove base temporary directory during cleanup - PrintMnemonic bool // print the mnemonic of first validator as log output for testing + AppConstructor AppConstructor // the ABCI application constructor + GenesisState evmostypes.GenesisState // custom gensis state to provide + TimeoutCommit time.Duration // the consensus commitment timeout + AccountTokens math.Int // the amount of unique validator tokens (e.g. 1000node0) + StakingTokens math.Int // the amount of tokens each validator has available to stake + BondedTokens math.Int // the amount of tokens each validator stakes + NumValidators int // the total number of validators to create and bond + ChainID string // the network chain-id + BondDenom string // the staking bond denomination + MinGasPrices string // the minimum gas prices each validator will accept + PruningStrategy string // the pruning strategy each validator will have + SigningAlgo string // signing algorithm for keys + RPCAddress string // RPC listen address (including port) + JSONRPCAddress string // JSON-RPC listen address (including port) + APIAddress string // REST API listen address (including port) + GRPCAddress string // GRPC server listen address (including port) + EnableTMLogging bool // enable Tendermint logging to STDOUT + CleanupDir bool // remove base temporary directory during cleanup + PrintMnemonic bool // print the mnemonic of first validator as log output for testing } // DefaultConfig returns a sane default configuration suitable for nearly all // testing requirements. func DefaultConfig() Config { - encCfg := encoding.MakeConfig(exampleapp.ModuleBasics) - chainID := fmt.Sprintf("evmos_%d-1", tmrand.Int63n(9999999999999)+1) - return Config{ - Codec: encCfg.Codec, - TxConfig: encCfg.TxConfig, - LegacyAmino: encCfg.Amino, - InterfaceRegistry: encCfg.InterfaceRegistry, + chainID := fmt.Sprintf("evmos_%d-1", cmtrand.Int63n(9999999999999)+1) + dir, err := os.MkdirTemp("", "simapp") + if err != nil { + panic(fmt.Sprintf("failed creating temporary directory: %v", err)) + } + defer os.RemoveAll(dir) + tempApp := exampleapp.NewExampleApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simutils.NewAppOptionsWithFlagHome(dir), baseapp.SetChainID(chainID)) + + cfg := Config{ + Codec: tempApp.AppCodec(), + TxConfig: tempApp.TxConfig(), + LegacyAmino: tempApp.LegacyAmino(), + InterfaceRegistry: tempApp.InterfaceRegistry(), AccountRetriever: authtypes.AccountRetriever{}, AppConstructor: NewAppConstructor(chainID), - GenesisState: exampleapp.ModuleBasics.DefaultGenesis(encCfg.Codec), + GenesisState: tempApp.DefaultGenesis(), TimeoutCommit: 3 * time.Second, ChainID: chainID, NumValidators: 4, BondDenom: "aevmos", - MinGasPrices: fmt.Sprintf("0.000006%s", testutil.ExampleAttoDenom), + MinGasPrices: fmt.Sprintf("0.000006%s", testconstants.ExampleAttoDenom), AccountTokens: sdk.TokensFromConsensusPower(1000000000000000000, evmostypes.AttoPowerReduction), StakingTokens: sdk.TokensFromConsensusPower(500000000000000000, evmostypes.AttoPowerReduction), BondedTokens: sdk.TokensFromConsensusPower(100000000000000000, evmostypes.AttoPowerReduction), @@ -123,9 +131,10 @@ func DefaultConfig() Config { KeyringOptions: []keyring.Option{hd.EthSecp256k1Option()}, PrintMnemonic: false, } + return cfg } -// NewAppConstructor returns a new evmOS example application construction +// NewAppConstructor returns a new Evmos AppConstructor func NewAppConstructor(chainID string) AppConstructor { return func(val Validator) servertypes.Application { return exampleapp.NewExampleApp( @@ -173,15 +182,18 @@ type ( P2PAddress string Address sdk.AccAddress ValAddress sdk.ValAddress - RPCClient tmclient.Client + RPCClient cmtclient.Client JSONRPCClient *ethclient.Client + app servertypes.Application tmNode *node.Node api *api.Server grpc *grpc.Server grpcWeb *http.Server jsonrpc *http.Server jsonrpcDone chan struct{} + errGroup *errgroup.Group + cancelFn context.CancelFunc } ) @@ -255,13 +267,13 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { appCfg.Telemetry.GlobalLabels = [][]string{{"chain_id", cfg.ChainID}} ctx := server.NewDefaultContext() - tmCfg := ctx.Config - tmCfg.Consensus.TimeoutCommit = cfg.TimeoutCommit + cmtCfg := ctx.Config + cmtCfg.Consensus.TimeoutCommit = cfg.TimeoutCommit // Only allow the first validator to expose an RPC, API and gRPC // server/client due to Tendermint in-process constraints. apiAddr := "" - tmCfg.RPC.ListenAddress = "" + cmtCfg.RPC.ListenAddress = "" appCfg.GRPC.Enable = false appCfg.GRPCWeb.Enable = false appCfg.JSONRPC.Enable = false @@ -270,11 +282,11 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { if cfg.APIAddress != "" { apiListenAddr = cfg.APIAddress } else { - var err error - apiListenAddr, _, err = server.FreeTCPAddr() - if err != nil { - return nil, err + if len(portPool) == 0 { + return nil, fmt.Errorf("failed to get port for API server") } + port := <-portPool + apiListenAddr = fmt.Sprintf("tcp://0.0.0.0:%s", port) } appCfg.API.Address = apiListenAddr @@ -285,41 +297,35 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { apiAddr = fmt.Sprintf("http://%s:%s", apiURL.Hostname(), apiURL.Port()) if cfg.RPCAddress != "" { - tmCfg.RPC.ListenAddress = cfg.RPCAddress + cmtCfg.RPC.ListenAddress = cfg.RPCAddress } else { - rpcAddr, _, err := server.FreeTCPAddr() - if err != nil { - return nil, err + if len(portPool) == 0 { + return nil, fmt.Errorf("failed to get port for RPC server") } - tmCfg.RPC.ListenAddress = rpcAddr + port := <-portPool + cmtCfg.RPC.ListenAddress = fmt.Sprintf("tcp://0.0.0.0:%s", port) } if cfg.GRPCAddress != "" { appCfg.GRPC.Address = cfg.GRPCAddress } else { - _, grpcPort, err := server.FreeTCPAddr() - if err != nil { - return nil, err + if len(portPool) == 0 { + return nil, fmt.Errorf("failed to get port for GRPC server") } - appCfg.GRPC.Address = fmt.Sprintf("0.0.0.0:%s", grpcPort) + port := <-portPool + appCfg.GRPC.Address = fmt.Sprintf("0.0.0.0:%s", port) } appCfg.GRPC.Enable = true - - _, grpcWebPort, err := server.FreeTCPAddr() - if err != nil { - return nil, err - } - appCfg.GRPCWeb.Address = fmt.Sprintf("0.0.0.0:%s", grpcWebPort) appCfg.GRPCWeb.Enable = true if cfg.JSONRPCAddress != "" { appCfg.JSONRPC.Address = cfg.JSONRPCAddress } else { - _, jsonRPCPort, err := server.FreeTCPAddr() - if err != nil { - return nil, err + if len(portPool) == 0 { + return nil, fmt.Errorf("failed to get port for JSON-RPC server") } - appCfg.JSONRPC.Address = fmt.Sprintf("0.0.0.0:%s", jsonRPCPort) + port := <-portPool + appCfg.JSONRPC.Address = fmt.Sprintf("0.0.0.0:%s", port) } appCfg.JSONRPC.Enable = true appCfg.JSONRPC.API = config.GetAPINamespaces() @@ -327,8 +333,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { logger := log.NewNopLogger() if cfg.EnableTMLogging { - logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout)) - logger, _ = tmflags.ParseLogLevel("info", logger, tmcfg.DefaultLogLevel) + logger = log.NewLogger(os.Stdout) } ctx.Logger = logger @@ -348,25 +353,27 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { return nil, err } - tmCfg.SetRoot(nodeDir) - tmCfg.Moniker = nodeDirName + cmtCfg.SetRoot(nodeDir) + cmtCfg.Moniker = nodeDirName monikers[i] = nodeDirName - proxyAddr, _, err := server.FreeTCPAddr() - if err != nil { - return nil, err + if len(portPool) == 0 { + return nil, fmt.Errorf("failed to get port for Proxy server") } - tmCfg.ProxyApp = proxyAddr + port := <-portPool + proxyAddr := fmt.Sprintf("tcp://0.0.0.0:%s", port) + cmtCfg.ProxyApp = proxyAddr - p2pAddr, _, err := server.FreeTCPAddr() - if err != nil { - return nil, err + if len(portPool) == 0 { + return nil, fmt.Errorf("failed to get port for Proxy server") } - tmCfg.P2P.ListenAddress = p2pAddr - tmCfg.P2P.AddrBookStrict = false - tmCfg.P2P.AllowDuplicateIP = true + port = <-portPool + p2pAddr := fmt.Sprintf("tcp://0.0.0.0:%s", port) + cmtCfg.P2P.ListenAddress = p2pAddr + cmtCfg.P2P.AddrBookStrict = false + cmtCfg.P2P.AllowDuplicateIP = true - nodeID, pubKey, err := genutil.InitializeNodeValidatorFiles(tmCfg) + nodeID, pubKey, err := genutil.InitializeNodeValidatorFiles(cmtCfg) if err != nil { return nil, err } @@ -384,7 +391,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { return nil, err } - addr, secret, err := cosmostestutil.GenerateSaveCoinKey(kb, nodeDirName, "", true, algo) + addr, secret, err := testutil.GenerateSaveCoinKey(kb, nodeDirName, "", true, algo) if err != nil { return nil, err } @@ -412,7 +419,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { sdk.NewCoin(cfg.BondDenom, cfg.StakingTokens), ) - genFiles = append(genFiles, tmCfg.GenesisFile()) + genFiles = append(genFiles, cmtCfg.GenesisFile()) genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: balances.Sort()}) genAccounts = append(genAccounts, authtypes.NewBaseAccount(addr, nil, 0, 0)) @@ -422,7 +429,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { } createValMsg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addr), + addr.String(), valPubKeys[i], sdk.NewCoin(cfg.BondDenom, cfg.BondedTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), @@ -456,7 +463,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { WithKeybase(kb). WithTxConfig(cfg.TxConfig) - if err := tx.Sign(txFactory, nodeDirName, txBuilder, true); err != nil { + if err := tx.Sign(context.Background(), txFactory, nodeDirName, txBuilder, true); err != nil { return nil, err } @@ -469,7 +476,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { return nil, err } - customAppTemplate, _ := chaincmd.InitAppConfig(testutil.ExampleAttoDenom) + customAppTemplate, _ := chaincmd.InitAppConfig(testconstants.ExampleAttoDenom) srvconfig.SetConfigTemplate(customAppTemplate) srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config/app.toml"), appCfg) @@ -483,7 +490,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { clientCtx := client.Context{}. WithKeyringDir(clientDir). WithKeyring(kb). - WithHomeDir(tmCfg.RootDir). + WithHomeDir(cmtCfg.RootDir). WithChainID(cfg.ChainID). WithInterfaceRegistry(cfg.InterfaceRegistry). WithCodec(cfg.Codec). @@ -499,8 +506,8 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { NodeID: nodeID, PubKey: pubKey, Moniker: nodeDirName, - RPCAddress: tmCfg.RPC.ListenAddress, - P2PAddress: tmCfg.P2P.ListenAddress, + RPCAddress: cmtCfg.RPC.ListenAddress, + P2PAddress: cmtCfg.P2P.ListenAddress, APIAddress: apiAddr, Address: addr, ValAddress: sdk.ValAddress(addr), @@ -528,7 +535,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { // Ensure we cleanup incase any test was abruptly halted (e.g. SIGINT) as any // defer in a test would not be called. - server.TrapSignal(network.Cleanup) + trapSignal(network.Cleanup) return network, nil } @@ -693,3 +700,27 @@ func centerText(text string, width int) string { return fmt.Sprintf("%s%s%s", leftBuffer, text, rightBuffer) } + +// trapSignal traps SIGINT and SIGTERM and calls os.Exit once a signal is received. +func trapSignal(cleanupFunc func()) { + sigs := make(chan os.Signal, 1) + signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) + + go func() { + sig := <-sigs + + if cleanupFunc != nil { + cleanupFunc() + } + exitCode := 128 + + switch sig { + case syscall.SIGINT: + exitCode += int(syscall.SIGINT) + case syscall.SIGTERM: + exitCode += int(syscall.SIGTERM) + } + + os.Exit(exitCode) + }() +} diff --git a/testutil/network/util.go b/testutil/network/util.go index 62e1ce78..792f1b8d 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -4,11 +4,13 @@ package network import ( + "context" "encoding/json" "fmt" "path/filepath" - "time" + "cosmossdk.io/log" + cmtcfg "github.com/cometbft/cometbft/config" tmos "github.com/cometbft/cometbft/libs/os" "github.com/cometbft/cometbft/node" "github.com/cometbft/cometbft/p2p" @@ -16,12 +18,11 @@ import ( "github.com/cometbft/cometbft/proxy" "github.com/cometbft/cometbft/rpc/client/local" "github.com/cometbft/cometbft/types" - tmtime "github.com/cometbft/cometbft/types/time" - "github.com/ethereum/go-ethereum/ethclient" - + cmttime "github.com/cometbft/cometbft/types/time" + sdkserver "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" servergrpc "github.com/cosmos/cosmos-sdk/server/grpc" - srvtypes "github.com/cosmos/cosmos-sdk/server/types" + servercmtlog "github.com/cosmos/cosmos-sdk/server/log" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" @@ -31,37 +32,40 @@ import ( govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - + "github.com/ethereum/go-ethereum/ethclient" "github.com/evmos/os/server" evmtypes "github.com/evmos/os/x/evm/types" + "golang.org/x/sync/errgroup" ) func startInProcess(cfg Config, val *Validator) error { logger := val.Ctx.Logger - tmCfg := val.Ctx.Config - tmCfg.Instrumentation.Prometheus = false + cmtCfg := val.Ctx.Config + cmtCfg.Instrumentation.Prometheus = false if err := val.AppConfig.ValidateBasic(); err != nil { return err } - nodeKey, err := p2p.LoadOrGenNodeKey(tmCfg.NodeKeyFile()) + nodeKey, err := p2p.LoadOrGenNodeKey(cmtCfg.NodeKeyFile()) if err != nil { return err } app := cfg.AppConstructor(*val) + val.app = app - genDocProvider := node.DefaultGenesisDocProviderFunc(tmCfg) + genDocProvider := server.GenDocProvider(cmtCfg) + cmtApp := sdkserver.NewCometABCIWrapper(app) tmNode, err := node.NewNode( - tmCfg, - pvm.LoadOrGenFilePV(tmCfg.PrivValidatorKeyFile(), tmCfg.PrivValidatorStateFile()), + cmtCfg, + pvm.LoadOrGenFilePV(cmtCfg.PrivValidatorKeyFile(), cmtCfg.PrivValidatorStateFile()), nodeKey, - proxy.NewLocalClientCreator(app), + proxy.NewLocalClientCreator(cmtApp), genDocProvider, - node.DefaultDBProvider, - node.DefaultMetricsProvider(tmCfg.Instrumentation), - logger.With("module", val.Moniker), + cmtcfg.DefaultDBProvider, + node.DefaultMetricsProvider(cmtCfg.Instrumentation), + servercmtlog.CometLoggerWrapper{Logger: logger.With("module", val.Moniker)}, ) if err != nil { return err @@ -87,43 +91,37 @@ func startInProcess(cfg Config, val *Validator) error { // Add the tendermint queries service in the gRPC router. app.RegisterTendermintService(val.ClientCtx) + app.RegisterNodeService(val.ClientCtx, val.AppConfig.Config) } + ctx := context.Background() + ctx, val.cancelFn = context.WithCancel(ctx) + val.errGroup, ctx = errgroup.WithContext(ctx) + if val.AppConfig.API.Enable && val.APIAddress != "" { - apiSrv := api.New(val.ClientCtx, logger.With("module", "api-server")) + apiSrv := api.New(val.ClientCtx, logger.With("module", "api-server"), val.grpc) app.RegisterAPIRoutes(apiSrv, val.AppConfig.API) - errCh := make(chan error) - - go func() { - if err := apiSrv.Start(val.AppConfig.Config); err != nil { - errCh <- err - } - }() - - select { - case err := <-errCh: - return err - case <-time.After(srvtypes.ServerStartTime): // assume server started successfully - } + val.errGroup.Go(func() error { + return apiSrv.Start(ctx, val.AppConfig.Config) + }) val.api = apiSrv } if val.AppConfig.GRPC.Enable { - grpcSrv, err := servergrpc.StartGRPCServer(val.ClientCtx, app, val.AppConfig.GRPC) + grpcSrv, err := servergrpc.NewGRPCServer(val.ClientCtx, app, val.AppConfig.GRPC) if err != nil { return err } - val.grpc = grpcSrv + // Start the gRPC server in a goroutine. Note, the provided ctx will ensure + // that the server is gracefully shut down. + val.errGroup.Go(func() error { + return servergrpc.StartGRPCServer(ctx, logger.With(log.ModuleKey, "grpc-server"), val.AppConfig.GRPC, grpcSrv) + }) - if val.AppConfig.GRPCWeb.Enable { - val.grpcWeb, err = servergrpc.StartGRPCWeb(grpcSrv, val.AppConfig.Config) - if err != nil { - return err - } - } + val.grpc = grpcSrv } if val.AppConfig.JSONRPC.Enable && val.AppConfig.JSONRPC.Address != "" { @@ -151,27 +149,27 @@ func startInProcess(cfg Config, val *Validator) error { } func collectGenFiles(cfg Config, vals []*Validator, outputDir string) error { - genTime := tmtime.Now() + genTime := cmttime.Now() for i := 0; i < cfg.NumValidators; i++ { - tmCfg := vals[i].Ctx.Config + cmtCfg := vals[i].Ctx.Config nodeDir := filepath.Join(outputDir, vals[i].Moniker, "evmosd") gentxsDir := filepath.Join(outputDir, "gentxs") - tmCfg.Moniker = vals[i].Moniker - tmCfg.SetRoot(nodeDir) + cmtCfg.Moniker = vals[i].Moniker + cmtCfg.SetRoot(nodeDir) initCfg := genutiltypes.NewInitConfig(cfg.ChainID, gentxsDir, vals[i].NodeID, vals[i].PubKey) - genFile := tmCfg.GenesisFile() - genDoc, err := types.GenesisDocFromFile(genFile) + genFile := cmtCfg.GenesisFile() + appGenesis, err := genutiltypes.AppGenesisFromFile(genFile) if err != nil { return err } appState, err := genutil.GenAppStateFromConfig(cfg.Codec, cfg.TxConfig, - tmCfg, initCfg, *genDoc, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator) + cmtCfg, initCfg, appGenesis, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator, cfg.TxConfig.SigningContext().ValidatorAddressCodec()) if err != nil { return err } @@ -213,9 +211,9 @@ func initGenFiles(cfg Config, genAccounts []authtypes.GenesisAccount, genBalance cfg.Codec.MustUnmarshalJSON(cfg.GenesisState[govtypes.ModuleName], &govGenState) govGenState.Params.MinDeposit[0].Denom = cfg.BondDenom + govGenState.Params.ExpeditedMinDeposit[0].Denom = cfg.BondDenom cfg.GenesisState[govtypes.ModuleName] = cfg.Codec.MustMarshalJSON(&govGenState) - // TODO: remove Evmos native implementations var inflationGenState minttypes.GenesisState cfg.Codec.MustUnmarshalJSON(cfg.GenesisState[minttypes.ModuleName], &inflationGenState) diff --git a/testutil/staking_rewards.go b/testutil/staking_rewards.go new file mode 100644 index 00000000..b8901efe --- /dev/null +++ b/testutil/staking_rewards.go @@ -0,0 +1,126 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package testutil + +import ( + "fmt" + "testing" + + "github.com/evmos/os/testutil/constants" + + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" + teststaking "github.com/cosmos/cosmos-sdk/x/staking/testutil" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + app "github.com/evmos/os/example_chain" + testutiltx "github.com/evmos/os/testutil/tx" + "github.com/stretchr/testify/require" +) + +// PrepareAccountsForDelegationRewards prepares the test suite for testing to withdraw delegation rewards. +// +// Balance is the amount of tokens that will be left in the account after the setup is done. +// For each defined reward, a validator is created and tokens are allocated to it using the distribution keeper, +// such that the given amount of tokens is outstanding as a staking reward for the account. +// +// The setup is done in the following way: +// - Fund the account with the given address with the given balance. +// - If the given balance is zero, the account will be created with zero balance. +// +// For every reward defined in the rewards argument, the following steps are executed: +// - Set up a validator with zero commission and delegate to it -> the account delegation will be 50% of the total delegation. +// - Allocate rewards to the validator. +// +// The function returns the updated context along with a potential error. +func PrepareAccountsForDelegationRewards(t *testing.T, ctx sdk.Context, app *app.ExampleChain, addr sdk.AccAddress, balance math.Int, rewards ...math.Int) (sdk.Context, error) { + // Calculate the necessary amount of tokens to fund the account in order for the desired residual balance to + // be left after creating validators and delegating to them. + totalRewards := math.ZeroInt() + for _, reward := range rewards { + totalRewards = totalRewards.Add(reward) + } + totalNeededBalance := balance.Add(totalRewards) + + if totalNeededBalance.IsZero() { + app.AccountKeeper.SetAccount(ctx, app.AccountKeeper.NewAccountWithAddress(ctx, addr)) + } else { + // Fund account with enough tokens to stake them + err := FundAccountWithBaseDenom(ctx, app.BankKeeper, addr, totalNeededBalance.Int64()) + if err != nil { + return sdk.Context{}, fmt.Errorf("failed to fund account: %s", err.Error()) + } + } + + if totalRewards.IsZero() { + return ctx, nil + } + + // reset historical count in distribution keeper which is necessary + // for the delegation rewards to be calculated correctly + app.DistrKeeper.DeleteAllValidatorHistoricalRewards(ctx) + + // set distribution module account balance which pays out the rewards + distrAcc := app.DistrKeeper.GetDistributionAccount(ctx) + err := FundModuleAccount(ctx, app.BankKeeper, distrAcc.GetName(), sdk.NewCoins(sdk.NewCoin(constants.ExampleAttoDenom, totalRewards))) + if err != nil { + return sdk.Context{}, fmt.Errorf("failed to fund distribution module account: %s", err.Error()) + } + app.AccountKeeper.SetModuleAccount(ctx, distrAcc) + + for _, reward := range rewards { + if reward.IsZero() { + continue + } + + // Set up validator and delegate to it + privKey := ed25519.GenPrivKey() + addr2, _ := testutiltx.NewAccAddressAndKey() + err := FundAccountWithBaseDenom(ctx, app.BankKeeper, addr2, reward.Int64()) + if err != nil { + return sdk.Context{}, fmt.Errorf("failed to fund validator account: %s", err.Error()) + } + + zeroDec := math.LegacyZeroDec() + stakingParams, err := app.StakingKeeper.GetParams(ctx) + if err != nil { + return sdk.Context{}, fmt.Errorf("failed to get staking params: %s", err.Error()) + } + stakingParams.BondDenom = constants.ExampleAttoDenom + stakingParams.MinCommissionRate = zeroDec + err = app.StakingKeeper.SetParams(ctx, stakingParams) + require.NoError(t, err) + + stakingHelper := teststaking.NewHelper(t, ctx, app.StakingKeeper) + stakingHelper.Commission = stakingtypes.NewCommissionRates(zeroDec, zeroDec, zeroDec) + stakingHelper.Denom = constants.ExampleAttoDenom + + valAddr := sdk.ValAddress(addr2.Bytes()) + // self-delegate the same amount of tokens as the delegate address also stakes + // this ensures, that the delegation rewards are 50% of the total rewards + stakingHelper.CreateValidator(valAddr, privKey.PubKey(), reward, true) + stakingHelper.Delegate(addr, valAddr, reward) + + // end block to bond validator and increase block height + // Not using Commit() here because code panics due to invalid block height + _, err = app.StakingKeeper.EndBlocker(ctx) + require.NoError(t, err) + + // allocate rewards to validator (of these 50% will be paid out to the delegator) + validator, err := app.StakingKeeper.Validator(ctx, valAddr) + if err != nil { + return sdk.Context{}, fmt.Errorf("failed to get validator: %s", err.Error()) + } + allocatedRewards := sdk.NewDecCoins(sdk.NewDecCoin(constants.ExampleAttoDenom, reward.Mul(math.NewInt(2)))) + if err = app.DistrKeeper.AllocateTokensToValidator(ctx, validator, allocatedRewards); err != nil { + return sdk.Context{}, fmt.Errorf("failed to allocate tokens to validator: %s", err.Error()) + } + } + + // Increase block height in ctx for the rewards calculation + // NOTE: this will only work for unit tests that use the context + // returned by this function + currentHeight := ctx.BlockHeight() + return ctx.WithBlockHeight(currentHeight + 1), nil +} diff --git a/testutil/statedb.go b/testutil/statedb.go index 5ccdb687..64e721a0 100644 --- a/testutil/statedb.go +++ b/testutil/statedb.go @@ -12,5 +12,5 @@ import ( // NewStateDB returns a new StateDB for testing purposes. func NewStateDB(ctx sdk.Context, evmKeeper anteinterfaces.EVMKeeper) *statedb.StateDB { - return statedb.New(ctx, evmKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash().Bytes()))) + return statedb.New(ctx, evmKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash()))) } diff --git a/testutil/tx/cosmos.go b/testutil/tx/cosmos.go index dcc35be1..98a7474e 100644 --- a/testutil/tx/cosmos.go +++ b/testutil/tx/cosmos.go @@ -11,11 +11,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - app "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" + exampleapp "github.com/evmos/os/example_chain" + "github.com/evmos/os/testutil/constants" + protov2 "google.golang.org/protobuf/proto" ) -var DefaultFee = sdk.NewCoin(testutil.ExampleAttoDenom, sdkmath.NewInt(1e16)) // 0.01 AEVMOS +var DefaultFee = sdk.NewCoin(constants.ExampleAttoDenom, sdkmath.NewInt(1e16)) // 0.01 AEVMOS // CosmosTxArgs contains the params to create a cosmos tx type CosmosTxArgs struct { @@ -41,7 +42,7 @@ type CosmosTxArgs struct { // It returns the signed transaction and an error func PrepareCosmosTx( ctx sdk.Context, - app *app.ExampleChain, + exampleApp *exampleapp.ExampleChain, args CosmosTxArgs, ) (authsigning.Tx, error) { txBuilder := args.TxCfg.NewTxBuilder() @@ -50,7 +51,7 @@ func PrepareCosmosTx( var fees sdk.Coins if args.GasPrice != nil { - fees = sdk.Coins{{Denom: testutil.ExampleAttoDenom, Amount: args.GasPrice.MulRaw(int64(args.Gas))}} //#nosec G115 -- int overflow is not a concern here + fees = sdk.Coins{{Denom: constants.ExampleAttoDenom, Amount: args.GasPrice.MulRaw(int64(args.Gas))}} //#nosec G115 } else { fees = sdk.Coins{DefaultFee} } @@ -64,7 +65,7 @@ func PrepareCosmosTx( return signCosmosTx( ctx, - app, + exampleApp, args, txBuilder, ) @@ -74,12 +75,17 @@ func PrepareCosmosTx( // the provided private key func signCosmosTx( ctx sdk.Context, - app *app.ExampleChain, + exampleApp *exampleapp.ExampleChain, args CosmosTxArgs, txBuilder client.TxBuilder, ) (authsigning.Tx, error) { addr := sdk.AccAddress(args.Priv.PubKey().Address().Bytes()) - seq, err := app.AccountKeeper.GetSequence(ctx, addr) + seq, err := exampleApp.AccountKeeper.GetSequence(ctx, addr) + if err != nil { + return nil, err + } + + signMode, err := authsigning.APISignModeToInternal(args.TxCfg.SignModeHandler().DefaultMode()) if err != nil { return nil, err } @@ -89,7 +95,7 @@ func signCosmosTx( sigV2 := signing.SignatureV2{ PubKey: args.Priv.PubKey(), Data: &signing.SingleSignatureData{ - SignMode: args.TxCfg.SignModeHandler().DefaultMode(), + SignMode: signMode, Signature: nil, }, Sequence: seq, @@ -102,14 +108,15 @@ func signCosmosTx( } // Second round: all signer infos are set, so each signer can sign. - accNumber := app.AccountKeeper.GetAccount(ctx, addr).GetAccountNumber() + accNumber := exampleApp.AccountKeeper.GetAccount(ctx, addr).GetAccountNumber() signerData := authsigning.SignerData{ ChainID: args.ChainID, AccountNumber: accNumber, Sequence: seq, } sigV2, err = tx.SignWithPrivKey( - args.TxCfg.SignModeHandler().DefaultMode(), + ctx, + signMode, signerData, txBuilder, args.Priv, args.TxCfg, seq, @@ -133,6 +140,7 @@ var _ sdk.Tx = &InvalidTx{} // NOTE: This is used for testing purposes, to serve the edge case of invalid data being passed to functions. type InvalidTx struct{} -func (InvalidTx) GetMsgs() []sdk.Msg { return []sdk.Msg{nil} } +func (InvalidTx) GetMsgs() []sdk.Msg { return nil } +func (InvalidTx) GetMsgsV2() ([]protov2.Message, error) { return nil, nil } func (InvalidTx) ValidateBasic() error { return nil } diff --git a/testutil/tx/eip712.go b/testutil/tx/eip712.go index edc6798c..f4f59632 100644 --- a/testutil/tx/eip712.go +++ b/testutil/tx/eip712.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package tx import ( @@ -10,14 +11,14 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx/signing" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" cryptocodec "github.com/evmos/os/crypto/codec" "github.com/evmos/os/ethereum/eip712" - app "github.com/evmos/os/example_chain" + exampleapp "github.com/evmos/os/example_chain" "github.com/evmos/os/types" ) @@ -44,12 +45,12 @@ type signatureV2Args struct { // It returns the signed transaction and an error func CreateEIP712CosmosTx( ctx sdk.Context, - app *app.ExampleChain, + exampleApp *exampleapp.ExampleChain, args EIP712TxArgs, ) (sdk.Tx, error) { builder, err := PrepareEIP712CosmosTx( ctx, - app, + exampleApp, args, ) return builder.GetTx(), err @@ -60,7 +61,7 @@ func CreateEIP712CosmosTx( // It returns the tx builder with the signed transaction and an error func PrepareEIP712CosmosTx( ctx sdk.Context, - exampleApp *app.ExampleChain, + exampleApp *exampleapp.ExampleChain, args EIP712TxArgs, ) (client.TxBuilder, error) { txArgs := args.CosmosTxArgs @@ -83,7 +84,7 @@ func PrepareEIP712CosmosTx( fee := legacytx.NewStdFee(txArgs.Gas, txArgs.Fees) //nolint:all msgs := txArgs.Msgs - data := legacytx.StdSignBytes(ctx.ChainID(), accNumber, nonce, 0, fee, msgs, "", nil) + data := legacytx.StdSignBytes(ctx.ChainID(), accNumber, nonce, 0, fee, msgs, "") typedDataArgs := typedDataArgs{ chainID: chainIDNum, @@ -123,7 +124,7 @@ func PrepareEIP712CosmosTx( // the provided private key and the typed data func signCosmosEIP712Tx( ctx sdk.Context, - exampleApp *app.ExampleChain, + exampleApp *exampleapp.ExampleChain, args EIP712TxArgs, builder authtx.ExtensionOptionsTxBuilder, data apitypes.TypedData, @@ -142,7 +143,7 @@ func signCosmosEIP712Tx( } keyringSigner := NewSigner(priv) - signature, pubKey, err := keyringSigner.SignByAddress(from, sigHash) + signature, pubKey, err := keyringSigner.SignByAddress(from, sigHash, signingtypes.SignMode_SIGN_MODE_DIRECT) if err != nil { return nil, err } @@ -191,13 +192,13 @@ func createTypedData(args typedDataArgs, useLegacy bool) (apitypes.TypedData, er // getTxSignatureV2 returns the SignatureV2 object corresponding to // the arguments, using the legacy implementation as needed. -func getTxSignatureV2(args signatureV2Args) signing.SignatureV2 { +func getTxSignatureV2(args signatureV2Args) signingtypes.SignatureV2 { // Must use SIGN_MODE_DIRECT, since Amino has some trouble parsing certain Any values from a SignDoc // with the Legacy EIP-712 TypedData encodings. This is not an issue with the latest encoding. - return signing.SignatureV2{ + return signingtypes.SignatureV2{ PubKey: args.pubKey, - Data: &signing.SingleSignatureData{ - SignMode: signing.SignMode_SIGN_MODE_DIRECT, + Data: &signingtypes.SingleSignatureData{ + SignMode: signingtypes.SignMode_SIGN_MODE_DIRECT, Signature: args.signature, }, Sequence: args.nonce, diff --git a/testutil/tx/eth.go b/testutil/tx/eth.go index 47eb257e..40e39803 100644 --- a/testutil/tx/eth.go +++ b/testutil/tx/eth.go @@ -4,9 +4,12 @@ package tx import ( + "context" "encoding/json" "math/big" + testconstants "github.com/evmos/os/testutil/constants" + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" @@ -18,9 +21,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" - app "github.com/evmos/os/example_chain" + exampleapp "github.com/evmos/os/example_chain" "github.com/evmos/os/server/config" - "github.com/evmos/os/testutil" evmtypes "github.com/evmos/os/x/evm/types" ) @@ -28,13 +30,13 @@ import ( // It returns the signed transaction and an error func PrepareEthTx( txCfg client.TxConfig, - app *app.ExampleChain, + exampleApp *exampleapp.ExampleChain, priv cryptotypes.PrivKey, msgs ...sdk.Msg, ) (authsigning.Tx, error) { txBuilder := txCfg.NewTxBuilder() - signer := ethtypes.LatestSignerForChainID(app.EVMKeeper.ChainID()) + signer := ethtypes.LatestSignerForChainID(exampleApp.EVMKeeper.ChainID()) txFee := sdk.Coins{} txGasLimit := uint64(0) @@ -55,7 +57,7 @@ func PrepareEthTx( msg.From = "" txGasLimit += msg.GetGas() - txFee = txFee.Add(sdk.Coin{Denom: testutil.ExampleAttoDenom, Amount: sdkmath.NewIntFromBigInt(msg.GetFee())}) + txFee = txFee.Add(sdk.Coin{Denom: testconstants.ExampleAttoDenom, Amount: sdkmath.NewIntFromBigInt(msg.GetFee())}) } if err := txBuilder.SetMsgs(msgs...); err != nil { @@ -91,7 +93,7 @@ func PrepareEthTx( // Should this not be the case, just pass in zero. func CreateEthTx( ctx sdk.Context, - app *app.ExampleChain, + exampleApp *exampleapp.ExampleChain, privKey cryptotypes.PrivKey, from sdk.AccAddress, dest sdk.AccAddress, @@ -100,17 +102,17 @@ func CreateEthTx( ) (*evmtypes.MsgEthereumTx, error) { toAddr := common.BytesToAddress(dest.Bytes()) fromAddr := common.BytesToAddress(from.Bytes()) - chainID := app.EVMKeeper.ChainID() + chainID := exampleApp.EVMKeeper.ChainID() // When we send multiple Ethereum Tx's in one Cosmos Tx, we need to increment the nonce for each one. - nonce := app.EVMKeeper.GetNonce(ctx, fromAddr) + uint64(nonceIncrement) + nonce := exampleApp.EVMKeeper.GetNonce(ctx, fromAddr) + uint64(nonceIncrement) //#nosec G115 -- will not exceed uint64 evmTxParams := &evmtypes.EvmTxArgs{ ChainID: chainID, Nonce: nonce, To: &toAddr, Amount: amount, GasLimit: 100000, - GasFeeCap: app.FeeMarketKeeper.GetBaseFee(ctx), + GasFeeCap: exampleApp.FeeMarketKeeper.GetBaseFee(ctx), GasTipCap: big.NewInt(1), Accesses: ðtypes.AccessList{}, } @@ -119,7 +121,7 @@ func CreateEthTx( // If we are creating multiple eth Tx's with different senders, we need to sign here rather than later. if privKey != nil { - signer := ethtypes.LatestSignerForChainID(app.EVMKeeper.ChainID()) + signer := ethtypes.LatestSignerForChainID(exampleApp.EVMKeeper.ChainID()) err := msgEthereumTx.Sign(signer, NewSigner(privKey)) if err != nil { return nil, err @@ -132,7 +134,7 @@ func CreateEthTx( // GasLimit estimates the gas limit for the provided parameters. To achieve // this, need to provide the corresponding QueryClient to call the // `eth_estimateGas` rpc method. If not provided, returns a default value -func GasLimit(ctx sdk.Context, from common.Address, data evmtypes.HexString, queryClientEvm evmtypes.QueryClient) (uint64, error) { +func GasLimit(ctx context.Context, from common.Address, data evmtypes.HexString, queryClientEvm evmtypes.QueryClient) (uint64, error) { // default gas limit (used if no queryClientEvm is provided) gas := uint64(100000000000) @@ -145,8 +147,7 @@ func GasLimit(ctx sdk.Context, from common.Address, data evmtypes.HexString, que return gas, err } - goCtx := sdk.WrapSDKContext(ctx) - res, err := queryClientEvm.EstimateGas(goCtx, &evmtypes.EthCallRequest{ + res, err := queryClientEvm.EstimateGas(ctx, &evmtypes.EthCallRequest{ Args: args, GasCap: config.DefaultGasCap, }) diff --git a/testutil/tx/signer.go b/testutil/tx/signer.go index 98a5c3c5..b6217f4c 100644 --- a/testutil/tx/signer.go +++ b/testutil/tx/signer.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/evmos/os/crypto/ethsecp256k1" @@ -54,7 +55,7 @@ func NewSigner(sk cryptotypes.PrivKey) keyring.Signer { } // Sign signs the message using the underlying private key -func (s Signer) Sign(_ string, msg []byte) ([]byte, cryptotypes.PubKey, error) { +func (s Signer) Sign(_ string, msg []byte, _ signing.SignMode) ([]byte, cryptotypes.PubKey, error) { if s.privKey.Type() != ethsecp256k1.KeyType { return nil, nil, fmt.Errorf( "invalid private key type for signing ethereum tx; expected %s, got %s", @@ -72,11 +73,11 @@ func (s Signer) Sign(_ string, msg []byte) ([]byte, cryptotypes.PubKey, error) { } // SignByAddress sign byte messages with a user key providing the address. -func (s Signer) SignByAddress(address sdk.Address, msg []byte) ([]byte, cryptotypes.PubKey, error) { +func (s Signer) SignByAddress(address sdk.Address, msg []byte, signMode signing.SignMode) ([]byte, cryptotypes.PubKey, error) { signer := sdk.AccAddress(s.privKey.PubKey().Address()) if !signer.Equals(address) { return nil, nil, fmt.Errorf("address mismatch: signer %s ≠ given address %s", signer, address) } - return s.Sign("", msg) + return s.Sign("", msg, signMode) } diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..b1e70682 --- /dev/null +++ b/tox.ini @@ -0,0 +1,4 @@ +[flake8] +max-line-length = 120 +exclude = */node_modules +ignore = E203,W503 \ No newline at end of file diff --git a/types/block.go b/types/block.go index 886b11f1..e24f8c4a 100644 --- a/types/block.go +++ b/types/block.go @@ -21,7 +21,7 @@ func BlockGasLimit(ctx sdk.Context) uint64 { // Otherwise get from the consensus parameters cp := ctx.ConsensusParams() - if cp == nil || cp.Block == nil { + if cp.Block == nil { return 0 } diff --git a/types/codec.go b/types/codec.go index e747281d..1d746017 100644 --- a/types/codec.go +++ b/types/codec.go @@ -4,6 +4,7 @@ package types import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdktypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -12,7 +13,7 @@ import ( // implementations and interfaces. func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( - (*authtypes.AccountI)(nil), + (*sdktypes.AccountI)(nil), // TODO: uncomment after moving into migrations for EVM version // &EthAccount{}, ) diff --git a/types/dynamic_fee.pb.go b/types/dynamic_fee.pb.go index 5e64776a..42ec6674 100644 --- a/types/dynamic_fee.pb.go +++ b/types/dynamic_fee.pb.go @@ -6,6 +6,7 @@ package types import ( cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -72,22 +73,23 @@ func init() { func init() { proto.RegisterFile("os/types/v1/dynamic_fee.proto", fileDescriptor_a9afa21b8d75b43a) } var fileDescriptor_a9afa21b8d75b43a = []byte{ - // 227 bytes of a gzipped FileDescriptorProto + // 244 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcd, 0x2f, 0xd6, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, 0x4f, 0xa9, 0xcc, 0x4b, 0xcc, 0xcd, 0x4c, 0x8e, 0x4f, 0x4b, 0x4d, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xce, 0x2f, 0xd6, 0x03, 0x4b, - 0xeb, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0xc5, 0xf5, 0x41, 0x2c, 0x88, 0x12, - 0xa5, 0x2c, 0x2e, 0x69, 0xd7, 0x8a, 0x92, 0xd4, 0xbc, 0xe2, 0xcc, 0xfc, 0x3c, 0xff, 0x82, 0x92, - 0xcc, 0xfc, 0x3c, 0x17, 0x88, 0x31, 0x6e, 0xa9, 0xa9, 0x21, 0x15, 0x42, 0xde, 0x5c, 0x42, 0xb9, - 0x89, 0x15, 0xf1, 0x05, 0x45, 0x99, 0xf9, 0x45, 0x99, 0x25, 0x95, 0x20, 0x46, 0x72, 0xaa, 0x04, - 0xa3, 0x02, 0xa3, 0x06, 0xa7, 0x93, 0xec, 0x89, 0x7b, 0xf2, 0x0c, 0xb7, 0xee, 0xc9, 0x8b, 0x26, - 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0x17, 0xa7, 0x64, 0xeb, 0x65, 0xe6, 0xeb, 0xe7, 0x26, 0x96, 0x64, - 0xe8, 0x79, 0xe6, 0x95, 0x04, 0x09, 0xe4, 0x26, 0x56, 0x04, 0x40, 0xf5, 0x05, 0x80, 0xb4, 0x39, - 0x19, 0x9f, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, - 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x64, 0x7a, 0x66, 0x49, - 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x6a, 0x59, 0x6e, 0x7e, 0xb1, 0x3e, 0xcc, 0x63, - 0x49, 0x6c, 0x60, 0x77, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x4d, 0xf3, 0xbb, 0x1c, 0xeb, - 0x00, 0x00, 0x00, + 0xeb, 0x95, 0x19, 0x4a, 0x09, 0x26, 0xe6, 0x66, 0xe6, 0xe5, 0xeb, 0x83, 0x49, 0x88, 0xbc, 0x94, + 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0xf2, 0xb9, 0xa4, 0x5d, + 0x2b, 0x4a, 0x52, 0xf3, 0x8a, 0x33, 0xf3, 0xf3, 0xfc, 0x0b, 0x4a, 0x32, 0xf3, 0xf3, 0x5c, 0x20, + 0x26, 0xbb, 0xa5, 0xa6, 0x86, 0x54, 0x08, 0x05, 0x70, 0x09, 0xe5, 0x26, 0x56, 0xc4, 0x17, 0x14, + 0x65, 0xe6, 0x17, 0x65, 0x96, 0x54, 0x82, 0x18, 0xc9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, + 0x4e, 0x4a, 0x27, 0xee, 0xc9, 0x33, 0xdc, 0xba, 0x27, 0x2f, 0x9a, 0x9c, 0x5f, 0x9c, 0x9b, 0x5f, + 0x5c, 0x9c, 0x92, 0xad, 0x97, 0x99, 0xaf, 0x9f, 0x9b, 0x58, 0x92, 0xa1, 0xe7, 0x99, 0x57, 0xb2, + 0xe2, 0xf9, 0x06, 0x2d, 0xc6, 0x20, 0x81, 0xdc, 0xc4, 0x8a, 0x00, 0xa8, 0xe6, 0x00, 0x90, 0x5e, + 0x27, 0xe3, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, + 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x92, 0x4c, 0xcf, 0x2c, + 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0x2d, 0xcb, 0xcd, 0x2f, 0xd6, 0x87, 0x79, + 0x38, 0x89, 0x0d, 0xec, 0x58, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x10, 0x52, 0x32, 0xb9, + 0x03, 0x01, 0x00, 0x00, } func (m *ExtensionOptionDynamicFeeTx) Marshal() (dAtA []byte, err error) { diff --git a/types/gasmeter.go b/types/gasmeter.go index ecce9799..bdd25bcc 100644 --- a/types/gasmeter.go +++ b/types/gasmeter.go @@ -6,7 +6,7 @@ import ( fmt "fmt" math "math" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" ) // ErrorNegativeGasConsumed defines an error thrown when the amount of gas refunded results in a diff --git a/types/genesis.go b/types/genesis.go new file mode 100644 index 00000000..89e9a30c --- /dev/null +++ b/types/genesis.go @@ -0,0 +1,15 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package types + +import "encoding/json" + +// GenesisState of the blockchain is represented here as a map of raw json +// messages key'd by a identifier string. +// The identifier is used to determine which module genesis information belongs +// to so it may be appropriately routed during init chain. +// Within this application default genesis information is retrieved from +// the ModuleBasicManager which populates json from each BasicModule +// object provided to it during init. +type GenesisState map[string]json.RawMessage diff --git a/types/indexer.go b/types/indexer.go index bbe44a4e..f466a6c9 100644 --- a/types/indexer.go +++ b/types/indexer.go @@ -1,10 +1,11 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package types import ( abci "github.com/cometbft/cometbft/abci/types" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/ethereum/go-ethereum/common" ) @@ -12,7 +13,7 @@ import ( type EVMTxIndexer interface { // LastIndexedBlock returns -1 if indexer db is empty LastIndexedBlock() (int64, error) - IndexBlock(*tmtypes.Block, []*abci.ResponseDeliverTx) error + IndexBlock(*cmttypes.Block, []*abci.ExecTxResult) error // GetByTxHash returns nil if tx not found. GetByTxHash(common.Hash) (*TxResult, error) diff --git a/utils/eth/eth.go b/utils/eth/eth.go new file mode 100644 index 00000000..d53d1e99 --- /dev/null +++ b/utils/eth/eth.go @@ -0,0 +1,51 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package eth + +import "math/big" + +// DeriveChainID derives the chain id from the given v parameter. +// +// CONTRACT: v value is either: +// +// - {0,1} + CHAIN_ID * 2 + 35, if EIP155 is used +// - {0,1} + 27, otherwise +// +// Ref: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md +func DeriveChainID(v *big.Int) *big.Int { + if v == nil || v.Sign() < 1 { + return nil + } + + if v.BitLen() <= 64 { + v := v.Uint64() + if v == 27 || v == 28 { + return new(big.Int) + } + + if v < 35 { + return nil + } + + // V MUST be of the form {0,1} + CHAIN_ID * 2 + 35 + return new(big.Int).SetUint64((v - 35) / 2) + } + v = new(big.Int).Sub(v, big.NewInt(35)) + return v.Div(v, big.NewInt(2)) +} + +// RawSignatureValues is a helper function +// that parses the v,r and s fields of an Ethereum transaction +func RawSignatureValues(vBz, rBz, sBz []byte) (v, r, s *big.Int) { + if len(vBz) > 0 { + v = new(big.Int).SetBytes(vBz) + } + if len(rBz) > 0 { + r = new(big.Int).SetBytes(rBz) + } + if len(sBz) > 0 { + s = new(big.Int).SetBytes(sBz) + } + return v, r, s +} diff --git a/utils/utils.go b/utils/utils.go index 0af3ddb8..c9e0fdb4 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -14,7 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/types/multisig" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/crypto/ethsecp256k1" "golang.org/x/exp/constraints" @@ -49,7 +49,7 @@ func CosmosToEthAddr(accAddr sdk.AccAddress) common.Address { } // IsSupportedKey returns true if the pubkey type is supported by the chain -// (i.e eth_secp256k1, amino multisig, ed25519). +// (i.e. eth_secp256k1, amino multisig, ed25519). // NOTE: Nested multisigs are not supported. func IsSupportedKey(pubkey cryptotypes.PubKey) bool { switch pubkey := pubkey.(type) { diff --git a/wallets/ledger/ledger.go b/wallets/ledger/ledger.go index f84dacf0..6e89cd29 100644 --- a/wallets/ledger/ledger.go +++ b/wallets/ledger/ledger.go @@ -96,7 +96,7 @@ func (e EvmosSECP256K1) GetAddressPubKeySECP256K1(hdPath []uint32, hrp string) ( // SignSECP256K1 returns the signature bytes generated from signing a transaction // using the EIP712 signature. -func (e EvmosSECP256K1) SignSECP256K1(hdPath []uint32, signDocBytes []byte) ([]byte, error) { +func (e EvmosSECP256K1) SignSECP256K1(hdPath []uint32, signDocBytes []byte, _ byte) ([]byte, error) { fmt.Printf("Generating payload, please check your Ledger...\n") if e.PrimaryWallet == nil { diff --git a/wallets/ledger/ledger_suite_test.go b/wallets/ledger/ledger_suite_test.go index 6431be73..86de6f9d 100644 --- a/wallets/ledger/ledger_suite_test.go +++ b/wallets/ledger/ledger_suite_test.go @@ -9,6 +9,8 @@ import ( "regexp" "testing" + "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" "github.com/stretchr/testify/suite" @@ -22,7 +24,7 @@ import ( auxTx "github.com/cosmos/cosmos-sdk/x/auth/tx" bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/integration/os/network" "github.com/evmos/os/wallets/ledger" "github.com/evmos/os/wallets/ledger/mocks" "github.com/evmos/os/wallets/usbwallet" @@ -37,6 +39,13 @@ type LedgerTestSuite struct { hrp string } +// Load encoding config for sign doc encoding/decoding +// This is done on app instantiation. +// We use the testutil network to load the encoding config +func init() { + network.New() +} + func TestLedgerTestSuite(t *testing.T) { suite.Run(t, new(LedgerTestSuite)) } @@ -79,12 +88,12 @@ func (suite *LedgerTestSuite) getMockTxAmino() []byte { "type":"cosmos-sdk/MsgSend", "value":{ "amount":[{"amount":"150","denom":"atom"}], - "from_address":"cosmos1r5sckdd808qvg7p8d0auaw896zcluqfd7djffp", - "to_address":"cosmos10t8ca2w09ykd6ph0agdz5stvgau47whhaggl9a" + "from_address":"evmos10jmp6sgh4cc6zt3e8gw05wavvejgr5pwjnpcky", + "to_address":"evmos1fx944mzagwdhx0wz7k9tfztc8g3lkfk6rrgv6l" } }], "sequence":"6" - }`, testutil.ExampleChainID), + }`, constants.ExampleChainID), "", ) @@ -96,8 +105,8 @@ func (suite *LedgerTestSuite) getMockTxProtobuf() []byte { memo := "memo" msg := bankTypes.NewMsgSend( - sdk.MustAccAddressFromBech32("cosmos1r5sckdd808qvg7p8d0auaw896zcluqfd7djffp"), - sdk.MustAccAddressFromBech32("cosmos10t8ca2w09ykd6ph0agdz5stvgau47whhaggl9a"), + sdk.MustAccAddressFromBech32("evmos1r5sckdd808qvg7p8d0auaw896zcluqfduvr8nf"), + sdk.MustAccAddressFromBech32("evmos10t8ca2w09ykd6ph0agdz5stvgau47whhlfe3l4"), []sdk.Coin{ { Denom: "atom", @@ -148,7 +157,7 @@ func (suite *LedgerTestSuite) getMockTxProtobuf() []byte { signBytes, err := auxTx.DirectSignBytes( bodyBytes, authInfoBytes, - testutil.ExampleChainID, + constants.ExampleChainID, 0, ) suite.Require().NoError(err) diff --git a/wallets/ledger/ledger_test.go b/wallets/ledger/ledger_test.go index 2fc0978c..cdd8f751 100644 --- a/wallets/ledger/ledger_test.go +++ b/wallets/ledger/ledger_test.go @@ -5,26 +5,14 @@ package ledger_test import ( sdk "github.com/cosmos/cosmos-sdk/types" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" gethaccounts "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - "github.com/evmos/os/encoding" - "github.com/evmos/os/ethereum/eip712" - app "github.com/evmos/os/example_chain" "github.com/evmos/os/wallets/accounts" "github.com/evmos/os/wallets/ledger" ) -// Test Mnemonic: -// glow spread dentist swamp people siren hint muscle first sausage castle metal cycle abandon accident logic again around mix dial knee organ episode usual - -// Load encoding config for sign doc encoding/decoding -func init() { - config := encoding.MakeConfig(app.ModuleBasics) - eip712.SetEncodingConfig(config) - sdk.GetConfig().SetBech32PrefixForAccount("cosmos", "") -} - func (suite *LedgerTestSuite) TestEvmosLedgerDerivation() { testCases := []struct { name string @@ -156,7 +144,7 @@ func (suite *LedgerTestSuite) TestSignatures() { suite.Run(tc.name, func() { suite.SetupTest() // reset tc.mockFunc() - _, err := suite.ledger.SignSECP256K1(gethaccounts.DefaultBaseDerivationPath, tc.tx) + _, err := suite.ledger.SignSECP256K1(gethaccounts.DefaultBaseDerivationPath, tc.tx, byte(signingtypes.SignMode_SIGN_MODE_TEXTUAL)) if tc.expPass { suite.Require().NoError(err) } else { @@ -200,9 +188,9 @@ func (suite *LedgerTestSuite) TestSignatureEquivalence() { suite.Run(tc.name, func() { suite.SetupTest() // reset tc.mockFunc() - protoSignature, err := suite.ledger.SignSECP256K1(gethaccounts.DefaultBaseDerivationPath, tc.txProtobuf) + protoSignature, err := suite.ledger.SignSECP256K1(gethaccounts.DefaultBaseDerivationPath, tc.txProtobuf, byte(signingtypes.SignMode_SIGN_MODE_TEXTUAL)) suite.Require().NoError(err) - aminoSignature, err := suite.ledger.SignSECP256K1(gethaccounts.DefaultBaseDerivationPath, tc.txAmino) + aminoSignature, err := suite.ledger.SignSECP256K1(gethaccounts.DefaultBaseDerivationPath, tc.txAmino, byte(signingtypes.SignMode_SIGN_MODE_TEXTUAL)) suite.Require().NoError(err) if tc.expPass { suite.Require().Equal(protoSignature, aminoSignature) diff --git a/x/erc20/client/cli/tx.go b/x/erc20/client/cli/tx.go index ea585a91..3e209977 100644 --- a/x/erc20/client/cli/tx.go +++ b/x/erc20/client/cli/tx.go @@ -7,21 +7,14 @@ import ( "fmt" "cosmossdk.io/math" - "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/gov/client/cli" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/ethereum/go-ethereum/common" - evmostypes "github.com/evmos/os/types" - "github.com/evmos/os/x/erc20/types" + "github.com/spf13/cobra" ) // NewTxCmd returns a root CLI command handler for erc20 transaction commands @@ -86,127 +79,3 @@ func NewConvertERC20Cmd() *cobra.Command { flags.AddTxFlagsToCmd(cmd) return cmd } - -// NewRegisterERC20ProposalCmd implements the command to submit a community-pool-spend proposal -func NewRegisterERC20ProposalCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "register-erc20 ERC20_ADDRESS...", - Args: cobra.MinimumNArgs(1), - Short: "Submit a proposal to register ERC20 token", - Long: "Submit a proposal to register ERC20 tokens along with an initial deposit. To register multiple tokens in one proposal pass them after each other e.g. `register-erc20 ` ", - Example: fmt.Sprintf("$ %s tx gov submit-legacy-proposal register-erc20 --from=", version.AppName), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - title, err := cmd.Flags().GetString(cli.FlagTitle) - if err != nil { - return err - } - - description, err := cmd.Flags().GetString(cli.FlagDescription) //nolint:staticcheck - if err != nil { - return err - } - - depositStr, err := cmd.Flags().GetString(cli.FlagDeposit) - if err != nil { - return err - } - - deposit, err := sdk.ParseCoinsNormalized(depositStr) - if err != nil { - return err - } - - erc20Addresses := args - from := clientCtx.GetFromAddress() - content := types.NewRegisterERC20Proposal(title, description, erc20Addresses...) - - msg, err := govv1beta1.NewMsgSubmitProposal(content, deposit, from) - if err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(cli.FlagTitle, "", "title of proposal") - cmd.Flags().String(cli.FlagDescription, "", "description of proposal") //nolint:staticcheck - cmd.Flags().String(cli.FlagDeposit, "1aevmos", "deposit of proposal") - if err := cmd.MarkFlagRequired(cli.FlagTitle); err != nil { - panic(err) - } - if err := cmd.MarkFlagRequired(cli.FlagDescription); err != nil { //nolint:staticcheck - panic(err) - } - if err := cmd.MarkFlagRequired(cli.FlagDeposit); err != nil { - panic(err) - } - return cmd -} - -// NewToggleTokenConversionProposalCmd implements the command to submit a community-pool-spend proposal -func NewToggleTokenConversionProposalCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "toggle-token-conversion TOKEN", - Args: cobra.ExactArgs(1), - Short: "Submit a toggle token conversion proposal", - Long: "Submit a proposal to toggle the conversion of a token pair along with an initial deposit.", - Example: fmt.Sprintf("$ %s tx gov submit-legacy-proposal toggle-token-conversion DENOM_OR_CONTRACT --from=", version.AppName), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - title, err := cmd.Flags().GetString(cli.FlagTitle) - if err != nil { - return err - } - - description, err := cmd.Flags().GetString(cli.FlagDescription) //nolint:staticcheck - if err != nil { - return err - } - - depositStr, err := cmd.Flags().GetString(cli.FlagDeposit) - if err != nil { - return err - } - - deposit, err := sdk.ParseCoinsNormalized(depositStr) - if err != nil { - return err - } - - from := clientCtx.GetFromAddress() - token := args[0] - content := types.NewToggleTokenConversionProposal(title, description, token) - - msg, err := govv1beta1.NewMsgSubmitProposal(content, deposit, from) - if err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(cli.FlagTitle, "", "title of proposal") - cmd.Flags().String(cli.FlagDescription, "", "description of proposal") //nolint:staticcheck - cmd.Flags().String(cli.FlagDeposit, "1aevmos", "deposit of proposal") - if err := cmd.MarkFlagRequired(cli.FlagTitle); err != nil { - panic(err) - } - if err := cmd.MarkFlagRequired(cli.FlagDescription); err != nil { //nolint:staticcheck - panic(err) - } - if err := cmd.MarkFlagRequired(cli.FlagDeposit); err != nil { - panic(err) - } - return cmd -} diff --git a/x/erc20/client/proposal_handler.go b/x/erc20/client/proposal_handler.go deleted file mode 100644 index b5d94277..00000000 --- a/x/erc20/client/proposal_handler.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright Tharsis Labs Ltd.(Evmos) -// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) - -package client - -import ( - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - - "github.com/evmos/os/x/erc20/client/cli" -) - -var ( - RegisterERC20ProposalHandler = govclient.NewProposalHandler(cli.NewRegisterERC20ProposalCmd) - ToggleTokenConversionProposalHandler = govclient.NewProposalHandler(cli.NewToggleTokenConversionProposalCmd) -) diff --git a/x/erc20/genesis_test.go b/x/erc20/genesis_test.go index d2e81e0f..0c8505a8 100644 --- a/x/erc20/genesis_test.go +++ b/x/erc20/genesis_test.go @@ -4,14 +4,15 @@ import ( "testing" "time" + "github.com/evmos/os/testutil/constants" + "github.com/cometbft/cometbft/crypto/tmhash" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmversion "github.com/cometbft/cometbft/proto/tendermint/version" "github.com/cometbft/cometbft/version" sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" exampleapp "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" "github.com/evmos/os/testutil/integration/os/network" utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/erc20" @@ -41,9 +42,9 @@ func (suite *GenesisTestSuite) SetupTest() { // consensus key consAddress := sdk.ConsAddress(utiltx.GenerateAddress().Bytes()) - chainID := testutil.ExampleChainID - suite.app = exampleapp.Setup(suite.T(), false, chainID) - suite.ctx = suite.app.BaseApp.NewContext(false, tmproto.Header{ + chainID := constants.ExampleChainID + suite.app = exampleapp.Setup(suite.T(), chainID) + suite.ctx = suite.app.BaseApp.NewContextLegacy(false, tmproto.Header{ Height: 1, ChainID: chainID, Time: time.Now().UTC(), diff --git a/x/erc20/ibc_middleware.go b/x/erc20/ibc_middleware.go index ac67442d..7940ab8d 100644 --- a/x/erc20/ibc_middleware.go +++ b/x/erc20/ibc_middleware.go @@ -7,10 +7,10 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - "github.com/cosmos/ibc-go/v7/modules/core/exported" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + "github.com/cosmos/ibc-go/v8/modules/core/exported" errortypes "github.com/cosmos/cosmos-sdk/types/errors" "github.com/evmos/os/ibc" diff --git a/x/erc20/keeper/dynamic_precompiles.go b/x/erc20/keeper/dynamic_precompiles.go index df219a53..6ad2b59b 100644 --- a/x/erc20/keeper/dynamic_precompiles.go +++ b/x/erc20/keeper/dynamic_precompiles.go @@ -9,8 +9,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" "github.com/evmos/os/utils" "github.com/evmos/os/x/erc20/types" + "github.com/evmos/os/x/evm/statedb" ) // RegisterERC20Extension creates and adds an ERC20 precompile interface for an IBC Coin. @@ -24,14 +26,70 @@ func (k Keeper) RegisterERC20Extension(ctx sdk.Context, denom string) (*types.To if err != nil { return nil, err } + // Add to existing EVM extensions err = k.EnableDynamicPrecompiles(ctx, pair.GetERC20Contract()) if err != nil { return nil, err } + return &pair, err } +// RegisterERC20CodeHash sets the codehash for the erc20 precompile account +// if the bytecode for the erc20 codehash does not exists, it stores it. +func (k Keeper) RegisterERC20CodeHash(ctx sdk.Context, address common.Address) error { + var ( + // bytecode and codeHash is the same for all IBC coins + // cause they're all using the same contract + bytecode = common.FromHex(types.Erc20Bytecode) + codeHash = crypto.Keccak256(bytecode) + ) + // check if code was already stored + code := k.evmKeeper.GetCode(ctx, common.Hash(codeHash)) + if len(code) == 0 { + k.evmKeeper.SetCode(ctx, codeHash, bytecode) + } + + var ( + nonce uint64 + balance = common.Big0 + ) + // keep balance and nonce if account exists + if acc := k.evmKeeper.GetAccount(ctx, address); acc != nil { + nonce = acc.Nonce + balance = acc.Balance + } + + return k.evmKeeper.SetAccount(ctx, address, statedb.Account{ + CodeHash: codeHash, + Nonce: nonce, + Balance: balance, + }) +} + +// UnRegisterERC20CodeHash sets the codehash for the account to an empty one +func (k Keeper) UnRegisterERC20CodeHash(ctx sdk.Context, erc20Address string) error { + emptyCodeHash := crypto.Keccak256(nil) + contractAddr := common.HexToAddress(erc20Address) + + var ( + nonce uint64 + balance = common.Big0 + ) + // keep balance and nonce if account exists + if acc := k.evmKeeper.GetAccount(ctx, contractAddr); acc != nil { + nonce = acc.Nonce + balance = acc.Balance + } + + return k.evmKeeper.SetAccount(ctx, contractAddr, statedb.Account{ + CodeHash: emptyCodeHash, + Nonce: nonce, + Balance: balance, + }) +} + // EnableDynamicPrecompiles appends the addresses of the given Precompiles to the list // of active dynamic precompiles. func (k Keeper) EnableDynamicPrecompiles(ctx sdk.Context, addresses ...common.Address) error { diff --git a/x/erc20/keeper/dynamic_precompiles_test.go b/x/erc20/keeper/dynamic_precompiles_test.go new file mode 100644 index 00000000..170300b6 --- /dev/null +++ b/x/erc20/keeper/dynamic_precompiles_test.go @@ -0,0 +1,87 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package keeper_test + +import ( + "math/big" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + utiltx "github.com/evmos/os/testutil/tx" + "github.com/evmos/os/x/erc20/types" + "github.com/evmos/os/x/evm/statedb" +) + +func (suite *KeeperTestSuite) TestRegisterERC20CodeHash() { + var ( + ctx sdk.Context + // bytecode and codeHash is the same for all IBC coins + // cause they're all using the same contract + bytecode = common.FromHex(types.Erc20Bytecode) + codeHash = crypto.Keccak256(bytecode) + nonce uint64 = 10 + balance = big.NewInt(100) + emptyCodeHash = crypto.Keccak256(nil) + ) + + account := utiltx.GenerateAddress() + + testCases := []struct { + name string + malleate func() + existent bool + }{ + { + "ok", + func() { + }, + false, + }, + { + "existent account", + func() { + err := suite.network.App.EVMKeeper.SetAccount(ctx, account, statedb.Account{ + CodeHash: codeHash, + Nonce: nonce, + Balance: balance, + }) + suite.Require().NoError(err) + }, + true, + }, + } + for _, tc := range testCases { + suite.SetupTest() // reset + ctx = suite.network.GetContext() + tc.malleate() + + err := suite.network.App.Erc20Keeper.RegisterERC20CodeHash(ctx, account) + suite.Require().NoError(err) + + acc := suite.network.App.EVMKeeper.GetAccount(ctx, account) + suite.Require().Equal(codeHash, acc.CodeHash) + if tc.existent { + suite.Require().Equal(balance, acc.Balance) + suite.Require().Equal(nonce, acc.Nonce) + } else { + suite.Require().Equal(common.Big0, acc.Balance) + suite.Require().Equal(uint64(0), acc.Nonce) + } + + err = suite.network.App.Erc20Keeper.UnRegisterERC20CodeHash(ctx, account.Hex()) + suite.Require().NoError(err) + + acc = suite.network.App.EVMKeeper.GetAccount(ctx, account) + suite.Require().Equal(emptyCodeHash, acc.CodeHash) + if tc.existent { + suite.Require().Equal(balance, acc.Balance) + suite.Require().Equal(nonce, acc.Nonce) + } else { + suite.Require().Equal(common.Big0, acc.Balance) + suite.Require().Equal(uint64(0), acc.Nonce) + } + + } +} diff --git a/x/erc20/keeper/erc20_utils_test.go b/x/erc20/keeper/erc20_utils_test.go index d17e5ab2..4cf03cdb 100644 --- a/x/erc20/keeper/erc20_utils_test.go +++ b/x/erc20/keeper/erc20_utils_test.go @@ -1,75 +1,67 @@ package keeper_test import ( - "fmt" + "errors" "math/big" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + + abcitypes "github.com/cometbft/cometbft/abci/types" + "github.com/evmos/os/contracts" - "github.com/evmos/os/x/erc20/types" + "github.com/evmos/os/testutil/integration/os/factory" evm "github.com/evmos/os/x/evm/types" ) -func (suite *KeeperTestSuite) MintERC20Token(contractAddr, from, to common.Address, amount *big.Int) *evm.MsgEthereumTx { - transferData, err := contracts.ERC20MinterBurnerDecimalsContract.ABI.Pack("mint", to, amount) - suite.Require().NoError(err) - return suite.sendTx(contractAddr, from, transferData) -} - -func (suite *KeeperTestSuite) TransferERC20TokenToModule(contractAddr, from common.Address, amount *big.Int) *evm.MsgEthereumTx { - transferData, err := contracts.ERC20MinterBurnerDecimalsContract.ABI.Pack("transfer", types.ModuleAddress, amount) - suite.Require().NoError(err) - return suite.sendTx(contractAddr, from, transferData) -} - -func (suite *KeeperTestSuite) GrantERC20Token(contractAddr, from, to common.Address, roleString string) *evm.MsgEthereumTx { - // 0xCc508cD0818C85b8b8a1aB4cEEef8d981c8956A6 MINTER_ROLE - role := crypto.Keccak256([]byte(roleString)) - // needs to be an array not a slice - var v [32]byte - copy(v[:], role) +func (suite *KeeperTestSuite) MintERC20Token(contractAddr, to common.Address, amount *big.Int) (abcitypes.ExecTxResult, error) { + res, err := suite.factory.ExecuteContractCall( + suite.keyring.GetPrivKey(0), + evm.EvmTxArgs{ + To: &contractAddr, + }, + factory.CallArgs{ + ContractABI: contracts.ERC20MinterBurnerDecimalsContract.ABI, + MethodName: "mint", + Args: []interface{}{to, amount}, + }, + ) + if err != nil { + return res, err + } - transferData, err := contracts.ERC20MinterBurnerDecimalsContract.ABI.Pack("grantRole", v, to) - suite.Require().NoError(err) - return suite.sendTx(contractAddr, from, transferData) + return res, suite.network.NextBlock() } -func (suite *KeeperTestSuite) BalanceOf(contract, account common.Address) interface{} { +func (suite *KeeperTestSuite) BalanceOf(contract, account common.Address) (interface{}, error) { erc20 := contracts.ERC20MinterBurnerDecimalsContract.ABI - res, err := suite.app.EVMKeeper.CallEVM(suite.ctx, erc20, types.ModuleAddress, contract, false, "balanceOf", account) + res, err := suite.factory.ExecuteContractCall( + suite.keyring.GetPrivKey(0), + evm.EvmTxArgs{ + To: &contract, + }, + factory.CallArgs{ + ContractABI: erc20, + MethodName: "balanceOf", + Args: []interface{}{account}, + }, + ) if err != nil { - return nil + return nil, err } - unpacked, err := erc20.Unpack("balanceOf", res.Ret) + ethRes, err := evm.DecodeTxResponse(res.Data) if err != nil { - return nil + return nil, err + } + + unpacked, err := erc20.Unpack("balanceOf", ethRes.Ret) + if err != nil { + return nil, err } if len(unpacked) == 0 { - return nil + return nil, errors.New("nothing unpacked from response") } - return unpacked[0] -} - -func (suite *KeeperTestSuite) NameOf(contract common.Address) string { - erc20 := contracts.ERC20MinterBurnerDecimalsContract.ABI - - res, err := suite.app.EVMKeeper.CallEVM(suite.ctx, erc20, types.ModuleAddress, contract, false, "name") - suite.Require().NoError(err) - suite.Require().NotNil(res) - - unpacked, err := erc20.Unpack("name", res.Ret) - suite.Require().NoError(err) - suite.Require().NotEmpty(unpacked) - - return fmt.Sprintf("%v", unpacked[0]) -} - -func (suite *KeeperTestSuite) TransferERC20Token(contractAddr, from, to common.Address, amount *big.Int) *evm.MsgEthereumTx { - transferData, err := contracts.ERC20MinterBurnerDecimalsContract.ABI.Pack("transfer", to, amount) - suite.Require().NoError(err) - return suite.sendTx(contractAddr, from, transferData) + return unpacked[0], suite.network.NextBlock() } diff --git a/x/erc20/keeper/evm_test.go b/x/erc20/keeper/evm_test.go index abda0ee2..84f99adb 100644 --- a/x/erc20/keeper/evm_test.go +++ b/x/erc20/keeper/evm_test.go @@ -3,20 +3,27 @@ package keeper_test import ( "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/ethereum/go-ethereum/common" - "github.com/evmos/os/contracts" + testfactory "github.com/evmos/os/testutil/integration/os/factory" utiltx "github.com/evmos/os/testutil/tx" + evmtypes "github.com/evmos/os/x/evm/types" + "github.com/stretchr/testify/mock" + + "github.com/evmos/os/contracts" "github.com/evmos/os/x/erc20/keeper" "github.com/evmos/os/x/erc20/types" erc20mocks "github.com/evmos/os/x/erc20/types/mocks" - evmtypes "github.com/evmos/os/x/evm/types" - "github.com/stretchr/testify/mock" ) func (suite *KeeperTestSuite) TestQueryERC20() { - var contract common.Address + var ( + contract common.Address + ctx sdk.Context + ) testCases := []struct { name string malleate func() @@ -29,16 +36,30 @@ func (suite *KeeperTestSuite) TestQueryERC20() { }, { "ok", - func() { contract, _ = suite.DeployContract("coin", "token", erc20Decimals) }, + func() { + var err error + contract, err = suite.factory.DeployContract( + suite.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{}, + testfactory.ContractDeploymentData{ + Contract: contracts.ERC20MinterBurnerDecimalsContract, + ConstructorArgs: []interface{}{"coin", "token", erc20Decimals}, + }, + ) + suite.Require().NoError(err) + suite.Require().NoError(suite.network.NextBlock()) + ctx = suite.network.GetContext() + }, true, }, } for _, tc := range testCases { suite.SetupTest() // reset + ctx = suite.network.GetContext() tc.malleate() - res, err := suite.app.Erc20Keeper.QueryERC20(suite.ctx, contract) + res, err := suite.network.App.Erc20Keeper.QueryERC20(ctx, contract) if tc.res { suite.Require().NoError(err) suite.Require().Equal( @@ -93,18 +114,18 @@ func (suite *KeeperTestSuite) TestBalanceOf() { for _, tc := range testCases { suite.SetupTest() // reset mockEVMKeeper = &erc20mocks.EVMKeeper{} - suite.app.Erc20Keeper = keeper.NewKeeper( - suite.app.GetKey("erc20"), suite.app.AppCodec(), + suite.network.App.Erc20Keeper = keeper.NewKeeper( + suite.network.App.GetKey("erc20"), suite.network.App.AppCodec(), authtypes.NewModuleAddress(govtypes.ModuleName), - suite.app.AccountKeeper, suite.app.BankKeeper, - mockEVMKeeper, suite.app.StakingKeeper, - s.app.AuthzKeeper, &s.app.TransferKeeper, + suite.network.App.AccountKeeper, suite.network.App.BankKeeper, + mockEVMKeeper, suite.network.App.StakingKeeper, + suite.network.App.AuthzKeeper, &suite.network.App.TransferKeeper, ) tc.malleate() abi := contracts.ERC20MinterBurnerDecimalsContract.ABI - balance := suite.app.Erc20Keeper.BalanceOf(suite.ctx, abi, contract, utiltx.GenerateAddress()) + balance := suite.network.App.Erc20Keeper.BalanceOf(suite.network.GetContext(), abi, contract, utiltx.GenerateAddress()) if tc.res { suite.Require().Equal(balance.Int64(), tc.expBalance) } else { @@ -192,16 +213,16 @@ func (suite *KeeperTestSuite) TestQueryERC20ForceFail() { // TODO: what's the reason we are using mockEVMKeeper here? Instead of just passing the suite.app.EVMKeeper? mockEVMKeeper = &erc20mocks.EVMKeeper{} - suite.app.Erc20Keeper = keeper.NewKeeper( - suite.app.GetKey("erc20"), suite.app.AppCodec(), - authtypes.NewModuleAddress(govtypes.ModuleName), suite.app.AccountKeeper, - suite.app.BankKeeper, suite.app.EVMKeeper, suite.app.StakingKeeper, - s.app.AuthzKeeper, &s.app.TransferKeeper, + suite.network.App.Erc20Keeper = keeper.NewKeeper( + suite.network.App.GetKey("erc20"), suite.network.App.AppCodec(), + authtypes.NewModuleAddress(govtypes.ModuleName), suite.network.App.AccountKeeper, + suite.network.App.BankKeeper, mockEVMKeeper, suite.network.App.StakingKeeper, + suite.network.App.AuthzKeeper, &suite.network.App.TransferKeeper, ) tc.malleate() - res, err := suite.app.Erc20Keeper.QueryERC20(suite.ctx, contract) + res, err := suite.network.App.Erc20Keeper.QueryERC20(suite.network.GetContext(), contract) if tc.res { suite.Require().NoError(err) suite.Require().Equal( diff --git a/x/erc20/keeper/grpc_query.go b/x/erc20/keeper/grpc_query.go index da650592..8da99c2d 100644 --- a/x/erc20/keeper/grpc_query.go +++ b/x/erc20/keeper/grpc_query.go @@ -6,15 +6,13 @@ package keeper import ( "context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" evmostypes "github.com/evmos/os/types" - "github.com/evmos/os/x/erc20/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) var _ types.QueryServer = Keeper{} diff --git a/x/erc20/keeper/grpc_query_test.go b/x/erc20/keeper/grpc_query_test.go index 0ba99ab3..529a98bb 100644 --- a/x/erc20/keeper/grpc_query_test.go +++ b/x/erc20/keeper/grpc_query_test.go @@ -6,13 +6,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" exampleapp "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/erc20/types" ) func (suite *KeeperTestSuite) TestTokenPairs() { var ( + ctx sdk.Context req *types.QueryTokenPairsRequest expRes *types.QueryTokenPairsResponse ) @@ -23,7 +23,7 @@ func (suite *KeeperTestSuite) TestTokenPairs() { expPass bool }{ { - "no additional pairs registered", + "no pairs registered", func() { req = &types.QueryTokenPairsRequest{} expRes = &types.QueryTokenPairsResponse{ @@ -43,7 +43,7 @@ func (suite *KeeperTestSuite) TestTokenPairs() { } pairs := exampleapp.ExampleTokenPairs pair := types.NewTokenPair(utiltx.GenerateAddress(), "coin", types.OWNER_MODULE) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) + suite.network.App.Erc20Keeper.SetTokenPair(ctx, pair) pairs = append(pairs, pair) expRes = &types.QueryTokenPairsResponse{ @@ -61,8 +61,8 @@ func (suite *KeeperTestSuite) TestTokenPairs() { pair := types.NewTokenPair(utiltx.GenerateAddress(), "coin", types.OWNER_MODULE) pair2 := types.NewTokenPair(utiltx.GenerateAddress(), "coin2", types.OWNER_MODULE) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair2) + suite.network.App.Erc20Keeper.SetTokenPair(ctx, pair) + suite.network.App.Erc20Keeper.SetTokenPair(ctx, pair2) pairs = append(pairs, pair, pair2) expRes = &types.QueryTokenPairsResponse{ @@ -76,8 +76,8 @@ func (suite *KeeperTestSuite) TestTokenPairs() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset + ctx = suite.network.GetContext() - ctx := sdk.WrapSDKContext(suite.ctx) tc.malleate() res, err := suite.queryClient.TokenPairs(ctx, req) @@ -94,6 +94,7 @@ func (suite *KeeperTestSuite) TestTokenPairs() { func (suite *KeeperTestSuite) TestTokenPair() { var ( + ctx sdk.Context req *types.QueryTokenPairRequest expRes *types.QueryTokenPairResponse ) @@ -126,10 +127,7 @@ func (suite *KeeperTestSuite) TestTokenPair() { func() { addr := utiltx.GenerateAddress() pair := types.NewTokenPair(addr, "coin", types.OWNER_MODULE) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, addr, pair.GetID()) - suite.app.Erc20Keeper.SetDenomMap(suite.ctx, pair.Denom, pair.GetID()) - + suite.network.App.Erc20Keeper.SetToken(ctx, pair) req = &types.QueryTokenPairRequest{ Token: pair.Erc20Address, } @@ -142,8 +140,8 @@ func (suite *KeeperTestSuite) TestTokenPair() { func() { addr := utiltx.GenerateAddress() pair := types.NewTokenPair(addr, "coin", types.OWNER_MODULE) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, addr, pair.GetID()) - suite.app.Erc20Keeper.SetDenomMap(suite.ctx, pair.Denom, pair.GetID()) + suite.network.App.Erc20Keeper.SetERC20Map(ctx, addr, pair.GetID()) + suite.network.App.Erc20Keeper.SetDenomMap(ctx, pair.Denom, pair.GetID()) req = &types.QueryTokenPairRequest{ Token: pair.Erc20Address, @@ -156,8 +154,8 @@ func (suite *KeeperTestSuite) TestTokenPair() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset + ctx = suite.network.GetContext() - ctx := sdk.WrapSDKContext(suite.ctx) tc.malleate() res, err := suite.queryClient.TokenPair(ctx, req) @@ -172,11 +170,9 @@ func (suite *KeeperTestSuite) TestTokenPair() { } func (suite *KeeperTestSuite) TestQueryParams() { - ctx := sdk.WrapSDKContext(suite.ctx) - expParams := types.DefaultParams() - // NOTE: we need to add the example token pair address which is not in the default params but in the genesis state - // of the test suite app and therefore is returned by the query client. - expParams.NativePrecompiles = append(expParams.NativePrecompiles, testutil.WEVMOSContractMainnet) + suite.SetupTest() + ctx := suite.network.GetContext() + expParams := exampleapp.NewErc20GenesisState().Params res, err := suite.queryClient.Params(ctx, &types.QueryParamsRequest{}) suite.Require().NoError(err) diff --git a/x/erc20/keeper/ibc_callbacks.go b/x/erc20/keeper/ibc_callbacks.go index cb7ea41f..5bea222b 100644 --- a/x/erc20/keeper/ibc_callbacks.go +++ b/x/erc20/keeper/ibc_callbacks.go @@ -7,20 +7,17 @@ import ( "strings" errorsmod "cosmossdk.io/errors" - - "github.com/armon/go-metrics" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + "github.com/cosmos/ibc-go/v8/modules/core/exported" "github.com/ethereum/go-ethereum/common" - - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/cosmos/ibc-go/v7/modules/core/exported" - "github.com/evmos/os/ibc" "github.com/evmos/os/x/erc20/types" + "github.com/hashicorp/go-metrics" ) // OnRecvPacket performs the ICS20 middleware receive callback for automatically @@ -97,7 +94,11 @@ func (k Keeper) OnRecvPacket( } // check if the coin is a native staking token - if coin.Denom == evmParams.EvmDenom { + bondDenom, err := k.stakingKeeper.BondDenom(ctx) + if err != nil { + return channeltypes.NewErrorAcknowledgement(err) + } + if coin.Denom == bondDenom { // no-op, received coin is the staking denomination return ack } diff --git a/x/erc20/keeper/ibc_callbacks_integration_test.go b/x/erc20/keeper/ibc_callbacks_integration_test.go deleted file mode 100644 index f49ce531..00000000 --- a/x/erc20/keeper/ibc_callbacks_integration_test.go +++ /dev/null @@ -1,275 +0,0 @@ -package keeper_test - -import ( - "math/big" - - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - "github.com/ethereum/go-ethereum/common" - "github.com/evmos/os/contracts" - precompiletestutil "github.com/evmos/os/precompiles/testutil" - "github.com/evmos/os/utils" - "github.com/evmos/os/x/erc20/types" - - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/ginkgo/v2" -) - -var _ = Describe("Convert native ERC20 receiving from IBC back to Erc20", Ordered, func() { - var ( - sender, receiver string - receiverAcc sdk.AccAddress - senderAcc sdk.AccAddress - amount int64 = 10 - pair *types.TokenPair - erc20Denomtrace transfertypes.DenomTrace - ) - - BeforeEach(func() { - s.suiteIBCTesting = true - s.SetupTest() - s.suiteIBCTesting = false - }) - - Describe("registered native erc20", func() { - BeforeEach(func() { - receiver = s.IBCOsmosisChain.SenderAccount.GetAddress().String() - sender = s.EvmosChain.SenderAccount.GetAddress().String() - receiverAcc = sdk.MustAccAddressFromBech32(receiver) - senderAcc = sdk.MustAccAddressFromBech32(sender) - - // Register ERC20 pair - addr, err := s.DeployContractToChain("testcoin", "tt", 18) - s.Require().NoError(err) - pair, err = s.app.Erc20Keeper.RegisterERC20(s.EvmosChain.GetContext(), addr) - s.Require().NoError(err) - - erc20Denomtrace = transfertypes.DenomTrace{ - Path: "transfer/channel-0", - BaseDenom: pair.Denom, - } - - s.EvmosChain.SenderAccount.SetSequence(s.EvmosChain.SenderAccount.GetSequence() + 1) //nolint:errcheck - }) - It("should convert erc20 ibc voucher to original erc20", func() { - // Mint tokens and send to receiver - _, err := s.app.EVMKeeper.CallEVM(s.EvmosChain.GetContext(), contracts.ERC20MinterBurnerDecimalsContract.ABI, common.BytesToAddress(senderAcc.Bytes()), pair.GetERC20Contract(), true, "mint", common.BytesToAddress(senderAcc.Bytes()), big.NewInt(amount)) - s.Require().NoError(err) - // Check Balance - balanceToken := s.app.Erc20Keeper.BalanceOf(s.EvmosChain.GetContext(), contracts.ERC20MinterBurnerDecimalsContract.ABI, pair.GetERC20Contract(), common.BytesToAddress(senderAcc.Bytes())) - s.Require().Equal(amount, balanceToken.Int64()) - - // Convert half of the available tokens - msgConvertERC20 := types.NewMsgConvertERC20( - math.NewInt(amount), - senderAcc, - pair.GetERC20Contract(), - common.BytesToAddress(senderAcc.Bytes()), - ) - - err = msgConvertERC20.ValidateBasic() - s.Require().NoError(err) - // Use MsgConvertERC20 to convert the ERC20 to a Cosmos IBC Coin - _, err = s.app.Erc20Keeper.ConvertERC20(sdk.WrapSDKContext(s.EvmosChain.GetContext()), msgConvertERC20) - s.Require().NoError(err) - - // Check Balance - balanceToken = s.app.Erc20Keeper.BalanceOf(s.EvmosChain.GetContext(), contracts.ERC20MinterBurnerDecimalsContract.ABI, pair.GetERC20Contract(), common.BytesToAddress(senderAcc.Bytes())) - s.Require().Equal(int64(0), balanceToken.Int64()) - - // IBC coin balance should be amount - erc20CoinsBalance := s.app.BankKeeper.GetBalance(s.EvmosChain.GetContext(), senderAcc, pair.Denom) - s.Require().Equal(amount, erc20CoinsBalance.Amount.Int64()) - - s.EvmosChain.Coordinator.CommitBlock() - - // Attempt to send erc20 into ibc, should send without conversion - s.SendBackCoins(s.pathOsmosisEvmos, s.EvmosChain, pair.Denom, amount, sender, receiver, 1, pair.Denom) - s.IBCOsmosisChain.Coordinator.CommitBlock() - - // Check balance on the Osmosis chain - erc20IBCBalance := s.IBCOsmosisChain.GetSimApp().BankKeeper.GetBalance(s.IBCOsmosisChain.GetContext(), receiverAcc, erc20Denomtrace.IBCDenom()) - s.Require().Equal(amount, erc20IBCBalance.Amount.Int64()) - - s.SendAndReceiveMessage(s.pathOsmosisEvmos, s.IBCOsmosisChain, erc20Denomtrace.IBCDenom(), amount, receiver, sender, 1, erc20Denomtrace.GetFullDenomPath()) - // Check Balance - balanceToken = s.app.Erc20Keeper.BalanceOf(s.EvmosChain.GetContext(), contracts.ERC20MinterBurnerDecimalsContract.ABI, pair.GetERC20Contract(), common.BytesToAddress(senderAcc.Bytes())) - s.Require().Equal(amount, balanceToken.Int64()) - }) - - It("should convert full available balance of erc20 coin to original erc20 token", func() { - // Mint tokens and send to receiver - _, err := s.app.EVMKeeper.CallEVM(s.EvmosChain.GetContext(), contracts.ERC20MinterBurnerDecimalsContract.ABI, common.BytesToAddress(senderAcc.Bytes()), pair.GetERC20Contract(), true, "mint", common.BytesToAddress(senderAcc.Bytes()), big.NewInt(amount)) - s.Require().NoError(err) - // Check Balance - balanceToken := s.app.Erc20Keeper.BalanceOf(s.EvmosChain.GetContext(), contracts.ERC20MinterBurnerDecimalsContract.ABI, pair.GetERC20Contract(), common.BytesToAddress(senderAcc.Bytes())) - s.Require().Equal(amount, balanceToken.Int64()) - - // Convert half of the available tokens - msgConvertERC20 := types.NewMsgConvertERC20( - math.NewInt(amount), - senderAcc, - pair.GetERC20Contract(), - common.BytesToAddress(senderAcc.Bytes()), - ) - - err = msgConvertERC20.ValidateBasic() - s.Require().NoError(err) - // Use MsgConvertERC20 to convert the ERC20 to a Cosmos IBC Coin - _, err = s.app.Erc20Keeper.ConvertERC20(sdk.WrapSDKContext(s.EvmosChain.GetContext()), msgConvertERC20) - s.Require().NoError(err) - - // Check Balance - balanceToken = s.app.Erc20Keeper.BalanceOf(s.EvmosChain.GetContext(), contracts.ERC20MinterBurnerDecimalsContract.ABI, pair.GetERC20Contract(), common.BytesToAddress(senderAcc.Bytes())) - s.Require().Equal(int64(0), balanceToken.Int64()) - - // erc20 coin balance should be amount - erc20CoinsBalance := s.app.BankKeeper.GetBalance(s.EvmosChain.GetContext(), senderAcc, pair.Denom) - s.Require().Equal(amount, erc20CoinsBalance.Amount.Int64()) - - s.EvmosChain.Coordinator.CommitBlock() - - // Attempt to send erc20 into ibc, should send without conversion - s.SendBackCoins(s.pathOsmosisEvmos, s.EvmosChain, pair.Denom, amount/2, sender, receiver, 1, pair.Denom) - s.IBCOsmosisChain.Coordinator.CommitBlock() - - // Check balance on the Osmosis chain - erc20IBCBalance := s.IBCOsmosisChain.GetSimApp().BankKeeper.GetBalance(s.IBCOsmosisChain.GetContext(), receiverAcc, erc20Denomtrace.IBCDenom()) - s.Require().Equal(amount/2, erc20IBCBalance.Amount.Int64()) - - s.SendAndReceiveMessage(s.pathOsmosisEvmos, s.IBCOsmosisChain, erc20Denomtrace.IBCDenom(), amount/2, receiver, sender, 1, erc20Denomtrace.GetFullDenomPath()) - // Check Balance - balanceToken = s.app.Erc20Keeper.BalanceOf(s.EvmosChain.GetContext(), contracts.ERC20MinterBurnerDecimalsContract.ABI, pair.GetERC20Contract(), common.BytesToAddress(senderAcc.Bytes())) - s.Require().Equal(amount, balanceToken.Int64()) - - // IBC coin balance should be zero - erc20CoinsBalance = s.app.BankKeeper.GetBalance(s.EvmosChain.GetContext(), senderAcc, pair.Denom) - s.Require().Equal(int64(0), erc20CoinsBalance.Amount.Int64()) - }) - - It("send native ERC-20 to osmosis, when sending back IBC coins should convert full balance back to erc20 token", func() { - // Mint tokens and send to receiver - _, err := s.app.EVMKeeper.CallEVM(s.EvmosChain.GetContext(), contracts.ERC20MinterBurnerDecimalsContract.ABI, common.BytesToAddress(senderAcc.Bytes()), pair.GetERC20Contract(), true, "mint", common.BytesToAddress(senderAcc.Bytes()), big.NewInt(amount)) - s.Require().NoError(err) - // Check Balance - balanceToken := s.app.Erc20Keeper.BalanceOf(s.EvmosChain.GetContext(), contracts.ERC20MinterBurnerDecimalsContract.ABI, pair.GetERC20Contract(), common.BytesToAddress(senderAcc.Bytes())) - s.Require().Equal(amount, balanceToken.Int64()) - - s.EvmosChain.Coordinator.CommitBlock() - - // Attempt to send 1/2 of erc20 balance via ibc, should convert erc20 tokens to ibc coins and send the converted balance via IBC - s.SendBackCoins(s.pathOsmosisEvmos, s.EvmosChain, types.ModuleName+"/"+pair.GetERC20Contract().String(), amount/2, sender, receiver, 1, "") - s.IBCOsmosisChain.Coordinator.CommitBlock() - - // IBC coin balance should be zero - erc20CoinsBalance := s.app.BankKeeper.GetBalance(s.EvmosChain.GetContext(), senderAcc, pair.Denom) - s.Require().Equal(int64(0), erc20CoinsBalance.Amount.Int64()) - - // Check updated token Balance - balanceToken = s.app.Erc20Keeper.BalanceOf(s.EvmosChain.GetContext(), contracts.ERC20MinterBurnerDecimalsContract.ABI, pair.GetERC20Contract(), common.BytesToAddress(senderAcc.Bytes())) - s.Require().Equal(amount/2, balanceToken.Int64()) - - // Check balance on the Osmosis chain - erc20IBCBalance := s.IBCOsmosisChain.GetSimApp().BankKeeper.GetBalance(s.IBCOsmosisChain.GetContext(), receiverAcc, erc20Denomtrace.IBCDenom()) - s.Require().Equal(amount/2, erc20IBCBalance.Amount.Int64()) - - // send back the IBC coins from Osmosis to Evmos - s.SendAndReceiveMessage(s.pathOsmosisEvmos, s.IBCOsmosisChain, erc20Denomtrace.IBCDenom(), amount/2, receiver, sender, 1, erc20Denomtrace.GetFullDenomPath()) - // Check Balance - balanceToken = s.app.Erc20Keeper.BalanceOf(s.EvmosChain.GetContext(), contracts.ERC20MinterBurnerDecimalsContract.ABI, pair.GetERC20Contract(), common.BytesToAddress(senderAcc.Bytes())) - s.Require().Equal(amount, balanceToken.Int64()) - - // IBC coin balance should be zero - erc20CoinsBalance = s.app.BankKeeper.GetBalance(s.EvmosChain.GetContext(), senderAcc, pair.Denom) - s.Require().Equal(int64(0), erc20CoinsBalance.Amount.Int64()) - }) - }) -}) - -var _ = Describe("Native coins from IBC", Ordered, func() { - // amount to be transferred - var amount int64 = 10 - - BeforeEach(func() { - s.suiteIBCTesting = true - s.SetupTest() - s.suiteIBCTesting = false - }) - It("Is native from source chain - should transfer and register pair and deploy a precompile", func() { - osmosisAddress := s.IBCOsmosisChain.SenderAccount.GetAddress().String() - evmosAddress := s.EvmosChain.SenderAccount.GetAddress().String() - evmosAccount := sdk.MustAccAddressFromBech32(evmosAddress) - - // Precompile should not be available before IBC - uosmoContractAddr, err := utils.GetIBCDenomAddress(precompiletestutil.UosmoIbcdenom) - s.Require().NoError(err) - - params := s.app.EVMKeeper.GetParams(s.EvmosChain.GetContext()) - s.Require().False(s.app.EVMKeeper.IsAvailableStaticPrecompile(¶ms, uosmoContractAddr)) - // Check receiver's balance for IBC before transfer. Should be zero - ibcOsmoBalanceBefore := s.app.BankKeeper.GetBalance(s.EvmosChain.GetContext(), evmosAccount, precompiletestutil.UosmoIbcdenom) - s.Require().Equal(int64(0), ibcOsmoBalanceBefore.Amount.Int64()) - s.EvmosChain.Coordinator.CommitBlock() - - // Send uosmo from osmosis to evmos - s.SendAndReceiveMessage(s.pathOsmosisEvmos, s.IBCOsmosisChain, "uosmo", amount, osmosisAddress, evmosAddress, 1, "") - s.EvmosChain.Coordinator.CommitBlock() - - // Check IBC uosmo coin balance - should be equals to amount sended - ibcOsmoBalanceAfter := s.app.BankKeeper.GetBalance(s.EvmosChain.GetContext(), evmosAccount, precompiletestutil.UosmoIbcdenom) - s.Require().Equal(amount, ibcOsmoBalanceAfter.Amount.Int64()) - - // Pair should be registered now and precompile available - pairID := s.app.Erc20Keeper.GetTokenPairID(s.EvmosChain.GetContext(), precompiletestutil.UosmoIbcdenom) - _, found := s.app.Erc20Keeper.GetTokenPair(s.EvmosChain.GetContext(), pairID) - s.Require().True(found) - activeDynamicPrecompiles := s.app.Erc20Keeper.GetParams(s.EvmosChain.GetContext()).DynamicPrecompiles - s.Require().Contains(activeDynamicPrecompiles, uosmoContractAddr.String()) - }) - It("Not native from source chain - should transfer and not register pair or deploy precompile", func() { - // Send from Cosmos to Osmosis - sender := s.IBCCosmosChain.SenderAccount.GetAddress().String() - receiver := s.IBCOsmosisChain.SenderAccount.GetAddress().String() - receiverAcc := sdk.MustAccAddressFromBech32(receiver) - - UatomInOsmosisDenomtrace := transfertypes.DenomTrace{ - Path: "transfer/channel-1", - BaseDenom: "uatom", - } - UatomInOsmosisIbcdenom := UatomInOsmosisDenomtrace.IBCDenom() - uosmoContractAddr, err := utils.GetIBCDenomAddress(UatomInOsmosisIbcdenom) - s.Require().NoError(err) - params := s.app.EVMKeeper.GetParams(s.EvmosChain.GetContext()) - s.Require().False(s.app.EVMKeeper.IsAvailableStaticPrecompile(¶ms, uosmoContractAddr)) - - // check balance before transfer is 0 - ibcAtomBalanceBefore := s.app.BankKeeper.GetBalance(s.EvmosChain.GetContext(), receiverAcc, precompiletestutil.UatomOsmoIbcdenom) - s.Require().Equal(int64(0), ibcAtomBalanceBefore.Amount.Int64()) - - s.EvmosChain.Coordinator.CommitBlock() - s.SendBackCoins(s.pathOsmosisCosmos, s.IBCCosmosChain, "uatom", amount, sender, receiver, 1, "") - - // Balance of atom in Osmosis - ibcOsmoBalanceAfter := s.IBCOsmosisChain.GetSimApp().BankKeeper.GetBalance(s.IBCOsmosisChain.GetContext(), receiverAcc, UatomInOsmosisIbcdenom) - s.Require().Equal(amount, ibcOsmoBalanceAfter.Amount.Int64()) - - // Send ibc atom from osmosis account to our Evmos account - sender = s.IBCOsmosisChain.SenderAccount.GetAddress().String() - receiver = s.EvmosChain.SenderAccount.GetAddress().String() - receiverAcc = sdk.MustAccAddressFromBech32(receiver) - s.SendBackCoins(s.pathOsmosisEvmos, s.IBCOsmosisChain, UatomInOsmosisIbcdenom, amount, sender, receiver, 1, "transfer/channel-1/uatom") - - // check balance of ibc atom on evmos after transfer - ibcAtomBalanceAfter := s.app.BankKeeper.GetBalance(s.EvmosChain.GetContext(), receiverAcc, precompiletestutil.UatomOsmoIbcdenom) - s.Require().Equal(amount, ibcAtomBalanceAfter.Amount.Int64()) - - // Pair should not have been registered since atom is not native from osmosis - // Precompile shouldnt be deployed - pairID := s.app.Erc20Keeper.GetTokenPairID(s.EvmosChain.GetContext(), precompiletestutil.UatomOsmoIbcdenom) - _, found := s.app.Erc20Keeper.GetTokenPair(s.EvmosChain.GetContext(), pairID) - s.Require().False(found) - activeDynamicPrecompiles := s.app.Erc20Keeper.GetParams(s.EvmosChain.GetContext()).DynamicPrecompiles - s.Require().NotContains(activeDynamicPrecompiles, uosmoContractAddr.String()) - }) -}) diff --git a/x/erc20/keeper/ibc_callbacks_test.go b/x/erc20/keeper/ibc_callbacks_test.go index ef1f261d..a2834d76 100644 --- a/x/erc20/keeper/ibc_callbacks_test.go +++ b/x/erc20/keeper/ibc_callbacks_test.go @@ -5,22 +5,28 @@ import ( "fmt" "math/big" + testconstants "github.com/evmos/os/testutil/constants" + "cosmossdk.io/math" + "github.com/evmos/os/x/erc20/keeper" + + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + "github.com/ethereum/go-ethereum/common" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibcgotesting "github.com/cosmos/ibc-go/v7/testing" - ibcmock "github.com/cosmos/ibc-go/v7/testing/mock" - "github.com/ethereum/go-ethereum/common" - "github.com/evmos/os/contracts" "github.com/evmos/os/crypto/ethsecp256k1" - chainutil "github.com/evmos/os/example_chain/testutil" "github.com/evmos/os/testutil" - "github.com/evmos/os/x/erc20/keeper" + + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + ibcgotesting "github.com/cosmos/ibc-go/v8/testing" + ibcmock "github.com/cosmos/ibc-go/v8/testing/mock" + + "github.com/evmos/os/contracts" "github.com/evmos/os/x/erc20/types" evmtypes "github.com/evmos/os/x/evm/types" ) @@ -28,6 +34,7 @@ import ( var erc20Denom = "erc20/0xdac17f958d2ee523a2206206994597c13d831ec7" func (suite *KeeperTestSuite) TestOnRecvPacket() { + var ctx sdk.Context // secp256k1 account secpPk := secp256k1.GenPrivKey() secpAddr := sdk.AccAddress(secpPk.PubKey().Address()) @@ -53,7 +60,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { registeredDenom := cosmosTokenBase coins := sdk.NewCoins( - sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1000)), + sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(1000)), sdk.NewCoin(registeredDenom, math.NewInt(1000)), // some ERC20 token sdk.NewCoin(ibcBase, math.NewInt(1000)), // some IBC coin with a registered token pair ) @@ -149,7 +156,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { { name: "no-op - receiver is module account", malleate: func() { - secpAddr = suite.app.AccountKeeper.GetModuleAccount(suite.ctx, "erc20").GetAddress() + secpAddr = suite.network.App.AccountKeeper.GetModuleAccount(ctx, "erc20").GetAddress() transfer := transfertypes.NewFungibleTokenPacketData(registeredDenom, "100", secpAddrCosmos, secpAddr.String(), "") bz := transfertypes.ModuleCdc.MustMarshalJSON(&transfer) packet = channeltypes.NewPacket(bz, 100, transfertypes.PortID, sourceChannel, transfertypes.PortID, evmosChannel, timeoutHeight, 0) @@ -165,7 +172,9 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { malleate: func() { // base denom should be prefixed sourcePrefix := transfertypes.GetDenomPrefix(transfertypes.PortID, sourceChannel) - prefixedDenom := sourcePrefix + s.app.StakingKeeper.BondDenom(suite.ctx) + bondDenom, err := suite.network.App.StakingKeeper.BondDenom(ctx) + suite.Require().NoError(err) + prefixedDenom := sourcePrefix + bondDenom transfer := transfertypes.NewFungibleTokenPacketData(prefixedDenom, "100", secpAddrCosmos, ethsecpAddrEvmos, "") bz := transfertypes.ModuleCdc.MustMarshalJSON(&transfer) packet = channeltypes.NewPacket(bz, 1, transfertypes.PortID, sourceChannel, transfertypes.PortID, evmosChannel, timeoutHeight, 0) @@ -204,7 +213,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { receiver: ethsecpAddr, expErc20s: big.NewInt(0), expCoins: sdk.NewCoins( - sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(1000)), + sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(1000)), sdk.NewCoin(registeredDenom, math.NewInt(0)), sdk.NewCoin(ibcBase, math.NewInt(1000)), ), @@ -216,15 +225,22 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.mintFeeCollector = true suite.SetupTest() // reset + ctx = suite.network.GetContext() tc.malleate() + // Register Token Pair for testing + contractAddr, err := suite.setupRegisterERC20Pair(contractMinterBurner) + suite.Require().NoError(err, "failed to register pair") + // get updated context after registering ERC20 pair + ctx = suite.network.GetContext() + // Set Denom Trace denomTrace := transfertypes.DenomTrace{ Path: path, BaseDenom: registeredDenom, } - suite.app.TransferKeeper.SetDenomTrace(suite.ctx, denomTrace) + suite.network.App.TransferKeeper.SetDenomTrace(ctx, denomTrace) // Set Cosmos Channel channel := channeltypes.Channel{ @@ -233,47 +249,48 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { Counterparty: channeltypes.NewCounterparty(transfertypes.PortID, sourceChannel), ConnectionHops: []string{sourceChannel}, } - suite.app.IBCKeeper.ChannelKeeper.SetChannel(suite.ctx, transfertypes.PortID, evmosChannel, channel) + suite.network.App.IBCKeeper.ChannelKeeper.SetChannel(ctx, transfertypes.PortID, evmosChannel, channel) // Set Next Sequence Send - suite.app.IBCKeeper.ChannelKeeper.SetNextSequenceSend(suite.ctx, transfertypes.PortID, evmosChannel, 1) + suite.network.App.IBCKeeper.ChannelKeeper.SetNextSequenceSend(ctx, transfertypes.PortID, evmosChannel, 1) - suite.app.Erc20Keeper = keeper.NewKeeper( - suite.app.GetKey(types.StoreKey), - suite.app.AppCodec(), + suite.network.App.Erc20Keeper = keeper.NewKeeper( + suite.network.App.GetKey(types.StoreKey), + suite.network.App.AppCodec(), authtypes.NewModuleAddress(govtypes.ModuleName), - suite.app.AccountKeeper, - suite.app.BankKeeper, - suite.app.EVMKeeper, - suite.app.StakingKeeper, - suite.app.AuthzKeeper, - &suite.app.TransferKeeper, + suite.network.App.AccountKeeper, + suite.network.App.BankKeeper, + suite.network.App.EVMKeeper, + suite.network.App.StakingKeeper, + suite.network.App.AuthzKeeper, + &suite.network.App.TransferKeeper, ) // Fund receiver account with EVMOS, ERC20 coins and IBC vouchers // We do this since we are interested in the conversion portion w/ OnRecvPacket - err = chainutil.FundAccount(suite.ctx, suite.app.BankKeeper, tc.receiver, coins) + err = testutil.FundAccount(ctx, suite.network.App.BankKeeper, tc.receiver, coins) suite.Require().NoError(err) - // Register Token Pair for testing - contractAddr := suite.setupRegisterERC20Pair(1) - id := suite.app.Erc20Keeper.GetTokenPairID(suite.ctx, contractAddr.String()) - pair, _ := suite.app.Erc20Keeper.GetTokenPair(suite.ctx, id) + id := suite.network.App.Erc20Keeper.GetTokenPairID(ctx, contractAddr.String()) + pair, _ := suite.network.App.Erc20Keeper.GetTokenPair(ctx, id) suite.Require().NotNil(pair) if tc.disableERC20 { - params := suite.app.Erc20Keeper.GetParams(suite.ctx) + params := suite.network.App.Erc20Keeper.GetParams(ctx) params.EnableErc20 = false - suite.app.Erc20Keeper.SetParams(suite.ctx, params) //nolint:errcheck + suite.network.App.Erc20Keeper.SetParams(ctx, params) //nolint:errcheck } if tc.disableTokenPair { - _, err := suite.app.Erc20Keeper.ToggleConversion(suite.ctx, pair.Denom) + _, err := suite.network.App.Erc20Keeper.ToggleConversion(ctx, &types.MsgToggleConversion{ + Authority: authtypes.NewModuleAddress("gov").String(), + Token: pair.Denom, + }) suite.Require().NoError(err) } // Perform IBC callback - ack := suite.app.Erc20Keeper.OnRecvPacket(suite.ctx, packet, expAck) + ack := suite.network.App.Erc20Keeper.OnRecvPacket(ctx, packet, expAck) // Check acknowledgement if tc.ackSuccess { @@ -285,10 +302,10 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { if tc.checkBalances { // Check ERC20 balances - balanceTokenAfter := suite.app.Erc20Keeper.BalanceOf(suite.ctx, contracts.ERC20MinterBurnerDecimalsContract.ABI, pair.GetERC20Contract(), common.BytesToAddress(tc.receiver.Bytes())) + balanceTokenAfter := suite.network.App.Erc20Keeper.BalanceOf(ctx, contracts.ERC20MinterBurnerDecimalsContract.ABI, pair.GetERC20Contract(), common.BytesToAddress(tc.receiver.Bytes())) suite.Require().Equal(tc.expErc20s.Int64(), balanceTokenAfter.Int64()) // Check Cosmos Coin Balances - balances := suite.app.BankKeeper.GetAllBalances(suite.ctx, tc.receiver) + balances := suite.network.App.BankKeeper.GetAllBalances(ctx, tc.receiver) suite.Require().Equal(tc.expCoins, balances) } }) @@ -296,6 +313,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { } func (suite *KeeperTestSuite) TestConvertCoinToERC20FromPacket() { + var ctx sdk.Context senderAddr := "evmos1x2w87cvt5mqjncav4lxy8yfreynn273xn5335v" testCases := []struct { @@ -322,14 +340,16 @@ func (suite *KeeperTestSuite) TestConvertCoinToERC20FromPacket() { name: "pass - erc20 is disabled", malleate: func() transfertypes.FungibleTokenPacketData { // Register Token Pair for testing - contractAddr := suite.setupRegisterERC20Pair(1) - id := suite.app.Erc20Keeper.GetTokenPairID(suite.ctx, contractAddr.String()) - pair, _ := suite.app.Erc20Keeper.GetTokenPair(suite.ctx, id) + contractAddr, err := suite.setupRegisterERC20Pair(contractMinterBurner) + suite.Require().NoError(err, "failed to register pair") + ctx = suite.network.GetContext() + id := suite.network.App.Erc20Keeper.GetTokenPairID(ctx, contractAddr.String()) + pair, _ := suite.network.App.Erc20Keeper.GetTokenPair(ctx, id) suite.Require().NotNil(pair) - params := suite.app.Erc20Keeper.GetParams(suite.ctx) + params := suite.network.App.Erc20Keeper.GetParams(ctx) params.EnableErc20 = false - _ = suite.app.Erc20Keeper.SetParams(suite.ctx, params) + _ = suite.network.App.Erc20Keeper.SetParams(ctx, params) return transfertypes.NewFungibleTokenPacketData(pair.Denom, "10", senderAddr, "", "") }, expPass: true, @@ -345,14 +365,16 @@ func (suite *KeeperTestSuite) TestConvertCoinToERC20FromPacket() { name: "pass - erc20 is disabled", malleate: func() transfertypes.FungibleTokenPacketData { // Register Token Pair for testing - contractAddr := suite.setupRegisterERC20Pair(1) - id := suite.app.Erc20Keeper.GetTokenPairID(suite.ctx, contractAddr.String()) - pair, _ := suite.app.Erc20Keeper.GetTokenPair(suite.ctx, id) + contractAddr, err := suite.setupRegisterERC20Pair(contractMinterBurner) + suite.Require().NoError(err, "failed to register pair") + ctx = suite.network.GetContext() + id := suite.network.App.Erc20Keeper.GetTokenPairID(ctx, contractAddr.String()) + pair, _ := suite.network.App.Erc20Keeper.GetTokenPair(ctx, id) suite.Require().NotNil(pair) - err := chainutil.FundAccount( - suite.ctx, - suite.app.BankKeeper, + err = testutil.FundAccount( + ctx, + suite.network.App.BankKeeper, sdk.MustAccAddressFromBech32(senderAddr), sdk.NewCoins( sdk.NewCoin(pair.Denom, math.NewInt(100)), @@ -360,7 +382,7 @@ func (suite *KeeperTestSuite) TestConvertCoinToERC20FromPacket() { ) suite.Require().NoError(err) - _, err = suite.app.EVMKeeper.CallEVM(s.ctx, contracts.ERC20MinterBurnerDecimalsContract.ABI, suite.address, contractAddr, true, "mint", types.ModuleAddress, big.NewInt(10)) + _, err = suite.network.App.EVMKeeper.CallEVM(ctx, contracts.ERC20MinterBurnerDecimalsContract.ABI, suite.keyring.GetAddr(0), contractAddr, true, "mint", types.ModuleAddress, big.NewInt(10)) suite.Require().NoError(err) return transfertypes.NewFungibleTokenPacketData(pair.Denom, "10", senderAddr, "", "") @@ -371,11 +393,14 @@ func (suite *KeeperTestSuite) TestConvertCoinToERC20FromPacket() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.mintFeeCollector = true + defer func() { suite.mintFeeCollector = false }() + suite.SetupTest() // reset + ctx = suite.network.GetContext() transfer := tc.malleate() - err := suite.app.Erc20Keeper.ConvertCoinToERC20FromPacket(suite.ctx, transfer) + err := suite.network.App.Erc20Keeper.ConvertCoinToERC20FromPacket(ctx, transfer) if tc.expPass { suite.Require().NoError(err) } else { @@ -387,6 +412,7 @@ func (suite *KeeperTestSuite) TestConvertCoinToERC20FromPacket() { func (suite *KeeperTestSuite) TestOnAcknowledgementPacket() { var ( + ctx sdk.Context data transfertypes.FungibleTokenPacketData ack channeltypes.Acknowledgement pair types.TokenPair @@ -409,17 +435,19 @@ func (suite *KeeperTestSuite) TestOnAcknowledgementPacket() { name: "no-op - ack error sender is module account", malleate: func() { // Register Token Pair for testing - contractAddr := suite.setupRegisterERC20Pair(1) - id := suite.app.Erc20Keeper.GetTokenPairID(suite.ctx, contractAddr.String()) - pair, _ = suite.app.Erc20Keeper.GetTokenPair(suite.ctx, id) + contractAddr, err := suite.setupRegisterERC20Pair(contractMinterBurner) + suite.Require().NoError(err, "failed to register pair") + ctx = suite.network.GetContext() + id := suite.network.App.Erc20Keeper.GetTokenPairID(ctx, contractAddr.String()) + pair, _ = suite.network.App.Erc20Keeper.GetTokenPair(ctx, id) suite.Require().NotNil(pair) // for testing purposes we can only fund is not allowed to receive funds - moduleAcc := suite.app.AccountKeeper.GetModuleAccount(suite.ctx, "erc20") + moduleAcc := suite.network.App.AccountKeeper.GetModuleAccount(ctx, "erc20") sender = moduleAcc.GetAddress() - err := chainutil.FundModuleAccount( - suite.ctx, - suite.app.BankKeeper, + err = testutil.FundModuleAccount( + ctx, + suite.network.App.BankKeeper, moduleAcc.GetName(), sdk.NewCoins( sdk.NewCoin(pair.Denom, math.NewInt(100)), @@ -437,18 +465,20 @@ func (suite *KeeperTestSuite) TestOnAcknowledgementPacket() { name: "no-op - positive ack", malleate: func() { // Register Token Pair for testing - contractAddr := suite.setupRegisterERC20Pair(1) - id := suite.app.Erc20Keeper.GetTokenPairID(suite.ctx, contractAddr.String()) - pair, _ = suite.app.Erc20Keeper.GetTokenPair(suite.ctx, id) + contractAddr, err := suite.setupRegisterERC20Pair(contractMinterBurner) + suite.Require().NoError(err, "failed to register pair") + ctx = suite.network.GetContext() + id := suite.network.App.Erc20Keeper.GetTokenPairID(ctx, contractAddr.String()) + pair, _ = suite.network.App.Erc20Keeper.GetTokenPair(ctx, id) suite.Require().NotNil(pair) sender = sdk.AccAddress(senderPk.PubKey().Address()) // Fund receiver account with EVMOS, ERC20 coins and IBC vouchers // We do this since we are interested in the conversion portion w/ OnRecvPacket - err := chainutil.FundAccount( - suite.ctx, - suite.app.BankKeeper, + err = testutil.FundAccount( + ctx, + suite.network.App.BankKeeper, sender, sdk.NewCoins( sdk.NewCoin(pair.Denom, math.NewInt(100)), @@ -465,11 +495,12 @@ func (suite *KeeperTestSuite) TestOnAcknowledgementPacket() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset + ctx = suite.network.GetContext() tc.malleate() - err := suite.app.Erc20Keeper.OnAcknowledgementPacket( - suite.ctx, channeltypes.Packet{}, data, ack, + err := suite.network.App.Erc20Keeper.OnAcknowledgementPacket( + ctx, channeltypes.Packet{}, data, ack, ) suite.Require().NoError(err) @@ -480,8 +511,8 @@ func (suite *KeeperTestSuite) TestOnAcknowledgementPacket() { } // check balance is the same as expected - balance := suite.app.Erc20Keeper.BalanceOf( - suite.ctx, contracts.ERC20MinterBurnerDecimalsContract.ABI, + balance := suite.network.App.Erc20Keeper.BalanceOf( + ctx, contracts.ERC20MinterBurnerDecimalsContract.ABI, pair.GetERC20Contract(), common.BytesToAddress(sender.Bytes()), ) @@ -491,6 +522,7 @@ func (suite *KeeperTestSuite) TestOnAcknowledgementPacket() { } func (suite *KeeperTestSuite) TestOnTimeoutPacket() { + var ctx sdk.Context testCases := []struct { name string malleate func() transfertypes.FungibleTokenPacketData @@ -501,7 +533,7 @@ func (suite *KeeperTestSuite) TestOnTimeoutPacket() { name: "no-op - sender is module account", malleate: func() transfertypes.FungibleTokenPacketData { // any module account can be passed here - moduleAcc := suite.app.AccountKeeper.GetModuleAccount(suite.ctx, evmtypes.ModuleName) + moduleAcc := suite.network.App.AccountKeeper.GetModuleAccount(ctx, evmtypes.ModuleName) return transfertypes.NewFungibleTokenPacketData("", "10", moduleAcc.GetAddress().String(), "", "") }, @@ -511,10 +543,11 @@ func (suite *KeeperTestSuite) TestOnTimeoutPacket() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() + ctx = suite.network.GetContext() data := tc.malleate() - err := suite.app.Erc20Keeper.OnTimeoutPacket(suite.ctx, channeltypes.Packet{}, data) + err := suite.network.App.Erc20Keeper.OnTimeoutPacket(ctx, channeltypes.Packet{}, data) if tc.expPass { suite.Require().NoError(err) } else { diff --git a/x/erc20/keeper/integration_test.go b/x/erc20/keeper/integration_test.go index fa1e6792..e384ab25 100644 --- a/x/erc20/keeper/integration_test.go +++ b/x/erc20/keeper/integration_test.go @@ -1,7 +1,9 @@ package keeper_test import ( + "fmt" "math/big" + "testing" //nolint:revive // dot imports are fine for Ginkgo . "github.com/onsi/ginkgo/v2" @@ -9,32 +11,39 @@ import ( . "github.com/onsi/gomega" "cosmossdk.io/math" - abci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/ethereum/go-ethereum/common" - "github.com/evmos/os/crypto/ethsecp256k1" - exampleapp "github.com/evmos/os/example_chain" - chainutil "github.com/evmos/os/example_chain/testutil" - "github.com/evmos/os/testutil" + "github.com/evmos/os/testutil/integration/common/factory" + testutils "github.com/evmos/os/testutil/integration/os/utils" "github.com/evmos/os/x/erc20/types" ) +func TestPrecompileIntegrationTestSuite(t *testing.T) { + // Run Ginkgo integration tests + RegisterFailHandler(Fail) + RunSpecs(t, "ERC20 Module Integration Tests") +} + var _ = Describe("Performing EVM transactions", Ordered, func() { + var s *KeeperTestSuite BeforeEach(func() { + s = new(KeeperTestSuite) s.SetupTest() - params := s.app.Erc20Keeper.GetParams(s.ctx) - params.EnableErc20 = true - err := s.app.Erc20Keeper.SetParams(s.ctx, params) - Expect(err).To(BeNil()) }) Context("with the ERC20 module disabled", func() { BeforeEach(func() { - params := s.app.Erc20Keeper.GetParams(s.ctx) + params := types.DefaultParams() params.EnableErc20 = false - s.app.Erc20Keeper.SetParams(s.ctx, params) //nolint:errcheck + err := testutils.UpdateERC20Params(testutils.UpdateParamsInput{ + Tf: s.factory, + Network: s.network, + Pk: s.keyring.GetPrivKey(0), + Params: params, + }) + Expect(err).To(BeNil()) }) It("should be successful", func() { _, err := s.DeployContract("coin", "token", erc20Decimals) @@ -51,99 +60,56 @@ var _ = Describe("Performing EVM transactions", Ordered, func() { }) var _ = Describe("ERC20:", Ordered, func() { - amt := math.NewInt(100) - fundsAmt, _ := math.NewIntFromString("100000000000000000000000") - - privKey, _ := ethsecp256k1.GenerateKey() - addrBz := privKey.PubKey().Address().Bytes() - accAddr := sdk.AccAddress(addrBz) - addr := common.BytesToAddress(addrBz) - var ( - pair types.TokenPair - coin sdk.Coin + s *KeeperTestSuite contract common.Address contract2 common.Address // moduleAcc is the address of the ERC-20 module account - moduleAcc sdk.AccAddress + moduleAcc = authtypes.NewModuleAddress(types.ModuleName) + amt = math.NewInt(100) ) BeforeEach(func() { + s = new(KeeperTestSuite) s.SetupTest() - - moduleAcc = s.app.AccountKeeper.GetModuleAccount(s.ctx, types.ModuleName).GetAddress() - - govParams := s.app.GovKeeper.GetParams(s.ctx) - govParams.Quorum = "0.0000000001" - err := s.app.GovKeeper.SetParams(s.ctx, govParams) - Expect(err).To(BeNil()) }) Describe("Submitting a token pair proposal through governance", func() { - Context("with existing coins", func() { - BeforeEach(func() { - // Mint coins to pay gas fee, gov deposit and registering coins in Bankkeeper - coins := sdk.NewCoins( - sdk.NewCoin(testutil.ExampleAttoDenom, fundsAmt), - sdk.NewCoin(stakingtypes.DefaultParams().BondDenom, fundsAmt), - sdk.NewCoin(metadataIbc.Base, math.NewInt(1)), - sdk.NewCoin(metadataCoin.Base, math.NewInt(1)), - ) - err := chainutil.FundAccount(s.ctx, s.app.BankKeeper, accAddr, coins) - Expect(err).To(BeNil()) - s.Commit() - }) - - // TODO: this context seems to not have any tests within??? - }) - Context("with deployed contracts", func() { BeforeEach(func() { var err error - // Mint coins to pay gas fee, gov deposit and registering coins in Bankkeeper contract, err = s.DeployContract(erc20Name, erc20Symbol, erc20Decimals) - s.Require().NoError(err) + Expect(err).To(BeNil()) contract2, err = s.DeployContract(erc20Name, erc20Symbol, erc20Decimals) - s.Require().NoError(err) - - coins := sdk.NewCoins( - sdk.NewCoin(testutil.ExampleAttoDenom, fundsAmt), - sdk.NewCoin(stakingtypes.DefaultParams().BondDenom, fundsAmt), - ) - err = chainutil.FundAccount(s.ctx, s.app.BankKeeper, accAddr, coins) - s.Require().NoError(err) - s.Commit() + Expect(err).To(BeNil()) }) Describe("for a single ERC20 token", func() { BeforeEach(func() { - // register with sufficient deposit - id, err := submitRegisterERC20Proposal(s.ctx, s.app, privKey, []string{contract.String()}) - s.Require().NoError(err) - - proposal, found := s.app.GovKeeper.GetProposal(s.ctx, id) - s.Require().True(found) - - _, err = chainutil.Delegate(s.ctx, s.app, privKey, sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(500000000000000000)), s.validator) - s.Require().NoError(err) + // register erc20 + _, err := testutils.RegisterERC20( + s.factory, + s.network, + testutils.ERC20RegistrationData{ + Addresses: []string{contract.Hex()}, + ProposerPriv: s.keyring.GetPrivKey(0), + }, + ) + Expect(err).To(BeNil()) + }) - _, err = chainutil.Vote(s.ctx, s.app, privKey, id, govv1beta1.OptionYes) - s.Require().NoError(err) + It("should create a token pair owned by the contract deployer", func() { + qc := s.network.GetERC20Client() - // Make proposal pass in EndBlocker - duration := proposal.VotingEndTime.Sub(s.ctx.BlockTime()) + 1 - s.CommitAndBeginBlockAfter(duration) - s.app.EndBlocker(s.ctx, abci.RequestEndBlock{Height: s.ctx.BlockHeight()}) - s.Commit() - }) + res, err := qc.TokenPairs(s.network.GetContext(), &types.QueryTokenPairsRequest{}) + Expect(err).To(BeNil()) - It("should create a token pairs owned by the contract deployer", func() { - tokenPairs := s.app.Erc20Keeper.GetTokenPairs(s.ctx) - s.Require().Equal(2, len(tokenPairs)) + tokenPairs := res.TokenPairs + Expect(tokenPairs).To(HaveLen(2)) for i, tokenPair := range tokenPairs { if tokenPair.Erc20Address == contract.Hex() { - s.Require().Equal(types.OWNER_EXTERNAL, tokenPairs[i].ContractOwner) + Expect(tokenPairs[i].ContractOwner).To(Equal(types.OWNER_EXTERNAL)) } } }) @@ -151,31 +117,28 @@ var _ = Describe("ERC20:", Ordered, func() { Describe("for multiple ERC20 tokens", func() { BeforeEach(func() { - // register with sufficient deposit - id, err := submitRegisterERC20Proposal(s.ctx, s.app, privKey, []string{contract.String(), contract2.String()}) - s.Require().NoError(err) - proposal, found := s.app.GovKeeper.GetProposal(s.ctx, id) - s.Require().True(found) - - _, err = chainutil.Delegate(s.ctx, s.app, privKey, sdk.NewCoin(testutil.ExampleAttoDenom, math.NewInt(500000000000000000)), s.validator) - s.Require().NoError(err) - - _, err = chainutil.Vote(s.ctx, s.app, privKey, id, govv1beta1.OptionYes) - s.Require().NoError(err) - - // Make proposal pass in EndBlocker - duration := proposal.VotingEndTime.Sub(s.ctx.BlockTime()) + 1 - s.CommitAndBeginBlockAfter(duration) - s.app.EndBlocker(s.ctx, abci.RequestEndBlock{Height: s.ctx.BlockHeight()}) - s.Commit() + // register erc20 tokens + _, err := testutils.RegisterERC20( + s.factory, + s.network, + testutils.ERC20RegistrationData{ + Addresses: []string{contract.Hex(), contract2.Hex()}, + ProposerPriv: s.keyring.GetPrivKey(0), + }, + ) + Expect(err).To(BeNil()) }) It("should create a token pairs owned by the contract deployer", func() { - tokenPairs := s.app.Erc20Keeper.GetTokenPairs(s.ctx) - s.Require().Equal(3, len(tokenPairs)) + qc := s.network.GetERC20Client() + res, err := qc.TokenPairs(s.network.GetContext(), &types.QueryTokenPairsRequest{}) + Expect(err).To(BeNil()) + + tokenPairs := res.TokenPairs + Expect(tokenPairs).To(HaveLen(3)) for i, tokenPair := range tokenPairs { if tokenPair.Erc20Address == contract2.Hex() { - s.Require().Equal(types.OWNER_EXTERNAL, tokenPairs[i].ContractOwner) + Expect(tokenPairs[i].ContractOwner).To(Equal(types.OWNER_EXTERNAL)) } } }) @@ -186,52 +149,44 @@ var _ = Describe("ERC20:", Ordered, func() { Describe("Converting", func() { Context("with a registered ERC20", func() { BeforeEach(func() { - contract := s.setupRegisterERC20Pair(contractMinterBurner) - id := s.app.Erc20Keeper.GetTokenPairID(s.ctx, contract.String()) - pair, _ = s.app.Erc20Keeper.GetTokenPair(s.ctx, id) - coin = sdk.NewCoin(pair.Denom, amt) - - err := chainutil.FundAccount(s.ctx, s.app.BankKeeper, accAddr, sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, fundsAmt))) - s.Require().NoError(err) + var err error + contract, err = s.setupRegisterERC20Pair(contractMinterBurner) + Expect(err).To(BeNil()) - _ = s.MintERC20Token(contract, s.address, addr, big.NewInt(amt.Int64())) - s.Commit() + res, err := s.MintERC20Token(contract, s.keyring.GetAddr(0), big.NewInt(amt.Int64())) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeTrue()) }) Describe("an ERC20 token into a Cosmos coin", func() { BeforeEach(func() { - convertERC20(s.ctx, s.app, privKey, amt, pair.GetERC20Contract()) + // convert ERC20 to cosmos coin + msg := types.NewMsgConvertERC20(amt, s.keyring.GetAccAddr(0), contract, s.keyring.GetAddr(0)) + res, err := s.factory.CommitCosmosTx(s.keyring.GetPrivKey(0), factory.CosmosTxArgs{Msgs: []sdk.Msg{msg}}) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeTrue()) }) It("should decrease tokens on the sender account", func() { - balanceERC20 := s.BalanceOf(pair.GetERC20Contract(), addr).(*big.Int) - Expect(balanceERC20.Int64()).To(Equal(int64(0))) + balanceERC20, err := s.BalanceOf(contract, s.keyring.GetAddr(0)) + Expect(err).To(BeNil()) + Expect(balanceERC20.(*big.Int).Int64()).To(Equal(int64(0))) }) It("should escrow tokens on the module account", func() { moduleAddr := common.BytesToAddress(moduleAcc.Bytes()) - balanceERC20 := s.BalanceOf(pair.GetERC20Contract(), moduleAddr).(*big.Int) - Expect(balanceERC20.Int64()).To(Equal(amt.Int64())) + balanceERC20, err := s.BalanceOf(contract, moduleAddr) + Expect(err).To(BeNil()) + Expect(balanceERC20.(*big.Int).Int64()).To(Equal(amt.Int64())) }) It("should send coins to the receiver account", func() { - balanceCoin := s.app.BankKeeper.GetBalance(s.ctx, accAddr, pair.Denom) - Expect(balanceCoin).To(Equal(coin)) + balRes, err := s.handler.GetBalance(s.keyring.GetAccAddr(0), fmt.Sprintf("erc20/%s", contract.Hex())) + Expect(err).To(BeNil()) + balanceCoin := balRes.Balance + Expect(balanceCoin.Amount).To(Equal(amt)) }) }) }) }) }) - -func submitRegisterERC20Proposal(ctx sdk.Context, appEvmos *exampleapp.ExampleChain, pk *ethsecp256k1.PrivKey, addrs []string) (id uint64, err error) { - content := types.NewRegisterERC20Proposal("test token", "foo", addrs...) - return chainutil.SubmitProposal(ctx, appEvmos, pk, content, 8) -} - -func convertERC20(ctx sdk.Context, appEvmos *exampleapp.ExampleChain, pk *ethsecp256k1.PrivKey, amt math.Int, contract common.Address) { - addrBz := pk.PubKey().Address().Bytes() - convertERC20Msg := types.NewMsgConvertERC20(amt, sdk.AccAddress(addrBz), contract, common.BytesToAddress(addrBz)) - res, err := chainutil.DeliverTx(ctx, appEvmos, pk, nil, convertERC20Msg) - s.Require().NoError(err) - Expect(res.IsOK()).To(BeTrue(), "failed to convert ERC20: %s", res.Log) -} diff --git a/x/erc20/keeper/keeper.go b/x/erc20/keeper/keeper.go index 007b1338..f128ae00 100644 --- a/x/erc20/keeper/keeper.go +++ b/x/erc20/keeper/keeper.go @@ -6,9 +6,9 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" diff --git a/x/erc20/keeper/mint_test.go b/x/erc20/keeper/mint_test.go index f594fe14..904e4634 100644 --- a/x/erc20/keeper/mint_test.go +++ b/x/erc20/keeper/mint_test.go @@ -11,6 +11,7 @@ import ( ) func (suite *KeeperTestSuite) TestMintingEnabled() { + var ctx sdk.Context sender := sdk.AccAddress(utiltx.GenerateAddress().Bytes()) receiver := sdk.AccAddress(utiltx.GenerateAddress().Bytes()) expPair := types.NewTokenPair(utiltx.GenerateAddress(), "coin", types.OWNER_MODULE) @@ -26,7 +27,7 @@ func (suite *KeeperTestSuite) TestMintingEnabled() { func() { params := types.DefaultParams() params.EnableErc20 = false - suite.app.Erc20Keeper.SetParams(suite.ctx, params) //nolint:errcheck + suite.network.App.Erc20Keeper.SetParams(ctx, params) //nolint:errcheck }, false, }, @@ -39,9 +40,9 @@ func (suite *KeeperTestSuite) TestMintingEnabled() { "conversion is disabled for the given pair", func() { expPair.Enabled = false - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, expPair) - suite.app.Erc20Keeper.SetDenomMap(suite.ctx, expPair.Denom, id) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, expPair.GetERC20Contract(), id) + suite.network.App.Erc20Keeper.SetTokenPair(ctx, expPair) + suite.network.App.Erc20Keeper.SetDenomMap(ctx, expPair.Denom, id) + suite.network.App.Erc20Keeper.SetERC20Map(ctx, expPair.GetERC20Contract(), id) }, false, }, @@ -49,15 +50,15 @@ func (suite *KeeperTestSuite) TestMintingEnabled() { "token transfers are disabled", func() { expPair.Enabled = true - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, expPair) - suite.app.Erc20Keeper.SetDenomMap(suite.ctx, expPair.Denom, id) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, expPair.GetERC20Contract(), id) + suite.network.App.Erc20Keeper.SetTokenPair(ctx, expPair) + suite.network.App.Erc20Keeper.SetDenomMap(ctx, expPair.Denom, id) + suite.network.App.Erc20Keeper.SetERC20Map(ctx, expPair.GetERC20Contract(), id) params := banktypes.DefaultParams() params.SendEnabled = []*banktypes.SendEnabled{ //nolint:staticcheck {Denom: expPair.Denom, Enabled: false}, } - err := suite.app.BankKeeper.SetParams(suite.ctx, params) + err := suite.network.App.BankKeeper.SetParams(ctx, params) suite.Require().NoError(err) }, false, @@ -65,19 +66,19 @@ func (suite *KeeperTestSuite) TestMintingEnabled() { { "token not registered", func() { - suite.app.Erc20Keeper.SetDenomMap(suite.ctx, expPair.Denom, id) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, expPair.GetERC20Contract(), id) + suite.network.App.Erc20Keeper.SetDenomMap(ctx, expPair.Denom, id) + suite.network.App.Erc20Keeper.SetERC20Map(ctx, expPair.GetERC20Contract(), id) }, false, }, { "receiver address is blocked (module account)", func() { - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, expPair) - suite.app.Erc20Keeper.SetDenomMap(suite.ctx, expPair.Denom, id) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, expPair.GetERC20Contract(), id) + suite.network.App.Erc20Keeper.SetTokenPair(ctx, expPair) + suite.network.App.Erc20Keeper.SetDenomMap(ctx, expPair.Denom, id) + suite.network.App.Erc20Keeper.SetERC20Map(ctx, expPair.GetERC20Contract(), id) - acc := suite.app.AccountKeeper.GetModuleAccount(suite.ctx, types.ModuleName) + acc := suite.network.App.AccountKeeper.GetModuleAccount(ctx, types.ModuleName) receiver = acc.GetAddress() }, false, @@ -85,9 +86,9 @@ func (suite *KeeperTestSuite) TestMintingEnabled() { { "ok", func() { - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, expPair) - suite.app.Erc20Keeper.SetDenomMap(suite.ctx, expPair.Denom, id) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, expPair.GetERC20Contract(), id) + suite.network.App.Erc20Keeper.SetTokenPair(ctx, expPair) + suite.network.App.Erc20Keeper.SetDenomMap(ctx, expPair.Denom, id) + suite.network.App.Erc20Keeper.SetERC20Map(ctx, expPair.GetERC20Contract(), id) receiver = sdk.AccAddress(utiltx.GenerateAddress().Bytes()) }, @@ -98,10 +99,11 @@ func (suite *KeeperTestSuite) TestMintingEnabled() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset + ctx = suite.network.GetContext() tc.malleate() - pair, err := suite.app.Erc20Keeper.MintingEnabled(suite.ctx, sender, receiver, expPair.Erc20Address) + pair, err := suite.network.App.Erc20Keeper.MintingEnabled(ctx, sender, receiver, expPair.Erc20Address) if tc.expPass { suite.Require().NoError(err) suite.Require().Equal(expPair, pair) diff --git a/x/erc20/keeper/msg_server.go b/x/erc20/keeper/msg_server.go index 620a260e..0e881c44 100644 --- a/x/erc20/keeper/msg_server.go +++ b/x/erc20/keeper/msg_server.go @@ -7,18 +7,16 @@ import ( "context" "math/big" + sdkerrors "cosmossdk.io/errors" "cosmossdk.io/math" - - errorsmod "cosmossdk.io/errors" - "github.com/armon/go-metrics" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/ethereum/go-ethereum/common" - "github.com/evmos/os/contracts" "github.com/evmos/os/x/erc20/types" + "github.com/hashicorp/go-metrics" ) var _ types.MsgServer = &Keeper{} @@ -82,7 +80,7 @@ func (k Keeper) convertERC20IntoCoinsForNativeToken( balanceCoin := k.bankKeeper.GetBalance(ctx, receiver, pair.Denom) balanceToken := k.BalanceOf(ctx, erc20, contract, types.ModuleAddress) if balanceToken == nil { - return nil, errorsmod.Wrap(types.ErrEVMCall, "failed to retrieve balance") + return nil, sdkerrors.Wrap(types.ErrEVMCall, "failed to retrieve balance") } // Escrow tokens on module account @@ -103,7 +101,7 @@ func (k Keeper) convertERC20IntoCoinsForNativeToken( } if !unpackedRet.Value { - return nil, errorsmod.Wrap(errortypes.ErrLogic, "failed to execute transfer") + return nil, sdkerrors.Wrap(errortypes.ErrLogic, "failed to execute transfer") } // Check expected escrow balance after transfer execution @@ -112,13 +110,13 @@ func (k Keeper) convertERC20IntoCoinsForNativeToken( tokens := coins[0].Amount.BigInt() balanceTokenAfter := k.BalanceOf(ctx, erc20, contract, types.ModuleAddress) if balanceTokenAfter == nil { - return nil, errorsmod.Wrap(types.ErrEVMCall, "failed to retrieve balance") + return nil, sdkerrors.Wrap(types.ErrEVMCall, "failed to retrieve balance") } expToken := big.NewInt(0).Add(balanceToken, tokens) if r := balanceTokenAfter.Cmp(expToken); r != 0 { - return nil, errorsmod.Wrapf( + return nil, sdkerrors.Wrapf( types.ErrBalanceInvariance, "invalid token balance - expected: %v, actual: %v", expToken, balanceTokenAfter, @@ -139,8 +137,8 @@ func (k Keeper) convertERC20IntoCoinsForNativeToken( balanceCoinAfter := k.bankKeeper.GetBalance(ctx, receiver, pair.Denom) expCoin := balanceCoin.Add(coins[0]) - if ok := balanceCoinAfter.IsEqual(expCoin); !ok { - return nil, errorsmod.Wrapf( + if ok := balanceCoinAfter.Equal(expCoin); !ok { + return nil, sdkerrors.Wrapf( types.ErrBalanceInvariance, "invalid coin balance - expected: %v, actual: %v", expCoin, balanceCoinAfter, @@ -211,13 +209,13 @@ func (k Keeper) ConvertCoinNativeERC20( balanceToken := k.BalanceOf(ctx, erc20, contract, receiver) if balanceToken == nil { - return errorsmod.Wrap(types.ErrEVMCall, "failed to retrieve balance") + return sdkerrors.Wrap(types.ErrEVMCall, "failed to retrieve balance") } // Escrow Coins on module account coins := sdk.Coins{{Denom: pair.Denom, Amount: amount}} if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, sender, types.ModuleName, coins); err != nil { - return errorsmod.Wrap(err, "failed to escrow coins") + return sdkerrors.Wrap(err, "failed to escrow coins") } // Unescrow Tokens and send to receiver @@ -233,19 +231,19 @@ func (k Keeper) ConvertCoinNativeERC20( } if !unpackedRet.Value { - return errorsmod.Wrap(errortypes.ErrLogic, "failed to execute unescrow tokens from user") + return sdkerrors.Wrap(errortypes.ErrLogic, "failed to execute unescrow tokens from user") } // Check expected Receiver balance after transfer execution balanceTokenAfter := k.BalanceOf(ctx, erc20, contract, receiver) if balanceTokenAfter == nil { - return errorsmod.Wrap(types.ErrEVMCall, "failed to retrieve balance") + return sdkerrors.Wrap(types.ErrEVMCall, "failed to retrieve balance") } exp := big.NewInt(0).Add(balanceToken, amount.BigInt()) if r := balanceTokenAfter.Cmp(exp); r != 0 { - return errorsmod.Wrapf( + return sdkerrors.Wrapf( types.ErrBalanceInvariance, "invalid token balance - expected: %v, actual: %v", exp, balanceTokenAfter, ) @@ -254,7 +252,7 @@ func (k Keeper) ConvertCoinNativeERC20( // Burn escrowed Coins err = k.bankKeeper.BurnCoins(ctx, types.ModuleName, coins) if err != nil { - return errorsmod.Wrap(err, "failed to burn coins") + return sdkerrors.Wrap(err, "failed to burn coins") } // Check for unexpected `Approval` event in logs @@ -266,7 +264,7 @@ func (k Keeper) ConvertCoinNativeERC20( // is the Cosmos SDK governance module account func (k *Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { if k.authority.String() != req.Authority { - return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, req.Authority) + return nil, sdkerrors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, req.Authority) } ctx := sdk.UnwrapSDKContext(goCtx) @@ -276,3 +274,83 @@ func (k *Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) return &types.MsgUpdateParamsResponse{}, nil } + +// RegisterERC20 implements the gRPC MsgServer interface. After a successful governance vote +// it updates creates the token pair for an ERC20 contract if the requested authority +// is the Cosmos SDK governance module account +func (k *Keeper) RegisterERC20(goCtx context.Context, req *types.MsgRegisterERC20) (*types.MsgRegisterERC20Response, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // Check if the conversion is globally enabled + if !k.IsERC20Enabled(ctx) { + return nil, types.ErrERC20Disabled.Wrap("registration is currently disabled by governance") + } + + if err := k.validateAuthority(req.Authority); err != nil { + return nil, err + } + + for _, addr := range req.Erc20Addresses { + if !common.IsHexAddress(addr) { + return nil, errortypes.ErrInvalidAddress.Wrapf("invalid ERC20 contract address: %s", addr) + } + + pair, err := k.registerERC20(ctx, common.HexToAddress(addr)) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeRegisterERC20, + sdk.NewAttribute(types.AttributeKeyCosmosCoin, pair.Denom), + sdk.NewAttribute(types.AttributeKeyERC20Token, pair.Erc20Address), + ), + ) + } + + return &types.MsgRegisterERC20Response{}, nil +} + +// ToggleConversion implements the gRPC MsgServer interface. +// +// After a successful governance vote it adjusts the possibility of converting tokens between their +// conversions according to the outcome of the vote. +func (k *Keeper) ToggleConversion(goCtx context.Context, req *types.MsgToggleConversion) (*types.MsgToggleConversionResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // Check if the conversion is globally enabled + if !k.IsERC20Enabled(ctx) { + return nil, types.ErrERC20Disabled.Wrap("toggle conversion is currently disabled by governance") + } + + if err := k.validateAuthority(req.Authority); err != nil { + return nil, err + } + + pair, err := k.toggleConversion(ctx, req.Token) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeToggleTokenConversion, + sdk.NewAttribute(types.AttributeKeyCosmosCoin, pair.Denom), + sdk.NewAttribute(types.AttributeKeyERC20Token, pair.Erc20Address), + ), + ) + + return &types.MsgToggleConversionResponse{}, nil +} + +// validateAuthority is a helper function to validate that the provided authority +// is the keeper's authority address +func (k *Keeper) validateAuthority(authority string) error { + if _, err := k.accountKeeper.AddressCodec().StringToBytes(authority); err != nil { + return errortypes.ErrInvalidAddress.Wrapf("invalid authority address: %s", err) + } + + if k.authority.String() != authority { + return sdkerrors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, authority) + } + return nil +} diff --git a/x/erc20/keeper/msg_server_test.go b/x/erc20/keeper/msg_server_test.go index 518fc2fd..563fff6e 100644 --- a/x/erc20/keeper/msg_server_test.go +++ b/x/erc20/keeper/msg_server_test.go @@ -9,18 +9,21 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/ethereum/go-ethereum/common" + testutils "github.com/evmos/os/testutil/integration/os/utils" "github.com/evmos/os/x/erc20/keeper" "github.com/evmos/os/x/erc20/types" erc20mocks "github.com/evmos/os/x/erc20/types/mocks" "github.com/evmos/os/x/evm/statedb" evmtypes "github.com/evmos/os/x/evm/types" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/mock" ) func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { - var contractAddr common.Address - var coinName string - + var ( + contractAddr common.Address + coinName string + ) testCases := []struct { name string mint int64 @@ -51,31 +54,6 @@ func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { true, false, }, - { - "ok - equal funds", - 10, - 10, - func(common.Address) {}, - func() {}, - contractMinterBurner, - true, - false, - }, - { - "ok - suicided contract", - 10, - 10, - func(erc20 common.Address) { - stateDB := suite.StateDB() - ok := stateDB.Suicide(erc20) - suite.Require().True(ok) - suite.Require().NoError(stateDB.Commit()) - }, - func() {}, - contractMinterBurner, - true, - true, - }, { "fail - insufficient funds - callEVM", 0, @@ -93,7 +71,15 @@ func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { func(common.Address) { params := types.DefaultParams() params.EnableErc20 = false - suite.app.Erc20Keeper.SetParams(suite.ctx, params) //nolint:errcheck + err := testutils.UpdateERC20Params( + testutils.UpdateParamsInput{ + Tf: suite.factory, + Network: suite.network, + Pk: suite.keyring.GetPrivKey(0), + Params: params, + }, + ) + suite.Require().NoError(err) }, func() {}, contractMinterBurner, @@ -130,20 +116,6 @@ func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { false, false, }, - { - "fail - no module address", - 100, - 10, - func(common.Address) { - }, - func() { - acc := suite.app.AccountKeeper.GetAccount(suite.ctx, types.ModuleAddress.Bytes()) - suite.app.AccountKeeper.RemoveAccount(suite.ctx, acc) - }, - contractMinterBurner, - false, - false, - }, { "fail - force evm fail", 100, @@ -151,11 +123,11 @@ func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { func(common.Address) {}, func() { mockEVMKeeper := &erc20mocks.EVMKeeper{} - suite.app.Erc20Keeper = keeper.NewKeeper( - suite.app.GetKey("erc20"), suite.app.AppCodec(), - authtypes.NewModuleAddress(govtypes.ModuleName), suite.app.AccountKeeper, - suite.app.BankKeeper, mockEVMKeeper, suite.app.StakingKeeper, - suite.app.AuthzKeeper, &suite.app.TransferKeeper, + suite.network.App.Erc20Keeper = keeper.NewKeeper( + suite.network.App.GetKey("erc20"), suite.network.App.AppCodec(), + authtypes.NewModuleAddress(govtypes.ModuleName), suite.network.App.AccountKeeper, + suite.network.App.BankKeeper, mockEVMKeeper, suite.network.App.StakingKeeper, + suite.network.App.AuthzKeeper, &suite.network.App.TransferKeeper, ) existingAcc := &statedb.Account{Nonce: uint64(1), Balance: common.Big1} @@ -178,11 +150,11 @@ func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { func(common.Address) {}, func() { mockEVMKeeper := &erc20mocks.EVMKeeper{} - suite.app.Erc20Keeper = keeper.NewKeeper( - suite.app.GetKey("erc20"), suite.app.AppCodec(), - authtypes.NewModuleAddress(govtypes.ModuleName), suite.app.AccountKeeper, - suite.app.BankKeeper, mockEVMKeeper, suite.app.StakingKeeper, - suite.app.AuthzKeeper, &suite.app.TransferKeeper, + suite.network.App.Erc20Keeper = keeper.NewKeeper( + suite.network.App.GetKey("erc20"), suite.network.App.AppCodec(), + authtypes.NewModuleAddress(govtypes.ModuleName), suite.network.App.AccountKeeper, + suite.network.App.BankKeeper, mockEVMKeeper, suite.network.App.StakingKeeper, + suite.network.App.AuthzKeeper, &suite.network.App.TransferKeeper, ) existingAcc := &statedb.Account{Nonce: uint64(1), Balance: common.Big1} @@ -204,11 +176,11 @@ func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { func(common.Address) {}, func() { mockEVMKeeper := &erc20mocks.EVMKeeper{} - suite.app.Erc20Keeper = keeper.NewKeeper( - suite.app.GetKey("erc20"), suite.app.AppCodec(), - authtypes.NewModuleAddress(govtypes.ModuleName), suite.app.AccountKeeper, - suite.app.BankKeeper, mockEVMKeeper, suite.app.StakingKeeper, - suite.app.AuthzKeeper, &suite.app.TransferKeeper, + suite.network.App.Erc20Keeper = keeper.NewKeeper( + suite.network.App.GetKey("erc20"), suite.network.App.AppCodec(), + authtypes.NewModuleAddress(govtypes.ModuleName), suite.network.App.AccountKeeper, + suite.network.App.BankKeeper, mockEVMKeeper, suite.network.App.StakingKeeper, + suite.network.App.AuthzKeeper, &suite.network.App.TransferKeeper, ) existingAcc := &statedb.Account{Nonce: uint64(1), Balance: common.Big1} @@ -231,11 +203,11 @@ func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { func(common.Address) {}, func() { mockEVMKeeper := &erc20mocks.EVMKeeper{} - suite.app.Erc20Keeper = keeper.NewKeeper( - suite.app.GetKey("erc20"), suite.app.AppCodec(), - authtypes.NewModuleAddress(govtypes.ModuleName), suite.app.AccountKeeper, - suite.app.BankKeeper, mockEVMKeeper, suite.app.StakingKeeper, - suite.app.AuthzKeeper, &suite.app.TransferKeeper, + suite.network.App.Erc20Keeper = keeper.NewKeeper( + suite.network.App.GetKey("erc20"), suite.network.App.AppCodec(), + authtypes.NewModuleAddress(govtypes.ModuleName), suite.network.App.AccountKeeper, + suite.network.App.BankKeeper, mockEVMKeeper, suite.network.App.StakingKeeper, + suite.network.App.AuthzKeeper, &suite.network.App.TransferKeeper, ) existingAcc := &statedb.Account{Nonce: uint64(1), Balance: common.Big1} @@ -257,19 +229,20 @@ func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { 10, func(common.Address) {}, func() { - mockBankKeeper := &erc20mocks.BankKeeper{} + ctrl := gomock.NewController(suite.T()) + mockBankKeeper := erc20mocks.NewMockBankKeeper(ctrl) - suite.app.Erc20Keeper = keeper.NewKeeper( - suite.app.GetKey("erc20"), suite.app.AppCodec(), - authtypes.NewModuleAddress(govtypes.ModuleName), suite.app.AccountKeeper, - mockBankKeeper, suite.app.EVMKeeper, suite.app.StakingKeeper, - suite.app.AuthzKeeper, &suite.app.TransferKeeper, + suite.network.App.Erc20Keeper = keeper.NewKeeper( + suite.network.App.GetKey("erc20"), suite.network.App.AppCodec(), + authtypes.NewModuleAddress(govtypes.ModuleName), suite.network.App.AccountKeeper, + mockBankKeeper, suite.network.App.EVMKeeper, suite.network.App.StakingKeeper, + suite.network.App.AuthzKeeper, &suite.network.App.TransferKeeper, ) - mockBankKeeper.On("MintCoins", mock.Anything, mock.Anything, mock.Anything).Return(fmt.Errorf("failed to mint")) - mockBankKeeper.On("SendCoinsFromModuleToAccount", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(fmt.Errorf("failed to unescrow")) - mockBankKeeper.On("BlockedAddr", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(false) - mockBankKeeper.On("GetBalance", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(sdk.Coin{Denom: "coin", Amount: math.OneInt()}) + mockBankKeeper.EXPECT().MintCoins(gomock.Any(), gomock.Any(), gomock.Any()).Return(fmt.Errorf("failed to mint")).AnyTimes() + mockBankKeeper.EXPECT().SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(fmt.Errorf("failed to unescrow")).AnyTimes() + mockBankKeeper.EXPECT().BlockedAddr(gomock.Any()).Return(false).AnyTimes() + mockBankKeeper.EXPECT().GetBalance(gomock.Any(), gomock.Any(), gomock.Any()).Return(sdk.Coin{Denom: "coin", Amount: math.OneInt()}).AnyTimes() }, contractMinterBurner, false, @@ -281,18 +254,20 @@ func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { 10, func(common.Address) {}, func() { - mockBankKeeper := &erc20mocks.BankKeeper{} - suite.app.Erc20Keeper = keeper.NewKeeper( - suite.app.GetKey("erc20"), suite.app.AppCodec(), - authtypes.NewModuleAddress(govtypes.ModuleName), suite.app.AccountKeeper, - mockBankKeeper, suite.app.EVMKeeper, suite.app.StakingKeeper, - suite.app.AuthzKeeper, &suite.app.TransferKeeper, + ctrl := gomock.NewController(suite.T()) + mockBankKeeper := erc20mocks.NewMockBankKeeper(ctrl) + + suite.network.App.Erc20Keeper = keeper.NewKeeper( + suite.network.App.GetKey("erc20"), suite.network.App.AppCodec(), + authtypes.NewModuleAddress(govtypes.ModuleName), suite.network.App.AccountKeeper, + mockBankKeeper, suite.network.App.EVMKeeper, suite.network.App.StakingKeeper, + suite.network.App.AuthzKeeper, &suite.network.App.TransferKeeper, ) - mockBankKeeper.On("MintCoins", mock.Anything, mock.Anything, mock.Anything).Return(nil) - mockBankKeeper.On("SendCoinsFromModuleToAccount", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(fmt.Errorf("failed to unescrow")) - mockBankKeeper.On("BlockedAddr", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(false) - mockBankKeeper.On("GetBalance", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(sdk.Coin{Denom: "coin", Amount: math.OneInt()}) + mockBankKeeper.EXPECT().MintCoins(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil) + mockBankKeeper.EXPECT().SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(fmt.Errorf("failed to unescrow")) + mockBankKeeper.EXPECT().BlockedAddr(gomock.Any()).Return(false) + mockBankKeeper.EXPECT().GetBalance(gomock.Any(), gomock.Any(), gomock.Any()).Return(sdk.Coin{Denom: "coin", Amount: math.OneInt()}) }, contractMinterBurner, false, @@ -304,19 +279,20 @@ func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { 10, func(common.Address) {}, func() { - mockBankKeeper := &erc20mocks.BankKeeper{} + ctrl := gomock.NewController(suite.T()) + mockBankKeeper := erc20mocks.NewMockBankKeeper(ctrl) - suite.app.Erc20Keeper = keeper.NewKeeper( - suite.app.GetKey("erc20"), suite.app.AppCodec(), - authtypes.NewModuleAddress(govtypes.ModuleName), suite.app.AccountKeeper, - mockBankKeeper, suite.app.EVMKeeper, suite.app.StakingKeeper, - suite.app.AuthzKeeper, &suite.app.TransferKeeper, + suite.network.App.Erc20Keeper = keeper.NewKeeper( + suite.network.App.GetKey("erc20"), suite.network.App.AppCodec(), + authtypes.NewModuleAddress(govtypes.ModuleName), suite.network.App.AccountKeeper, + mockBankKeeper, suite.network.App.EVMKeeper, suite.network.App.StakingKeeper, + suite.network.App.AuthzKeeper, &suite.network.App.TransferKeeper, ) - mockBankKeeper.On("MintCoins", mock.Anything, mock.Anything, mock.Anything).Return(nil) - mockBankKeeper.On("SendCoinsFromModuleToAccount", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) - mockBankKeeper.On("BlockedAddr", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(false) - mockBankKeeper.On("GetBalance", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(sdk.Coin{Denom: coinName, Amount: math.NewInt(int64(10))}) + mockBankKeeper.EXPECT().MintCoins(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil) + mockBankKeeper.EXPECT().SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil) + mockBankKeeper.EXPECT().BlockedAddr(gomock.Any()).Return(false) + mockBankKeeper.EXPECT().GetBalance(gomock.Any(), gomock.Any(), gomock.Any()).Return(sdk.Coin{Denom: coinName, Amount: math.OneInt()}).AnyTimes() }, contractMinterBurner, false, @@ -325,39 +301,44 @@ func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { } for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { + var err error suite.mintFeeCollector = true + defer func() { + suite.mintFeeCollector = false + }() + suite.SetupTest() - contractAddr = suite.setupRegisterERC20Pair(tc.contractType) + contractAddr, err = suite.setupRegisterERC20Pair(tc.contractType) + suite.Require().NoError(err) tc.malleate(contractAddr) suite.Require().NotNil(contractAddr) - suite.Commit() coinName = types.CreateDenom(contractAddr.String()) - sender := sdk.AccAddress(suite.address.Bytes()) + sender := suite.keyring.GetAccAddr(0) + + _, err = suite.MintERC20Token(contractAddr, suite.keyring.GetAddr(0), big.NewInt(tc.mint)) + suite.Require().NoError(err) + // update context with latest committed changes + + tc.extra() + msg := types.NewMsgConvertERC20( math.NewInt(tc.transfer), sender, contractAddr, - suite.address, + suite.keyring.GetAddr(0), ) - suite.MintERC20Token(contractAddr, suite.address, suite.address, big.NewInt(tc.mint)) - suite.Commit() - ctx := sdk.WrapSDKContext(suite.ctx) + ctx := suite.network.GetContext() + _, err = suite.network.App.Erc20Keeper.ConvertERC20(ctx, msg) - tc.extra() - res, err := suite.app.Erc20Keeper.ConvertERC20(ctx, msg) - - expRes := &types.MsgConvertERC20Response{} - suite.Commit() - balance := suite.BalanceOf(contractAddr, suite.address) - cosmosBalance := suite.app.BankKeeper.GetBalance(suite.ctx, sender, coinName) + cosmosBalance := suite.network.App.BankKeeper.GetBalance(ctx, sender, coinName) if tc.expPass { suite.Require().NoError(err, tc.name) - acc := suite.app.EVMKeeper.GetAccountWithoutBalance(suite.ctx, contractAddr) + acc := suite.network.App.EVMKeeper.GetAccountWithoutBalance(ctx, contractAddr) if tc.selfdestructed { suite.Require().Nil(acc, "expected contract to be destroyed") } else { @@ -365,13 +346,11 @@ func (suite *KeeperTestSuite) TestConvertERC20NativeERC20() { } if tc.selfdestructed || !acc.IsContract() { - id := suite.app.Erc20Keeper.GetTokenPairID(suite.ctx, contractAddr.String()) - _, found := suite.app.Erc20Keeper.GetTokenPair(suite.ctx, id) + id := suite.network.App.Erc20Keeper.GetTokenPairID(ctx, contractAddr.String()) + _, found := suite.network.App.Erc20Keeper.GetTokenPair(ctx, id) suite.Require().False(found) } else { - suite.Require().Equal(expRes, res) suite.Require().Equal(cosmosBalance.Amount, math.NewInt(tc.transfer)) - suite.Require().Equal(balance.(*big.Int).Int64(), big.NewInt(tc.mint-tc.transfer).Int64()) } } else { suite.Require().Error(err, tc.name) @@ -403,9 +382,9 @@ func (suite *KeeperTestSuite) TestUpdateParams() { } for _, tc := range testCases { - tc := tc suite.Run("MsgUpdateParams", func() { - _, err := suite.app.Erc20Keeper.UpdateParams(suite.ctx, tc.request) + suite.SetupTest() + _, err := suite.network.App.Erc20Keeper.UpdateParams(suite.network.GetContext(), tc.request) if tc.expectErr { suite.Require().Error(err) } else { diff --git a/x/erc20/keeper/params.go b/x/erc20/keeper/params.go index d47e2340..31e0846e 100644 --- a/x/erc20/keeper/params.go +++ b/x/erc20/keeper/params.go @@ -7,6 +7,7 @@ import ( "slices" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/x/erc20/types" ) @@ -22,6 +23,25 @@ func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { return types.NewParams(enableErc20, nativePrecompiles, dynamicPrecompiles) } +func (k Keeper) UpdateCodeHash(ctx sdk.Context, updatedDynamicPrecompiles []string) error { + // if a precompile is disabled or deleted in the params, we should remove the codehash + oldDynamicPrecompiles := k.getDynamicPrecompiles(ctx) + disabledPrecompiles, enabledPrecompiles := types.GetDisabledAndEnabledPrecompiles(oldDynamicPrecompiles, updatedDynamicPrecompiles) + for _, precompile := range disabledPrecompiles { + if err := k.UnRegisterERC20CodeHash(ctx, precompile); err != nil { + return err + } + } + + // if a precompile is added we should register the account with the erc20 codehash + for _, precompile := range enabledPrecompiles { + if err := k.RegisterERC20CodeHash(ctx, common.HexToAddress(precompile)); err != nil { + return err + } + } + return nil +} + // SetParams sets the erc20 parameters to the param space. func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { // and keep params equal between different executions @@ -32,6 +52,11 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { return err } + // update the codehash for enabled or disabled dynamic precompiles + if err := k.UpdateCodeHash(ctx, params.DynamicPrecompiles); err != nil { + return err + } + k.setERC20Enabled(ctx, params.EnableErc20) k.setDynamicPrecompiles(ctx, params.DynamicPrecompiles) k.setNativePrecompiles(ctx, params.NativePrecompiles) diff --git a/x/erc20/keeper/params_test.go b/x/erc20/keeper/params_test.go index 5323c153..1a914eee 100644 --- a/x/erc20/keeper/params_test.go +++ b/x/erc20/keeper/params_test.go @@ -1,15 +1,13 @@ package keeper_test import ( - "reflect" - - "github.com/evmos/os/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + testconstants "github.com/evmos/os/testutil/constants" "github.com/evmos/os/x/erc20/types" ) func (suite *KeeperTestSuite) TestParams() { - params := suite.app.Erc20Keeper.GetParams(suite.ctx) - suite.app.Erc20Keeper.SetParams(suite.ctx, params) //nolint:errcheck + var ctx sdk.Context testCases := []struct { name string @@ -23,38 +21,40 @@ func (suite *KeeperTestSuite) TestParams() { erc20Params := types.DefaultParams() // NOTE: we need to add the example token pair address which is not in the default params but in the genesis state // of the test suite app and therefore is returned by the query client. - erc20Params.NativePrecompiles = append(erc20Params.NativePrecompiles, testutil.WEVMOSContractMainnet) + erc20Params.NativePrecompiles = append(erc20Params.NativePrecompiles, testconstants.WEVMOSContractMainnet) return erc20Params }, func() interface{} { - return suite.app.Erc20Keeper.GetParams(suite.ctx) + return suite.network.App.Erc20Keeper.GetParams(ctx) }, true, }, { "success - Checks if dynamic precompiles are set correctly", func() interface{} { + params := types.DefaultParams() params.DynamicPrecompiles = []string{"0xB5124FA2b2cF92B2D469b249433BA1c96BDF536D", "0xC4CcDf91b810a61cCB48b35ccCc066C63bf94B4F"} - err := suite.app.Erc20Keeper.SetParams(suite.ctx, params) + err := suite.network.App.Erc20Keeper.SetParams(ctx, params) suite.Require().NoError(err) return params.DynamicPrecompiles }, func() interface{} { - return suite.app.Erc20Keeper.GetParams(suite.ctx).DynamicPrecompiles + return suite.network.App.Erc20Keeper.GetParams(ctx).DynamicPrecompiles }, true, }, { "success - Checks if native precompiles are set correctly", func() interface{} { + params := types.DefaultParams() params.NativePrecompiles = []string{"0x205CF44075E77A3543abC690437F3b2819bc450a", "0x8FA78CEB7F04118Ec6d06AaC37Ca854691d8e963"} - err := suite.app.Erc20Keeper.SetParams(suite.ctx, params) + err := suite.network.App.Erc20Keeper.SetParams(ctx, params) suite.Require().NoError(err) return params.NativePrecompiles }, func() interface{} { - return suite.app.Erc20Keeper.GetParams(suite.ctx).NativePrecompiles + return suite.network.App.Erc20Keeper.GetParams(ctx).NativePrecompiles }, true, }, @@ -62,8 +62,10 @@ func (suite *KeeperTestSuite) TestParams() { for _, tc := range testCases { suite.Run(tc.name, func() { - outcome := reflect.DeepEqual(tc.paramsFun(), tc.getFun()) - suite.Require().Equal(tc.expected, outcome) + suite.SetupTest() + ctx = suite.network.GetContext() + + suite.Require().Equal(tc.paramsFun(), tc.getFun()) }) } } diff --git a/x/erc20/keeper/precompiles.go b/x/erc20/keeper/precompiles.go index c02a646e..35e0314b 100644 --- a/x/erc20/keeper/precompiles.go +++ b/x/erc20/keeper/precompiles.go @@ -5,6 +5,7 @@ package keeper import ( "fmt" + "slices" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" @@ -60,6 +61,6 @@ func (k Keeper) InstantiateERC20Precompile(ctx sdk.Context, contractAddr common. // IsAvailableDynamicPrecompile returns true if the given precompile address is contained in the // EVM keeper's available dynamic precompiles precompiles params. func (k Keeper) IsAvailableERC20Precompile(params *types.Params, address common.Address) bool { - return params.IsNativePrecompile(address) || - params.IsDynamicPrecompile(address) + return slices.Contains(params.NativePrecompiles, address.Hex()) || + slices.Contains(params.DynamicPrecompiles, address.Hex()) } diff --git a/x/erc20/keeper/precompiles_test.go b/x/erc20/keeper/precompiles_test.go index 443b2c85..74c490a5 100644 --- a/x/erc20/keeper/precompiles_test.go +++ b/x/erc20/keeper/precompiles_test.go @@ -1,19 +1,20 @@ package keeper_test import ( + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/x/erc20/types" ) func (suite *KeeperTestSuite) TestGetERC20PrecompileInstance() { + var ( + ctx sdk.Context + tokenPairs []types.TokenPair + ) newTokenHexAddr := "0x205CF44075E77A3543abC690437F3b2819bc450a" //nolint:gosec nonExistendTokenHexAddr := "0x8FA78CEB7F04118Ec6d06AaC37Ca854691d8e963" //nolint:gosec newTokenDenom := "test" - params := suite.app.Erc20Keeper.GetParams(suite.ctx) tokenPair := types.NewTokenPair(common.HexToAddress(newTokenHexAddr), newTokenDenom, types.OWNER_MODULE) - suite.app.Erc20Keeper.SetToken(suite.ctx, tokenPair) - tokenPairs := suite.app.Erc20Keeper.GetTokenPairs(suite.ctx) - suite.Require().True(len(tokenPairs) > 1) testCases := []struct { name string @@ -26,8 +27,8 @@ func (suite *KeeperTestSuite) TestGetERC20PrecompileInstance() { { "fail - precompile not on params", func() { - params = types.DefaultParams() - err := suite.app.Erc20Keeper.SetParams(suite.ctx, params) + params := types.DefaultParams() + err := suite.network.App.Erc20Keeper.SetParams(ctx, params) suite.Require().NoError(err) }, common.HexToAddress(nonExistendTokenHexAddr), @@ -38,8 +39,9 @@ func (suite *KeeperTestSuite) TestGetERC20PrecompileInstance() { { "fail - precompile on params, but token pair doesn't exist", func() { + params := types.DefaultParams() params.NativePrecompiles = []string{newTokenHexAddr, nonExistendTokenHexAddr} - err := suite.app.Erc20Keeper.SetParams(suite.ctx, params) + err := suite.network.App.Erc20Keeper.SetParams(ctx, params) suite.Require().NoError(err) }, common.HexToAddress(nonExistendTokenHexAddr), @@ -50,11 +52,12 @@ func (suite *KeeperTestSuite) TestGetERC20PrecompileInstance() { { "success - precompile on params, and token pair exist", func() { - params.NativePrecompiles = []string{tokenPairs[0].Erc20Address} - err := suite.app.Erc20Keeper.SetParams(suite.ctx, params) + params := types.DefaultParams() + params.NativePrecompiles = []string{tokenPair.Erc20Address} + err := suite.network.App.Erc20Keeper.SetParams(ctx, params) suite.Require().NoError(err) }, - common.HexToAddress(tokenPairs[0].Erc20Address), + common.HexToAddress(tokenPair.Erc20Address), true, false, "", @@ -62,9 +65,19 @@ func (suite *KeeperTestSuite) TestGetERC20PrecompileInstance() { } for _, tc := range testCases { suite.Run(tc.name, func() { + suite.SetupTest() + ctx = suite.network.GetContext() + + suite.network.App.Erc20Keeper.SetToken(ctx, tokenPair) + tokenPairs = suite.network.App.Erc20Keeper.GetTokenPairs(ctx) + suite.Require().True(len(tokenPairs) > 1, + "expected more than 1 token pair to be set; got %d", + len(tokenPairs), + ) + tc.paramsFun() - _, found, err := suite.app.Erc20Keeper.GetERC20PrecompileInstance(suite.ctx, tc.precompile) + _, found, err := suite.network.App.Erc20Keeper.GetERC20PrecompileInstance(ctx, tc.precompile) suite.Require().Equal(found, tc.expectedFound) if tc.expectedError { suite.Require().ErrorContains(err, tc.err) diff --git a/x/erc20/keeper/proposals.go b/x/erc20/keeper/proposals.go index 663f2722..78a655dd 100644 --- a/x/erc20/keeper/proposals.go +++ b/x/erc20/keeper/proposals.go @@ -14,7 +14,7 @@ import ( // RegisterERC20 creates a Cosmos coin and registers the token pair between the // coin and the ERC20 -func (k Keeper) RegisterERC20( +func (k Keeper) registerERC20( ctx sdk.Context, contract common.Address, ) (*types.TokenPair, error) { @@ -110,7 +110,7 @@ func (k Keeper) CreateCoinMetadata( } // ToggleConversion toggles conversion for a given token pair -func (k Keeper) ToggleConversion( +func (k Keeper) toggleConversion( ctx sdk.Context, token string, ) (types.TokenPair, error) { diff --git a/x/erc20/keeper/proposals_test.go b/x/erc20/keeper/proposals_test.go index 78e76cf0..db753cdb 100644 --- a/x/erc20/keeper/proposals_test.go +++ b/x/erc20/keeper/proposals_test.go @@ -3,10 +3,14 @@ package keeper_test import ( "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/ethereum/go-ethereum/common" + "github.com/evmos/os/contracts" + testfactory "github.com/evmos/os/testutil/integration/os/factory" + testutils "github.com/evmos/os/testutil/integration/os/utils" "github.com/evmos/os/x/erc20/keeper" "github.com/evmos/os/x/erc20/types" erc20mocks "github.com/evmos/os/x/erc20/types/mocks" @@ -32,43 +36,24 @@ const ( ibcBase = "ibc/7B2A4F6E798182988D77B6B884919AF617A73503FDAC27C916CD7A69A69013CF" ) -var ( - metadataCoin = banktypes.Metadata{ - Description: "description of the token", - Base: cosmosTokenBase, - // NOTE: Denom units MUST be increasing - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: cosmosTokenBase, - Exponent: 0, - }, - { - Denom: cosmosTokenDisplay, - Exponent: defaultExponent, - }, - }, - Name: cosmosTokenBase, - Symbol: erc20Symbol, - Display: cosmosTokenBase, - } - - metadataIbc = banktypes.Metadata{ - Description: "ATOM IBC voucher (channel 14)", - Base: ibcBase, - // NOTE: Denom units MUST be increasing - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: ibcBase, - Exponent: 0, - }, +var metadataIbc = banktypes.Metadata{ + Description: "ATOM IBC voucher (channel 14)", + Base: ibcBase, + // NOTE: Denom units MUST be increasing + DenomUnits: []*banktypes.DenomUnit{ + { + Denom: ibcBase, + Exponent: 0, }, - Name: "ATOM channel-14", - Symbol: "ibcATOM-14", - Display: ibcBase, - } -) + }, + Name: "ATOM channel-14", + Symbol: "ibcATOM-14", + Display: ibcBase, +} -func (suite *KeeperTestSuite) setupRegisterERC20Pair(contractType int) common.Address { +// setupRegisterERC20Pair deploys an ERC20 smart contract and +// registers it as ERC20. +func (suite *KeeperTestSuite) setupRegisterERC20Pair(contractType int) (common.Address, error) { var ( contract common.Address err error @@ -82,16 +67,26 @@ func (suite *KeeperTestSuite) setupRegisterERC20Pair(contractType int) common.Ad default: contract, err = suite.DeployContract(erc20Name, erc20Symbol, erc20Decimals) } - suite.Require().NoError(err) - suite.Commit() - _, err = suite.app.Erc20Keeper.RegisterERC20(suite.ctx, contract) - suite.Require().NoError(err) - return contract + if err != nil { + return common.Address{}, err + } + if err := suite.network.NextBlock(); err != nil { + return common.Address{}, err + } + + // submit gov proposal to register ERC20 token pair + _, err = testutils.RegisterERC20(suite.factory, suite.network, testutils.ERC20RegistrationData{ + Addresses: []string{contract.Hex()}, + ProposerPriv: suite.keyring.GetPrivKey(0), + }) + + return contract, err } func (suite *KeeperTestSuite) TestRegisterERC20() { var ( + ctx sdk.Context contractAddr common.Address pair types.TokenPair ) @@ -103,21 +98,21 @@ func (suite *KeeperTestSuite) TestRegisterERC20() { { "token ERC20 already registered", func() { - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, pair.GetERC20Contract(), pair.GetID()) + suite.network.App.Erc20Keeper.SetERC20Map(ctx, pair.GetERC20Contract(), pair.GetID()) }, false, }, { "denom already registered", func() { - suite.app.Erc20Keeper.SetDenomMap(suite.ctx, pair.Denom, pair.GetID()) + suite.network.App.Erc20Keeper.SetDenomMap(ctx, pair.Denom, pair.GetID()) }, false, }, { "meta data already stored", func() { - suite.app.Erc20Keeper.CreateCoinMetadata(suite.ctx, contractAddr) //nolint:errcheck + suite.network.App.Erc20Keeper.CreateCoinMetadata(ctx, contractAddr) //nolint:errcheck }, false, }, @@ -131,11 +126,11 @@ func (suite *KeeperTestSuite) TestRegisterERC20() { func() { mockEVMKeeper := &erc20mocks.EVMKeeper{} - suite.app.Erc20Keeper = keeper.NewKeeper( - suite.app.GetKey("erc20"), suite.app.AppCodec(), - authtypes.NewModuleAddress(govtypes.ModuleName), suite.app.AccountKeeper, - suite.app.BankKeeper, mockEVMKeeper, suite.app.StakingKeeper, - suite.app.AuthzKeeper, &suite.app.TransferKeeper, + suite.network.App.Erc20Keeper = keeper.NewKeeper( + suite.network.App.GetKey("erc20"), suite.network.App.AppCodec(), + authtypes.NewModuleAddress(govtypes.ModuleName), suite.network.App.AccountKeeper, + suite.network.App.BankKeeper, mockEVMKeeper, suite.network.App.StakingKeeper, + suite.network.App.AuthzKeeper, &suite.network.App.TransferKeeper, ) mockEVMKeeper.On("EstimateGasInternal", mock.Anything, mock.Anything, mock.Anything).Return(&evmtypes.EstimateGasResponse{Gas: uint64(200)}, nil) @@ -150,16 +145,29 @@ func (suite *KeeperTestSuite) TestRegisterERC20() { var err error suite.SetupTest() // reset - contractAddr, err = suite.DeployContract(erc20Name, erc20Symbol, cosmosDecimals) - suite.Require().NoError(err) + contractAddr, err = suite.factory.DeployContract( + suite.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{}, + testfactory.ContractDeploymentData{ + Contract: contracts.ERC20MinterBurnerDecimalsContract, + ConstructorArgs: []interface{}{erc20Name, erc20Symbol, cosmosDecimals}, + }, + ) + suite.Require().NoError(err, "failed to deploy contract") + suite.Require().NoError(suite.network.NextBlock(), "failed to advance block") coinName := types.CreateDenom(contractAddr.String()) pair = types.NewTokenPair(contractAddr, coinName, types.OWNER_EXTERNAL) + ctx = suite.network.GetContext() + tc.malleate() - _, err = suite.app.Erc20Keeper.RegisterERC20(suite.ctx, contractAddr) - metadata, found := suite.app.BankKeeper.GetDenomMetaData(suite.ctx, coinName) + _, err = suite.network.App.Erc20Keeper.RegisterERC20(ctx, &types.MsgRegisterERC20{ + Authority: authtypes.NewModuleAddress("gov").String(), + Erc20Addresses: []string{contractAddr.Hex()}, + }) + metadata, found := suite.network.App.BankKeeper.GetDenomMetaData(ctx, coinName) if tc.expPass { suite.Require().NoError(err, tc.name) // Metadata variables @@ -182,8 +190,10 @@ func (suite *KeeperTestSuite) TestRegisterERC20() { } } -func (suite KeeperTestSuite) TestToggleConverision() { //nolint:govet // we can copy locks here because it is a test +func (suite *KeeperTestSuite) TestToggleConverision() { var ( + ctx sdk.Context + err error contractAddr common.Address id []byte pair types.TokenPair @@ -198,9 +208,17 @@ func (suite KeeperTestSuite) TestToggleConverision() { //nolint:govet // we can { "token not registered", func() { - contractAddr, err := suite.DeployContract(erc20Name, erc20Symbol, erc20Decimals) - suite.Require().NoError(err) - suite.Commit() + contractAddr, err = suite.factory.DeployContract( + suite.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{}, + testfactory.ContractDeploymentData{ + Contract: contracts.ERC20MinterBurnerDecimalsContract, + ConstructorArgs: []interface{}{erc20Name, erc20Symbol, erc20Decimals}, + }, + ) + suite.Require().NoError(err, "failed to deploy contract") + suite.Require().NoError(suite.network.NextBlock(), "failed to advance block") + pair = types.NewTokenPair(contractAddr, cosmosTokenBase, types.OWNER_MODULE) }, false, @@ -209,11 +227,19 @@ func (suite KeeperTestSuite) TestToggleConverision() { //nolint:govet // we can { "token not registered - pair not found", func() { - contractAddr, err := suite.DeployContract(erc20Name, erc20Symbol, erc20Decimals) - suite.Require().NoError(err) - suite.Commit() + contractAddr, err = suite.factory.DeployContract( + suite.keyring.GetPrivKey(0), + evmtypes.EvmTxArgs{}, + testfactory.ContractDeploymentData{ + Contract: contracts.ERC20MinterBurnerDecimalsContract, + ConstructorArgs: []interface{}{erc20Name, erc20Symbol, erc20Decimals}, + }, + ) + suite.Require().NoError(err, "failed to deploy contract") + suite.Require().NoError(suite.network.NextBlock(), "failed to advance block") + pair = types.NewTokenPair(contractAddr, cosmosTokenBase, types.OWNER_MODULE) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, common.HexToAddress(pair.Erc20Address), pair.GetID()) + suite.network.App.Erc20Keeper.SetERC20Map(ctx, common.HexToAddress(pair.Erc20Address), pair.GetID()) }, false, false, @@ -221,9 +247,11 @@ func (suite KeeperTestSuite) TestToggleConverision() { //nolint:govet // we can { "disable conversion", func() { - contractAddr = suite.setupRegisterERC20Pair(contractMinterBurner) - id = suite.app.Erc20Keeper.GetTokenPairID(suite.ctx, contractAddr.String()) - pair, _ = suite.app.Erc20Keeper.GetTokenPair(suite.ctx, id) + contractAddr, err = suite.setupRegisterERC20Pair(contractMinterBurner) + suite.Require().NoError(err, "failed to register pair") + ctx = suite.network.GetContext() + id = suite.network.App.Erc20Keeper.GetTokenPairID(ctx, contractAddr.String()) + pair, _ = suite.network.App.Erc20Keeper.GetTokenPair(ctx, id) }, true, false, @@ -231,10 +259,15 @@ func (suite KeeperTestSuite) TestToggleConverision() { //nolint:govet // we can { "disable and enable conversion", func() { - contractAddr = suite.setupRegisterERC20Pair(contractMinterBurner) - id = suite.app.Erc20Keeper.GetTokenPairID(suite.ctx, contractAddr.String()) - pair, _ = suite.app.Erc20Keeper.GetTokenPair(suite.ctx, id) - pair, _ = suite.app.Erc20Keeper.ToggleConversion(suite.ctx, contractAddr.String()) + contractAddr, err = suite.setupRegisterERC20Pair(contractMinterBurner) + suite.Require().NoError(err, "failed to register pair") + ctx = suite.network.GetContext() + id = suite.network.App.Erc20Keeper.GetTokenPairID(ctx, contractAddr.String()) + pair, _ = suite.network.App.Erc20Keeper.GetTokenPair(ctx, id) + res, err := suite.network.App.Erc20Keeper.ToggleConversion(ctx, &types.MsgToggleConversion{Authority: authtypes.NewModuleAddress("gov").String(), Token: contractAddr.String()}) + suite.Require().NoError(err) + suite.Require().NotNil(res) + pair, _ = suite.network.App.Erc20Keeper.GetTokenPair(ctx, id) }, true, true, @@ -243,13 +276,13 @@ func (suite KeeperTestSuite) TestToggleConverision() { //nolint:govet // we can for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset + ctx = suite.network.GetContext() tc.malleate() - var err error - pair, err = suite.app.Erc20Keeper.ToggleConversion(suite.ctx, contractAddr.String()) + _, err = suite.network.App.Erc20Keeper.ToggleConversion(ctx, &types.MsgToggleConversion{Authority: authtypes.NewModuleAddress("gov").String(), Token: contractAddr.String()}) // Request the pair using the GetPairToken func to make sure that is updated on the db - pair, _ = suite.app.Erc20Keeper.GetTokenPair(suite.ctx, id) + pair, _ = suite.network.App.Erc20Keeper.GetTokenPair(ctx, id) if tc.expPass { suite.Require().NoError(err, tc.name) if tc.conversionEnabled { diff --git a/x/erc20/keeper/setup_test.go b/x/erc20/keeper/setup_test.go index e17680ae..79ccfd3f 100644 --- a/x/erc20/keeper/setup_test.go +++ b/x/erc20/keeper/setup_test.go @@ -3,66 +3,66 @@ package keeper_test import ( "testing" - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/ginkgo/v2" - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/gomega" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibcgotesting "github.com/cosmos/ibc-go/v7/testing" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - exampleapp "github.com/evmos/os/example_chain" - ibctesting "github.com/evmos/os/ibc/testing" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/ethereum/go-ethereum/params" + testconstants "github.com/evmos/os/testutil/constants" + "github.com/evmos/os/testutil/integration/os/factory" + "github.com/evmos/os/testutil/integration/os/grpc" + "github.com/evmos/os/testutil/integration/os/keyring" + "github.com/evmos/os/testutil/integration/os/network" "github.com/evmos/os/x/erc20/types" - evm "github.com/evmos/os/x/evm/types" "github.com/stretchr/testify/suite" ) type KeeperTestSuite struct { suite.Suite - ctx sdk.Context - app *exampleapp.ExampleChain - queryClientEvm evm.QueryClient - queryClient types.QueryClient - address common.Address - consAddress sdk.ConsAddress - clientCtx client.Context //nolint:unused - ethSigner ethtypes.Signer - priv cryptotypes.PrivKey - validator stakingtypes.Validator - signer keyring.Signer - mintFeeCollector bool - - coordinator *ibcgotesting.Coordinator + network *network.UnitTestNetwork + handler grpc.Handler + keyring keyring.Keyring + factory factory.TxFactory - // testing chains used for convenience and readability - EvmosChain *ibcgotesting.TestChain - IBCOsmosisChain *ibcgotesting.TestChain - IBCCosmosChain *ibcgotesting.TestChain + queryClient types.QueryClient - pathOsmosisEvmos *ibctesting.Path - pathCosmosEvmos *ibctesting.Path - pathOsmosisCosmos *ibctesting.Path + mintFeeCollector bool +} - suiteIBCTesting bool +func TestKeeperUnitTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) } -var s *KeeperTestSuite +func (suite *KeeperTestSuite) SetupTest() { + keys := keyring.New(2) + // Set custom balance based on test params + customGenesis := network.CustomGenesisState{} -func TestKeeperTestSuite(t *testing.T) { - s = new(KeeperTestSuite) - suite.Run(t, s) + if suite.mintFeeCollector { + // mint some coin to fee collector + coins := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(int64(params.TxGas)-1))) + balances := []banktypes.Balance{ + { + Address: authtypes.NewModuleAddress(authtypes.FeeCollectorName).String(), + Coins: coins, + }, + } + bankGenesis := banktypes.DefaultGenesisState() + bankGenesis.Balances = balances + customGenesis[banktypes.ModuleName] = bankGenesis + } - RegisterFailHandler(Fail) - RunSpecs(t, "ERC20 Keeper Integration Tests Suite") -} + nw := network.NewUnitTestNetwork( + network.WithPreFundedAccounts(keys.GetAllAccAddrs()...), + network.WithCustomGenesis(customGenesis), + ) + gh := grpc.NewIntegrationHandler(nw) + tf := factory.New(nw, gh) -func (suite *KeeperTestSuite) SetupTest() { - suite.DoSetupTest() + suite.network = nw + suite.factory = tf + suite.handler = gh + suite.keyring = keys + suite.queryClient = nw.GetERC20Client() } diff --git a/x/erc20/keeper/testdata/ERC20DirectBalanceManipulation.json b/x/erc20/keeper/testdata/ERC20DirectBalanceManipulation.json index 0ff17069..da4c529a 100644 --- a/x/erc20/keeper/testdata/ERC20DirectBalanceManipulation.json +++ b/x/erc20/keeper/testdata/ERC20DirectBalanceManipulation.json @@ -660,8 +660,8 @@ "type": "function" } ], - "bytecode": "0x6080604052734dc6ac40af078661fc43823086e1513635eeab14600760016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503480156200006657600080fd5b5060405162003dca38038062003dca83398181016040528101906200008c9190620006ef565b6040518060400160405280601e81526020017f455243323044697265637442616c616e63654d616e6970756c6174696f6e00008152506040518060400160405280601e81526020017f455243323044697265637442616c616e63654d616e6970756c6174696f6e0000815250818181600590816200010b919062000991565b5080600690816200011d919062000991565b5050506000600760006101000a81548160ff0219169083151502179055506200015f6000801b620001536200021160201b60201c565b6200021960201b60201c565b620001a07f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6620001946200021160201b60201c565b6200021960201b60201c565b620001e17f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a620001d56200021160201b60201c565b6200021960201b60201c565b5050620001f86000801b336200021960201b60201c565b6200020a33826200022f60201b60201c565b5062000c2b565b600033905090565b6200022b82826200039d60201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620002a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002989062000ad9565b60405180910390fd5b620002b560008383620003db60201b60201c565b8060046000828254620002c9919062000b2a565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516200037d919062000b76565b60405180910390a36200039960008383620003f360201b60201c565b5050565b620003af8282620003f860201b60201c565b620003d68160016000858152602001908152602001600020620004e960201b90919060201c565b505050565b620003ee8383836200052160201b60201c565b505050565b505050565b6200040a82826200058c60201b60201c565b620004e557600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506200048a6200021160201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000519836000018373ffffffffffffffffffffffffffffffffffffffff1660001b620005f660201b60201c565b905092915050565b620005348383836200067060201b60201c565b620005446200067560201b60201c565b1562000587576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200057e9062000c09565b60405180910390fd5b505050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60006200060a83836200068c60201b60201c565b620006655782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506200066a565b600090505b92915050565b505050565b6000600760009054906101000a900460ff16905090565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b6000819050919050565b620006c981620006b4565b8114620006d557600080fd5b50565b600081519050620006e981620006be565b92915050565b600060208284031215620007085762000707620006af565b5b60006200071884828501620006d8565b91505092915050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620007a357607f821691505b602082108103620007b957620007b86200075b565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620008237fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620007e4565b6200082f8683620007e4565b95508019841693508086168417925050509392505050565b6000819050919050565b6000620008726200086c6200086684620006b4565b62000847565b620006b4565b9050919050565b6000819050919050565b6200088e8362000851565b620008a66200089d8262000879565b848454620007f1565b825550505050565b600090565b620008bd620008ae565b620008ca81848462000883565b505050565b5b81811015620008f257620008e6600082620008b3565b600181019050620008d0565b5050565b601f82111562000941576200090b81620007bf565b6200091684620007d4565b8101602085101562000926578190505b6200093e6200093585620007d4565b830182620008cf565b50505b505050565b600082821c905092915050565b6000620009666000198460080262000946565b1980831691505092915050565b600062000981838362000953565b9150826002028217905092915050565b6200099c8262000721565b67ffffffffffffffff811115620009b857620009b76200072c565b5b620009c482546200078a565b620009d1828285620008f6565b600060209050601f83116001811462000a095760008415620009f4578287015190505b62000a00858262000973565b86555062000a70565b601f19841662000a1986620007bf565b60005b8281101562000a435784890151825560018201915060208501945060208101905062000a1c565b8683101562000a63578489015162000a5f601f89168262000953565b8355505b6001600288020188555050505b505050505050565b600082825260208201905092915050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b600062000ac1601f8362000a78565b915062000ace8262000a89565b602082019050919050565b6000602082019050818103600083015262000af48162000ab2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000b3782620006b4565b915062000b4483620006b4565b925082820190508082111562000b5f5762000b5e62000afb565b5b92915050565b62000b7081620006b4565b82525050565b600060208201905062000b8d600083018462000b65565b92915050565b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b600062000bf1602a8362000a78565b915062000bfe8262000b93565b604082019050919050565b6000602082019050818103600083015262000c248162000be2565b9050919050565b61318f8062000c3b6000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063a457c2d711610097578063d539139311610071578063d53913931461052d578063d547741f1461054b578063dd62ed3e14610567578063e63ab1e914610597576101c4565b8063a457c2d71461049d578063a9059cbb146104cd578063ca15c873146104fd576101c4565b80639010d07c116100d35780639010d07c1461040157806391d148541461043157806395d89b4114610461578063a217fddf1461047f576101c4565b806370a08231146103ab57806379cc6790146103db5780638456cb59146103f7576101c4565b8063313ce567116101665780633f4ba83a116101405780633f4ba83a1461034b57806340c10f191461035557806342966c68146103715780635c975abb1461038d576101c4565b8063313ce567146102e157806336568abe146102ff578063395093511461031b576101c4565b806318160ddd116101a257806318160ddd1461024757806323b872dd14610265578063248a9ca3146102955780632f2ff15d146102c5576101c4565b806301ffc9a7146101c957806306fdde03146101f9578063095ea7b314610217575b600080fd5b6101e360048036038101906101de9190612008565b6105b5565b6040516101f09190612050565b60405180910390f35b61020161062f565b60405161020e91906120fb565b60405180910390f35b610231600480360381019061022c91906121b1565b6106c1565b60405161023e9190612050565b60405180910390f35b61024f6106e4565b60405161025c9190612200565b60405180910390f35b61027f600480360381019061027a919061221b565b6106ee565b60405161028c9190612050565b60405180910390f35b6102af60048036038101906102aa91906122a4565b61071d565b6040516102bc91906122e0565b60405180910390f35b6102df60048036038101906102da91906122fb565b61073c565b005b6102e961075d565b6040516102f69190612357565b60405180910390f35b610319600480360381019061031491906122fb565b610766565b005b610335600480360381019061033091906121b1565b6107e9565b6040516103429190612050565b60405180910390f35b610353610820565b005b61036f600480360381019061036a91906121b1565b61089a565b005b61038b60048036038101906103869190612372565b610918565b005b61039561092c565b6040516103a29190612050565b60405180910390f35b6103c560048036038101906103c0919061239f565b610943565b6040516103d29190612200565b60405180910390f35b6103f560048036038101906103f091906121b1565b61098c565b005b6103ff6109ac565b005b61041b600480360381019061041691906123cc565b610a26565b604051610428919061241b565b60405180910390f35b61044b600480360381019061044691906122fb565b610a55565b6040516104589190612050565b60405180910390f35b610469610abf565b60405161047691906120fb565b60405180910390f35b610487610b51565b60405161049491906122e0565b60405180910390f35b6104b760048036038101906104b291906121b1565b610b58565b6040516104c49190612050565b60405180910390f35b6104e760048036038101906104e291906121b1565b610bcf565b6040516104f49190612050565b60405180910390f35b610517600480360381019061051291906122a4565b610c2c565b6040516105249190612200565b60405180910390f35b610535610c50565b60405161054291906122e0565b60405180910390f35b610565600480360381019061056091906122fb565b610c74565b005b610581600480360381019061057c9190612436565b610c95565b60405161058e9190612200565b60405180910390f35b61059f610d1c565b6040516105ac91906122e0565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610628575061062782610d40565b5b9050919050565b60606005805461063e906124a5565b80601f016020809104026020016040519081016040528092919081815260200182805461066a906124a5565b80156106b75780601f1061068c576101008083540402835291602001916106b7565b820191906000526020600020905b81548152906001019060200180831161069a57829003601f168201915b5050505050905090565b6000806106cc610dba565b90506106d9818585610dc2565b600191505092915050565b6000600454905090565b6000806106f9610dba565b9050610706858285610f8b565b610711858585611017565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b6107458261071d565b61074e81611290565b61075883836112a4565b505050565b60006012905090565b61076e610dba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d290612548565b60405180910390fd5b6107e582826112d8565b5050565b6000806107f4610dba565b90506108158185856108068589610c95565b6108109190612597565b610dc2565b600191505092915050565b6108517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61084c610dba565b610a55565b610890576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108879061263d565b60405180910390fd5b61089861130c565b565b6108cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66108c6610dba565b610a55565b61090a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610901906126cf565b60405180910390fd5b610914828261136f565b5050565b610929610923610dba565b826114c6565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61099e82610998610dba565b83610f8b565b6109a882826114c6565b5050565b6109dd7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6109d8610dba565b610a55565b610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390612761565b60405180910390fd5b610a24611695565b565b6000610a4d82600160008681526020019081526020016000206116f890919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610ace906124a5565b80601f0160208091040260200160405190810160405280929190818152602001828054610afa906124a5565b8015610b475780601f10610b1c57610100808354040283529160200191610b47565b820191906000526020600020905b815481529060010190602001808311610b2a57829003601f168201915b5050505050905090565b6000801b81565b600080610b63610dba565b90506000610b718286610c95565b905083811015610bb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bad906127f3565b60405180910390fd5b610bc38286868403610dc2565b60019250505092915050565b600080600283610bdf9190612842565b9050610c18600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff168285610c139190612873565b611712565b50610c238482611712565b91505092915050565b6000610c4960016000848152602001908152602001600020611735565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610c7d8261071d565b610c8681611290565b610c9083836112d8565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610db35750610db28261174a565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610e31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2890612919565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e97906129ab565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f7e9190612200565b60405180910390a3505050565b6000610f978484610c95565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146110115781811015611003576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffa90612a17565b60405180910390fd5b6110108484848403610dc2565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611086576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107d90612aa9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90612b3b565b60405180910390fd5b6111008383836117b4565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117e90612bcd565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516112779190612200565b60405180910390a361128a8484846117c4565b50505050565b6112a18161129c610dba565b6117c9565b50565b6112ae828261184e565b6112d3816001600085815260200190815260200160002061192e90919063ffffffff16565b505050565b6112e2828261195e565b6113078160016000858152602001908152602001600020611a3f90919063ffffffff16565b505050565b611314611a6f565b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611358610dba565b604051611365919061241b565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036113de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d590612c39565b60405180910390fd5b6113ea600083836117b4565b80600460008282546113fc9190612597565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516114ae9190612200565b60405180910390a36114c2600083836117c4565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611535576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152c90612ccb565b60405180910390fd5b611541826000836117b4565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156115c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115bf90612d5d565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161167c9190612200565b60405180910390a3611690836000846117c4565b505050565b61169d611ab8565b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116e1610dba565b6040516116ee919061241b565b60405180910390a1565b60006117078360000183611b02565b60001c905092915050565b60008061171d610dba565b905061172a818585611017565b600191505092915050565b600061174382600001611b2d565b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6117bf838383611b3e565b505050565b505050565b6117d38282610a55565b61184a576117e081611b96565b6117ee8360001c6020611bc3565b6040516020016117ff929190612e51565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184191906120fb565b60405180910390fd5b5050565b6118588282610a55565b61192a57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506118cf610dba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000611956836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611dff565b905092915050565b6119688282610a55565b15611a3b57600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119e0610dba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611a67836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e6f565b905092915050565b611a7761092c565b611ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aad90612ed7565b60405180910390fd5b565b611ac061092c565b15611b00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af790612f43565b60405180910390fd5b565b6000826000018281548110611b1a57611b19612f63565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b611b49838383611f83565b611b5161092c565b15611b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8890613004565b60405180910390fd5b505050565b6060611bbc8273ffffffffffffffffffffffffffffffffffffffff16601460ff16611bc3565b9050919050565b606060006002836002611bd69190613024565b611be09190612597565b67ffffffffffffffff811115611bf957611bf8613066565b5b6040519080825280601f01601f191660200182016040528015611c2b5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611c6357611c62612f63565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611cc757611cc6612f63565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611d079190613024565b611d119190612597565b90505b6001811115611db1577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611d5357611d52612f63565b5b1a60f81b828281518110611d6a57611d69612f63565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611daa90613095565b9050611d14565b5060008414611df5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dec9061310a565b60405180910390fd5b8091505092915050565b6000611e0b8383611f88565b611e64578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e69565b600090505b92915050565b60008083600101600084815260200190815260200160002054905060008114611f77576000600182611ea19190612873565b9050600060018660000180549050611eb99190612873565b9050818114611f28576000866000018281548110611eda57611ed9612f63565b5b9060005260206000200154905080876000018481548110611efe57611efd612f63565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480611f3c57611f3b61312a565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611f7d565b60009150505b92915050565b505050565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611fe581611fb0565b8114611ff057600080fd5b50565b60008135905061200281611fdc565b92915050565b60006020828403121561201e5761201d611fab565b5b600061202c84828501611ff3565b91505092915050565b60008115159050919050565b61204a81612035565b82525050565b60006020820190506120656000830184612041565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156120a557808201518184015260208101905061208a565b60008484015250505050565b6000601f19601f8301169050919050565b60006120cd8261206b565b6120d78185612076565b93506120e7818560208601612087565b6120f0816120b1565b840191505092915050565b6000602082019050818103600083015261211581846120c2565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006121488261211d565b9050919050565b6121588161213d565b811461216357600080fd5b50565b6000813590506121758161214f565b92915050565b6000819050919050565b61218e8161217b565b811461219957600080fd5b50565b6000813590506121ab81612185565b92915050565b600080604083850312156121c8576121c7611fab565b5b60006121d685828601612166565b92505060206121e78582860161219c565b9150509250929050565b6121fa8161217b565b82525050565b600060208201905061221560008301846121f1565b92915050565b60008060006060848603121561223457612233611fab565b5b600061224286828701612166565b935050602061225386828701612166565b92505060406122648682870161219c565b9150509250925092565b6000819050919050565b6122818161226e565b811461228c57600080fd5b50565b60008135905061229e81612278565b92915050565b6000602082840312156122ba576122b9611fab565b5b60006122c88482850161228f565b91505092915050565b6122da8161226e565b82525050565b60006020820190506122f560008301846122d1565b92915050565b6000806040838503121561231257612311611fab565b5b60006123208582860161228f565b925050602061233185828601612166565b9150509250929050565b600060ff82169050919050565b6123518161233b565b82525050565b600060208201905061236c6000830184612348565b92915050565b60006020828403121561238857612387611fab565b5b60006123968482850161219c565b91505092915050565b6000602082840312156123b5576123b4611fab565b5b60006123c384828501612166565b91505092915050565b600080604083850312156123e3576123e2611fab565b5b60006123f18582860161228f565b92505060206124028582860161219c565b9150509250929050565b6124158161213d565b82525050565b6000602082019050612430600083018461240c565b92915050565b6000806040838503121561244d5761244c611fab565b5b600061245b85828601612166565b925050602061246c85828601612166565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806124bd57607f821691505b6020821081036124d0576124cf612476565b5b50919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612532602f83612076565b915061253d826124d6565b604082019050919050565b6000602082019050818103600083015261256181612525565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006125a28261217b565b91506125ad8361217b565b92508282019050808211156125c5576125c4612568565b5b92915050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f20756e706175736500000000000000602082015250565b6000612627603983612076565b9150612632826125cb565b604082019050919050565b600060208201905081810360008301526126568161261a565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f7665206d696e74657220726f6c6520746f206d696e7400000000000000000000602082015250565b60006126b9603683612076565b91506126c48261265d565b604082019050919050565b600060208201905081810360008301526126e8816126ac565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f207061757365000000000000000000602082015250565b600061274b603783612076565b9150612756826126ef565b604082019050919050565b6000602082019050818103600083015261277a8161273e565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b60006127dd602583612076565b91506127e882612781565b604082019050919050565b6000602082019050818103600083015261280c816127d0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061284d8261217b565b91506128588361217b565b92508261286857612867612813565b5b828204905092915050565b600061287e8261217b565b91506128898361217b565b92508282039050818111156128a1576128a0612568565b5b92915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612903602483612076565b915061290e826128a7565b604082019050919050565b60006020820190508181036000830152612932816128f6565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612995602283612076565b91506129a082612939565b604082019050919050565b600060208201905081810360008301526129c481612988565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612a01601d83612076565b9150612a0c826129cb565b602082019050919050565b60006020820190508181036000830152612a30816129f4565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612a93602583612076565b9150612a9e82612a37565b604082019050919050565b60006020820190508181036000830152612ac281612a86565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612b25602383612076565b9150612b3082612ac9565b604082019050919050565b60006020820190508181036000830152612b5481612b18565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612bb7602683612076565b9150612bc282612b5b565b604082019050919050565b60006020820190508181036000830152612be681612baa565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000612c23601f83612076565b9150612c2e82612bed565b602082019050919050565b60006020820190508181036000830152612c5281612c16565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612cb5602183612076565b9150612cc082612c59565b604082019050919050565b60006020820190508181036000830152612ce481612ca8565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612d47602283612076565b9150612d5282612ceb565b604082019050919050565b60006020820190508181036000830152612d7681612d3a565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612dbe601783612d7d565b9150612dc982612d88565b601782019050919050565b6000612ddf8261206b565b612de98185612d7d565b9350612df9818560208601612087565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612e3b601183612d7d565b9150612e4682612e05565b601182019050919050565b6000612e5c82612db1565b9150612e688285612dd4565b9150612e7382612e2e565b9150612e7f8284612dd4565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612ec1601483612076565b9150612ecc82612e8b565b602082019050919050565b60006020820190508181036000830152612ef081612eb4565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000612f2d601083612076565b9150612f3882612ef7565b602082019050919050565b60006020820190508181036000830152612f5c81612f20565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b6000612fee602a83612076565b9150612ff982612f92565b604082019050919050565b6000602082019050818103600083015261301d81612fe1565b9050919050565b600061302f8261217b565b915061303a8361217b565b92508282026130488161217b565b9150828204841483151761305f5761305e612568565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006130a08261217b565b9150600082036130b3576130b2612568565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b60006130f4602083612076565b91506130ff826130be565b602082019050919050565b60006020820190508181036000830152613123816130e7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea26469706673582212207e51811b14cef92dc9d1d2828ebf82f27a791da8bf268f130c73b8d14693a41764736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063a457c2d711610097578063d539139311610071578063d53913931461052d578063d547741f1461054b578063dd62ed3e14610567578063e63ab1e914610597576101c4565b8063a457c2d71461049d578063a9059cbb146104cd578063ca15c873146104fd576101c4565b80639010d07c116100d35780639010d07c1461040157806391d148541461043157806395d89b4114610461578063a217fddf1461047f576101c4565b806370a08231146103ab57806379cc6790146103db5780638456cb59146103f7576101c4565b8063313ce567116101665780633f4ba83a116101405780633f4ba83a1461034b57806340c10f191461035557806342966c68146103715780635c975abb1461038d576101c4565b8063313ce567146102e157806336568abe146102ff578063395093511461031b576101c4565b806318160ddd116101a257806318160ddd1461024757806323b872dd14610265578063248a9ca3146102955780632f2ff15d146102c5576101c4565b806301ffc9a7146101c957806306fdde03146101f9578063095ea7b314610217575b600080fd5b6101e360048036038101906101de9190612008565b6105b5565b6040516101f09190612050565b60405180910390f35b61020161062f565b60405161020e91906120fb565b60405180910390f35b610231600480360381019061022c91906121b1565b6106c1565b60405161023e9190612050565b60405180910390f35b61024f6106e4565b60405161025c9190612200565b60405180910390f35b61027f600480360381019061027a919061221b565b6106ee565b60405161028c9190612050565b60405180910390f35b6102af60048036038101906102aa91906122a4565b61071d565b6040516102bc91906122e0565b60405180910390f35b6102df60048036038101906102da91906122fb565b61073c565b005b6102e961075d565b6040516102f69190612357565b60405180910390f35b610319600480360381019061031491906122fb565b610766565b005b610335600480360381019061033091906121b1565b6107e9565b6040516103429190612050565b60405180910390f35b610353610820565b005b61036f600480360381019061036a91906121b1565b61089a565b005b61038b60048036038101906103869190612372565b610918565b005b61039561092c565b6040516103a29190612050565b60405180910390f35b6103c560048036038101906103c0919061239f565b610943565b6040516103d29190612200565b60405180910390f35b6103f560048036038101906103f091906121b1565b61098c565b005b6103ff6109ac565b005b61041b600480360381019061041691906123cc565b610a26565b604051610428919061241b565b60405180910390f35b61044b600480360381019061044691906122fb565b610a55565b6040516104589190612050565b60405180910390f35b610469610abf565b60405161047691906120fb565b60405180910390f35b610487610b51565b60405161049491906122e0565b60405180910390f35b6104b760048036038101906104b291906121b1565b610b58565b6040516104c49190612050565b60405180910390f35b6104e760048036038101906104e291906121b1565b610bcf565b6040516104f49190612050565b60405180910390f35b610517600480360381019061051291906122a4565b610c2c565b6040516105249190612200565b60405180910390f35b610535610c50565b60405161054291906122e0565b60405180910390f35b610565600480360381019061056091906122fb565b610c74565b005b610581600480360381019061057c9190612436565b610c95565b60405161058e9190612200565b60405180910390f35b61059f610d1c565b6040516105ac91906122e0565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610628575061062782610d40565b5b9050919050565b60606005805461063e906124a5565b80601f016020809104026020016040519081016040528092919081815260200182805461066a906124a5565b80156106b75780601f1061068c576101008083540402835291602001916106b7565b820191906000526020600020905b81548152906001019060200180831161069a57829003601f168201915b5050505050905090565b6000806106cc610dba565b90506106d9818585610dc2565b600191505092915050565b6000600454905090565b6000806106f9610dba565b9050610706858285610f8b565b610711858585611017565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b6107458261071d565b61074e81611290565b61075883836112a4565b505050565b60006012905090565b61076e610dba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d290612548565b60405180910390fd5b6107e582826112d8565b5050565b6000806107f4610dba565b90506108158185856108068589610c95565b6108109190612597565b610dc2565b600191505092915050565b6108517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61084c610dba565b610a55565b610890576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108879061263d565b60405180910390fd5b61089861130c565b565b6108cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66108c6610dba565b610a55565b61090a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610901906126cf565b60405180910390fd5b610914828261136f565b5050565b610929610923610dba565b826114c6565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61099e82610998610dba565b83610f8b565b6109a882826114c6565b5050565b6109dd7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6109d8610dba565b610a55565b610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390612761565b60405180910390fd5b610a24611695565b565b6000610a4d82600160008681526020019081526020016000206116f890919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610ace906124a5565b80601f0160208091040260200160405190810160405280929190818152602001828054610afa906124a5565b8015610b475780601f10610b1c57610100808354040283529160200191610b47565b820191906000526020600020905b815481529060010190602001808311610b2a57829003601f168201915b5050505050905090565b6000801b81565b600080610b63610dba565b90506000610b718286610c95565b905083811015610bb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bad906127f3565b60405180910390fd5b610bc38286868403610dc2565b60019250505092915050565b600080600283610bdf9190612842565b9050610c18600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff168285610c139190612873565b611712565b50610c238482611712565b91505092915050565b6000610c4960016000848152602001908152602001600020611735565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610c7d8261071d565b610c8681611290565b610c9083836112d8565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610db35750610db28261174a565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610e31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2890612919565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e97906129ab565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f7e9190612200565b60405180910390a3505050565b6000610f978484610c95565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146110115781811015611003576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffa90612a17565b60405180910390fd5b6110108484848403610dc2565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611086576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107d90612aa9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90612b3b565b60405180910390fd5b6111008383836117b4565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117e90612bcd565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516112779190612200565b60405180910390a361128a8484846117c4565b50505050565b6112a18161129c610dba565b6117c9565b50565b6112ae828261184e565b6112d3816001600085815260200190815260200160002061192e90919063ffffffff16565b505050565b6112e2828261195e565b6113078160016000858152602001908152602001600020611a3f90919063ffffffff16565b505050565b611314611a6f565b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611358610dba565b604051611365919061241b565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036113de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d590612c39565b60405180910390fd5b6113ea600083836117b4565b80600460008282546113fc9190612597565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516114ae9190612200565b60405180910390a36114c2600083836117c4565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611535576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152c90612ccb565b60405180910390fd5b611541826000836117b4565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156115c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115bf90612d5d565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161167c9190612200565b60405180910390a3611690836000846117c4565b505050565b61169d611ab8565b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116e1610dba565b6040516116ee919061241b565b60405180910390a1565b60006117078360000183611b02565b60001c905092915050565b60008061171d610dba565b905061172a818585611017565b600191505092915050565b600061174382600001611b2d565b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6117bf838383611b3e565b505050565b505050565b6117d38282610a55565b61184a576117e081611b96565b6117ee8360001c6020611bc3565b6040516020016117ff929190612e51565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184191906120fb565b60405180910390fd5b5050565b6118588282610a55565b61192a57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506118cf610dba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000611956836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611dff565b905092915050565b6119688282610a55565b15611a3b57600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119e0610dba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611a67836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e6f565b905092915050565b611a7761092c565b611ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aad90612ed7565b60405180910390fd5b565b611ac061092c565b15611b00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af790612f43565b60405180910390fd5b565b6000826000018281548110611b1a57611b19612f63565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b611b49838383611f83565b611b5161092c565b15611b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8890613004565b60405180910390fd5b505050565b6060611bbc8273ffffffffffffffffffffffffffffffffffffffff16601460ff16611bc3565b9050919050565b606060006002836002611bd69190613024565b611be09190612597565b67ffffffffffffffff811115611bf957611bf8613066565b5b6040519080825280601f01601f191660200182016040528015611c2b5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611c6357611c62612f63565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611cc757611cc6612f63565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611d079190613024565b611d119190612597565b90505b6001811115611db1577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611d5357611d52612f63565b5b1a60f81b828281518110611d6a57611d69612f63565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611daa90613095565b9050611d14565b5060008414611df5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dec9061310a565b60405180910390fd5b8091505092915050565b6000611e0b8383611f88565b611e64578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e69565b600090505b92915050565b60008083600101600084815260200190815260200160002054905060008114611f77576000600182611ea19190612873565b9050600060018660000180549050611eb99190612873565b9050818114611f28576000866000018281548110611eda57611ed9612f63565b5b9060005260206000200154905080876000018481548110611efe57611efd612f63565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480611f3c57611f3b61312a565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611f7d565b60009150505b92915050565b505050565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611fe581611fb0565b8114611ff057600080fd5b50565b60008135905061200281611fdc565b92915050565b60006020828403121561201e5761201d611fab565b5b600061202c84828501611ff3565b91505092915050565b60008115159050919050565b61204a81612035565b82525050565b60006020820190506120656000830184612041565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156120a557808201518184015260208101905061208a565b60008484015250505050565b6000601f19601f8301169050919050565b60006120cd8261206b565b6120d78185612076565b93506120e7818560208601612087565b6120f0816120b1565b840191505092915050565b6000602082019050818103600083015261211581846120c2565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006121488261211d565b9050919050565b6121588161213d565b811461216357600080fd5b50565b6000813590506121758161214f565b92915050565b6000819050919050565b61218e8161217b565b811461219957600080fd5b50565b6000813590506121ab81612185565b92915050565b600080604083850312156121c8576121c7611fab565b5b60006121d685828601612166565b92505060206121e78582860161219c565b9150509250929050565b6121fa8161217b565b82525050565b600060208201905061221560008301846121f1565b92915050565b60008060006060848603121561223457612233611fab565b5b600061224286828701612166565b935050602061225386828701612166565b92505060406122648682870161219c565b9150509250925092565b6000819050919050565b6122818161226e565b811461228c57600080fd5b50565b60008135905061229e81612278565b92915050565b6000602082840312156122ba576122b9611fab565b5b60006122c88482850161228f565b91505092915050565b6122da8161226e565b82525050565b60006020820190506122f560008301846122d1565b92915050565b6000806040838503121561231257612311611fab565b5b60006123208582860161228f565b925050602061233185828601612166565b9150509250929050565b600060ff82169050919050565b6123518161233b565b82525050565b600060208201905061236c6000830184612348565b92915050565b60006020828403121561238857612387611fab565b5b60006123968482850161219c565b91505092915050565b6000602082840312156123b5576123b4611fab565b5b60006123c384828501612166565b91505092915050565b600080604083850312156123e3576123e2611fab565b5b60006123f18582860161228f565b92505060206124028582860161219c565b9150509250929050565b6124158161213d565b82525050565b6000602082019050612430600083018461240c565b92915050565b6000806040838503121561244d5761244c611fab565b5b600061245b85828601612166565b925050602061246c85828601612166565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806124bd57607f821691505b6020821081036124d0576124cf612476565b5b50919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612532602f83612076565b915061253d826124d6565b604082019050919050565b6000602082019050818103600083015261256181612525565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006125a28261217b565b91506125ad8361217b565b92508282019050808211156125c5576125c4612568565b5b92915050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f20756e706175736500000000000000602082015250565b6000612627603983612076565b9150612632826125cb565b604082019050919050565b600060208201905081810360008301526126568161261a565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f7665206d696e74657220726f6c6520746f206d696e7400000000000000000000602082015250565b60006126b9603683612076565b91506126c48261265d565b604082019050919050565b600060208201905081810360008301526126e8816126ac565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f207061757365000000000000000000602082015250565b600061274b603783612076565b9150612756826126ef565b604082019050919050565b6000602082019050818103600083015261277a8161273e565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b60006127dd602583612076565b91506127e882612781565b604082019050919050565b6000602082019050818103600083015261280c816127d0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061284d8261217b565b91506128588361217b565b92508261286857612867612813565b5b828204905092915050565b600061287e8261217b565b91506128898361217b565b92508282039050818111156128a1576128a0612568565b5b92915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612903602483612076565b915061290e826128a7565b604082019050919050565b60006020820190508181036000830152612932816128f6565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612995602283612076565b91506129a082612939565b604082019050919050565b600060208201905081810360008301526129c481612988565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612a01601d83612076565b9150612a0c826129cb565b602082019050919050565b60006020820190508181036000830152612a30816129f4565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612a93602583612076565b9150612a9e82612a37565b604082019050919050565b60006020820190508181036000830152612ac281612a86565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612b25602383612076565b9150612b3082612ac9565b604082019050919050565b60006020820190508181036000830152612b5481612b18565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612bb7602683612076565b9150612bc282612b5b565b604082019050919050565b60006020820190508181036000830152612be681612baa565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000612c23601f83612076565b9150612c2e82612bed565b602082019050919050565b60006020820190508181036000830152612c5281612c16565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612cb5602183612076565b9150612cc082612c59565b604082019050919050565b60006020820190508181036000830152612ce481612ca8565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612d47602283612076565b9150612d5282612ceb565b604082019050919050565b60006020820190508181036000830152612d7681612d3a565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612dbe601783612d7d565b9150612dc982612d88565b601782019050919050565b6000612ddf8261206b565b612de98185612d7d565b9350612df9818560208601612087565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612e3b601183612d7d565b9150612e4682612e05565b601182019050919050565b6000612e5c82612db1565b9150612e688285612dd4565b9150612e7382612e2e565b9150612e7f8284612dd4565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612ec1601483612076565b9150612ecc82612e8b565b602082019050919050565b60006020820190508181036000830152612ef081612eb4565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000612f2d601083612076565b9150612f3882612ef7565b602082019050919050565b60006020820190508181036000830152612f5c81612f20565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b6000612fee602a83612076565b9150612ff982612f92565b604082019050919050565b6000602082019050818103600083015261301d81612fe1565b9050919050565b600061302f8261217b565b915061303a8361217b565b92508282026130488161217b565b9150828204841483151761305f5761305e612568565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006130a08261217b565b9150600082036130b3576130b2612568565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b60006130f4602083612076565b91506130ff826130be565b602082019050919050565b60006020820190508181036000830152613123816130e7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea26469706673582212207e51811b14cef92dc9d1d2828ebf82f27a791da8bf268f130c73b8d14693a41764736f6c63430008130033", + "bytecode": "0x6080604052734dc6ac40af078661fc43823086e1513635eeab14600760016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503480156200006657600080fd5b5060405162003dca38038062003dca83398181016040528101906200008c9190620006ef565b6040518060400160405280601e81526020017f455243323044697265637442616c616e63654d616e6970756c6174696f6e00008152506040518060400160405280601e81526020017f455243323044697265637442616c616e63654d616e6970756c6174696f6e0000815250818181600590816200010b919062000991565b5080600690816200011d919062000991565b5050506000600760006101000a81548160ff0219169083151502179055506200015f6000801b620001536200021160201b60201c565b6200021960201b60201c565b620001a07f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6620001946200021160201b60201c565b6200021960201b60201c565b620001e17f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a620001d56200021160201b60201c565b6200021960201b60201c565b5050620001f86000801b336200021960201b60201c565b6200020a33826200022f60201b60201c565b5062000c2b565b600033905090565b6200022b82826200039d60201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620002a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002989062000ad9565b60405180910390fd5b620002b560008383620003db60201b60201c565b8060046000828254620002c9919062000b2a565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516200037d919062000b76565b60405180910390a36200039960008383620003f360201b60201c565b5050565b620003af8282620003f860201b60201c565b620003d68160016000858152602001908152602001600020620004e960201b90919060201c565b505050565b620003ee8383836200052160201b60201c565b505050565b505050565b6200040a82826200058c60201b60201c565b620004e557600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506200048a6200021160201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000519836000018373ffffffffffffffffffffffffffffffffffffffff1660001b620005f660201b60201c565b905092915050565b620005348383836200067060201b60201c565b620005446200067560201b60201c565b1562000587576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200057e9062000c09565b60405180910390fd5b505050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60006200060a83836200068c60201b60201c565b620006655782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506200066a565b600090505b92915050565b505050565b6000600760009054906101000a900460ff16905090565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b6000819050919050565b620006c981620006b4565b8114620006d557600080fd5b50565b600081519050620006e981620006be565b92915050565b600060208284031215620007085762000707620006af565b5b60006200071884828501620006d8565b91505092915050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620007a357607f821691505b602082108103620007b957620007b86200075b565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620008237fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620007e4565b6200082f8683620007e4565b95508019841693508086168417925050509392505050565b6000819050919050565b6000620008726200086c6200086684620006b4565b62000847565b620006b4565b9050919050565b6000819050919050565b6200088e8362000851565b620008a66200089d8262000879565b848454620007f1565b825550505050565b600090565b620008bd620008ae565b620008ca81848462000883565b505050565b5b81811015620008f257620008e6600082620008b3565b600181019050620008d0565b5050565b601f82111562000941576200090b81620007bf565b6200091684620007d4565b8101602085101562000926578190505b6200093e6200093585620007d4565b830182620008cf565b50505b505050565b600082821c905092915050565b6000620009666000198460080262000946565b1980831691505092915050565b600062000981838362000953565b9150826002028217905092915050565b6200099c8262000721565b67ffffffffffffffff811115620009b857620009b76200072c565b5b620009c482546200078a565b620009d1828285620008f6565b600060209050601f83116001811462000a095760008415620009f4578287015190505b62000a00858262000973565b86555062000a70565b601f19841662000a1986620007bf565b60005b8281101562000a435784890151825560018201915060208501945060208101905062000a1c565b8683101562000a63578489015162000a5f601f89168262000953565b8355505b6001600288020188555050505b505050505050565b600082825260208201905092915050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b600062000ac1601f8362000a78565b915062000ace8262000a89565b602082019050919050565b6000602082019050818103600083015262000af48162000ab2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000b3782620006b4565b915062000b4483620006b4565b925082820190508082111562000b5f5762000b5e62000afb565b5b92915050565b62000b7081620006b4565b82525050565b600060208201905062000b8d600083018462000b65565b92915050565b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b600062000bf1602a8362000a78565b915062000bfe8262000b93565b604082019050919050565b6000602082019050818103600083015262000c248162000be2565b9050919050565b61318f8062000c3b6000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063a457c2d711610097578063d539139311610071578063d53913931461052d578063d547741f1461054b578063dd62ed3e14610567578063e63ab1e914610597576101c4565b8063a457c2d71461049d578063a9059cbb146104cd578063ca15c873146104fd576101c4565b80639010d07c116100d35780639010d07c1461040157806391d148541461043157806395d89b4114610461578063a217fddf1461047f576101c4565b806370a08231146103ab57806379cc6790146103db5780638456cb59146103f7576101c4565b8063313ce567116101665780633f4ba83a116101405780633f4ba83a1461034b57806340c10f191461035557806342966c68146103715780635c975abb1461038d576101c4565b8063313ce567146102e157806336568abe146102ff578063395093511461031b576101c4565b806318160ddd116101a257806318160ddd1461024757806323b872dd14610265578063248a9ca3146102955780632f2ff15d146102c5576101c4565b806301ffc9a7146101c957806306fdde03146101f9578063095ea7b314610217575b600080fd5b6101e360048036038101906101de9190612008565b6105b5565b6040516101f09190612050565b60405180910390f35b61020161062f565b60405161020e91906120fb565b60405180910390f35b610231600480360381019061022c91906121b1565b6106c1565b60405161023e9190612050565b60405180910390f35b61024f6106e4565b60405161025c9190612200565b60405180910390f35b61027f600480360381019061027a919061221b565b6106ee565b60405161028c9190612050565b60405180910390f35b6102af60048036038101906102aa91906122a4565b61071d565b6040516102bc91906122e0565b60405180910390f35b6102df60048036038101906102da91906122fb565b61073c565b005b6102e961075d565b6040516102f69190612357565b60405180910390f35b610319600480360381019061031491906122fb565b610766565b005b610335600480360381019061033091906121b1565b6107e9565b6040516103429190612050565b60405180910390f35b610353610820565b005b61036f600480360381019061036a91906121b1565b61089a565b005b61038b60048036038101906103869190612372565b610918565b005b61039561092c565b6040516103a29190612050565b60405180910390f35b6103c560048036038101906103c0919061239f565b610943565b6040516103d29190612200565b60405180910390f35b6103f560048036038101906103f091906121b1565b61098c565b005b6103ff6109ac565b005b61041b600480360381019061041691906123cc565b610a26565b604051610428919061241b565b60405180910390f35b61044b600480360381019061044691906122fb565b610a55565b6040516104589190612050565b60405180910390f35b610469610abf565b60405161047691906120fb565b60405180910390f35b610487610b51565b60405161049491906122e0565b60405180910390f35b6104b760048036038101906104b291906121b1565b610b58565b6040516104c49190612050565b60405180910390f35b6104e760048036038101906104e291906121b1565b610bcf565b6040516104f49190612050565b60405180910390f35b610517600480360381019061051291906122a4565b610c2c565b6040516105249190612200565b60405180910390f35b610535610c50565b60405161054291906122e0565b60405180910390f35b610565600480360381019061056091906122fb565b610c74565b005b610581600480360381019061057c9190612436565b610c95565b60405161058e9190612200565b60405180910390f35b61059f610d1c565b6040516105ac91906122e0565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610628575061062782610d40565b5b9050919050565b60606005805461063e906124a5565b80601f016020809104026020016040519081016040528092919081815260200182805461066a906124a5565b80156106b75780601f1061068c576101008083540402835291602001916106b7565b820191906000526020600020905b81548152906001019060200180831161069a57829003601f168201915b5050505050905090565b6000806106cc610dba565b90506106d9818585610dc2565b600191505092915050565b6000600454905090565b6000806106f9610dba565b9050610706858285610f8b565b610711858585611017565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b6107458261071d565b61074e81611290565b61075883836112a4565b505050565b60006012905090565b61076e610dba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d290612548565b60405180910390fd5b6107e582826112d8565b5050565b6000806107f4610dba565b90506108158185856108068589610c95565b6108109190612597565b610dc2565b600191505092915050565b6108517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61084c610dba565b610a55565b610890576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108879061263d565b60405180910390fd5b61089861130c565b565b6108cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66108c6610dba565b610a55565b61090a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610901906126cf565b60405180910390fd5b610914828261136f565b5050565b610929610923610dba565b826114c6565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61099e82610998610dba565b83610f8b565b6109a882826114c6565b5050565b6109dd7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6109d8610dba565b610a55565b610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390612761565b60405180910390fd5b610a24611695565b565b6000610a4d82600160008681526020019081526020016000206116f890919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610ace906124a5565b80601f0160208091040260200160405190810160405280929190818152602001828054610afa906124a5565b8015610b475780601f10610b1c57610100808354040283529160200191610b47565b820191906000526020600020905b815481529060010190602001808311610b2a57829003601f168201915b5050505050905090565b6000801b81565b600080610b63610dba565b90506000610b718286610c95565b905083811015610bb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bad906127f3565b60405180910390fd5b610bc38286868403610dc2565b60019250505092915050565b600080600283610bdf9190612842565b9050610c18600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff168285610c139190612873565b611712565b50610c238482611712565b91505092915050565b6000610c4960016000848152602001908152602001600020611735565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610c7d8261071d565b610c8681611290565b610c9083836112d8565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610db35750610db28261174a565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610e31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2890612919565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e97906129ab565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f7e9190612200565b60405180910390a3505050565b6000610f978484610c95565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146110115781811015611003576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffa90612a17565b60405180910390fd5b6110108484848403610dc2565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611086576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107d90612aa9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90612b3b565b60405180910390fd5b6111008383836117b4565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117e90612bcd565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516112779190612200565b60405180910390a361128a8484846117c4565b50505050565b6112a18161129c610dba565b6117c9565b50565b6112ae828261184e565b6112d3816001600085815260200190815260200160002061192e90919063ffffffff16565b505050565b6112e2828261195e565b6113078160016000858152602001908152602001600020611a3f90919063ffffffff16565b505050565b611314611a6f565b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611358610dba565b604051611365919061241b565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036113de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d590612c39565b60405180910390fd5b6113ea600083836117b4565b80600460008282546113fc9190612597565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516114ae9190612200565b60405180910390a36114c2600083836117c4565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611535576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152c90612ccb565b60405180910390fd5b611541826000836117b4565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156115c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115bf90612d5d565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161167c9190612200565b60405180910390a3611690836000846117c4565b505050565b61169d611ab8565b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116e1610dba565b6040516116ee919061241b565b60405180910390a1565b60006117078360000183611b02565b60001c905092915050565b60008061171d610dba565b905061172a818585611017565b600191505092915050565b600061174382600001611b2d565b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6117bf838383611b3e565b505050565b505050565b6117d38282610a55565b61184a576117e081611b96565b6117ee8360001c6020611bc3565b6040516020016117ff929190612e51565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184191906120fb565b60405180910390fd5b5050565b6118588282610a55565b61192a57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506118cf610dba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000611956836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611dff565b905092915050565b6119688282610a55565b15611a3b57600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119e0610dba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611a67836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e6f565b905092915050565b611a7761092c565b611ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aad90612ed7565b60405180910390fd5b565b611ac061092c565b15611b00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af790612f43565b60405180910390fd5b565b6000826000018281548110611b1a57611b19612f63565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b611b49838383611f83565b611b5161092c565b15611b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8890613004565b60405180910390fd5b505050565b6060611bbc8273ffffffffffffffffffffffffffffffffffffffff16601460ff16611bc3565b9050919050565b606060006002836002611bd69190613024565b611be09190612597565b67ffffffffffffffff811115611bf957611bf8613066565b5b6040519080825280601f01601f191660200182016040528015611c2b5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611c6357611c62612f63565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611cc757611cc6612f63565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611d079190613024565b611d119190612597565b90505b6001811115611db1577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611d5357611d52612f63565b5b1a60f81b828281518110611d6a57611d69612f63565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611daa90613095565b9050611d14565b5060008414611df5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dec9061310a565b60405180910390fd5b8091505092915050565b6000611e0b8383611f88565b611e64578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e69565b600090505b92915050565b60008083600101600084815260200190815260200160002054905060008114611f77576000600182611ea19190612873565b9050600060018660000180549050611eb99190612873565b9050818114611f28576000866000018281548110611eda57611ed9612f63565b5b9060005260206000200154905080876000018481548110611efe57611efd612f63565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480611f3c57611f3b61312a565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611f7d565b60009150505b92915050565b505050565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611fe581611fb0565b8114611ff057600080fd5b50565b60008135905061200281611fdc565b92915050565b60006020828403121561201e5761201d611fab565b5b600061202c84828501611ff3565b91505092915050565b60008115159050919050565b61204a81612035565b82525050565b60006020820190506120656000830184612041565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156120a557808201518184015260208101905061208a565b60008484015250505050565b6000601f19601f8301169050919050565b60006120cd8261206b565b6120d78185612076565b93506120e7818560208601612087565b6120f0816120b1565b840191505092915050565b6000602082019050818103600083015261211581846120c2565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006121488261211d565b9050919050565b6121588161213d565b811461216357600080fd5b50565b6000813590506121758161214f565b92915050565b6000819050919050565b61218e8161217b565b811461219957600080fd5b50565b6000813590506121ab81612185565b92915050565b600080604083850312156121c8576121c7611fab565b5b60006121d685828601612166565b92505060206121e78582860161219c565b9150509250929050565b6121fa8161217b565b82525050565b600060208201905061221560008301846121f1565b92915050565b60008060006060848603121561223457612233611fab565b5b600061224286828701612166565b935050602061225386828701612166565b92505060406122648682870161219c565b9150509250925092565b6000819050919050565b6122818161226e565b811461228c57600080fd5b50565b60008135905061229e81612278565b92915050565b6000602082840312156122ba576122b9611fab565b5b60006122c88482850161228f565b91505092915050565b6122da8161226e565b82525050565b60006020820190506122f560008301846122d1565b92915050565b6000806040838503121561231257612311611fab565b5b60006123208582860161228f565b925050602061233185828601612166565b9150509250929050565b600060ff82169050919050565b6123518161233b565b82525050565b600060208201905061236c6000830184612348565b92915050565b60006020828403121561238857612387611fab565b5b60006123968482850161219c565b91505092915050565b6000602082840312156123b5576123b4611fab565b5b60006123c384828501612166565b91505092915050565b600080604083850312156123e3576123e2611fab565b5b60006123f18582860161228f565b92505060206124028582860161219c565b9150509250929050565b6124158161213d565b82525050565b6000602082019050612430600083018461240c565b92915050565b6000806040838503121561244d5761244c611fab565b5b600061245b85828601612166565b925050602061246c85828601612166565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806124bd57607f821691505b6020821081036124d0576124cf612476565b5b50919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612532602f83612076565b915061253d826124d6565b604082019050919050565b6000602082019050818103600083015261256181612525565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006125a28261217b565b91506125ad8361217b565b92508282019050808211156125c5576125c4612568565b5b92915050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f20756e706175736500000000000000602082015250565b6000612627603983612076565b9150612632826125cb565b604082019050919050565b600060208201905081810360008301526126568161261a565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f7665206d696e74657220726f6c6520746f206d696e7400000000000000000000602082015250565b60006126b9603683612076565b91506126c48261265d565b604082019050919050565b600060208201905081810360008301526126e8816126ac565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f207061757365000000000000000000602082015250565b600061274b603783612076565b9150612756826126ef565b604082019050919050565b6000602082019050818103600083015261277a8161273e565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b60006127dd602583612076565b91506127e882612781565b604082019050919050565b6000602082019050818103600083015261280c816127d0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061284d8261217b565b91506128588361217b565b92508261286857612867612813565b5b828204905092915050565b600061287e8261217b565b91506128898361217b565b92508282039050818111156128a1576128a0612568565b5b92915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612903602483612076565b915061290e826128a7565b604082019050919050565b60006020820190508181036000830152612932816128f6565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612995602283612076565b91506129a082612939565b604082019050919050565b600060208201905081810360008301526129c481612988565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612a01601d83612076565b9150612a0c826129cb565b602082019050919050565b60006020820190508181036000830152612a30816129f4565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612a93602583612076565b9150612a9e82612a37565b604082019050919050565b60006020820190508181036000830152612ac281612a86565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612b25602383612076565b9150612b3082612ac9565b604082019050919050565b60006020820190508181036000830152612b5481612b18565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612bb7602683612076565b9150612bc282612b5b565b604082019050919050565b60006020820190508181036000830152612be681612baa565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000612c23601f83612076565b9150612c2e82612bed565b602082019050919050565b60006020820190508181036000830152612c5281612c16565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612cb5602183612076565b9150612cc082612c59565b604082019050919050565b60006020820190508181036000830152612ce481612ca8565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612d47602283612076565b9150612d5282612ceb565b604082019050919050565b60006020820190508181036000830152612d7681612d3a565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612dbe601783612d7d565b9150612dc982612d88565b601782019050919050565b6000612ddf8261206b565b612de98185612d7d565b9350612df9818560208601612087565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612e3b601183612d7d565b9150612e4682612e05565b601182019050919050565b6000612e5c82612db1565b9150612e688285612dd4565b9150612e7382612e2e565b9150612e7f8284612dd4565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612ec1601483612076565b9150612ecc82612e8b565b602082019050919050565b60006020820190508181036000830152612ef081612eb4565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000612f2d601083612076565b9150612f3882612ef7565b602082019050919050565b60006020820190508181036000830152612f5c81612f20565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b6000612fee602a83612076565b9150612ff982612f92565b604082019050919050565b6000602082019050818103600083015261301d81612fe1565b9050919050565b600061302f8261217b565b915061303a8361217b565b92508282026130488161217b565b9150828204841483151761305f5761305e612568565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006130a08261217b565b9150600082036130b3576130b2612568565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b60006130f4602083612076565b91506130ff826130be565b602082019050919050565b60006020820190508181036000830152613123816130e7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea264697066735822122045a663a6268be58b34e06e44a98d69ac00c67812b2996505d21fd5773559660264736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063a457c2d711610097578063d539139311610071578063d53913931461052d578063d547741f1461054b578063dd62ed3e14610567578063e63ab1e914610597576101c4565b8063a457c2d71461049d578063a9059cbb146104cd578063ca15c873146104fd576101c4565b80639010d07c116100d35780639010d07c1461040157806391d148541461043157806395d89b4114610461578063a217fddf1461047f576101c4565b806370a08231146103ab57806379cc6790146103db5780638456cb59146103f7576101c4565b8063313ce567116101665780633f4ba83a116101405780633f4ba83a1461034b57806340c10f191461035557806342966c68146103715780635c975abb1461038d576101c4565b8063313ce567146102e157806336568abe146102ff578063395093511461031b576101c4565b806318160ddd116101a257806318160ddd1461024757806323b872dd14610265578063248a9ca3146102955780632f2ff15d146102c5576101c4565b806301ffc9a7146101c957806306fdde03146101f9578063095ea7b314610217575b600080fd5b6101e360048036038101906101de9190612008565b6105b5565b6040516101f09190612050565b60405180910390f35b61020161062f565b60405161020e91906120fb565b60405180910390f35b610231600480360381019061022c91906121b1565b6106c1565b60405161023e9190612050565b60405180910390f35b61024f6106e4565b60405161025c9190612200565b60405180910390f35b61027f600480360381019061027a919061221b565b6106ee565b60405161028c9190612050565b60405180910390f35b6102af60048036038101906102aa91906122a4565b61071d565b6040516102bc91906122e0565b60405180910390f35b6102df60048036038101906102da91906122fb565b61073c565b005b6102e961075d565b6040516102f69190612357565b60405180910390f35b610319600480360381019061031491906122fb565b610766565b005b610335600480360381019061033091906121b1565b6107e9565b6040516103429190612050565b60405180910390f35b610353610820565b005b61036f600480360381019061036a91906121b1565b61089a565b005b61038b60048036038101906103869190612372565b610918565b005b61039561092c565b6040516103a29190612050565b60405180910390f35b6103c560048036038101906103c0919061239f565b610943565b6040516103d29190612200565b60405180910390f35b6103f560048036038101906103f091906121b1565b61098c565b005b6103ff6109ac565b005b61041b600480360381019061041691906123cc565b610a26565b604051610428919061241b565b60405180910390f35b61044b600480360381019061044691906122fb565b610a55565b6040516104589190612050565b60405180910390f35b610469610abf565b60405161047691906120fb565b60405180910390f35b610487610b51565b60405161049491906122e0565b60405180910390f35b6104b760048036038101906104b291906121b1565b610b58565b6040516104c49190612050565b60405180910390f35b6104e760048036038101906104e291906121b1565b610bcf565b6040516104f49190612050565b60405180910390f35b610517600480360381019061051291906122a4565b610c2c565b6040516105249190612200565b60405180910390f35b610535610c50565b60405161054291906122e0565b60405180910390f35b610565600480360381019061056091906122fb565b610c74565b005b610581600480360381019061057c9190612436565b610c95565b60405161058e9190612200565b60405180910390f35b61059f610d1c565b6040516105ac91906122e0565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610628575061062782610d40565b5b9050919050565b60606005805461063e906124a5565b80601f016020809104026020016040519081016040528092919081815260200182805461066a906124a5565b80156106b75780601f1061068c576101008083540402835291602001916106b7565b820191906000526020600020905b81548152906001019060200180831161069a57829003601f168201915b5050505050905090565b6000806106cc610dba565b90506106d9818585610dc2565b600191505092915050565b6000600454905090565b6000806106f9610dba565b9050610706858285610f8b565b610711858585611017565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b6107458261071d565b61074e81611290565b61075883836112a4565b505050565b60006012905090565b61076e610dba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d290612548565b60405180910390fd5b6107e582826112d8565b5050565b6000806107f4610dba565b90506108158185856108068589610c95565b6108109190612597565b610dc2565b600191505092915050565b6108517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61084c610dba565b610a55565b610890576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108879061263d565b60405180910390fd5b61089861130c565b565b6108cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66108c6610dba565b610a55565b61090a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610901906126cf565b60405180910390fd5b610914828261136f565b5050565b610929610923610dba565b826114c6565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61099e82610998610dba565b83610f8b565b6109a882826114c6565b5050565b6109dd7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6109d8610dba565b610a55565b610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390612761565b60405180910390fd5b610a24611695565b565b6000610a4d82600160008681526020019081526020016000206116f890919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610ace906124a5565b80601f0160208091040260200160405190810160405280929190818152602001828054610afa906124a5565b8015610b475780601f10610b1c57610100808354040283529160200191610b47565b820191906000526020600020905b815481529060010190602001808311610b2a57829003601f168201915b5050505050905090565b6000801b81565b600080610b63610dba565b90506000610b718286610c95565b905083811015610bb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bad906127f3565b60405180910390fd5b610bc38286868403610dc2565b60019250505092915050565b600080600283610bdf9190612842565b9050610c18600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff168285610c139190612873565b611712565b50610c238482611712565b91505092915050565b6000610c4960016000848152602001908152602001600020611735565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610c7d8261071d565b610c8681611290565b610c9083836112d8565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610db35750610db28261174a565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610e31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2890612919565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e97906129ab565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f7e9190612200565b60405180910390a3505050565b6000610f978484610c95565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146110115781811015611003576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffa90612a17565b60405180910390fd5b6110108484848403610dc2565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611086576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107d90612aa9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90612b3b565b60405180910390fd5b6111008383836117b4565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117e90612bcd565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516112779190612200565b60405180910390a361128a8484846117c4565b50505050565b6112a18161129c610dba565b6117c9565b50565b6112ae828261184e565b6112d3816001600085815260200190815260200160002061192e90919063ffffffff16565b505050565b6112e2828261195e565b6113078160016000858152602001908152602001600020611a3f90919063ffffffff16565b505050565b611314611a6f565b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611358610dba565b604051611365919061241b565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036113de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d590612c39565b60405180910390fd5b6113ea600083836117b4565b80600460008282546113fc9190612597565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516114ae9190612200565b60405180910390a36114c2600083836117c4565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611535576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152c90612ccb565b60405180910390fd5b611541826000836117b4565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156115c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115bf90612d5d565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161167c9190612200565b60405180910390a3611690836000846117c4565b505050565b61169d611ab8565b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116e1610dba565b6040516116ee919061241b565b60405180910390a1565b60006117078360000183611b02565b60001c905092915050565b60008061171d610dba565b905061172a818585611017565b600191505092915050565b600061174382600001611b2d565b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6117bf838383611b3e565b505050565b505050565b6117d38282610a55565b61184a576117e081611b96565b6117ee8360001c6020611bc3565b6040516020016117ff929190612e51565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184191906120fb565b60405180910390fd5b5050565b6118588282610a55565b61192a57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506118cf610dba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000611956836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611dff565b905092915050565b6119688282610a55565b15611a3b57600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119e0610dba565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611a67836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e6f565b905092915050565b611a7761092c565b611ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aad90612ed7565b60405180910390fd5b565b611ac061092c565b15611b00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af790612f43565b60405180910390fd5b565b6000826000018281548110611b1a57611b19612f63565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b611b49838383611f83565b611b5161092c565b15611b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8890613004565b60405180910390fd5b505050565b6060611bbc8273ffffffffffffffffffffffffffffffffffffffff16601460ff16611bc3565b9050919050565b606060006002836002611bd69190613024565b611be09190612597565b67ffffffffffffffff811115611bf957611bf8613066565b5b6040519080825280601f01601f191660200182016040528015611c2b5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611c6357611c62612f63565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611cc757611cc6612f63565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611d079190613024565b611d119190612597565b90505b6001811115611db1577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611d5357611d52612f63565b5b1a60f81b828281518110611d6a57611d69612f63565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611daa90613095565b9050611d14565b5060008414611df5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dec9061310a565b60405180910390fd5b8091505092915050565b6000611e0b8383611f88565b611e64578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e69565b600090505b92915050565b60008083600101600084815260200190815260200160002054905060008114611f77576000600182611ea19190612873565b9050600060018660000180549050611eb99190612873565b9050818114611f28576000866000018281548110611eda57611ed9612f63565b5b9060005260206000200154905080876000018481548110611efe57611efd612f63565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480611f3c57611f3b61312a565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611f7d565b60009150505b92915050565b505050565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611fe581611fb0565b8114611ff057600080fd5b50565b60008135905061200281611fdc565b92915050565b60006020828403121561201e5761201d611fab565b5b600061202c84828501611ff3565b91505092915050565b60008115159050919050565b61204a81612035565b82525050565b60006020820190506120656000830184612041565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156120a557808201518184015260208101905061208a565b60008484015250505050565b6000601f19601f8301169050919050565b60006120cd8261206b565b6120d78185612076565b93506120e7818560208601612087565b6120f0816120b1565b840191505092915050565b6000602082019050818103600083015261211581846120c2565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006121488261211d565b9050919050565b6121588161213d565b811461216357600080fd5b50565b6000813590506121758161214f565b92915050565b6000819050919050565b61218e8161217b565b811461219957600080fd5b50565b6000813590506121ab81612185565b92915050565b600080604083850312156121c8576121c7611fab565b5b60006121d685828601612166565b92505060206121e78582860161219c565b9150509250929050565b6121fa8161217b565b82525050565b600060208201905061221560008301846121f1565b92915050565b60008060006060848603121561223457612233611fab565b5b600061224286828701612166565b935050602061225386828701612166565b92505060406122648682870161219c565b9150509250925092565b6000819050919050565b6122818161226e565b811461228c57600080fd5b50565b60008135905061229e81612278565b92915050565b6000602082840312156122ba576122b9611fab565b5b60006122c88482850161228f565b91505092915050565b6122da8161226e565b82525050565b60006020820190506122f560008301846122d1565b92915050565b6000806040838503121561231257612311611fab565b5b60006123208582860161228f565b925050602061233185828601612166565b9150509250929050565b600060ff82169050919050565b6123518161233b565b82525050565b600060208201905061236c6000830184612348565b92915050565b60006020828403121561238857612387611fab565b5b60006123968482850161219c565b91505092915050565b6000602082840312156123b5576123b4611fab565b5b60006123c384828501612166565b91505092915050565b600080604083850312156123e3576123e2611fab565b5b60006123f18582860161228f565b92505060206124028582860161219c565b9150509250929050565b6124158161213d565b82525050565b6000602082019050612430600083018461240c565b92915050565b6000806040838503121561244d5761244c611fab565b5b600061245b85828601612166565b925050602061246c85828601612166565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806124bd57607f821691505b6020821081036124d0576124cf612476565b5b50919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612532602f83612076565b915061253d826124d6565b604082019050919050565b6000602082019050818103600083015261256181612525565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006125a28261217b565b91506125ad8361217b565b92508282019050808211156125c5576125c4612568565b5b92915050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f20756e706175736500000000000000602082015250565b6000612627603983612076565b9150612632826125cb565b604082019050919050565b600060208201905081810360008301526126568161261a565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f7665206d696e74657220726f6c6520746f206d696e7400000000000000000000602082015250565b60006126b9603683612076565b91506126c48261265d565b604082019050919050565b600060208201905081810360008301526126e8816126ac565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f207061757365000000000000000000602082015250565b600061274b603783612076565b9150612756826126ef565b604082019050919050565b6000602082019050818103600083015261277a8161273e565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b60006127dd602583612076565b91506127e882612781565b604082019050919050565b6000602082019050818103600083015261280c816127d0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061284d8261217b565b91506128588361217b565b92508261286857612867612813565b5b828204905092915050565b600061287e8261217b565b91506128898361217b565b92508282039050818111156128a1576128a0612568565b5b92915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612903602483612076565b915061290e826128a7565b604082019050919050565b60006020820190508181036000830152612932816128f6565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612995602283612076565b91506129a082612939565b604082019050919050565b600060208201905081810360008301526129c481612988565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612a01601d83612076565b9150612a0c826129cb565b602082019050919050565b60006020820190508181036000830152612a30816129f4565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612a93602583612076565b9150612a9e82612a37565b604082019050919050565b60006020820190508181036000830152612ac281612a86565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612b25602383612076565b9150612b3082612ac9565b604082019050919050565b60006020820190508181036000830152612b5481612b18565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612bb7602683612076565b9150612bc282612b5b565b604082019050919050565b60006020820190508181036000830152612be681612baa565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000612c23601f83612076565b9150612c2e82612bed565b602082019050919050565b60006020820190508181036000830152612c5281612c16565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612cb5602183612076565b9150612cc082612c59565b604082019050919050565b60006020820190508181036000830152612ce481612ca8565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612d47602283612076565b9150612d5282612ceb565b604082019050919050565b60006020820190508181036000830152612d7681612d3a565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612dbe601783612d7d565b9150612dc982612d88565b601782019050919050565b6000612ddf8261206b565b612de98185612d7d565b9350612df9818560208601612087565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612e3b601183612d7d565b9150612e4682612e05565b601182019050919050565b6000612e5c82612db1565b9150612e688285612dd4565b9150612e7382612e2e565b9150612e7f8284612dd4565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612ec1601483612076565b9150612ecc82612e8b565b602082019050919050565b60006020820190508181036000830152612ef081612eb4565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000612f2d601083612076565b9150612f3882612ef7565b602082019050919050565b60006020820190508181036000830152612f5c81612f20565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b6000612fee602a83612076565b9150612ff982612f92565b604082019050919050565b6000602082019050818103600083015261301d81612fe1565b9050919050565b600061302f8261217b565b915061303a8361217b565b92508282026130488161217b565b9150828204841483151761305f5761305e612568565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006130a08261217b565b9150600082036130b3576130b2612568565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b60006130f4602083612076565b91506130ff826130be565b602082019050919050565b60006020820190508181036000830152613123816130e7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea264697066735822122045a663a6268be58b34e06e44a98d69ac00c67812b2996505d21fd5773559660264736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/x/erc20/keeper/testdata/ERC20MaliciousDelayed.json b/x/erc20/keeper/testdata/ERC20MaliciousDelayed.json index 49ce5502..893b4119 100644 --- a/x/erc20/keeper/testdata/ERC20MaliciousDelayed.json +++ b/x/erc20/keeper/testdata/ERC20MaliciousDelayed.json @@ -660,8 +660,8 @@ "type": "function" } ], - "bytecode": "0x6080604052734dc6ac40af078661fc43823086e1513635eeab14600760016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550670de0b6b3a76400006008553480156200007257600080fd5b5060405162003d5c38038062003d5c8339818101604052810190620000989190620006fb565b6040518060400160405280601581526020017f45524332304d616c6963696f757344656c6179656400000000000000000000008152506040518060400160405280601581526020017f45524332304d414c4943494f555344454c415945440000000000000000000000815250818181600590816200011791906200099d565b5080600690816200012991906200099d565b5050506000600760006101000a81548160ff0219169083151502179055506200016b6000801b6200015f6200021d60201b60201c565b6200022560201b60201c565b620001ac7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6620001a06200021d60201b60201c565b6200022560201b60201c565b620001ed7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a620001e16200021d60201b60201c565b6200022560201b60201c565b5050620002046000801b336200022560201b60201c565b6200021633826200023b60201b60201c565b5062000c37565b600033905090565b620002378282620003a960201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620002ad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002a49062000ae5565b60405180910390fd5b620002c160008383620003e760201b60201c565b8060046000828254620002d5919062000b36565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405162000389919062000b82565b60405180910390a3620003a560008383620003ff60201b60201c565b5050565b620003bb82826200040460201b60201c565b620003e28160016000858152602001908152602001600020620004f560201b90919060201c565b505050565b620003fa8383836200052d60201b60201c565b505050565b505050565b6200041682826200059860201b60201c565b620004f157600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550620004966200021d60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000525836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6200060260201b60201c565b905092915050565b620005408383836200067c60201b60201c565b620005506200068160201b60201c565b1562000593576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200058a9062000c15565b60405180910390fd5b505050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60006200061683836200069860201b60201c565b6200067157826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905062000676565b600090505b92915050565b505050565b6000600760009054906101000a900460ff16905090565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b6000819050919050565b620006d581620006c0565b8114620006e157600080fd5b50565b600081519050620006f581620006ca565b92915050565b600060208284031215620007145762000713620006bb565b5b60006200072484828501620006e4565b91505092915050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620007af57607f821691505b602082108103620007c557620007c462000767565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200082f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620007f0565b6200083b8683620007f0565b95508019841693508086168417925050509392505050565b6000819050919050565b60006200087e620008786200087284620006c0565b62000853565b620006c0565b9050919050565b6000819050919050565b6200089a836200085d565b620008b2620008a98262000885565b848454620007fd565b825550505050565b600090565b620008c9620008ba565b620008d68184846200088f565b505050565b5b81811015620008fe57620008f2600082620008bf565b600181019050620008dc565b5050565b601f8211156200094d576200091781620007cb565b6200092284620007e0565b8101602085101562000932578190505b6200094a6200094185620007e0565b830182620008db565b50505b505050565b600082821c905092915050565b6000620009726000198460080262000952565b1980831691505092915050565b60006200098d83836200095f565b9150826002028217905092915050565b620009a8826200072d565b67ffffffffffffffff811115620009c457620009c362000738565b5b620009d0825462000796565b620009dd82828562000902565b600060209050601f83116001811462000a15576000841562000a00578287015190505b62000a0c85826200097f565b86555062000a7c565b601f19841662000a2586620007cb565b60005b8281101562000a4f5784890151825560018201915060208501945060208101905062000a28565b8683101562000a6f578489015162000a6b601f8916826200095f565b8355505b6001600288020188555050505b505050505050565b600082825260208201905092915050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b600062000acd601f8362000a84565b915062000ada8262000a95565b602082019050919050565b6000602082019050818103600083015262000b008162000abe565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000b4382620006c0565b915062000b5083620006c0565b925082820190508082111562000b6b5762000b6a62000b07565b5b92915050565b62000b7c81620006c0565b82525050565b600060208201905062000b99600083018462000b71565b92915050565b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b600062000bfd602a8362000a84565b915062000c0a8262000b9f565b604082019050919050565b6000602082019050818103600083015262000c308162000bee565b9050919050565b6131158062000c476000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063a457c2d711610097578063d539139311610071578063d53913931461052d578063d547741f1461054b578063dd62ed3e14610567578063e63ab1e914610597576101c4565b8063a457c2d71461049d578063a9059cbb146104cd578063ca15c873146104fd576101c4565b80639010d07c116100d35780639010d07c1461040157806391d148541461043157806395d89b4114610461578063a217fddf1461047f576101c4565b806370a08231146103ab57806379cc6790146103db5780638456cb59146103f7576101c4565b8063313ce567116101665780633f4ba83a116101405780633f4ba83a1461034b57806340c10f191461035557806342966c68146103715780635c975abb1461038d576101c4565b8063313ce567146102e157806336568abe146102ff578063395093511461031b576101c4565b806318160ddd116101a257806318160ddd1461024757806323b872dd14610265578063248a9ca3146102955780632f2ff15d146102c5576101c4565b806301ffc9a7146101c957806306fdde03146101f9578063095ea7b314610217575b600080fd5b6101e360048036038101906101de9190611fee565b6105b5565b6040516101f09190612036565b60405180910390f35b61020161062f565b60405161020e91906120e1565b60405180910390f35b610231600480360381019061022c9190612197565b6106c1565b60405161023e9190612036565b60405180910390f35b61024f6106e4565b60405161025c91906121e6565b60405180910390f35b61027f600480360381019061027a9190612201565b6106ee565b60405161028c9190612036565b60405180910390f35b6102af60048036038101906102aa919061228a565b61071d565b6040516102bc91906122c6565b60405180910390f35b6102df60048036038101906102da91906122e1565b61073c565b005b6102e961075d565b6040516102f6919061233d565b60405180910390f35b610319600480360381019061031491906122e1565b610766565b005b61033560048036038101906103309190612197565b6107e9565b6040516103429190612036565b60405180910390f35b610353610820565b005b61036f600480360381019061036a9190612197565b61089a565b005b61038b60048036038101906103869190612358565b610918565b005b61039561092c565b6040516103a29190612036565b60405180910390f35b6103c560048036038101906103c09190612385565b610943565b6040516103d291906121e6565b60405180910390f35b6103f560048036038101906103f09190612197565b61098c565b005b6103ff6109ac565b005b61041b600480360381019061041691906123b2565b610a26565b6040516104289190612401565b60405180910390f35b61044b600480360381019061044691906122e1565b610a55565b6040516104589190612036565b60405180910390f35b610469610abf565b60405161047691906120e1565b60405180910390f35b610487610b51565b60405161049491906122c6565b60405180910390f35b6104b760048036038101906104b29190612197565b610b58565b6040516104c49190612036565b60405180910390f35b6104e760048036038101906104e29190612197565b610bcf565b6040516104f49190612036565b60405180910390f35b6105176004803603810190610512919061228a565b610c12565b60405161052491906121e6565b60405180910390f35b610535610c36565b60405161054291906122c6565b60405180910390f35b610565600480360381019061056091906122e1565b610c5a565b005b610581600480360381019061057c919061241c565b610c7b565b60405161058e91906121e6565b60405180910390f35b61059f610d02565b6040516105ac91906122c6565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610628575061062782610d26565b5b9050919050565b60606005805461063e9061248b565b80601f016020809104026020016040519081016040528092919081815260200182805461066a9061248b565b80156106b75780601f1061068c576101008083540402835291602001916106b7565b820191906000526020600020905b81548152906001019060200180831161069a57829003601f168201915b5050505050905090565b6000806106cc610da0565b90506106d9818585610da8565b600191505092915050565b6000600454905090565b6000806106f9610da0565b9050610706858285610f71565b610711858585610ffd565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b6107458261071d565b61074e81611276565b610758838361128a565b505050565b60006012905090565b61076e610da0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d29061252e565b60405180910390fd5b6107e582826112be565b5050565b6000806107f4610da0565b90506108158185856108068589610c7b565b610810919061257d565b610da8565b600191505092915050565b6108517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61084c610da0565b610a55565b610890576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088790612623565b60405180910390fd5b6108986112f2565b565b6108cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66108c6610da0565b610a55565b61090a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610901906126b5565b60405180910390fd5b6109148282611355565b5050565b610929610923610da0565b826114ac565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61099e82610998610da0565b83610f71565b6109a882826114ac565b5050565b6109dd7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6109d8610da0565b610a55565b610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390612747565b60405180910390fd5b610a2461167b565b565b6000610a4d82600160008681526020019081526020016000206116de90919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610ace9061248b565b80601f0160208091040260200160405190810160405280929190818152602001828054610afa9061248b565b8015610b475780601f10610b1c57610100808354040283529160200191610b47565b820191906000526020600020905b815481529060010190602001808311610b2a57829003601f168201915b5050505050905090565b6000801b81565b600080610b63610da0565b90506000610b718286610c7b565b905083811015610bb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bad906127d9565b60405180910390fd5b610bc38286868403610da8565b60019250505092915050565b6000610c0083600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600854610da8565b610c0a83836116f8565b905092915050565b6000610c2f6001600084815260200190815260200160002061171b565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610c638261071d565b610c6c81611276565b610c7683836112be565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610d995750610d9882611730565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0e9061286b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d906128fd565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f6491906121e6565b60405180910390a3505050565b6000610f7d8484610c7b565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610ff75781811015610fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe090612969565b60405180910390fd5b610ff68484848403610da8565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361106c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611063906129fb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d290612a8d565b60405180910390fd5b6110e683838361179a565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561116d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116490612b1f565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161125d91906121e6565b60405180910390a36112708484846117aa565b50505050565b61128781611282610da0565b6117af565b50565b6112948282611834565b6112b9816001600085815260200190815260200160002061191490919063ffffffff16565b505050565b6112c88282611944565b6112ed8160016000858152602001908152602001600020611a2590919063ffffffff16565b505050565b6112fa611a55565b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61133e610da0565b60405161134b9190612401565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036113c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bb90612b8b565b60405180910390fd5b6113d06000838361179a565b80600460008282546113e2919061257d565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161149491906121e6565b60405180910390a36114a8600083836117aa565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361151b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151290612c1d565b60405180910390fd5b6115278260008361179a565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156115ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a590612caf565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161166291906121e6565b60405180910390a3611676836000846117aa565b505050565b611683611a9e565b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116c7610da0565b6040516116d49190612401565b60405180910390a1565b60006116ed8360000183611ae8565b60001c905092915050565b600080611703610da0565b9050611710818585610ffd565b600191505092915050565b600061172982600001611b13565b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6117a5838383611b24565b505050565b505050565b6117b98282610a55565b611830576117c681611b7c565b6117d48360001c6020611ba9565b6040516020016117e5929190612da3565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182791906120e1565b60405180910390fd5b5050565b61183e8282610a55565b61191057600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506118b5610da0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600061193c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611de5565b905092915050565b61194e8282610a55565b15611a2157600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119c6610da0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611a4d836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e55565b905092915050565b611a5d61092c565b611a9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9390612e29565b60405180910390fd5b565b611aa661092c565b15611ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611add90612e95565b60405180910390fd5b565b6000826000018281548110611b0057611aff612eb5565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b611b2f838383611f69565b611b3761092c565b15611b77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6e90612f56565b60405180910390fd5b505050565b6060611ba28273ffffffffffffffffffffffffffffffffffffffff16601460ff16611ba9565b9050919050565b606060006002836002611bbc9190612f76565b611bc6919061257d565b67ffffffffffffffff811115611bdf57611bde612fb8565b5b6040519080825280601f01601f191660200182016040528015611c115781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611c4957611c48612eb5565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611cad57611cac612eb5565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611ced9190612f76565b611cf7919061257d565b90505b6001811115611d97577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611d3957611d38612eb5565b5b1a60f81b828281518110611d5057611d4f612eb5565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611d9090612fe7565b9050611cfa565b5060008414611ddb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd29061305c565b60405180910390fd5b8091505092915050565b6000611df18383611f6e565b611e4a578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e4f565b600090505b92915050565b60008083600101600084815260200190815260200160002054905060008114611f5d576000600182611e87919061307c565b9050600060018660000180549050611e9f919061307c565b9050818114611f0e576000866000018281548110611ec057611ebf612eb5565b5b9060005260206000200154905080876000018481548110611ee457611ee3612eb5565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480611f2257611f216130b0565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611f63565b60009150505b92915050565b505050565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611fcb81611f96565b8114611fd657600080fd5b50565b600081359050611fe881611fc2565b92915050565b60006020828403121561200457612003611f91565b5b600061201284828501611fd9565b91505092915050565b60008115159050919050565b6120308161201b565b82525050565b600060208201905061204b6000830184612027565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561208b578082015181840152602081019050612070565b60008484015250505050565b6000601f19601f8301169050919050565b60006120b382612051565b6120bd818561205c565b93506120cd81856020860161206d565b6120d681612097565b840191505092915050565b600060208201905081810360008301526120fb81846120a8565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061212e82612103565b9050919050565b61213e81612123565b811461214957600080fd5b50565b60008135905061215b81612135565b92915050565b6000819050919050565b61217481612161565b811461217f57600080fd5b50565b6000813590506121918161216b565b92915050565b600080604083850312156121ae576121ad611f91565b5b60006121bc8582860161214c565b92505060206121cd85828601612182565b9150509250929050565b6121e081612161565b82525050565b60006020820190506121fb60008301846121d7565b92915050565b60008060006060848603121561221a57612219611f91565b5b60006122288682870161214c565b93505060206122398682870161214c565b925050604061224a86828701612182565b9150509250925092565b6000819050919050565b61226781612254565b811461227257600080fd5b50565b6000813590506122848161225e565b92915050565b6000602082840312156122a05761229f611f91565b5b60006122ae84828501612275565b91505092915050565b6122c081612254565b82525050565b60006020820190506122db60008301846122b7565b92915050565b600080604083850312156122f8576122f7611f91565b5b600061230685828601612275565b92505060206123178582860161214c565b9150509250929050565b600060ff82169050919050565b61233781612321565b82525050565b6000602082019050612352600083018461232e565b92915050565b60006020828403121561236e5761236d611f91565b5b600061237c84828501612182565b91505092915050565b60006020828403121561239b5761239a611f91565b5b60006123a98482850161214c565b91505092915050565b600080604083850312156123c9576123c8611f91565b5b60006123d785828601612275565b92505060206123e885828601612182565b9150509250929050565b6123fb81612123565b82525050565b600060208201905061241660008301846123f2565b92915050565b6000806040838503121561243357612432611f91565b5b60006124418582860161214c565b92505060206124528582860161214c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806124a357607f821691505b6020821081036124b6576124b561245c565b5b50919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612518602f8361205c565b9150612523826124bc565b604082019050919050565b600060208201905081810360008301526125478161250b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061258882612161565b915061259383612161565b92508282019050808211156125ab576125aa61254e565b5b92915050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f20756e706175736500000000000000602082015250565b600061260d60398361205c565b9150612618826125b1565b604082019050919050565b6000602082019050818103600083015261263c81612600565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f7665206d696e74657220726f6c6520746f206d696e7400000000000000000000602082015250565b600061269f60368361205c565b91506126aa82612643565b604082019050919050565b600060208201905081810360008301526126ce81612692565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f207061757365000000000000000000602082015250565b600061273160378361205c565b915061273c826126d5565b604082019050919050565b6000602082019050818103600083015261276081612724565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b60006127c360258361205c565b91506127ce82612767565b604082019050919050565b600060208201905081810360008301526127f2816127b6565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061285560248361205c565b9150612860826127f9565b604082019050919050565b6000602082019050818103600083015261288481612848565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006128e760228361205c565b91506128f28261288b565b604082019050919050565b60006020820190508181036000830152612916816128da565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612953601d8361205c565b915061295e8261291d565b602082019050919050565b6000602082019050818103600083015261298281612946565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006129e560258361205c565b91506129f082612989565b604082019050919050565b60006020820190508181036000830152612a14816129d8565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612a7760238361205c565b9150612a8282612a1b565b604082019050919050565b60006020820190508181036000830152612aa681612a6a565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612b0960268361205c565b9150612b1482612aad565b604082019050919050565b60006020820190508181036000830152612b3881612afc565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000612b75601f8361205c565b9150612b8082612b3f565b602082019050919050565b60006020820190508181036000830152612ba481612b68565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612c0760218361205c565b9150612c1282612bab565b604082019050919050565b60006020820190508181036000830152612c3681612bfa565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612c9960228361205c565b9150612ca482612c3d565b604082019050919050565b60006020820190508181036000830152612cc881612c8c565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612d10601783612ccf565b9150612d1b82612cda565b601782019050919050565b6000612d3182612051565b612d3b8185612ccf565b9350612d4b81856020860161206d565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612d8d601183612ccf565b9150612d9882612d57565b601182019050919050565b6000612dae82612d03565b9150612dba8285612d26565b9150612dc582612d80565b9150612dd18284612d26565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612e1360148361205c565b9150612e1e82612ddd565b602082019050919050565b60006020820190508181036000830152612e4281612e06565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000612e7f60108361205c565b9150612e8a82612e49565b602082019050919050565b60006020820190508181036000830152612eae81612e72565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b6000612f40602a8361205c565b9150612f4b82612ee4565b604082019050919050565b60006020820190508181036000830152612f6f81612f33565b9050919050565b6000612f8182612161565b9150612f8c83612161565b9250828202612f9a81612161565b91508282048414831517612fb157612fb061254e565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000612ff282612161565b9150600082036130055761300461254e565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b600061304660208361205c565b915061305182613010565b602082019050919050565b6000602082019050818103600083015261307581613039565b9050919050565b600061308782612161565b915061309283612161565b92508282039050818111156130aa576130a961254e565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea264697066735822122086af0a619cd72bc143e0e1e5535b82ae75ed217cc17e83643dd95cd6d28d1fb164736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063a457c2d711610097578063d539139311610071578063d53913931461052d578063d547741f1461054b578063dd62ed3e14610567578063e63ab1e914610597576101c4565b8063a457c2d71461049d578063a9059cbb146104cd578063ca15c873146104fd576101c4565b80639010d07c116100d35780639010d07c1461040157806391d148541461043157806395d89b4114610461578063a217fddf1461047f576101c4565b806370a08231146103ab57806379cc6790146103db5780638456cb59146103f7576101c4565b8063313ce567116101665780633f4ba83a116101405780633f4ba83a1461034b57806340c10f191461035557806342966c68146103715780635c975abb1461038d576101c4565b8063313ce567146102e157806336568abe146102ff578063395093511461031b576101c4565b806318160ddd116101a257806318160ddd1461024757806323b872dd14610265578063248a9ca3146102955780632f2ff15d146102c5576101c4565b806301ffc9a7146101c957806306fdde03146101f9578063095ea7b314610217575b600080fd5b6101e360048036038101906101de9190611fee565b6105b5565b6040516101f09190612036565b60405180910390f35b61020161062f565b60405161020e91906120e1565b60405180910390f35b610231600480360381019061022c9190612197565b6106c1565b60405161023e9190612036565b60405180910390f35b61024f6106e4565b60405161025c91906121e6565b60405180910390f35b61027f600480360381019061027a9190612201565b6106ee565b60405161028c9190612036565b60405180910390f35b6102af60048036038101906102aa919061228a565b61071d565b6040516102bc91906122c6565b60405180910390f35b6102df60048036038101906102da91906122e1565b61073c565b005b6102e961075d565b6040516102f6919061233d565b60405180910390f35b610319600480360381019061031491906122e1565b610766565b005b61033560048036038101906103309190612197565b6107e9565b6040516103429190612036565b60405180910390f35b610353610820565b005b61036f600480360381019061036a9190612197565b61089a565b005b61038b60048036038101906103869190612358565b610918565b005b61039561092c565b6040516103a29190612036565b60405180910390f35b6103c560048036038101906103c09190612385565b610943565b6040516103d291906121e6565b60405180910390f35b6103f560048036038101906103f09190612197565b61098c565b005b6103ff6109ac565b005b61041b600480360381019061041691906123b2565b610a26565b6040516104289190612401565b60405180910390f35b61044b600480360381019061044691906122e1565b610a55565b6040516104589190612036565b60405180910390f35b610469610abf565b60405161047691906120e1565b60405180910390f35b610487610b51565b60405161049491906122c6565b60405180910390f35b6104b760048036038101906104b29190612197565b610b58565b6040516104c49190612036565b60405180910390f35b6104e760048036038101906104e29190612197565b610bcf565b6040516104f49190612036565b60405180910390f35b6105176004803603810190610512919061228a565b610c12565b60405161052491906121e6565b60405180910390f35b610535610c36565b60405161054291906122c6565b60405180910390f35b610565600480360381019061056091906122e1565b610c5a565b005b610581600480360381019061057c919061241c565b610c7b565b60405161058e91906121e6565b60405180910390f35b61059f610d02565b6040516105ac91906122c6565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610628575061062782610d26565b5b9050919050565b60606005805461063e9061248b565b80601f016020809104026020016040519081016040528092919081815260200182805461066a9061248b565b80156106b75780601f1061068c576101008083540402835291602001916106b7565b820191906000526020600020905b81548152906001019060200180831161069a57829003601f168201915b5050505050905090565b6000806106cc610da0565b90506106d9818585610da8565b600191505092915050565b6000600454905090565b6000806106f9610da0565b9050610706858285610f71565b610711858585610ffd565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b6107458261071d565b61074e81611276565b610758838361128a565b505050565b60006012905090565b61076e610da0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d29061252e565b60405180910390fd5b6107e582826112be565b5050565b6000806107f4610da0565b90506108158185856108068589610c7b565b610810919061257d565b610da8565b600191505092915050565b6108517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61084c610da0565b610a55565b610890576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088790612623565b60405180910390fd5b6108986112f2565b565b6108cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66108c6610da0565b610a55565b61090a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610901906126b5565b60405180910390fd5b6109148282611355565b5050565b610929610923610da0565b826114ac565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61099e82610998610da0565b83610f71565b6109a882826114ac565b5050565b6109dd7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6109d8610da0565b610a55565b610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390612747565b60405180910390fd5b610a2461167b565b565b6000610a4d82600160008681526020019081526020016000206116de90919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610ace9061248b565b80601f0160208091040260200160405190810160405280929190818152602001828054610afa9061248b565b8015610b475780601f10610b1c57610100808354040283529160200191610b47565b820191906000526020600020905b815481529060010190602001808311610b2a57829003601f168201915b5050505050905090565b6000801b81565b600080610b63610da0565b90506000610b718286610c7b565b905083811015610bb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bad906127d9565b60405180910390fd5b610bc38286868403610da8565b60019250505092915050565b6000610c0083600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600854610da8565b610c0a83836116f8565b905092915050565b6000610c2f6001600084815260200190815260200160002061171b565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610c638261071d565b610c6c81611276565b610c7683836112be565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610d995750610d9882611730565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0e9061286b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d906128fd565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f6491906121e6565b60405180910390a3505050565b6000610f7d8484610c7b565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610ff75781811015610fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe090612969565b60405180910390fd5b610ff68484848403610da8565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361106c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611063906129fb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d290612a8d565b60405180910390fd5b6110e683838361179a565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561116d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116490612b1f565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161125d91906121e6565b60405180910390a36112708484846117aa565b50505050565b61128781611282610da0565b6117af565b50565b6112948282611834565b6112b9816001600085815260200190815260200160002061191490919063ffffffff16565b505050565b6112c88282611944565b6112ed8160016000858152602001908152602001600020611a2590919063ffffffff16565b505050565b6112fa611a55565b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61133e610da0565b60405161134b9190612401565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036113c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bb90612b8b565b60405180910390fd5b6113d06000838361179a565b80600460008282546113e2919061257d565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161149491906121e6565b60405180910390a36114a8600083836117aa565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361151b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151290612c1d565b60405180910390fd5b6115278260008361179a565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156115ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a590612caf565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161166291906121e6565b60405180910390a3611676836000846117aa565b505050565b611683611a9e565b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116c7610da0565b6040516116d49190612401565b60405180910390a1565b60006116ed8360000183611ae8565b60001c905092915050565b600080611703610da0565b9050611710818585610ffd565b600191505092915050565b600061172982600001611b13565b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6117a5838383611b24565b505050565b505050565b6117b98282610a55565b611830576117c681611b7c565b6117d48360001c6020611ba9565b6040516020016117e5929190612da3565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182791906120e1565b60405180910390fd5b5050565b61183e8282610a55565b61191057600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506118b5610da0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600061193c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611de5565b905092915050565b61194e8282610a55565b15611a2157600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119c6610da0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611a4d836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e55565b905092915050565b611a5d61092c565b611a9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9390612e29565b60405180910390fd5b565b611aa661092c565b15611ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611add90612e95565b60405180910390fd5b565b6000826000018281548110611b0057611aff612eb5565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b611b2f838383611f69565b611b3761092c565b15611b77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6e90612f56565b60405180910390fd5b505050565b6060611ba28273ffffffffffffffffffffffffffffffffffffffff16601460ff16611ba9565b9050919050565b606060006002836002611bbc9190612f76565b611bc6919061257d565b67ffffffffffffffff811115611bdf57611bde612fb8565b5b6040519080825280601f01601f191660200182016040528015611c115781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611c4957611c48612eb5565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611cad57611cac612eb5565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611ced9190612f76565b611cf7919061257d565b90505b6001811115611d97577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611d3957611d38612eb5565b5b1a60f81b828281518110611d5057611d4f612eb5565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611d9090612fe7565b9050611cfa565b5060008414611ddb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd29061305c565b60405180910390fd5b8091505092915050565b6000611df18383611f6e565b611e4a578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e4f565b600090505b92915050565b60008083600101600084815260200190815260200160002054905060008114611f5d576000600182611e87919061307c565b9050600060018660000180549050611e9f919061307c565b9050818114611f0e576000866000018281548110611ec057611ebf612eb5565b5b9060005260206000200154905080876000018481548110611ee457611ee3612eb5565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480611f2257611f216130b0565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611f63565b60009150505b92915050565b505050565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611fcb81611f96565b8114611fd657600080fd5b50565b600081359050611fe881611fc2565b92915050565b60006020828403121561200457612003611f91565b5b600061201284828501611fd9565b91505092915050565b60008115159050919050565b6120308161201b565b82525050565b600060208201905061204b6000830184612027565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561208b578082015181840152602081019050612070565b60008484015250505050565b6000601f19601f8301169050919050565b60006120b382612051565b6120bd818561205c565b93506120cd81856020860161206d565b6120d681612097565b840191505092915050565b600060208201905081810360008301526120fb81846120a8565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061212e82612103565b9050919050565b61213e81612123565b811461214957600080fd5b50565b60008135905061215b81612135565b92915050565b6000819050919050565b61217481612161565b811461217f57600080fd5b50565b6000813590506121918161216b565b92915050565b600080604083850312156121ae576121ad611f91565b5b60006121bc8582860161214c565b92505060206121cd85828601612182565b9150509250929050565b6121e081612161565b82525050565b60006020820190506121fb60008301846121d7565b92915050565b60008060006060848603121561221a57612219611f91565b5b60006122288682870161214c565b93505060206122398682870161214c565b925050604061224a86828701612182565b9150509250925092565b6000819050919050565b61226781612254565b811461227257600080fd5b50565b6000813590506122848161225e565b92915050565b6000602082840312156122a05761229f611f91565b5b60006122ae84828501612275565b91505092915050565b6122c081612254565b82525050565b60006020820190506122db60008301846122b7565b92915050565b600080604083850312156122f8576122f7611f91565b5b600061230685828601612275565b92505060206123178582860161214c565b9150509250929050565b600060ff82169050919050565b61233781612321565b82525050565b6000602082019050612352600083018461232e565b92915050565b60006020828403121561236e5761236d611f91565b5b600061237c84828501612182565b91505092915050565b60006020828403121561239b5761239a611f91565b5b60006123a98482850161214c565b91505092915050565b600080604083850312156123c9576123c8611f91565b5b60006123d785828601612275565b92505060206123e885828601612182565b9150509250929050565b6123fb81612123565b82525050565b600060208201905061241660008301846123f2565b92915050565b6000806040838503121561243357612432611f91565b5b60006124418582860161214c565b92505060206124528582860161214c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806124a357607f821691505b6020821081036124b6576124b561245c565b5b50919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612518602f8361205c565b9150612523826124bc565b604082019050919050565b600060208201905081810360008301526125478161250b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061258882612161565b915061259383612161565b92508282019050808211156125ab576125aa61254e565b5b92915050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f20756e706175736500000000000000602082015250565b600061260d60398361205c565b9150612618826125b1565b604082019050919050565b6000602082019050818103600083015261263c81612600565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f7665206d696e74657220726f6c6520746f206d696e7400000000000000000000602082015250565b600061269f60368361205c565b91506126aa82612643565b604082019050919050565b600060208201905081810360008301526126ce81612692565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f207061757365000000000000000000602082015250565b600061273160378361205c565b915061273c826126d5565b604082019050919050565b6000602082019050818103600083015261276081612724565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b60006127c360258361205c565b91506127ce82612767565b604082019050919050565b600060208201905081810360008301526127f2816127b6565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061285560248361205c565b9150612860826127f9565b604082019050919050565b6000602082019050818103600083015261288481612848565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006128e760228361205c565b91506128f28261288b565b604082019050919050565b60006020820190508181036000830152612916816128da565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612953601d8361205c565b915061295e8261291d565b602082019050919050565b6000602082019050818103600083015261298281612946565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006129e560258361205c565b91506129f082612989565b604082019050919050565b60006020820190508181036000830152612a14816129d8565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612a7760238361205c565b9150612a8282612a1b565b604082019050919050565b60006020820190508181036000830152612aa681612a6a565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612b0960268361205c565b9150612b1482612aad565b604082019050919050565b60006020820190508181036000830152612b3881612afc565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000612b75601f8361205c565b9150612b8082612b3f565b602082019050919050565b60006020820190508181036000830152612ba481612b68565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612c0760218361205c565b9150612c1282612bab565b604082019050919050565b60006020820190508181036000830152612c3681612bfa565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612c9960228361205c565b9150612ca482612c3d565b604082019050919050565b60006020820190508181036000830152612cc881612c8c565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612d10601783612ccf565b9150612d1b82612cda565b601782019050919050565b6000612d3182612051565b612d3b8185612ccf565b9350612d4b81856020860161206d565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612d8d601183612ccf565b9150612d9882612d57565b601182019050919050565b6000612dae82612d03565b9150612dba8285612d26565b9150612dc582612d80565b9150612dd18284612d26565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612e1360148361205c565b9150612e1e82612ddd565b602082019050919050565b60006020820190508181036000830152612e4281612e06565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000612e7f60108361205c565b9150612e8a82612e49565b602082019050919050565b60006020820190508181036000830152612eae81612e72565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b6000612f40602a8361205c565b9150612f4b82612ee4565b604082019050919050565b60006020820190508181036000830152612f6f81612f33565b9050919050565b6000612f8182612161565b9150612f8c83612161565b9250828202612f9a81612161565b91508282048414831517612fb157612fb061254e565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000612ff282612161565b9150600082036130055761300461254e565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b600061304660208361205c565b915061305182613010565b602082019050919050565b6000602082019050818103600083015261307581613039565b9050919050565b600061308782612161565b915061309283612161565b92508282039050818111156130aa576130a961254e565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea264697066735822122086af0a619cd72bc143e0e1e5535b82ae75ed217cc17e83643dd95cd6d28d1fb164736f6c63430008130033", + "bytecode": "0x6080604052734dc6ac40af078661fc43823086e1513635eeab14600760016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550670de0b6b3a76400006008553480156200007257600080fd5b5060405162003d5c38038062003d5c8339818101604052810190620000989190620006fb565b6040518060400160405280601581526020017f45524332304d616c6963696f757344656c6179656400000000000000000000008152506040518060400160405280601581526020017f45524332304d414c4943494f555344454c415945440000000000000000000000815250818181600590816200011791906200099d565b5080600690816200012991906200099d565b5050506000600760006101000a81548160ff0219169083151502179055506200016b6000801b6200015f6200021d60201b60201c565b6200022560201b60201c565b620001ac7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6620001a06200021d60201b60201c565b6200022560201b60201c565b620001ed7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a620001e16200021d60201b60201c565b6200022560201b60201c565b5050620002046000801b336200022560201b60201c565b6200021633826200023b60201b60201c565b5062000c37565b600033905090565b620002378282620003a960201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620002ad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002a49062000ae5565b60405180910390fd5b620002c160008383620003e760201b60201c565b8060046000828254620002d5919062000b36565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405162000389919062000b82565b60405180910390a3620003a560008383620003ff60201b60201c565b5050565b620003bb82826200040460201b60201c565b620003e28160016000858152602001908152602001600020620004f560201b90919060201c565b505050565b620003fa8383836200052d60201b60201c565b505050565b505050565b6200041682826200059860201b60201c565b620004f157600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550620004966200021d60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000525836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6200060260201b60201c565b905092915050565b620005408383836200067c60201b60201c565b620005506200068160201b60201c565b1562000593576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200058a9062000c15565b60405180910390fd5b505050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60006200061683836200069860201b60201c565b6200067157826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905062000676565b600090505b92915050565b505050565b6000600760009054906101000a900460ff16905090565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b6000819050919050565b620006d581620006c0565b8114620006e157600080fd5b50565b600081519050620006f581620006ca565b92915050565b600060208284031215620007145762000713620006bb565b5b60006200072484828501620006e4565b91505092915050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620007af57607f821691505b602082108103620007c557620007c462000767565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200082f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620007f0565b6200083b8683620007f0565b95508019841693508086168417925050509392505050565b6000819050919050565b60006200087e620008786200087284620006c0565b62000853565b620006c0565b9050919050565b6000819050919050565b6200089a836200085d565b620008b2620008a98262000885565b848454620007fd565b825550505050565b600090565b620008c9620008ba565b620008d68184846200088f565b505050565b5b81811015620008fe57620008f2600082620008bf565b600181019050620008dc565b5050565b601f8211156200094d576200091781620007cb565b6200092284620007e0565b8101602085101562000932578190505b6200094a6200094185620007e0565b830182620008db565b50505b505050565b600082821c905092915050565b6000620009726000198460080262000952565b1980831691505092915050565b60006200098d83836200095f565b9150826002028217905092915050565b620009a8826200072d565b67ffffffffffffffff811115620009c457620009c362000738565b5b620009d0825462000796565b620009dd82828562000902565b600060209050601f83116001811462000a15576000841562000a00578287015190505b62000a0c85826200097f565b86555062000a7c565b601f19841662000a2586620007cb565b60005b8281101562000a4f5784890151825560018201915060208501945060208101905062000a28565b8683101562000a6f578489015162000a6b601f8916826200095f565b8355505b6001600288020188555050505b505050505050565b600082825260208201905092915050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b600062000acd601f8362000a84565b915062000ada8262000a95565b602082019050919050565b6000602082019050818103600083015262000b008162000abe565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000b4382620006c0565b915062000b5083620006c0565b925082820190508082111562000b6b5762000b6a62000b07565b5b92915050565b62000b7c81620006c0565b82525050565b600060208201905062000b99600083018462000b71565b92915050565b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b600062000bfd602a8362000a84565b915062000c0a8262000b9f565b604082019050919050565b6000602082019050818103600083015262000c308162000bee565b9050919050565b6131158062000c476000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063a457c2d711610097578063d539139311610071578063d53913931461052d578063d547741f1461054b578063dd62ed3e14610567578063e63ab1e914610597576101c4565b8063a457c2d71461049d578063a9059cbb146104cd578063ca15c873146104fd576101c4565b80639010d07c116100d35780639010d07c1461040157806391d148541461043157806395d89b4114610461578063a217fddf1461047f576101c4565b806370a08231146103ab57806379cc6790146103db5780638456cb59146103f7576101c4565b8063313ce567116101665780633f4ba83a116101405780633f4ba83a1461034b57806340c10f191461035557806342966c68146103715780635c975abb1461038d576101c4565b8063313ce567146102e157806336568abe146102ff578063395093511461031b576101c4565b806318160ddd116101a257806318160ddd1461024757806323b872dd14610265578063248a9ca3146102955780632f2ff15d146102c5576101c4565b806301ffc9a7146101c957806306fdde03146101f9578063095ea7b314610217575b600080fd5b6101e360048036038101906101de9190611fee565b6105b5565b6040516101f09190612036565b60405180910390f35b61020161062f565b60405161020e91906120e1565b60405180910390f35b610231600480360381019061022c9190612197565b6106c1565b60405161023e9190612036565b60405180910390f35b61024f6106e4565b60405161025c91906121e6565b60405180910390f35b61027f600480360381019061027a9190612201565b6106ee565b60405161028c9190612036565b60405180910390f35b6102af60048036038101906102aa919061228a565b61071d565b6040516102bc91906122c6565b60405180910390f35b6102df60048036038101906102da91906122e1565b61073c565b005b6102e961075d565b6040516102f6919061233d565b60405180910390f35b610319600480360381019061031491906122e1565b610766565b005b61033560048036038101906103309190612197565b6107e9565b6040516103429190612036565b60405180910390f35b610353610820565b005b61036f600480360381019061036a9190612197565b61089a565b005b61038b60048036038101906103869190612358565b610918565b005b61039561092c565b6040516103a29190612036565b60405180910390f35b6103c560048036038101906103c09190612385565b610943565b6040516103d291906121e6565b60405180910390f35b6103f560048036038101906103f09190612197565b61098c565b005b6103ff6109ac565b005b61041b600480360381019061041691906123b2565b610a26565b6040516104289190612401565b60405180910390f35b61044b600480360381019061044691906122e1565b610a55565b6040516104589190612036565b60405180910390f35b610469610abf565b60405161047691906120e1565b60405180910390f35b610487610b51565b60405161049491906122c6565b60405180910390f35b6104b760048036038101906104b29190612197565b610b58565b6040516104c49190612036565b60405180910390f35b6104e760048036038101906104e29190612197565b610bcf565b6040516104f49190612036565b60405180910390f35b6105176004803603810190610512919061228a565b610c12565b60405161052491906121e6565b60405180910390f35b610535610c36565b60405161054291906122c6565b60405180910390f35b610565600480360381019061056091906122e1565b610c5a565b005b610581600480360381019061057c919061241c565b610c7b565b60405161058e91906121e6565b60405180910390f35b61059f610d02565b6040516105ac91906122c6565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610628575061062782610d26565b5b9050919050565b60606005805461063e9061248b565b80601f016020809104026020016040519081016040528092919081815260200182805461066a9061248b565b80156106b75780601f1061068c576101008083540402835291602001916106b7565b820191906000526020600020905b81548152906001019060200180831161069a57829003601f168201915b5050505050905090565b6000806106cc610da0565b90506106d9818585610da8565b600191505092915050565b6000600454905090565b6000806106f9610da0565b9050610706858285610f71565b610711858585610ffd565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b6107458261071d565b61074e81611276565b610758838361128a565b505050565b60006012905090565b61076e610da0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d29061252e565b60405180910390fd5b6107e582826112be565b5050565b6000806107f4610da0565b90506108158185856108068589610c7b565b610810919061257d565b610da8565b600191505092915050565b6108517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61084c610da0565b610a55565b610890576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088790612623565b60405180910390fd5b6108986112f2565b565b6108cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66108c6610da0565b610a55565b61090a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610901906126b5565b60405180910390fd5b6109148282611355565b5050565b610929610923610da0565b826114ac565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61099e82610998610da0565b83610f71565b6109a882826114ac565b5050565b6109dd7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6109d8610da0565b610a55565b610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390612747565b60405180910390fd5b610a2461167b565b565b6000610a4d82600160008681526020019081526020016000206116de90919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610ace9061248b565b80601f0160208091040260200160405190810160405280929190818152602001828054610afa9061248b565b8015610b475780601f10610b1c57610100808354040283529160200191610b47565b820191906000526020600020905b815481529060010190602001808311610b2a57829003601f168201915b5050505050905090565b6000801b81565b600080610b63610da0565b90506000610b718286610c7b565b905083811015610bb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bad906127d9565b60405180910390fd5b610bc38286868403610da8565b60019250505092915050565b6000610c0083600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600854610da8565b610c0a83836116f8565b905092915050565b6000610c2f6001600084815260200190815260200160002061171b565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610c638261071d565b610c6c81611276565b610c7683836112be565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610d995750610d9882611730565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0e9061286b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d906128fd565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f6491906121e6565b60405180910390a3505050565b6000610f7d8484610c7b565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610ff75781811015610fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe090612969565b60405180910390fd5b610ff68484848403610da8565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361106c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611063906129fb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d290612a8d565b60405180910390fd5b6110e683838361179a565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561116d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116490612b1f565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161125d91906121e6565b60405180910390a36112708484846117aa565b50505050565b61128781611282610da0565b6117af565b50565b6112948282611834565b6112b9816001600085815260200190815260200160002061191490919063ffffffff16565b505050565b6112c88282611944565b6112ed8160016000858152602001908152602001600020611a2590919063ffffffff16565b505050565b6112fa611a55565b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61133e610da0565b60405161134b9190612401565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036113c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bb90612b8b565b60405180910390fd5b6113d06000838361179a565b80600460008282546113e2919061257d565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161149491906121e6565b60405180910390a36114a8600083836117aa565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361151b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151290612c1d565b60405180910390fd5b6115278260008361179a565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156115ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a590612caf565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161166291906121e6565b60405180910390a3611676836000846117aa565b505050565b611683611a9e565b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116c7610da0565b6040516116d49190612401565b60405180910390a1565b60006116ed8360000183611ae8565b60001c905092915050565b600080611703610da0565b9050611710818585610ffd565b600191505092915050565b600061172982600001611b13565b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6117a5838383611b24565b505050565b505050565b6117b98282610a55565b611830576117c681611b7c565b6117d48360001c6020611ba9565b6040516020016117e5929190612da3565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182791906120e1565b60405180910390fd5b5050565b61183e8282610a55565b61191057600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506118b5610da0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600061193c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611de5565b905092915050565b61194e8282610a55565b15611a2157600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119c6610da0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611a4d836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e55565b905092915050565b611a5d61092c565b611a9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9390612e29565b60405180910390fd5b565b611aa661092c565b15611ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611add90612e95565b60405180910390fd5b565b6000826000018281548110611b0057611aff612eb5565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b611b2f838383611f69565b611b3761092c565b15611b77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6e90612f56565b60405180910390fd5b505050565b6060611ba28273ffffffffffffffffffffffffffffffffffffffff16601460ff16611ba9565b9050919050565b606060006002836002611bbc9190612f76565b611bc6919061257d565b67ffffffffffffffff811115611bdf57611bde612fb8565b5b6040519080825280601f01601f191660200182016040528015611c115781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611c4957611c48612eb5565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611cad57611cac612eb5565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611ced9190612f76565b611cf7919061257d565b90505b6001811115611d97577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611d3957611d38612eb5565b5b1a60f81b828281518110611d5057611d4f612eb5565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611d9090612fe7565b9050611cfa565b5060008414611ddb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd29061305c565b60405180910390fd5b8091505092915050565b6000611df18383611f6e565b611e4a578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e4f565b600090505b92915050565b60008083600101600084815260200190815260200160002054905060008114611f5d576000600182611e87919061307c565b9050600060018660000180549050611e9f919061307c565b9050818114611f0e576000866000018281548110611ec057611ebf612eb5565b5b9060005260206000200154905080876000018481548110611ee457611ee3612eb5565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480611f2257611f216130b0565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611f63565b60009150505b92915050565b505050565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611fcb81611f96565b8114611fd657600080fd5b50565b600081359050611fe881611fc2565b92915050565b60006020828403121561200457612003611f91565b5b600061201284828501611fd9565b91505092915050565b60008115159050919050565b6120308161201b565b82525050565b600060208201905061204b6000830184612027565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561208b578082015181840152602081019050612070565b60008484015250505050565b6000601f19601f8301169050919050565b60006120b382612051565b6120bd818561205c565b93506120cd81856020860161206d565b6120d681612097565b840191505092915050565b600060208201905081810360008301526120fb81846120a8565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061212e82612103565b9050919050565b61213e81612123565b811461214957600080fd5b50565b60008135905061215b81612135565b92915050565b6000819050919050565b61217481612161565b811461217f57600080fd5b50565b6000813590506121918161216b565b92915050565b600080604083850312156121ae576121ad611f91565b5b60006121bc8582860161214c565b92505060206121cd85828601612182565b9150509250929050565b6121e081612161565b82525050565b60006020820190506121fb60008301846121d7565b92915050565b60008060006060848603121561221a57612219611f91565b5b60006122288682870161214c565b93505060206122398682870161214c565b925050604061224a86828701612182565b9150509250925092565b6000819050919050565b61226781612254565b811461227257600080fd5b50565b6000813590506122848161225e565b92915050565b6000602082840312156122a05761229f611f91565b5b60006122ae84828501612275565b91505092915050565b6122c081612254565b82525050565b60006020820190506122db60008301846122b7565b92915050565b600080604083850312156122f8576122f7611f91565b5b600061230685828601612275565b92505060206123178582860161214c565b9150509250929050565b600060ff82169050919050565b61233781612321565b82525050565b6000602082019050612352600083018461232e565b92915050565b60006020828403121561236e5761236d611f91565b5b600061237c84828501612182565b91505092915050565b60006020828403121561239b5761239a611f91565b5b60006123a98482850161214c565b91505092915050565b600080604083850312156123c9576123c8611f91565b5b60006123d785828601612275565b92505060206123e885828601612182565b9150509250929050565b6123fb81612123565b82525050565b600060208201905061241660008301846123f2565b92915050565b6000806040838503121561243357612432611f91565b5b60006124418582860161214c565b92505060206124528582860161214c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806124a357607f821691505b6020821081036124b6576124b561245c565b5b50919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612518602f8361205c565b9150612523826124bc565b604082019050919050565b600060208201905081810360008301526125478161250b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061258882612161565b915061259383612161565b92508282019050808211156125ab576125aa61254e565b5b92915050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f20756e706175736500000000000000602082015250565b600061260d60398361205c565b9150612618826125b1565b604082019050919050565b6000602082019050818103600083015261263c81612600565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f7665206d696e74657220726f6c6520746f206d696e7400000000000000000000602082015250565b600061269f60368361205c565b91506126aa82612643565b604082019050919050565b600060208201905081810360008301526126ce81612692565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f207061757365000000000000000000602082015250565b600061273160378361205c565b915061273c826126d5565b604082019050919050565b6000602082019050818103600083015261276081612724565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b60006127c360258361205c565b91506127ce82612767565b604082019050919050565b600060208201905081810360008301526127f2816127b6565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061285560248361205c565b9150612860826127f9565b604082019050919050565b6000602082019050818103600083015261288481612848565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006128e760228361205c565b91506128f28261288b565b604082019050919050565b60006020820190508181036000830152612916816128da565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612953601d8361205c565b915061295e8261291d565b602082019050919050565b6000602082019050818103600083015261298281612946565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006129e560258361205c565b91506129f082612989565b604082019050919050565b60006020820190508181036000830152612a14816129d8565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612a7760238361205c565b9150612a8282612a1b565b604082019050919050565b60006020820190508181036000830152612aa681612a6a565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612b0960268361205c565b9150612b1482612aad565b604082019050919050565b60006020820190508181036000830152612b3881612afc565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000612b75601f8361205c565b9150612b8082612b3f565b602082019050919050565b60006020820190508181036000830152612ba481612b68565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612c0760218361205c565b9150612c1282612bab565b604082019050919050565b60006020820190508181036000830152612c3681612bfa565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612c9960228361205c565b9150612ca482612c3d565b604082019050919050565b60006020820190508181036000830152612cc881612c8c565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612d10601783612ccf565b9150612d1b82612cda565b601782019050919050565b6000612d3182612051565b612d3b8185612ccf565b9350612d4b81856020860161206d565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612d8d601183612ccf565b9150612d9882612d57565b601182019050919050565b6000612dae82612d03565b9150612dba8285612d26565b9150612dc582612d80565b9150612dd18284612d26565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612e1360148361205c565b9150612e1e82612ddd565b602082019050919050565b60006020820190508181036000830152612e4281612e06565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000612e7f60108361205c565b9150612e8a82612e49565b602082019050919050565b60006020820190508181036000830152612eae81612e72565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b6000612f40602a8361205c565b9150612f4b82612ee4565b604082019050919050565b60006020820190508181036000830152612f6f81612f33565b9050919050565b6000612f8182612161565b9150612f8c83612161565b9250828202612f9a81612161565b91508282048414831517612fb157612fb061254e565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000612ff282612161565b9150600082036130055761300461254e565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b600061304660208361205c565b915061305182613010565b602082019050919050565b6000602082019050818103600083015261307581613039565b9050919050565b600061308782612161565b915061309283612161565b92508282039050818111156130aa576130a961254e565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220ca74da21511fd15190e1e1b87fe9b3a7f4e30c5cf68a6da3cd37a90a1a92ff8364736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063a457c2d711610097578063d539139311610071578063d53913931461052d578063d547741f1461054b578063dd62ed3e14610567578063e63ab1e914610597576101c4565b8063a457c2d71461049d578063a9059cbb146104cd578063ca15c873146104fd576101c4565b80639010d07c116100d35780639010d07c1461040157806391d148541461043157806395d89b4114610461578063a217fddf1461047f576101c4565b806370a08231146103ab57806379cc6790146103db5780638456cb59146103f7576101c4565b8063313ce567116101665780633f4ba83a116101405780633f4ba83a1461034b57806340c10f191461035557806342966c68146103715780635c975abb1461038d576101c4565b8063313ce567146102e157806336568abe146102ff578063395093511461031b576101c4565b806318160ddd116101a257806318160ddd1461024757806323b872dd14610265578063248a9ca3146102955780632f2ff15d146102c5576101c4565b806301ffc9a7146101c957806306fdde03146101f9578063095ea7b314610217575b600080fd5b6101e360048036038101906101de9190611fee565b6105b5565b6040516101f09190612036565b60405180910390f35b61020161062f565b60405161020e91906120e1565b60405180910390f35b610231600480360381019061022c9190612197565b6106c1565b60405161023e9190612036565b60405180910390f35b61024f6106e4565b60405161025c91906121e6565b60405180910390f35b61027f600480360381019061027a9190612201565b6106ee565b60405161028c9190612036565b60405180910390f35b6102af60048036038101906102aa919061228a565b61071d565b6040516102bc91906122c6565b60405180910390f35b6102df60048036038101906102da91906122e1565b61073c565b005b6102e961075d565b6040516102f6919061233d565b60405180910390f35b610319600480360381019061031491906122e1565b610766565b005b61033560048036038101906103309190612197565b6107e9565b6040516103429190612036565b60405180910390f35b610353610820565b005b61036f600480360381019061036a9190612197565b61089a565b005b61038b60048036038101906103869190612358565b610918565b005b61039561092c565b6040516103a29190612036565b60405180910390f35b6103c560048036038101906103c09190612385565b610943565b6040516103d291906121e6565b60405180910390f35b6103f560048036038101906103f09190612197565b61098c565b005b6103ff6109ac565b005b61041b600480360381019061041691906123b2565b610a26565b6040516104289190612401565b60405180910390f35b61044b600480360381019061044691906122e1565b610a55565b6040516104589190612036565b60405180910390f35b610469610abf565b60405161047691906120e1565b60405180910390f35b610487610b51565b60405161049491906122c6565b60405180910390f35b6104b760048036038101906104b29190612197565b610b58565b6040516104c49190612036565b60405180910390f35b6104e760048036038101906104e29190612197565b610bcf565b6040516104f49190612036565b60405180910390f35b6105176004803603810190610512919061228a565b610c12565b60405161052491906121e6565b60405180910390f35b610535610c36565b60405161054291906122c6565b60405180910390f35b610565600480360381019061056091906122e1565b610c5a565b005b610581600480360381019061057c919061241c565b610c7b565b60405161058e91906121e6565b60405180910390f35b61059f610d02565b6040516105ac91906122c6565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610628575061062782610d26565b5b9050919050565b60606005805461063e9061248b565b80601f016020809104026020016040519081016040528092919081815260200182805461066a9061248b565b80156106b75780601f1061068c576101008083540402835291602001916106b7565b820191906000526020600020905b81548152906001019060200180831161069a57829003601f168201915b5050505050905090565b6000806106cc610da0565b90506106d9818585610da8565b600191505092915050565b6000600454905090565b6000806106f9610da0565b9050610706858285610f71565b610711858585610ffd565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b6107458261071d565b61074e81611276565b610758838361128a565b505050565b60006012905090565b61076e610da0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d29061252e565b60405180910390fd5b6107e582826112be565b5050565b6000806107f4610da0565b90506108158185856108068589610c7b565b610810919061257d565b610da8565b600191505092915050565b6108517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61084c610da0565b610a55565b610890576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088790612623565b60405180910390fd5b6108986112f2565b565b6108cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66108c6610da0565b610a55565b61090a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610901906126b5565b60405180910390fd5b6109148282611355565b5050565b610929610923610da0565b826114ac565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61099e82610998610da0565b83610f71565b6109a882826114ac565b5050565b6109dd7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6109d8610da0565b610a55565b610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390612747565b60405180910390fd5b610a2461167b565b565b6000610a4d82600160008681526020019081526020016000206116de90919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610ace9061248b565b80601f0160208091040260200160405190810160405280929190818152602001828054610afa9061248b565b8015610b475780601f10610b1c57610100808354040283529160200191610b47565b820191906000526020600020905b815481529060010190602001808311610b2a57829003601f168201915b5050505050905090565b6000801b81565b600080610b63610da0565b90506000610b718286610c7b565b905083811015610bb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bad906127d9565b60405180910390fd5b610bc38286868403610da8565b60019250505092915050565b6000610c0083600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600854610da8565b610c0a83836116f8565b905092915050565b6000610c2f6001600084815260200190815260200160002061171b565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610c638261071d565b610c6c81611276565b610c7683836112be565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610d995750610d9882611730565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0e9061286b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d906128fd565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f6491906121e6565b60405180910390a3505050565b6000610f7d8484610c7b565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610ff75781811015610fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe090612969565b60405180910390fd5b610ff68484848403610da8565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361106c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611063906129fb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d290612a8d565b60405180910390fd5b6110e683838361179a565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561116d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116490612b1f565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161125d91906121e6565b60405180910390a36112708484846117aa565b50505050565b61128781611282610da0565b6117af565b50565b6112948282611834565b6112b9816001600085815260200190815260200160002061191490919063ffffffff16565b505050565b6112c88282611944565b6112ed8160016000858152602001908152602001600020611a2590919063ffffffff16565b505050565b6112fa611a55565b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61133e610da0565b60405161134b9190612401565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036113c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bb90612b8b565b60405180910390fd5b6113d06000838361179a565b80600460008282546113e2919061257d565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161149491906121e6565b60405180910390a36114a8600083836117aa565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361151b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151290612c1d565b60405180910390fd5b6115278260008361179a565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156115ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a590612caf565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161166291906121e6565b60405180910390a3611676836000846117aa565b505050565b611683611a9e565b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116c7610da0565b6040516116d49190612401565b60405180910390a1565b60006116ed8360000183611ae8565b60001c905092915050565b600080611703610da0565b9050611710818585610ffd565b600191505092915050565b600061172982600001611b13565b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6117a5838383611b24565b505050565b505050565b6117b98282610a55565b611830576117c681611b7c565b6117d48360001c6020611ba9565b6040516020016117e5929190612da3565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182791906120e1565b60405180910390fd5b5050565b61183e8282610a55565b61191057600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506118b5610da0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600061193c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611de5565b905092915050565b61194e8282610a55565b15611a2157600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119c6610da0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611a4d836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e55565b905092915050565b611a5d61092c565b611a9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9390612e29565b60405180910390fd5b565b611aa661092c565b15611ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611add90612e95565b60405180910390fd5b565b6000826000018281548110611b0057611aff612eb5565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b611b2f838383611f69565b611b3761092c565b15611b77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6e90612f56565b60405180910390fd5b505050565b6060611ba28273ffffffffffffffffffffffffffffffffffffffff16601460ff16611ba9565b9050919050565b606060006002836002611bbc9190612f76565b611bc6919061257d565b67ffffffffffffffff811115611bdf57611bde612fb8565b5b6040519080825280601f01601f191660200182016040528015611c115781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611c4957611c48612eb5565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611cad57611cac612eb5565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611ced9190612f76565b611cf7919061257d565b90505b6001811115611d97577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611d3957611d38612eb5565b5b1a60f81b828281518110611d5057611d4f612eb5565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611d9090612fe7565b9050611cfa565b5060008414611ddb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd29061305c565b60405180910390fd5b8091505092915050565b6000611df18383611f6e565b611e4a578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e4f565b600090505b92915050565b60008083600101600084815260200190815260200160002054905060008114611f5d576000600182611e87919061307c565b9050600060018660000180549050611e9f919061307c565b9050818114611f0e576000866000018281548110611ec057611ebf612eb5565b5b9060005260206000200154905080876000018481548110611ee457611ee3612eb5565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480611f2257611f216130b0565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611f63565b60009150505b92915050565b505050565b600080836001016000848152602001908152602001600020541415905092915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611fcb81611f96565b8114611fd657600080fd5b50565b600081359050611fe881611fc2565b92915050565b60006020828403121561200457612003611f91565b5b600061201284828501611fd9565b91505092915050565b60008115159050919050565b6120308161201b565b82525050565b600060208201905061204b6000830184612027565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561208b578082015181840152602081019050612070565b60008484015250505050565b6000601f19601f8301169050919050565b60006120b382612051565b6120bd818561205c565b93506120cd81856020860161206d565b6120d681612097565b840191505092915050565b600060208201905081810360008301526120fb81846120a8565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061212e82612103565b9050919050565b61213e81612123565b811461214957600080fd5b50565b60008135905061215b81612135565b92915050565b6000819050919050565b61217481612161565b811461217f57600080fd5b50565b6000813590506121918161216b565b92915050565b600080604083850312156121ae576121ad611f91565b5b60006121bc8582860161214c565b92505060206121cd85828601612182565b9150509250929050565b6121e081612161565b82525050565b60006020820190506121fb60008301846121d7565b92915050565b60008060006060848603121561221a57612219611f91565b5b60006122288682870161214c565b93505060206122398682870161214c565b925050604061224a86828701612182565b9150509250925092565b6000819050919050565b61226781612254565b811461227257600080fd5b50565b6000813590506122848161225e565b92915050565b6000602082840312156122a05761229f611f91565b5b60006122ae84828501612275565b91505092915050565b6122c081612254565b82525050565b60006020820190506122db60008301846122b7565b92915050565b600080604083850312156122f8576122f7611f91565b5b600061230685828601612275565b92505060206123178582860161214c565b9150509250929050565b600060ff82169050919050565b61233781612321565b82525050565b6000602082019050612352600083018461232e565b92915050565b60006020828403121561236e5761236d611f91565b5b600061237c84828501612182565b91505092915050565b60006020828403121561239b5761239a611f91565b5b60006123a98482850161214c565b91505092915050565b600080604083850312156123c9576123c8611f91565b5b60006123d785828601612275565b92505060206123e885828601612182565b9150509250929050565b6123fb81612123565b82525050565b600060208201905061241660008301846123f2565b92915050565b6000806040838503121561243357612432611f91565b5b60006124418582860161214c565b92505060206124528582860161214c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806124a357607f821691505b6020821081036124b6576124b561245c565b5b50919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612518602f8361205c565b9150612523826124bc565b604082019050919050565b600060208201905081810360008301526125478161250b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061258882612161565b915061259383612161565b92508282019050808211156125ab576125aa61254e565b5b92915050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f20756e706175736500000000000000602082015250565b600061260d60398361205c565b9150612618826125b1565b604082019050919050565b6000602082019050818103600083015261263c81612600565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f7665206d696e74657220726f6c6520746f206d696e7400000000000000000000602082015250565b600061269f60368361205c565b91506126aa82612643565b604082019050919050565b600060208201905081810360008301526126ce81612692565b9050919050565b7f45524332305072657365744d696e7465725061757365723a206d75737420686160008201527f76652070617573657220726f6c6520746f207061757365000000000000000000602082015250565b600061273160378361205c565b915061273c826126d5565b604082019050919050565b6000602082019050818103600083015261276081612724565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b60006127c360258361205c565b91506127ce82612767565b604082019050919050565b600060208201905081810360008301526127f2816127b6565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061285560248361205c565b9150612860826127f9565b604082019050919050565b6000602082019050818103600083015261288481612848565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006128e760228361205c565b91506128f28261288b565b604082019050919050565b60006020820190508181036000830152612916816128da565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612953601d8361205c565b915061295e8261291d565b602082019050919050565b6000602082019050818103600083015261298281612946565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006129e560258361205c565b91506129f082612989565b604082019050919050565b60006020820190508181036000830152612a14816129d8565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612a7760238361205c565b9150612a8282612a1b565b604082019050919050565b60006020820190508181036000830152612aa681612a6a565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612b0960268361205c565b9150612b1482612aad565b604082019050919050565b60006020820190508181036000830152612b3881612afc565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000612b75601f8361205c565b9150612b8082612b3f565b602082019050919050565b60006020820190508181036000830152612ba481612b68565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612c0760218361205c565b9150612c1282612bab565b604082019050919050565b60006020820190508181036000830152612c3681612bfa565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612c9960228361205c565b9150612ca482612c3d565b604082019050919050565b60006020820190508181036000830152612cc881612c8c565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612d10601783612ccf565b9150612d1b82612cda565b601782019050919050565b6000612d3182612051565b612d3b8185612ccf565b9350612d4b81856020860161206d565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612d8d601183612ccf565b9150612d9882612d57565b601182019050919050565b6000612dae82612d03565b9150612dba8285612d26565b9150612dc582612d80565b9150612dd18284612d26565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612e1360148361205c565b9150612e1e82612ddd565b602082019050919050565b60006020820190508181036000830152612e4281612e06565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000612e7f60108361205c565b9150612e8a82612e49565b602082019050919050565b60006020820190508181036000830152612eae81612e72565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b6000612f40602a8361205c565b9150612f4b82612ee4565b604082019050919050565b60006020820190508181036000830152612f6f81612f33565b9050919050565b6000612f8182612161565b9150612f8c83612161565b9250828202612f9a81612161565b91508282048414831517612fb157612fb061254e565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000612ff282612161565b9150600082036130055761300461254e565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b600061304660208361205c565b915061305182613010565b602082019050919050565b6000602082019050818103600083015261307581613039565b9050919050565b600061308782612161565b915061309283612161565b92508282039050818111156130aa576130a961254e565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220ca74da21511fd15190e1e1b87fe9b3a7f4e30c5cf68a6da3cd37a90a1a92ff8364736f6c63430008140033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/x/erc20/keeper/token_pairs.go b/x/erc20/keeper/token_pairs.go index e675b5d8..5fec9027 100644 --- a/x/erc20/keeper/token_pairs.go +++ b/x/erc20/keeper/token_pairs.go @@ -5,8 +5,8 @@ package keeper import ( errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/utils" diff --git a/x/erc20/keeper/token_pairs_test.go b/x/erc20/keeper/token_pairs_test.go index 0b1a1319..b1beb06e 100644 --- a/x/erc20/keeper/token_pairs_test.go +++ b/x/erc20/keeper/token_pairs_test.go @@ -3,15 +3,19 @@ package keeper_test import ( "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" exampleapp "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" + testconstants "github.com/evmos/os/testutil/constants" utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/erc20/types" ) func (suite *KeeperTestSuite) TestGetTokenPairs() { - var expRes []types.TokenPair + var ( + ctx sdk.Context + expRes []types.TokenPair + ) testCases := []struct { name string @@ -24,7 +28,7 @@ func (suite *KeeperTestSuite) TestGetTokenPairs() { "1 pair registered", func() { pair := types.NewTokenPair(utiltx.GenerateAddress(), "coin", types.OWNER_MODULE) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) + suite.network.App.Erc20Keeper.SetTokenPair(ctx, pair) expRes = exampleapp.ExampleTokenPairs expRes = append(expRes, pair) }, @@ -34,8 +38,8 @@ func (suite *KeeperTestSuite) TestGetTokenPairs() { func() { pair := types.NewTokenPair(utiltx.GenerateAddress(), "coin", types.OWNER_MODULE) pair2 := types.NewTokenPair(utiltx.GenerateAddress(), "coin2", types.OWNER_MODULE) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair2) + suite.network.App.Erc20Keeper.SetTokenPair(ctx, pair) + suite.network.App.Erc20Keeper.SetTokenPair(ctx, pair2) expRes = exampleapp.ExampleTokenPairs expRes = append(expRes, []types.TokenPair{pair, pair2}...) }, @@ -44,9 +48,10 @@ func (suite *KeeperTestSuite) TestGetTokenPairs() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset + ctx = suite.network.GetContext() tc.malleate() - res := suite.app.Erc20Keeper.GetTokenPairs(suite.ctx) + res := suite.network.App.Erc20Keeper.GetTokenPairs(ctx) suite.Require().ElementsMatch(expRes, res, tc.name) }) @@ -54,8 +59,7 @@ func (suite *KeeperTestSuite) TestGetTokenPairs() { } func (suite *KeeperTestSuite) TestGetTokenPairID() { - pair := types.NewTokenPair(utiltx.GenerateAddress(), testutil.ExampleAttoDenom, types.OWNER_MODULE) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) + pair := types.NewTokenPair(utiltx.GenerateAddress(), testconstants.ExampleAttoDenom, types.OWNER_MODULE) testCases := []struct { name string @@ -67,7 +71,12 @@ func (suite *KeeperTestSuite) TestGetTokenPairID() { {"valid hex token", utiltx.GenerateAddress().String(), []byte{}}, } for _, tc := range testCases { - id := suite.app.Erc20Keeper.GetTokenPairID(suite.ctx, tc.token) + suite.SetupTest() + ctx := suite.network.GetContext() + + suite.network.App.Erc20Keeper.SetTokenPair(ctx, pair) + + id := suite.network.App.Erc20Keeper.GetTokenPairID(ctx, tc.token) if id != nil { suite.Require().Equal(tc.expID, id, tc.name) } else { @@ -77,8 +86,7 @@ func (suite *KeeperTestSuite) TestGetTokenPairID() { } func (suite *KeeperTestSuite) TestGetTokenPair() { - pair := types.NewTokenPair(utiltx.GenerateAddress(), testutil.ExampleAttoDenom, types.OWNER_MODULE) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) + pair := types.NewTokenPair(utiltx.GenerateAddress(), testconstants.ExampleAttoDenom, types.OWNER_MODULE) testCases := []struct { name string @@ -90,7 +98,11 @@ func (suite *KeeperTestSuite) TestGetTokenPair() { {"pair not found", []byte{}, false}, } for _, tc := range testCases { - p, found := suite.app.Erc20Keeper.GetTokenPair(suite.ctx, tc.id) + suite.SetupTest() + ctx := suite.network.GetContext() + + suite.network.App.Erc20Keeper.SetTokenPair(ctx, pair) + p, found := suite.network.App.Erc20Keeper.GetTokenPair(ctx, tc.id) if tc.ok { suite.Require().True(found, tc.name) suite.Require().Equal(pair, p, tc.name) @@ -101,11 +113,9 @@ func (suite *KeeperTestSuite) TestGetTokenPair() { } func (suite *KeeperTestSuite) TestDeleteTokenPair() { - pair := types.NewTokenPair(utiltx.GenerateAddress(), testutil.ExampleAttoDenom, types.OWNER_MODULE) + var ctx sdk.Context + pair := types.NewTokenPair(utiltx.GenerateAddress(), testconstants.ExampleAttoDenom, types.OWNER_MODULE) id := pair.GetID() - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, pair.GetERC20Contract(), id) - suite.app.Erc20Keeper.SetDenomMap(suite.ctx, pair.Denom, id) testCases := []struct { name string @@ -120,14 +130,18 @@ func (suite *KeeperTestSuite) TestDeleteTokenPair() { "delete tokenpair", id, func() { - suite.app.Erc20Keeper.DeleteTokenPair(suite.ctx, pair) + suite.network.App.Erc20Keeper.DeleteTokenPair(ctx, pair) }, false, }, } for _, tc := range testCases { + suite.SetupTest() + ctx = suite.network.GetContext() + suite.network.App.Erc20Keeper.SetToken(ctx, pair) + tc.malleate() - p, found := suite.app.Erc20Keeper.GetTokenPair(suite.ctx, tc.id) + p, found := suite.network.App.Erc20Keeper.GetTokenPair(ctx, tc.id) if tc.ok { suite.Require().True(found, tc.name) suite.Require().Equal(pair, p, tc.name) @@ -138,8 +152,8 @@ func (suite *KeeperTestSuite) TestDeleteTokenPair() { } func (suite *KeeperTestSuite) TestIsTokenPairRegistered() { - pair := types.NewTokenPair(utiltx.GenerateAddress(), testutil.ExampleAttoDenom, types.OWNER_MODULE) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) + var ctx sdk.Context + pair := types.NewTokenPair(utiltx.GenerateAddress(), testconstants.ExampleAttoDenom, types.OWNER_MODULE) testCases := []struct { name string @@ -150,7 +164,11 @@ func (suite *KeeperTestSuite) TestIsTokenPairRegistered() { {"pair not found", []byte{}, false}, } for _, tc := range testCases { - found := suite.app.Erc20Keeper.IsTokenPairRegistered(suite.ctx, tc.id) + suite.SetupTest() + ctx = suite.network.GetContext() + + suite.network.App.Erc20Keeper.SetTokenPair(ctx, pair) + found := suite.network.App.Erc20Keeper.IsTokenPairRegistered(ctx, tc.id) if tc.ok { suite.Require().True(found, tc.name) } else { @@ -160,11 +178,9 @@ func (suite *KeeperTestSuite) TestIsTokenPairRegistered() { } func (suite *KeeperTestSuite) TestIsERC20Registered() { + var ctx sdk.Context addr := utiltx.GenerateAddress() pair := types.NewTokenPair(addr, "coin", types.OWNER_MODULE) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, addr, pair.GetID()) - suite.app.Erc20Keeper.SetDenomMap(suite.ctx, pair.Denom, pair.GetID()) testCases := []struct { name string @@ -178,15 +194,20 @@ func (suite *KeeperTestSuite) TestIsERC20Registered() { "deleted erc20 map", pair.GetERC20Contract(), func() { - suite.app.Erc20Keeper.DeleteTokenPair(suite.ctx, pair) + suite.network.App.Erc20Keeper.DeleteTokenPair(ctx, pair) }, false, }, } for _, tc := range testCases { + suite.SetupTest() + ctx = suite.network.GetContext() + + suite.network.App.Erc20Keeper.SetToken(ctx, pair) + tc.malleate() - found := suite.app.Erc20Keeper.IsERC20Registered(suite.ctx, tc.erc20) + found := suite.network.App.Erc20Keeper.IsERC20Registered(ctx, tc.erc20) if tc.ok { suite.Require().True(found, tc.name) @@ -197,11 +218,9 @@ func (suite *KeeperTestSuite) TestIsERC20Registered() { } func (suite *KeeperTestSuite) TestIsDenomRegistered() { + var ctx sdk.Context addr := utiltx.GenerateAddress() pair := types.NewTokenPair(addr, "coin", types.OWNER_MODULE) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, addr, pair.GetID()) - suite.app.Erc20Keeper.SetDenomMap(suite.ctx, pair.Denom, pair.GetID()) testCases := []struct { name string @@ -215,15 +234,20 @@ func (suite *KeeperTestSuite) TestIsDenomRegistered() { "deleted denom map", pair.GetDenom(), func() { - suite.app.Erc20Keeper.DeleteTokenPair(suite.ctx, pair) + suite.network.App.Erc20Keeper.DeleteTokenPair(ctx, pair) }, false, }, } for _, tc := range testCases { + suite.SetupTest() + ctx = suite.network.GetContext() + + suite.network.App.Erc20Keeper.SetToken(ctx, pair) + tc.malleate() - found := suite.app.Erc20Keeper.IsDenomRegistered(suite.ctx, tc.denom) + found := suite.network.App.Erc20Keeper.IsDenomRegistered(ctx, tc.denom) if tc.ok { suite.Require().True(found, tc.name) @@ -234,6 +258,7 @@ func (suite *KeeperTestSuite) TestIsDenomRegistered() { } func (suite *KeeperTestSuite) TestGetTokenDenom() { + var ctx sdk.Context tokenAddress := utiltx.GenerateAddress() tokenDenom := "token" @@ -249,8 +274,8 @@ func (suite *KeeperTestSuite) TestGetTokenDenom() { tokenDenom, func() { pair := types.NewTokenPair(tokenAddress, tokenDenom, types.OWNER_MODULE) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, tokenAddress, pair.GetID()) + suite.network.App.Erc20Keeper.SetTokenPair(ctx, pair) + suite.network.App.Erc20Keeper.SetERC20Map(ctx, tokenAddress, pair.GetID()) }, true, "", @@ -261,8 +286,8 @@ func (suite *KeeperTestSuite) TestGetTokenDenom() { func() { address := utiltx.GenerateAddress() pair := types.NewTokenPair(address, tokenDenom, types.OWNER_MODULE) - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, pair) - suite.app.Erc20Keeper.SetERC20Map(suite.ctx, address, pair.GetID()) + suite.network.App.Erc20Keeper.SetTokenPair(ctx, pair) + suite.network.App.Erc20Keeper.SetERC20Map(ctx, address, pair.GetID()) }, false, fmt.Sprintf("token '%s' not registered", tokenAddress), @@ -270,10 +295,11 @@ func (suite *KeeperTestSuite) TestGetTokenDenom() { } for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { - suite.SetupTest() // reset + suite.SetupTest() + ctx = suite.network.GetContext() tc.malleate() - res, err := suite.app.Erc20Keeper.GetTokenDenom(suite.ctx, tokenAddress) + res, err := suite.network.App.Erc20Keeper.GetTokenDenom(ctx, tokenAddress) if tc.expError { suite.Require().NoError(err) diff --git a/x/erc20/keeper/utils_test.go b/x/erc20/keeper/utils_test.go index 7ce4cb69..f423ecf5 100644 --- a/x/erc20/keeper/utils_test.go +++ b/x/erc20/keeper/utils_test.go @@ -1,409 +1,78 @@ package keeper_test import ( - "encoding/json" - "math" "math/big" - "strconv" - "time" - sdkmath "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibcgotesting "github.com/cosmos/ibc-go/v7/testing" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/evmos/os/contracts" - "github.com/evmos/os/crypto/ethsecp256k1" - exampleapp "github.com/evmos/os/example_chain" - chainutil "github.com/evmos/os/example_chain/testutil" - ibctesting "github.com/evmos/os/ibc/testing" - precompiletestutil "github.com/evmos/os/precompiles/testutil" - "github.com/evmos/os/server/config" - "github.com/evmos/os/testutil" - utiltx "github.com/evmos/os/testutil/tx" + "github.com/evmos/os/testutil/integration/os/factory" "github.com/evmos/os/x/erc20/keeper/testdata" "github.com/evmos/os/x/erc20/types" - "github.com/evmos/os/x/evm/statedb" evm "github.com/evmos/os/x/evm/types" ) -func CreatePacket(amount, denom, sender, receiver, srcPort, srcChannel, dstPort, dstChannel string, seq, timeout uint64) channeltypes.Packet { - transfer := transfertypes.FungibleTokenPacketData{ - Amount: amount, - Denom: denom, - Receiver: sender, - Sender: receiver, - } - return channeltypes.NewPacket( - transfer.GetBytes(), - seq, - srcPort, - srcChannel, - dstPort, - dstChannel, - clienttypes.ZeroHeight(), // timeout height disabled - timeout, - ) -} - -func (suite *KeeperTestSuite) DoSetupTest() { - // account key - priv, err := ethsecp256k1.GenerateKey() - suite.Require().NoError(err) - - suite.priv = priv - suite.address = common.BytesToAddress(priv.PubKey().Address().Bytes()) - suite.signer = utiltx.NewSigner(priv) - - // consensus key - privCons, err := ethsecp256k1.GenerateKey() - suite.Require().NoError(err) - consAddress := sdk.ConsAddress(privCons.PubKey().Address()) - suite.consAddress = consAddress - - // init app - chainID := testutil.ExampleChainID - suite.app = exampleapp.Setup(suite.T(), false, chainID) - header := testutil.NewHeader( - 1, time.Now().UTC(), chainID, consAddress, nil, nil, - ) - suite.ctx = suite.app.BaseApp.NewContext(false, header) - - // query clients - queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) - types.RegisterQueryServer(queryHelper, suite.app.Erc20Keeper) - suite.queryClient = types.NewQueryClient(queryHelper) - - queryHelperEvm := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) - evm.RegisterQueryServer(queryHelperEvm, suite.app.EVMKeeper) - suite.queryClientEvm = evm.NewQueryClient(queryHelperEvm) - - // bond denom - stakingParams := suite.app.StakingKeeper.GetParams(suite.ctx) - stakingParams.BondDenom = testutil.ExampleAttoDenom - err = suite.app.StakingKeeper.SetParams(suite.ctx, stakingParams) - suite.Require().NoError(err) - - evmParams := suite.app.EVMKeeper.GetParams(suite.ctx) - evmParams.EvmDenom = testutil.ExampleAttoDenom - err = suite.app.EVMKeeper.SetParams(suite.ctx, evmParams) - suite.Require().NoError(err) - - // Set Validator - valAddr := sdk.ValAddress(suite.address.Bytes()) - validator, err := stakingtypes.NewValidator(valAddr, privCons.PubKey(), stakingtypes.Description{}) - suite.Require().NoError(err) - validator = stakingkeeper.TestingUpdateValidator(suite.app.StakingKeeper, suite.ctx, validator, true) - err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, validator.GetOperator()) - suite.Require().NoError(err) - err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) - suite.Require().NoError(err) - - // fund signer acc to pay for tx fees - amt := sdkmath.NewInt(int64(math.Pow10(18) * 2)) - err = chainutil.FundAccount( - suite.ctx, - suite.app.BankKeeper, - suite.priv.PubKey().Address().Bytes(), - sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, amt)), - ) - suite.Require().NoError(err) - - // TODO change to setup with 1 validator - validators := s.app.StakingKeeper.GetValidators(s.ctx, 2) - // set a bonded validator that takes part in consensus - if validators[0].Status == stakingtypes.Bonded { - suite.validator = validators[0] - } else { - suite.validator = validators[1] - } - - suite.ethSigner = ethtypes.LatestSignerForChainID(s.app.EVMKeeper.ChainID()) - - if suite.suiteIBCTesting { - suite.SetupIBCTest() - } -} - -func (suite *KeeperTestSuite) SetupIBCTest() { - // initializes 3 test chains - suite.coordinator = ibctesting.NewCoordinator(suite.T(), 1, 2) - suite.EvmosChain = suite.coordinator.GetChain(ibcgotesting.GetChainID(1)) - suite.IBCOsmosisChain = suite.coordinator.GetChain(ibcgotesting.GetChainID(2)) - suite.IBCCosmosChain = suite.coordinator.GetChain(ibcgotesting.GetChainID(3)) - suite.coordinator.CommitNBlocks(suite.EvmosChain, 2) - suite.coordinator.CommitNBlocks(suite.IBCOsmosisChain, 2) - suite.coordinator.CommitNBlocks(suite.IBCCosmosChain, 2) - - s.app = suite.EvmosChain.App.(*exampleapp.ExampleChain) - evmParams := s.app.EVMKeeper.GetParams(s.EvmosChain.GetContext()) - evmParams.EvmDenom = testutil.ExampleAttoDenom - err := s.app.EVMKeeper.SetParams(s.EvmosChain.GetContext(), evmParams) - suite.Require().NoError(err) - - // s.app.FeeMarketKeeper.SetBaseFee(s.EvmosChain.GetContext(), big.NewInt(1)) - - // Set block proposer once, so its carried over on the ibc-go-testing suite - validators := s.app.StakingKeeper.GetValidators(suite.EvmosChain.GetContext(), 2) - cons, err := validators[0].GetConsAddr() - suite.Require().NoError(err) - suite.EvmosChain.CurrentHeader.ProposerAddress = cons.Bytes() - - err = s.app.StakingKeeper.SetValidatorByConsAddr(suite.EvmosChain.GetContext(), validators[0]) - suite.Require().NoError(err) - - _, err = s.app.EVMKeeper.GetCoinbaseAddress(suite.EvmosChain.GetContext(), sdk.ConsAddress(suite.EvmosChain.CurrentHeader.ProposerAddress)) - suite.Require().NoError(err) - // Mint coins locked on the evmos account generated with secp. - amt, ok := sdkmath.NewIntFromString("1000000000000000000000") - suite.Require().True(ok) - coinEvmos := sdk.NewCoin(testutil.ExampleAttoDenom, amt) - coins := sdk.NewCoins(coinEvmos) - err = s.app.BankKeeper.MintCoins(suite.EvmosChain.GetContext(), minttypes.ModuleName, coins) - suite.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToAccount(suite.EvmosChain.GetContext(), minttypes.ModuleName, suite.EvmosChain.SenderAccount.GetAddress(), coins) - suite.Require().NoError(err) - - // we need some coins in the bankkeeper to be able to register the coins later - coins = sdk.NewCoins(sdk.NewCoin(precompiletestutil.UosmoIbcdenom, sdkmath.NewInt(100))) - err = s.app.BankKeeper.MintCoins(s.EvmosChain.GetContext(), types.ModuleName, coins) - s.Require().NoError(err) - coins = sdk.NewCoins(sdk.NewCoin(precompiletestutil.UatomIbcdenom, sdkmath.NewInt(100))) - err = s.app.BankKeeper.MintCoins(s.EvmosChain.GetContext(), types.ModuleName, coins) - s.Require().NoError(err) - - // Mint coins on the osmosis side which we'll use to unlock our aevmos - coinOsmo := sdk.NewCoin("uosmo", sdkmath.NewInt(10000000)) - coins = sdk.NewCoins(coinOsmo) - err = suite.IBCOsmosisChain.GetSimApp().BankKeeper.MintCoins(suite.IBCOsmosisChain.GetContext(), minttypes.ModuleName, coins) - suite.Require().NoError(err) - err = suite.IBCOsmosisChain.GetSimApp().BankKeeper.SendCoinsFromModuleToAccount(suite.IBCOsmosisChain.GetContext(), minttypes.ModuleName, suite.IBCOsmosisChain.SenderAccount.GetAddress(), coins) - suite.Require().NoError(err) - - // Mint coins on the cosmos side which we'll use to unlock our aevmos - coinAtom := sdk.NewCoin("uatom", sdkmath.NewInt(10)) - coins = sdk.NewCoins(coinAtom) - err = suite.IBCCosmosChain.GetSimApp().BankKeeper.MintCoins(suite.IBCCosmosChain.GetContext(), minttypes.ModuleName, coins) - suite.Require().NoError(err) - err = suite.IBCCosmosChain.GetSimApp().BankKeeper.SendCoinsFromModuleToAccount(suite.IBCCosmosChain.GetContext(), minttypes.ModuleName, suite.IBCCosmosChain.SenderAccount.GetAddress(), coins) - suite.Require().NoError(err) - - // Mint coins for IBC tx fee on Osmosis and Cosmos chains - stkCoin := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, amt)) - - err = suite.IBCOsmosisChain.GetSimApp().BankKeeper.MintCoins(suite.IBCOsmosisChain.GetContext(), minttypes.ModuleName, stkCoin) - suite.Require().NoError(err) - err = suite.IBCOsmosisChain.GetSimApp().BankKeeper.SendCoinsFromModuleToAccount(suite.IBCOsmosisChain.GetContext(), minttypes.ModuleName, suite.IBCOsmosisChain.SenderAccount.GetAddress(), stkCoin) - suite.Require().NoError(err) - - err = suite.IBCCosmosChain.GetSimApp().BankKeeper.MintCoins(suite.IBCCosmosChain.GetContext(), minttypes.ModuleName, stkCoin) - suite.Require().NoError(err) - err = suite.IBCCosmosChain.GetSimApp().BankKeeper.SendCoinsFromModuleToAccount(suite.IBCCosmosChain.GetContext(), minttypes.ModuleName, suite.IBCCosmosChain.SenderAccount.GetAddress(), stkCoin) - suite.Require().NoError(err) - - params := types.DefaultParams() - params.EnableErc20 = true - err = s.app.Erc20Keeper.SetParams(suite.EvmosChain.GetContext(), params) - suite.Require().NoError(err) - - suite.pathOsmosisEvmos = ibctesting.NewTransferPath(suite.IBCOsmosisChain, suite.EvmosChain) // clientID, connectionID, channelID empty - suite.pathCosmosEvmos = ibctesting.NewTransferPath(suite.IBCCosmosChain, suite.EvmosChain) - suite.pathOsmosisCosmos = ibctesting.NewTransferPath(suite.IBCCosmosChain, suite.IBCOsmosisChain) - ibctesting.SetupPath(suite.coordinator, suite.pathOsmosisEvmos) // clientID, connectionID, channelID filled - ibctesting.SetupPath(suite.coordinator, suite.pathCosmosEvmos) - ibctesting.SetupPath(suite.coordinator, suite.pathOsmosisCosmos) - suite.Require().Equal("07-tendermint-0", suite.pathOsmosisEvmos.EndpointA.ClientID) - suite.Require().Equal("connection-0", suite.pathOsmosisEvmos.EndpointA.ConnectionID) - suite.Require().Equal("channel-0", suite.pathOsmosisEvmos.EndpointA.ChannelID) - - coinEvmos = sdk.NewCoin(testutil.ExampleAttoDenom, sdkmath.NewInt(1000000000000000000)) - coins = sdk.NewCoins(coinEvmos) - err = s.app.BankKeeper.MintCoins(suite.EvmosChain.GetContext(), types.ModuleName, coins) - suite.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToModule(suite.EvmosChain.GetContext(), types.ModuleName, authtypes.FeeCollectorName, coins) - suite.Require().NoError(err) -} - -var timeoutHeight = clienttypes.NewHeight(1000, 1000) - -func (suite *KeeperTestSuite) StateDB() *statedb.StateDB { - return statedb.New(suite.ctx, suite.app.EVMKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(suite.ctx.HeaderHash().Bytes()))) -} - +// MintFeeCollector mints some coins to the fee collector address. +// Use this only for unit tests. For integration tests, you can use the +// mintFeeCollector flag to setup some balance on genesis func (suite *KeeperTestSuite) MintFeeCollector(coins sdk.Coins) { - err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, coins) + err := suite.network.App.BankKeeper.MintCoins(suite.network.GetContext(), types.ModuleName, coins) suite.Require().NoError(err) - err = suite.app.BankKeeper.SendCoinsFromModuleToModule(suite.ctx, types.ModuleName, authtypes.FeeCollectorName, coins) + err = suite.network.App.BankKeeper.SendCoinsFromModuleToModule(suite.network.GetContext(), types.ModuleName, authtypes.FeeCollectorName, coins) suite.Require().NoError(err) } -func (suite *KeeperTestSuite) sendTx(contractAddr, from common.Address, transferData []byte) *evm.MsgEthereumTx { - ctx := sdk.WrapSDKContext(suite.ctx) - chainID := suite.app.EVMKeeper.ChainID() - - args, err := json.Marshal(&evm.TransactionArgs{To: &contractAddr, From: &from, Data: (*hexutil.Bytes)(&transferData)}) - suite.Require().NoError(err) - res, err := suite.queryClientEvm.EstimateGas(ctx, &evm.EthCallRequest{ - Args: args, - GasCap: config.DefaultGasCap, - }) - suite.Require().NoError(err) - - nonce := suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address) - - // Mint the max gas to the FeeCollector to ensure balance in case of refund - evmParams := suite.app.EVMKeeper.GetParams(suite.ctx) - suite.MintFeeCollector(sdk.NewCoins(sdk.NewCoin(evmParams.EvmDenom, sdkmath.NewInt(suite.app.FeeMarketKeeper.GetBaseFee(suite.ctx).Int64()*int64(res.Gas))))) //#nosec G115 -- int overflow is not a concern here -- block number is not likely to exceed int64 max value - ercTransferTxParams := &evm.EvmTxArgs{ - ChainID: chainID, - Nonce: nonce, - To: &contractAddr, - GasLimit: res.Gas, - GasFeeCap: suite.app.FeeMarketKeeper.GetBaseFee(suite.ctx), - GasTipCap: big.NewInt(1), - Input: transferData, - Accesses: ðtypes.AccessList{}, - } - ercTransferTx := evm.NewTx(ercTransferTxParams) - - ercTransferTx.From = suite.address.Hex() - err = ercTransferTx.Sign(ethtypes.LatestSignerForChainID(chainID), suite.signer) - suite.Require().NoError(err) - rsp, err := suite.app.EVMKeeper.EthereumTx(ctx, ercTransferTx) - suite.Require().NoError(err) - suite.Require().Empty(rsp.VmError) - return ercTransferTx -} - -// Commit commits and starts a new block with an updated context. -func (suite *KeeperTestSuite) Commit() { - suite.CommitAndBeginBlockAfter(time.Hour * 1) -} - -// Commit commits a block at a given time. Reminder: At the end of each -// Tendermint Consensus round the following methods are run -// 1. BeginBlock -// 2. DeliverTx -// 3. EndBlock -// 4. Commit -func (suite *KeeperTestSuite) CommitAndBeginBlockAfter(t time.Duration) { - var err error - suite.ctx, err = chainutil.CommitAndCreateNewCtx(suite.ctx, suite.app, t, nil) - suite.Require().NoError(err) - - queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) - evm.RegisterQueryServer(queryHelper, suite.app.EVMKeeper) - suite.queryClientEvm = evm.NewQueryClient(queryHelper) -} - -// DeployContract deploys the ERC20MinterBurnerDecimalsContract. func (suite *KeeperTestSuite) DeployContract(name, symbol string, decimals uint8) (common.Address, error) { - suite.Commit() - addr, err := chainutil.DeployContract( - suite.ctx, - suite.app, - suite.priv, - suite.queryClientEvm, - contracts.ERC20MinterBurnerDecimalsContract, - name, symbol, decimals, + addr, err := suite.factory.DeployContract( + suite.keyring.GetPrivKey(0), + evm.EvmTxArgs{}, + factory.ContractDeploymentData{ + Contract: contracts.ERC20MinterBurnerDecimalsContract, + ConstructorArgs: []interface{}{name, symbol, decimals}, + }, ) - suite.Commit() - return addr, err + if err != nil { + return common.Address{}, err + } + + return addr, suite.network.NextBlock() } func (suite *KeeperTestSuite) DeployContractMaliciousDelayed() (common.Address, error) { - suite.Commit() - maliciousDelayedContract, err := testdata.LoadMaliciousDelayedContract() suite.Require().NoError(err, "failed to load malicious delayed contract") - addr, err := chainutil.DeployContract( - suite.ctx, - suite.app, - suite.priv, - suite.queryClientEvm, - maliciousDelayedContract, - big.NewInt(1000000000000000000), + addr, err := suite.factory.DeployContract( + suite.keyring.GetPrivKey(0), + evm.EvmTxArgs{}, + factory.ContractDeploymentData{ + Contract: maliciousDelayedContract, + ConstructorArgs: []interface{}{big.NewInt(1000000000000000000)}, + }, ) - suite.Commit() - return addr, err + if err != nil { + return common.Address{}, err + } + + return addr, suite.network.NextBlock() } func (suite *KeeperTestSuite) DeployContractDirectBalanceManipulation() (common.Address, error) { - suite.Commit() - balanceManipulationContract, err := testdata.LoadBalanceManipulationContract() suite.Require().NoError(err, "failed to load balance manipulation contract") - addr, err := chainutil.DeployContract( - suite.ctx, - suite.app, - suite.priv, - suite.queryClientEvm, - balanceManipulationContract, - big.NewInt(1000000000000000000), - ) - suite.Commit() - return addr, err -} - -// DeployContractToChain deploys the ERC20MinterBurnerDecimalsContract -// to the Evmos chain (used on IBC tests) -func (suite *KeeperTestSuite) DeployContractToChain(name, symbol string, decimals uint8) (common.Address, error) { - return chainutil.DeployContract( - s.EvmosChain.GetContext(), - s.EvmosChain.App.(*exampleapp.ExampleChain), - suite.EvmosChain.SenderPrivKey, - suite.queryClientEvm, - contracts.ERC20MinterBurnerDecimalsContract, - name, symbol, decimals, + addr, err := suite.factory.DeployContract( + suite.keyring.GetPrivKey(0), + evm.EvmTxArgs{}, + factory.ContractDeploymentData{ + Contract: balanceManipulationContract, + ConstructorArgs: []interface{}{big.NewInt(1000000000000000000)}, + }, ) -} - -func (suite *KeeperTestSuite) sendAndReceiveMessage( - path *ibctesting.Path, - originEndpoint *ibctesting.Endpoint, - destEndpoint *ibctesting.Endpoint, - originChain *ibcgotesting.TestChain, - coin string, - amount int64, - sender, receiver string, - seq uint64, - ibcCoinMetadata string, -) { - transferMsg := transfertypes.NewMsgTransfer(originEndpoint.ChannelConfig.PortID, originEndpoint.ChannelID, sdk.NewCoin(coin, sdkmath.NewInt(amount)), sender, receiver, timeoutHeight, 0, "") - _, err := ibctesting.SendMsgs(originChain, ibctesting.DefaultFeeAmt, transferMsg) - suite.Require().NoError(err) // message committed - // Recreate the packet that was sent - var transfer transfertypes.FungibleTokenPacketData - if ibcCoinMetadata == "" { - transfer = transfertypes.NewFungibleTokenPacketData(coin, strconv.Itoa(int(amount)), sender, receiver, "") - } else { - transfer = transfertypes.NewFungibleTokenPacketData(ibcCoinMetadata, strconv.Itoa(int(amount)), sender, receiver, "") + if err != nil { + return common.Address{}, err } - packet := channeltypes.NewPacket(transfer.GetBytes(), seq, originEndpoint.ChannelConfig.PortID, originEndpoint.ChannelID, destEndpoint.ChannelConfig.PortID, destEndpoint.ChannelID, timeoutHeight, 0) - // Receive message on the counterparty side, and send ack - err = path.RelayPacket(packet) - suite.Require().NoError(err) -} - -func (suite *KeeperTestSuite) SendAndReceiveMessage(path *ibctesting.Path, origin *ibcgotesting.TestChain, coin string, amount int64, sender, receiver string, seq uint64, ibcCoinMetadata string) { - // Send coin from A to B - suite.sendAndReceiveMessage(path, path.EndpointA, path.EndpointB, origin, coin, amount, sender, receiver, seq, ibcCoinMetadata) -} -// Send back coins (from path endpoint B to A). In case of IBC coins need to provide ibcCoinMetadata (//, e.g.: "transfer/channel-0/aevmos") as input parameter. -// We need this to instantiate properly a FungibleTokenPacketData https://github.com/cosmos/ibc-go/blob/main/docs/architecture/adr-001-coin-source-tracing.md -func (suite *KeeperTestSuite) SendBackCoins(path *ibctesting.Path, origin *ibcgotesting.TestChain, coin string, amount int64, sender, receiver string, seq uint64, ibcCoinMetadata string) { - // Send coin from B to A - suite.sendAndReceiveMessage(path, path.EndpointB, path.EndpointA, origin, coin, amount, sender, receiver, seq, ibcCoinMetadata) + return addr, suite.network.NextBlock() } diff --git a/x/erc20/module.go b/x/erc20/module.go index 6b1ea951..8600428f 100644 --- a/x/erc20/module.go +++ b/x/erc20/module.go @@ -8,6 +8,8 @@ import ( "encoding/json" "fmt" + "cosmossdk.io/core/appmodule" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -33,6 +35,9 @@ var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} _ module.AppModuleSimulation = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ module.HasABCIGenesis = AppModule{} ) // app module Basics object @@ -141,9 +146,15 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (am AppModule) GenerateGenesisState(_ *module.SimulationState) { } -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) { } func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return []simtypes.WeightedOperation{} } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/erc20/proposal_handler.go b/x/erc20/proposal_handler.go deleted file mode 100644 index 976c85a3..00000000 --- a/x/erc20/proposal_handler.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright Tharsis Labs Ltd.(Evmos) -// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) - -package erc20 - -import ( - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - errortypes "github.com/cosmos/cosmos-sdk/types/errors" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/ethereum/go-ethereum/common" - - "github.com/evmos/os/x/erc20/keeper" - "github.com/evmos/os/x/erc20/types" -) - -// NewErc20ProposalHandler creates a governance handler to manage new proposal types. -func NewErc20ProposalHandler(k *keeper.Keeper) govv1beta1.Handler { - return func(ctx sdk.Context, content govv1beta1.Content) error { - // Check if the conversion is globally enabled - if !k.IsERC20Enabled(ctx) { - return errorsmod.Wrap( - types.ErrERC20Disabled, "registration is currently disabled by governance", - ) - } - - switch c := content.(type) { - case *types.RegisterERC20Proposal: - return handleRegisterERC20Proposal(ctx, k, c) - case *types.ToggleTokenConversionProposal: - return handleToggleConversionProposal(ctx, k, c) - - default: - return errorsmod.Wrapf(errortypes.ErrUnknownRequest, "unrecognized %s proposal content type: %T", types.ModuleName, c) - } - } -} - -// handleRegisterERC20Proposal handles the registration proposal for multiple -// ERC20 tokens -func handleRegisterERC20Proposal( - ctx sdk.Context, - k *keeper.Keeper, - p *types.RegisterERC20Proposal, -) error { - for _, address := range p.Erc20Addresses { - pair, err := k.RegisterERC20(ctx, common.HexToAddress(address)) - if err != nil { - return err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeRegisterERC20, - sdk.NewAttribute(types.AttributeKeyCosmosCoin, pair.Denom), - sdk.NewAttribute(types.AttributeKeyERC20Token, pair.Erc20Address), - ), - ) - } - - return nil -} - -// handleToggleConversionProposal handles the toggle proposal for a token pair -func handleToggleConversionProposal( - ctx sdk.Context, - k *keeper.Keeper, - p *types.ToggleTokenConversionProposal, -) error { - pair, err := k.ToggleConversion(ctx, p.Token) - if err != nil { - return err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeToggleTokenConversion, - sdk.NewAttribute(types.AttributeKeyCosmosCoin, pair.Denom), - sdk.NewAttribute(types.AttributeKeyERC20Token, pair.Erc20Address), - ), - ) - - return nil -} diff --git a/x/erc20/types/codec.go b/x/erc20/types/codec.go index 803ad77a..f6995410 100644 --- a/x/erc20/types/codec.go +++ b/x/erc20/types/codec.go @@ -22,13 +22,15 @@ var ( ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) // AminoCdc is a amino codec created to support amino JSON compatible msgs. - AminoCdc = codec.NewAminoCodec(amino) + AminoCdc = codec.NewAminoCodec(amino) //nolint:staticcheck ) const ( // Amino names convertERC20Name = "evmos/MsgConvertERC20" updateParams = "evmos/erc20/MsgUpdateParams" + registerERC20 = "evmos/erc20/MsgRegisterERC20" + toggleConversion = "evmos/erc20/MsgToggleConversion" ) // NOTE: This is required for the GetSignBytes function @@ -43,6 +45,8 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { (*sdk.Msg)(nil), &MsgConvertERC20{}, &MsgUpdateParams{}, + &MsgRegisterERC20{}, + &MsgToggleConversion{}, ) registry.RegisterImplementations( (*govv1beta1.Content)(nil), @@ -60,4 +64,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgUpdateParams{}, updateParams, nil) cdc.RegisterConcrete(&MsgConvertERC20{}, convertERC20Name, nil) + cdc.RegisterConcrete(&MsgRegisterERC20{}, registerERC20, nil) + cdc.RegisterConcrete(&MsgToggleConversion{}, toggleConversion, nil) } diff --git a/x/erc20/types/constants.go b/x/erc20/types/constants.go new file mode 100644 index 00000000..db1e1ec5 --- /dev/null +++ b/x/erc20/types/constants.go @@ -0,0 +1,11 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package types + +// Erc20Bytecode got from a query previous to the Evmos v19 upgrade +// eth.getCode("0xc7e56EEc629D3728fE41baCa2f6BFc502096f94E","0x15B5788"). +// +// We're querying height 22763400 and the ERC-20 contract of the stSTARS IBC coin is +// 0xc7e56EEc629D3728fE41baCa2f6BFc502096f94E. +const Erc20Bytecode = "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80635c975abb11610104578063a217fddf116100a2578063d539139311610071578063d53913931461057d578063d547741f1461059b578063dd62ed3e146105b7578063e63ab1e9146105e7576101da565b8063a217fddf146104cf578063a457c2d7146104ed578063a9059cbb1461051d578063ca15c8731461054d576101da565b80638456cb59116100de5780638456cb59146104475780639010d07c1461045157806391d148541461048157806395d89b41146104b1576101da565b80635c975abb146103dd57806370a08231146103fb57806379cc67901461042b576101da565b8063282c51f31161017c578063395093511161014b578063395093511461036b5780633f4ba83a1461039b57806340c10f19146103a557806342966c68146103c1576101da565b8063282c51f3146102f75780632f2ff15d14610315578063313ce5671461033157806336568abe1461034f576101da565b806318160ddd116101b857806318160ddd1461025d5780631cf2c7e21461027b57806323b872dd14610297578063248a9ca3146102c7576101da565b806301ffc9a7146101df57806306fdde031461020f578063095ea7b31461022d575b600080fd5b6101f960048036038101906101f49190612216565b610605565b604051610206919061225e565b60405180910390f35b61021761067f565b6040516102249190612312565b60405180910390f35b610247600480360381019061024291906123c8565b610711565b604051610254919061225e565b60405180910390f35b61026561072f565b6040516102729190612417565b60405180910390f35b610295600480360381019061029091906123c8565b610739565b005b6102b160048036038101906102ac9190612432565b6107b7565b6040516102be919061225e565b60405180910390f35b6102e160048036038101906102dc91906124bb565b6108af565b6040516102ee91906124f7565b60405180910390f35b6102ff6108ce565b60405161030c91906124f7565b60405180910390f35b61032f600480360381019061032a9190612512565b6108f2565b005b61033961091b565b604051610346919061256e565b60405180910390f35b61036960048036038101906103649190612512565b610932565b005b610385600480360381019061038091906123c8565b6109b5565b604051610392919061225e565b60405180910390f35b6103a3610a61565b005b6103bf60048036038101906103ba91906123c8565b610adb565b005b6103db60048036038101906103d69190612589565b610b59565b005b6103e5610b6d565b6040516103f2919061225e565b60405180910390f35b610415600480360381019061041091906125b6565b610b84565b6040516104229190612417565b60405180910390f35b610445600480360381019061044091906123c8565b610bcd565b005b61044f610c48565b005b61046b600480360381019061046691906125e3565b610cc2565b6040516104789190612632565b60405180910390f35b61049b60048036038101906104969190612512565b610cf1565b6040516104a8919061225e565b60405180910390f35b6104b9610d5b565b6040516104c69190612312565b60405180910390f35b6104d7610ded565b6040516104e491906124f7565b60405180910390f35b610507600480360381019061050291906123c8565b610df4565b604051610514919061225e565b60405180910390f35b610537600480360381019061053291906123c8565b610edf565b604051610544919061225e565b60405180910390f35b610567600480360381019061056291906124bb565b610efd565b6040516105749190612417565b60405180910390f35b610585610f21565b60405161059291906124f7565b60405180910390f35b6105b560048036038101906105b09190612512565b610f45565b005b6105d160048036038101906105cc919061264d565b610f6e565b6040516105de9190612417565b60405180910390f35b6105ef610ff5565b6040516105fc91906124f7565b60405180910390f35b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610678575061067782611129565b5b9050919050565b60606005805461068e906126bc565b80601f01602080910402602001604051908101604052809291908181526020018280546106ba906126bc565b80156107075780601f106106dc57610100808354040283529160200191610707565b820191906000526020600020905b8154815290600101906020018083116106ea57829003601f168201915b5050505050905090565b600061072561071e6111a3565b84846111ab565b6001905092915050565b6000600454905090565b61076a7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a8486107656111a3565b610cf1565b6107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a090612760565b60405180910390fd5b6107b38282611376565b5050565b60006107c484848461154f565b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061080f6111a3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561088f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610886906127f2565b60405180910390fd5b6108a38561089b6111a3565b8584036111ab565b60019150509392505050565b6000806000838152602001908152602001600020600101549050919050565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b6108fb826108af565b61090c816109076111a3565b6117d3565b6109168383611870565b505050565b6000600760019054906101000a900460ff16905090565b61093a6111a3565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146109a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099e90612884565b60405180910390fd5b6109b182826118a4565b5050565b6000610a576109c26111a3565b8484600360006109d06111a3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a5291906128d3565b6111ab565b6001905092915050565b610a927f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610a8d6111a3565b610cf1565b610ad1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac89061299b565b60405180910390fd5b610ad96118d8565b565b610b0c7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610b076111a3565b610cf1565b610b4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4290612a2d565b60405180910390fd5b610b55828261197a565b5050565b610b6a610b646111a3565b82611376565b50565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610be083610bdb6111a3565b610f6e565b905081811015610c25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1c90612abf565b60405180910390fd5b610c3983610c316111a3565b8484036111ab565b610c438383611376565b505050565b610c797f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610c746111a3565b610cf1565b610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf90612b51565b60405180910390fd5b610cc0611adb565b565b6000610ce98260016000868152602001908152602001600020611b7e90919063ffffffff16565b905092915050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060068054610d6a906126bc565b80601f0160208091040260200160405190810160405280929190818152602001828054610d96906126bc565b8015610de35780601f10610db857610100808354040283529160200191610de3565b820191906000526020600020905b815481529060010190602001808311610dc657829003601f168201915b5050505050905090565b6000801b81565b60008060036000610e036111a3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610ec0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb790612be3565b60405180910390fd5b610ed4610ecb6111a3565b858584036111ab565b600191505092915050565b6000610ef3610eec6111a3565b848461154f565b6001905092915050565b6000610f1a60016000848152602001908152602001600020611b98565b9050919050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610f4e826108af565b610f5f81610f5a6111a3565b6117d3565b610f6983836118a4565b505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6110238282610cf1565b6110f557600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061109a6111a3565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000611121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611bad565b905092915050565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061119c575061119b82611c1d565b5b9050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561121b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121290612c75565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128290612d07565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516113699190612417565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113dd90612d99565b60405180910390fd5b6113f282600083611c87565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611479576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147090612e2b565b60405180910390fd5b818103600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008282546114d19190612e4b565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516115369190612417565b60405180910390a361154a83600084611c97565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b690612ef1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561162f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162690612f83565b60405180910390fd5b61163a838383611c87565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156116c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b890613015565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461175691906128d3565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516117ba9190612417565b60405180910390a36117cd848484611c97565b50505050565b6117dd8282610cf1565b61186c576118028173ffffffffffffffffffffffffffffffffffffffff166014611c9c565b6118108360001c6020611c9c565b604051602001611821929190613109565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118639190612312565b60405180910390fd5b5050565b61187a8282611019565b61189f81600160008581526020019081526020016000206110f990919063ffffffff16565b505050565b6118ae8282611ed8565b6118d38160016000858152602001908152602001600020611fb990919063ffffffff16565b505050565b6118e0610b6d565b61191f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119169061318f565b60405180910390fd5b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6119636111a3565b6040516119709190612632565b60405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e1906131fb565b60405180910390fd5b6119f660008383611c87565b8060046000828254611a0891906128d3565b9250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611a5e91906128d3565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611ac39190612417565b60405180910390a3611ad760008383611c97565b5050565b611ae3610b6d565b15611b23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b1a90613267565b60405180910390fd5b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611b676111a3565b604051611b749190612632565b60405180910390a1565b6000611b8d8360000183611fe9565b60001c905092915050565b6000611ba682600001612014565b9050919050565b6000611bb98383612025565b611c12578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611c17565b600090505b92915050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b611c92838383612048565b505050565b505050565b606060006002836002611caf9190613287565b611cb991906128d3565b67ffffffffffffffff811115611cd257611cd16132e1565b5b6040519080825280601f01601f191660200182016040528015611d045781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611d3c57611d3b613310565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611da057611d9f613310565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611de09190613287565b611dea91906128d3565b90505b6001811115611e8a577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611e2c57611e2b613310565b5b1a60f81b828281518110611e4357611e42613310565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611e839061333f565b9050611ded565b5060008414611ece576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec5906133b5565b60405180910390fd5b8091505092915050565b611ee28282610cf1565b15611fb557600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f5a6111a3565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000611fe1836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6120a0565b905092915050565b600082600001828154811061200157612000613310565b5b9060005260206000200154905092915050565b600081600001805490509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b6120538383836121b4565b61205b610b6d565b1561209b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209290613447565b60405180910390fd5b505050565b600080836001016000848152602001908152602001600020549050600081146121a85760006001826120d29190612e4b565b90506000600186600001805490506120ea9190612e4b565b905081811461215957600086600001828154811061210b5761210a613310565b5b906000526020600020015490508087600001848154811061212f5761212e613310565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b8560000180548061216d5761216c613467565b5b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506121ae565b60009150505b92915050565b505050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6121f3816121be565b81146121fe57600080fd5b50565b600081359050612210816121ea565b92915050565b60006020828403121561222c5761222b6121b9565b5b600061223a84828501612201565b91505092915050565b60008115159050919050565b61225881612243565b82525050565b6000602082019050612273600083018461224f565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156122b3578082015181840152602081019050612298565b838111156122c2576000848401525b50505050565b6000601f19601f8301169050919050565b60006122e482612279565b6122ee8185612284565b93506122fe818560208601612295565b612307816122c8565b840191505092915050565b6000602082019050818103600083015261232c81846122d9565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061235f82612334565b9050919050565b61236f81612354565b811461237a57600080fd5b50565b60008135905061238c81612366565b92915050565b6000819050919050565b6123a581612392565b81146123b057600080fd5b50565b6000813590506123c28161239c565b92915050565b600080604083850312156123df576123de6121b9565b5b60006123ed8582860161237d565b92505060206123fe858286016123b3565b9150509250929050565b61241181612392565b82525050565b600060208201905061242c6000830184612408565b92915050565b60008060006060848603121561244b5761244a6121b9565b5b60006124598682870161237d565b935050602061246a8682870161237d565b925050604061247b868287016123b3565b9150509250925092565b6000819050919050565b61249881612485565b81146124a357600080fd5b50565b6000813590506124b58161248f565b92915050565b6000602082840312156124d1576124d06121b9565b5b60006124df848285016124a6565b91505092915050565b6124f181612485565b82525050565b600060208201905061250c60008301846124e8565b92915050565b60008060408385031215612529576125286121b9565b5b6000612537858286016124a6565b92505060206125488582860161237d565b9150509250929050565b600060ff82169050919050565b61256881612552565b82525050565b6000602082019050612583600083018461255f565b92915050565b60006020828403121561259f5761259e6121b9565b5b60006125ad848285016123b3565b91505092915050565b6000602082840312156125cc576125cb6121b9565b5b60006125da8482850161237d565b91505092915050565b600080604083850312156125fa576125f96121b9565b5b6000612608858286016124a6565b9250506020612619858286016123b3565b9150509250929050565b61262c81612354565b82525050565b60006020820190506126476000830184612623565b92915050565b60008060408385031215612664576126636121b9565b5b60006126728582860161237d565b92505060206126838582860161237d565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806126d457607f821691505b602082108114156126e8576126e761268d565b5b50919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f68617665206275726e657220726f6c6520746f206275726e0000000000000000602082015250565b600061274a603883612284565b9150612755826126ee565b604082019050919050565b600060208201905081810360008301526127798161273d565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b60006127dc602883612284565b91506127e782612780565b604082019050919050565b6000602082019050818103600083015261280b816127cf565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b600061286e602f83612284565b915061287982612812565b604082019050919050565b6000602082019050818103600083015261289d81612861565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006128de82612392565b91506128e983612392565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561291e5761291d6128a4565b5b828201905092915050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f686176652070617573657220726f6c6520746f20756e70617573650000000000602082015250565b6000612985603b83612284565b915061299082612929565b604082019050919050565b600060208201905081810360008301526129b481612978565b9050919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f68617665206d696e74657220726f6c6520746f206d696e740000000000000000602082015250565b6000612a17603883612284565b9150612a22826129bb565b604082019050919050565b60006020820190508181036000830152612a4681612a0a565b9050919050565b7f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f7760008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b6000612aa9602483612284565b9150612ab482612a4d565b604082019050919050565b60006020820190508181036000830152612ad881612a9c565b9050919050565b7f45524332304d696e7465724275726e6572446563696d616c733a206d7573742060008201527f686176652070617573657220726f6c6520746f20706175736500000000000000602082015250565b6000612b3b603983612284565b9150612b4682612adf565b604082019050919050565b60006020820190508181036000830152612b6a81612b2e565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000612bcd602583612284565b9150612bd882612b71565b604082019050919050565b60006020820190508181036000830152612bfc81612bc0565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612c5f602483612284565b9150612c6a82612c03565b604082019050919050565b60006020820190508181036000830152612c8e81612c52565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612cf1602283612284565b9150612cfc82612c95565b604082019050919050565b60006020820190508181036000830152612d2081612ce4565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000612d83602183612284565b9150612d8e82612d27565b604082019050919050565b60006020820190508181036000830152612db281612d76565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000612e15602283612284565b9150612e2082612db9565b604082019050919050565b60006020820190508181036000830152612e4481612e08565b9050919050565b6000612e5682612392565b9150612e6183612392565b925082821015612e7457612e736128a4565b5b828203905092915050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612edb602583612284565b9150612ee682612e7f565b604082019050919050565b60006020820190508181036000830152612f0a81612ece565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612f6d602383612284565b9150612f7882612f11565b604082019050919050565b60006020820190508181036000830152612f9c81612f60565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612fff602683612284565b915061300a82612fa3565b604082019050919050565b6000602082019050818103600083015261302e81612ff2565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000613076601783613035565b915061308182613040565b601782019050919050565b600061309782612279565b6130a18185613035565b93506130b1818560208601612295565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b60006130f3601183613035565b91506130fe826130bd565b601182019050919050565b600061311482613069565b9150613120828561308c565b915061312b826130e6565b9150613137828461308c565b91508190509392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000613179601483612284565b915061318482613143565b602082019050919050565b600060208201905081810360008301526131a88161316c565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b60006131e5601f83612284565b91506131f0826131af565b602082019050919050565b60006020820190508181036000830152613214816131d8565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000613251601083612284565b915061325c8261321b565b602082019050919050565b6000602082019050818103600083015261328081613244565b9050919050565b600061329282612392565b915061329d83612392565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132d6576132d56128a4565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061334a82612392565b9150600082141561335e5761335d6128a4565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b600061339f602083612284565b91506133aa82613369565b602082019050919050565b600060208201905081810360008301526133ce81613392565b9050919050565b7f45524332305061757361626c653a20746f6b656e207472616e7366657220776860008201527f696c652070617573656400000000000000000000000000000000000000000000602082015250565b6000613431602a83612284565b915061343c826133d5565b604082019050919050565b6000602082019050818103600083015261346081613424565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220c3d4a4231a6c94cfb03623ea4b77df2c9ccfa487132bebf43620219e3dc2f4cf64736f6c63430008090033" diff --git a/x/erc20/types/erc20.pb.go b/x/erc20/types/erc20.pb.go index e9dd7be8..901457cc 100644 --- a/x/erc20/types/erc20.pb.go +++ b/x/erc20/types/erc20.pb.go @@ -134,6 +134,8 @@ func (m *TokenPair) GetContractOwner() Owner { // Deprecated: RegisterCoinProposal is a gov Content type to register a token // pair for a native Cosmos coin. We're keeping it to remove the existing // proposals from store. After that, remove this message. +// +// NOTE: Keep this message for backwards compatibility on proposals query type RegisterCoinProposal struct { // title of the proposal Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` @@ -245,8 +247,10 @@ func (m *ProposalMetadata) GetMetadata() []types.Metadata { return nil } -// RegisterERC20Proposal is a gov Content type to register a token pair for an -// ERC20 token +// Deprecated: RegisterERC20Proposal is a gov Content type to register a token +// pair for an ERC20 token. +// +// NOTE: Keep this message for backwards compatibility on proposals query type RegisterERC20Proposal struct { // title of the proposal Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` @@ -310,8 +314,10 @@ func (m *RegisterERC20Proposal) GetErc20Addresses() []string { return nil } -// ToggleTokenConversionProposal is a gov Content type to toggle the conversion -// of a token pair. +// Deprecated: ToggleTokenConversionProposal is a gov Content type to toggle the +// conversion of a token pair. +// +// NOTE: Keep this message for backwards compatibility on proposals query type ToggleTokenConversionProposal struct { // title of the proposal Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` diff --git a/x/erc20/types/genesis.pb.go b/x/erc20/types/genesis.pb.go index 61410340..8500e0f5 100644 --- a/x/erc20/types/genesis.pb.go +++ b/x/erc20/types/genesis.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -154,27 +155,28 @@ func init() { func init() { proto.RegisterFile("os/erc20/v1/genesis.proto", fileDescriptor_57bdb96c94ca7940) } var fileDescriptor_57bdb96c94ca7940 = []byte{ - // 315 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0x31, 0x4f, 0x32, 0x31, - 0x1c, 0xc6, 0xaf, 0x1c, 0x21, 0xbc, 0x3d, 0x86, 0xd7, 0x62, 0x14, 0x19, 0x4e, 0x60, 0x62, 0xb1, - 0x15, 0x1c, 0x8d, 0x0b, 0x89, 0x31, 0x71, 0x22, 0xe8, 0xe4, 0x42, 0xca, 0xf9, 0xcf, 0xd9, 0xc8, - 0x5d, 0x9b, 0xb6, 0x5e, 0x64, 0xf3, 0x23, 0xe8, 0xb7, 0x62, 0x64, 0x74, 0x32, 0x06, 0xbe, 0x88, - 0xa1, 0x3d, 0x23, 0x6c, 0xcd, 0xf3, 0x7b, 0x7e, 0x4f, 0x9a, 0x3f, 0x3e, 0x91, 0x86, 0x81, 0x4e, - 0x86, 0xe7, 0xac, 0x18, 0xb0, 0x14, 0x72, 0x30, 0xc2, 0x50, 0xa5, 0xa5, 0x95, 0x24, 0x92, 0x86, - 0x3a, 0x44, 0x8b, 0x41, 0xfb, 0x30, 0x95, 0xa9, 0x74, 0x39, 0xdb, 0xbe, 0x7c, 0xa5, 0x7d, 0xbc, - 0x6b, 0xfb, 0xae, 0x03, 0xbd, 0x37, 0x84, 0x1b, 0x37, 0x7e, 0xed, 0xce, 0x72, 0x0b, 0x64, 0x80, - 0x6b, 0x8a, 0x6b, 0x9e, 0x99, 0x16, 0xea, 0xa0, 0x7e, 0x34, 0x6c, 0xd2, 0x9d, 0x75, 0x3a, 0x76, - 0x68, 0x54, 0x5d, 0x7e, 0x9d, 0x06, 0x93, 0xb2, 0x48, 0xae, 0x70, 0x64, 0xe5, 0x33, 0xe4, 0x53, - 0xc5, 0x85, 0x36, 0xad, 0x4a, 0x27, 0xec, 0x47, 0xc3, 0xa3, 0x3d, 0xef, 0x7e, 0xcb, 0xc7, 0x5c, - 0xe8, 0x52, 0xc5, 0xf6, 0x37, 0x30, 0xbd, 0x0f, 0x84, 0x6b, 0x7e, 0x97, 0x74, 0x71, 0x03, 0x72, - 0x3e, 0x9b, 0xc3, 0xd4, 0x99, 0xee, 0x0b, 0xf5, 0x49, 0xe4, 0xb3, 0xeb, 0x6d, 0x44, 0xce, 0x30, - 0xc9, 0xb9, 0x15, 0x05, 0x4c, 0x95, 0x86, 0x44, 0x66, 0x4a, 0xcc, 0xc1, 0xb4, 0xc2, 0x4e, 0xd8, - 0xff, 0x37, 0x39, 0xf0, 0x64, 0xfc, 0x07, 0x08, 0xc3, 0xcd, 0xc7, 0x45, 0xce, 0x33, 0x91, 0xec, - 0xf5, 0xab, 0xae, 0x4f, 0x4a, 0xb4, 0x23, 0xdc, 0x56, 0xeb, 0x95, 0xff, 0xe1, 0xe8, 0x72, 0xb9, - 0x8e, 0xd1, 0x6a, 0x1d, 0xa3, 0xef, 0x75, 0x8c, 0xde, 0x37, 0x71, 0xb0, 0xda, 0xc4, 0xc1, 0xe7, - 0x26, 0x0e, 0x1e, 0xba, 0xa9, 0xb0, 0x4f, 0x2f, 0x33, 0x9a, 0xc8, 0x8c, 0x41, 0x91, 0x49, 0xc3, - 0xa4, 0x61, 0xaf, 0xe5, 0x71, 0xed, 0x42, 0x81, 0x99, 0xd5, 0xdc, 0x69, 0x2f, 0x7e, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x0d, 0xec, 0xf4, 0xee, 0xb3, 0x01, 0x00, 0x00, + // 336 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xb1, 0x4e, 0x32, 0x41, + 0x14, 0x85, 0x77, 0x58, 0x42, 0x60, 0x96, 0xe2, 0x67, 0xf8, 0xa3, 0x48, 0xb1, 0x02, 0x15, 0x31, + 0x71, 0x47, 0x30, 0xb1, 0xb1, 0x23, 0x31, 0x26, 0x56, 0x04, 0xad, 0x6c, 0xc8, 0xb0, 0xde, 0xac, + 0x13, 0xd9, 0xbd, 0x9b, 0x9d, 0x71, 0x23, 0xaf, 0x60, 0xa5, 0x6f, 0x61, 0xe9, 0x63, 0x50, 0x52, + 0x5a, 0x19, 0x03, 0x85, 0xaf, 0x61, 0x98, 0x5d, 0xe3, 0xd2, 0x4c, 0x6e, 0xce, 0x77, 0xce, 0x9c, + 0x9b, 0x4b, 0x0f, 0x50, 0x71, 0x48, 0xfc, 0xe1, 0x09, 0x4f, 0x07, 0x3c, 0x80, 0x08, 0x94, 0x54, + 0x5e, 0x9c, 0xa0, 0x46, 0xe6, 0xa0, 0xf2, 0x0c, 0xf2, 0xd2, 0x41, 0xbb, 0x21, 0x42, 0x19, 0x21, + 0x37, 0x6f, 0xc6, 0xdb, 0xff, 0x03, 0x0c, 0xd0, 0x8c, 0x7c, 0x3b, 0xe5, 0xea, 0x7e, 0xf1, 0xc3, + 0x2c, 0x6e, 0x40, 0xef, 0x99, 0xd0, 0xfa, 0x65, 0x56, 0x70, 0xad, 0x85, 0x06, 0x76, 0x46, 0x2b, + 0xb1, 0x48, 0x44, 0xa8, 0x5a, 0xa4, 0x43, 0xfa, 0xce, 0xb0, 0xe9, 0x15, 0x0a, 0xbd, 0xb1, 0x41, + 0xa3, 0xda, 0xf2, 0xf3, 0xd0, 0x7a, 0xfb, 0x7e, 0x3f, 0x22, 0x93, 0xdc, 0xcd, 0x46, 0xd4, 0xd1, + 0xf8, 0x00, 0xd1, 0x34, 0x16, 0x32, 0x51, 0xad, 0x52, 0xc7, 0xee, 0x3b, 0xc3, 0xbd, 0x9d, 0xf0, + 0xcd, 0x96, 0x8f, 0x85, 0x4c, 0x8a, 0x79, 0xaa, 0x7f, 0x55, 0xd5, 0x7b, 0x25, 0xb4, 0x92, 0x35, + 0xb0, 0x2e, 0xad, 0x43, 0x24, 0x66, 0x73, 0x98, 0x9a, 0xb8, 0x59, 0xa6, 0x3a, 0x71, 0x32, 0xed, + 0x62, 0x2b, 0xb1, 0x63, 0xca, 0x22, 0xa1, 0x65, 0x0a, 0xd3, 0x38, 0x01, 0x1f, 0xc3, 0x58, 0xce, + 0x41, 0xb5, 0xec, 0x8e, 0xdd, 0xaf, 0x4d, 0x1a, 0x19, 0x19, 0xff, 0x01, 0xc6, 0x69, 0xf3, 0x6e, + 0x11, 0x89, 0x50, 0xfa, 0x3b, 0xfe, 0xb2, 0xf1, 0xb3, 0x1c, 0x15, 0x02, 0x57, 0xe5, 0x6a, 0xe9, + 0x9f, 0x3d, 0x3a, 0x5f, 0xae, 0x5d, 0xb2, 0x5a, 0xbb, 0xe4, 0x6b, 0xed, 0x92, 0x97, 0x8d, 0x6b, + 0xad, 0x36, 0xae, 0xf5, 0xb1, 0x71, 0xad, 0xdb, 0x6e, 0x20, 0xf5, 0xfd, 0xe3, 0xcc, 0xf3, 0x31, + 0xe4, 0x90, 0x86, 0xa8, 0x38, 0x2a, 0xfe, 0x94, 0x9f, 0x59, 0x2f, 0x62, 0x50, 0xb3, 0x8a, 0x39, + 0xf2, 0xe9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x89, 0xbf, 0x66, 0xf1, 0xd0, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/erc20/types/genesis_test.go b/x/erc20/types/genesis_test.go index 0e6b2364..8ad166ab 100644 --- a/x/erc20/types/genesis_test.go +++ b/x/erc20/types/genesis_test.go @@ -4,7 +4,8 @@ import ( "testing" exampleapp "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" + + testconstants "github.com/evmos/os/testutil/constants" "github.com/evmos/os/x/erc20/types" "github.com/stretchr/testify/suite" ) @@ -57,8 +58,8 @@ func (suite *GenesisTestSuite) TestValidateGenesis() { Enabled: true, }, { - Erc20Address: testutil.WEVMOSContractMainnet, - Denom: testutil.ExampleAttoDenom, + Erc20Address: testconstants.WEVMOSContractMainnet, + Denom: testconstants.ExampleAttoDenom, Enabled: true, }, }, @@ -81,8 +82,8 @@ func (suite *GenesisTestSuite) TestValidateGenesis() { Enabled: true, }, { - Erc20Address: testutil.WEVMOSContractMainnet, - Denom: testutil.ExampleAttoDenom, + Erc20Address: testconstants.WEVMOSContractMainnet, + Denom: testconstants.ExampleAttoDenom, Enabled: true, }, }, @@ -105,8 +106,8 @@ func (suite *GenesisTestSuite) TestValidateGenesis() { Enabled: true, }, { - Erc20Address: testutil.WEVMOSContractMainnet, - Denom: testutil.ExampleAttoDenom, + Erc20Address: testconstants.WEVMOSContractMainnet, + Denom: testconstants.ExampleAttoDenom, Enabled: true, }, }, @@ -129,8 +130,8 @@ func (suite *GenesisTestSuite) TestValidateGenesis() { Enabled: true, }, { - Erc20Address: testutil.WEVMOSContractMainnet, - Denom: testutil.ExampleAttoDenom, + Erc20Address: testconstants.WEVMOSContractMainnet, + Denom: testconstants.ExampleAttoDenom, Enabled: true, }, }, @@ -148,8 +149,8 @@ func (suite *GenesisTestSuite) TestValidateGenesis() { Enabled: true, }, { - Erc20Address: testutil.WEVMOSContractMainnet, - Denom: testutil.ExampleAttoDenom, + Erc20Address: testconstants.WEVMOSContractMainnet, + Denom: testconstants.ExampleAttoDenom, Enabled: true, }, }, diff --git a/x/erc20/types/interfaces.go b/x/erc20/types/interfaces.go index 04bdf4c1..eaecd23a 100644 --- a/x/erc20/types/interfaces.go +++ b/x/erc20/types/interfaces.go @@ -6,32 +6,33 @@ package types import ( "context" + "cosmossdk.io/core/address" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/evmos/os/x/evm/core/vm" - "github.com/evmos/os/x/evm/statedb" evmtypes "github.com/evmos/os/x/evm/types" ) // AccountKeeper defines the expected interface needed to retrieve account info. type AccountKeeper interface { - GetSequence(sdk.Context, sdk.AccAddress) (uint64, error) - GetAccount(sdk.Context, sdk.AccAddress) authtypes.AccountI + AddressCodec() address.Codec + GetModuleAddress(moduleName string) sdk.AccAddress + GetSequence(context.Context, sdk.AccAddress) (uint64, error) + GetAccount(context.Context, sdk.AccAddress) sdk.AccountI } // StakingKeeper defines the expected interface needed to retrieve the staking denom. type StakingKeeper interface { - BondDenom(ctx sdk.Context) string + BondDenom(ctx context.Context) (string, error) } // EVMKeeper defines the expected EVM keeper interface used on erc20 type EVMKeeper interface { + // TODO: should these methods also be converted to use context.Context? GetParams(ctx sdk.Context) evmtypes.Params GetAccountWithoutBalance(ctx sdk.Context, addr common.Address) *statedb.Account EstimateGasInternal(c context.Context, req *evmtypes.EthCallRequest, fromType evmtypes.CallType) (*evmtypes.EstimateGasResponse, error) @@ -40,6 +41,10 @@ type EVMKeeper interface { IsAvailableStaticPrecompile(params *evmtypes.Params, address common.Address) bool CallEVM(ctx sdk.Context, abi abi.ABI, from, contract common.Address, commit bool, method string, args ...interface{}) (*evmtypes.MsgEthereumTxResponse, error) CallEVMWithData(ctx sdk.Context, from common.Address, contract *common.Address, data []byte, commit bool) (*evmtypes.MsgEthereumTxResponse, error) + GetCode(ctx sdk.Context, hash common.Hash) []byte + SetCode(ctx sdk.Context, hash []byte, bytecode []byte) + SetAccount(ctx sdk.Context, address common.Address, account statedb.Account) error + GetAccount(ctx sdk.Context, address common.Address) *statedb.Account } type ( diff --git a/x/erc20/types/mocks/AccountKeeper.go b/x/erc20/types/mocks/AccountKeeper.go deleted file mode 100644 index a23107d9..00000000 --- a/x/erc20/types/mocks/AccountKeeper.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. - -package mocks - -import ( - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - - mock "github.com/stretchr/testify/mock" - - types "github.com/cosmos/cosmos-sdk/types" -) - -// AccountKeeper is an autogenerated mock type for the AccountKeeper type -type AccountKeeper struct { - mock.Mock -} - -// GetAccount provides a mock function with given fields: _a0, _a1 -func (_m *AccountKeeper) GetAccount(_a0 types.Context, _a1 types.AccAddress) authtypes.AccountI { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for GetAccount") - } - - var r0 authtypes.AccountI - if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress) authtypes.AccountI); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(authtypes.AccountI) - } - } - - return r0 -} - -// GetSequence provides a mock function with given fields: _a0, _a1 -func (_m *AccountKeeper) GetSequence(_a0 types.Context, _a1 types.AccAddress) (uint64, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for GetSequence") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress) (uint64, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress) uint64); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func(types.Context, types.AccAddress) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewAccountKeeper creates a new instance of AccountKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewAccountKeeper(t interface { - mock.TestingT - Cleanup(func()) -}, -) *AccountKeeper { - mock := &AccountKeeper{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/x/erc20/types/mocks/BankKeeper.go b/x/erc20/types/mocks/BankKeeper.go index 4ee24019..a4582cdd 100644 --- a/x/erc20/types/mocks/BankKeeper.go +++ b/x/erc20/types/mocks/BankKeeper.go @@ -1,961 +1,916 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by MockGen. DO NOT EDIT. +// Source: x/gov/testutil/expected_keepers.go +// Package testutil is a generated GoMock package. package mocks import ( context "context" + reflect "reflect" - cosmos_sdktypes "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - - mock "github.com/stretchr/testify/mock" - + types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" - - types "github.com/cosmos/cosmos-sdk/x/bank/types" + keeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + types0 "github.com/cosmos/cosmos-sdk/x/bank/types" + gomock "github.com/golang/mock/gomock" ) -// BankKeeper is an autogenerated mock type for the bankkeeper.Keeper type +// BankKeeper is a mock of BankKeeper interface. type BankKeeper struct { - mock.Mock + ctrl *gomock.Controller + recorder *MockBankKeeperMockRecorder } -// AllBalances provides a mock function with given fields: _a0, _a1 -func (_m *BankKeeper) AllBalances(_a0 context.Context, _a1 *types.QueryAllBalancesRequest) (*types.QueryAllBalancesResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.QueryAllBalancesResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryAllBalancesRequest) (*types.QueryAllBalancesResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryAllBalancesRequest) *types.QueryAllBalancesResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryAllBalancesResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryAllBalancesRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 +// MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. +type MockBankKeeperMockRecorder struct { + mock *BankKeeper } -// Balance provides a mock function with given fields: _a0, _a1 -func (_m *BankKeeper) Balance(_a0 context.Context, _a1 *types.QueryBalanceRequest) (*types.QueryBalanceResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.QueryBalanceResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryBalanceRequest) (*types.QueryBalanceResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryBalanceRequest) *types.QueryBalanceResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryBalanceResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryBalanceRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 +// NewMockBankKeeper creates a new mock instance. +func NewMockBankKeeper(ctrl *gomock.Controller) *BankKeeper { + mock := &BankKeeper{ctrl: ctrl} + mock.recorder = &MockBankKeeperMockRecorder{mock} + return mock } -// BlockedAddr provides a mock function with given fields: addr -func (_m *BankKeeper) BlockedAddr(addr cosmos_sdktypes.AccAddress) bool { - ret := _m.Called(addr) - - var r0 bool - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.AccAddress) bool); ok { - r0 = rf(addr) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *BankKeeper) EXPECT() *MockBankKeeperMockRecorder { + return m.recorder } -// BurnCoins provides a mock function with given fields: ctx, moduleName, amt -func (_m *BankKeeper) BurnCoins(ctx cosmos_sdktypes.Context, moduleName string, amt cosmos_sdktypes.Coins) error { - ret := _m.Called(ctx, moduleName, amt) - - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string, cosmos_sdktypes.Coins) error); ok { - r0 = rf(ctx, moduleName, amt) - } else { - r0 = ret.Error(0) - } - - return r0 +// AllBalances mocks base method. +func (m *BankKeeper) AllBalances(arg0 context.Context, arg1 *types0.QueryAllBalancesRequest) (*types0.QueryAllBalancesResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AllBalances", arg0, arg1) + ret0, _ := ret[0].(*types0.QueryAllBalancesResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// DelegateCoins provides a mock function with given fields: ctx, delegatorAddr, moduleAccAddr, amt -func (_m *BankKeeper) DelegateCoins(ctx cosmos_sdktypes.Context, delegatorAddr cosmos_sdktypes.AccAddress, moduleAccAddr cosmos_sdktypes.AccAddress, amt cosmos_sdktypes.Coins) error { - ret := _m.Called(ctx, delegatorAddr, moduleAccAddr, amt) - - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.AccAddress, cosmos_sdktypes.AccAddress, cosmos_sdktypes.Coins) error); ok { - r0 = rf(ctx, delegatorAddr, moduleAccAddr, amt) - } else { - r0 = ret.Error(0) - } - - return r0 +// AllBalances indicates an expected call of AllBalances. +func (mr *MockBankKeeperMockRecorder) AllBalances(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllBalances", reflect.TypeOf((*BankKeeper)(nil).AllBalances), arg0, arg1) } -// DelegateCoinsFromAccountToModule provides a mock function with given fields: ctx, senderAddr, recipientModule, amt -func (_m *BankKeeper) DelegateCoinsFromAccountToModule(ctx cosmos_sdktypes.Context, senderAddr cosmos_sdktypes.AccAddress, recipientModule string, amt cosmos_sdktypes.Coins) error { - ret := _m.Called(ctx, senderAddr, recipientModule, amt) - - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.AccAddress, string, cosmos_sdktypes.Coins) error); ok { - r0 = rf(ctx, senderAddr, recipientModule, amt) - } else { - r0 = ret.Error(0) - } - - return r0 +// AppendSendRestriction mocks base method. +func (m *BankKeeper) AppendSendRestriction(restriction types0.SendRestrictionFn) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "AppendSendRestriction", restriction) } -// DeleteSendEnabled provides a mock function with given fields: ctx, denoms -func (_m *BankKeeper) DeleteSendEnabled(ctx cosmos_sdktypes.Context, denoms ...string) { - _va := make([]interface{}, len(denoms)) - for _i := range denoms { - _va[_i] = denoms[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx) - _ca = append(_ca, _va...) - _m.Called(_ca...) +// AppendSendRestriction indicates an expected call of AppendSendRestriction. +func (mr *MockBankKeeperMockRecorder) AppendSendRestriction(restriction interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppendSendRestriction", reflect.TypeOf((*BankKeeper)(nil).AppendSendRestriction), restriction) } -// DenomMetadata provides a mock function with given fields: _a0, _a1 -func (_m *BankKeeper) DenomMetadata(_a0 context.Context, _a1 *types.QueryDenomMetadataRequest) (*types.QueryDenomMetadataResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.QueryDenomMetadataResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryDenomMetadataRequest) (*types.QueryDenomMetadataResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryDenomMetadataRequest) *types.QueryDenomMetadataResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryDenomMetadataResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryDenomMetadataRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 +// Balance mocks base method. +func (m *BankKeeper) Balance(arg0 context.Context, arg1 *types0.QueryBalanceRequest) (*types0.QueryBalanceResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Balance", arg0, arg1) + ret0, _ := ret[0].(*types0.QueryBalanceResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// DenomOwners provides a mock function with given fields: _a0, _a1 -func (_m *BankKeeper) DenomOwners(_a0 context.Context, _a1 *types.QueryDenomOwnersRequest) (*types.QueryDenomOwnersResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.QueryDenomOwnersResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryDenomOwnersRequest) (*types.QueryDenomOwnersResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryDenomOwnersRequest) *types.QueryDenomOwnersResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryDenomOwnersResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryDenomOwnersRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 +// Balance indicates an expected call of Balance. +func (mr *MockBankKeeperMockRecorder) Balance(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Balance", reflect.TypeOf((*BankKeeper)(nil).Balance), arg0, arg1) } -// DenomsMetadata provides a mock function with given fields: _a0, _a1 -func (_m *BankKeeper) DenomsMetadata(_a0 context.Context, _a1 *types.QueryDenomsMetadataRequest) (*types.QueryDenomsMetadataResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.QueryDenomsMetadataResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryDenomsMetadataRequest) (*types.QueryDenomsMetadataResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryDenomsMetadataRequest) *types.QueryDenomsMetadataResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryDenomsMetadataResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryDenomsMetadataRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 +// BlockedAddr mocks base method. +func (m *BankKeeper) BlockedAddr(addr types.AccAddress) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BlockedAddr", addr) + ret0, _ := ret[0].(bool) + return ret0 } -// ExportGenesis provides a mock function with given fields: _a0 -func (_m *BankKeeper) ExportGenesis(_a0 cosmos_sdktypes.Context) *types.GenesisState { - ret := _m.Called(_a0) - - var r0 *types.GenesisState - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) *types.GenesisState); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.GenesisState) - } - } - - return r0 +// BlockedAddr indicates an expected call of BlockedAddr. +func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockedAddr", reflect.TypeOf((*BankKeeper)(nil).BlockedAddr), addr) } -// GetAccountsBalances provides a mock function with given fields: ctx -func (_m *BankKeeper) GetAccountsBalances(ctx cosmos_sdktypes.Context) []types.Balance { - ret := _m.Called(ctx) - - var r0 []types.Balance - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) []types.Balance); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]types.Balance) - } - } - - return r0 +// BurnCoins mocks base method. +func (m *BankKeeper) BurnCoins(ctx context.Context, moduleName string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BurnCoins", ctx, moduleName, amt) + ret0, _ := ret[0].(error) + return ret0 } -// GetAllBalances provides a mock function with given fields: ctx, addr -func (_m *BankKeeper) GetAllBalances(ctx cosmos_sdktypes.Context, addr cosmos_sdktypes.AccAddress) cosmos_sdktypes.Coins { - ret := _m.Called(ctx, addr) - - var r0 cosmos_sdktypes.Coins - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.AccAddress) cosmos_sdktypes.Coins); ok { - r0 = rf(ctx, addr) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(cosmos_sdktypes.Coins) - } - } - - return r0 +// BurnCoins indicates an expected call of BurnCoins. +func (mr *MockBankKeeperMockRecorder) BurnCoins(ctx, moduleName, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BurnCoins", reflect.TypeOf((*BankKeeper)(nil).BurnCoins), ctx, moduleName, amt) } -// GetAllDenomMetaData provides a mock function with given fields: ctx -func (_m *BankKeeper) GetAllDenomMetaData(ctx cosmos_sdktypes.Context) []types.Metadata { - ret := _m.Called(ctx) - - var r0 []types.Metadata - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) []types.Metadata); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]types.Metadata) - } - } - - return r0 +// ClearSendRestriction mocks base method. +func (m *BankKeeper) ClearSendRestriction() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "ClearSendRestriction") } -// GetAllSendEnabledEntries provides a mock function with given fields: ctx -func (_m *BankKeeper) GetAllSendEnabledEntries(ctx cosmos_sdktypes.Context) []types.SendEnabled { - ret := _m.Called(ctx) - - var r0 []types.SendEnabled - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) []types.SendEnabled); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]types.SendEnabled) - } - } - - return r0 +// ClearSendRestriction indicates an expected call of ClearSendRestriction. +func (mr *MockBankKeeperMockRecorder) ClearSendRestriction() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClearSendRestriction", reflect.TypeOf((*BankKeeper)(nil).ClearSendRestriction)) } -// GetAuthority provides a mock function with given fields: -func (_m *BankKeeper) GetAuthority() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 +// DelegateCoins mocks base method. +func (m *BankKeeper) DelegateCoins(ctx context.Context, delegatorAddr, moduleAccAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DelegateCoins", ctx, delegatorAddr, moduleAccAddr, amt) + ret0, _ := ret[0].(error) + return ret0 } -// GetBalance provides a mock function with given fields: ctx, addr, denom -func (_m *BankKeeper) GetBalance(ctx cosmos_sdktypes.Context, addr cosmos_sdktypes.AccAddress, denom string) cosmos_sdktypes.Coin { - ret := _m.Called(ctx, addr, denom) - - var r0 cosmos_sdktypes.Coin - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.AccAddress, string) cosmos_sdktypes.Coin); ok { - r0 = rf(ctx, addr, denom) - } else { - r0 = ret.Get(0).(cosmos_sdktypes.Coin) - } - - return r0 +// DelegateCoins indicates an expected call of DelegateCoins. +func (mr *MockBankKeeperMockRecorder) DelegateCoins(ctx, delegatorAddr, moduleAccAddr, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelegateCoins", reflect.TypeOf((*BankKeeper)(nil).DelegateCoins), ctx, delegatorAddr, moduleAccAddr, amt) } -// GetBlockedAddresses provides a mock function with given fields: -func (_m *BankKeeper) GetBlockedAddresses() map[string]bool { - ret := _m.Called() - - var r0 map[string]bool - if rf, ok := ret.Get(0).(func() map[string]bool); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]bool) - } - } - - return r0 +// DelegateCoinsFromAccountToModule mocks base method. +func (m *BankKeeper) DelegateCoinsFromAccountToModule(ctx context.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DelegateCoinsFromAccountToModule", ctx, senderAddr, recipientModule, amt) + ret0, _ := ret[0].(error) + return ret0 } -// GetDenomMetaData provides a mock function with given fields: ctx, denom -func (_m *BankKeeper) GetDenomMetaData(ctx cosmos_sdktypes.Context, denom string) (types.Metadata, bool) { - ret := _m.Called(ctx, denom) - - var r0 types.Metadata - var r1 bool - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string) (types.Metadata, bool)); ok { - return rf(ctx, denom) - } - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string) types.Metadata); ok { - r0 = rf(ctx, denom) - } else { - r0 = ret.Get(0).(types.Metadata) - } - - if rf, ok := ret.Get(1).(func(cosmos_sdktypes.Context, string) bool); ok { - r1 = rf(ctx, denom) - } else { - r1 = ret.Get(1).(bool) - } - - return r0, r1 +// DelegateCoinsFromAccountToModule indicates an expected call of DelegateCoinsFromAccountToModule. +func (mr *MockBankKeeperMockRecorder) DelegateCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelegateCoinsFromAccountToModule", reflect.TypeOf((*BankKeeper)(nil).DelegateCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) } -// GetPaginatedTotalSupply provides a mock function with given fields: ctx, pagination -func (_m *BankKeeper) GetPaginatedTotalSupply(ctx cosmos_sdktypes.Context, pagination *query.PageRequest) (cosmos_sdktypes.Coins, *query.PageResponse, error) { - ret := _m.Called(ctx, pagination) - - var r0 cosmos_sdktypes.Coins - var r1 *query.PageResponse - var r2 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, *query.PageRequest) (cosmos_sdktypes.Coins, *query.PageResponse, error)); ok { - return rf(ctx, pagination) - } - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, *query.PageRequest) cosmos_sdktypes.Coins); ok { - r0 = rf(ctx, pagination) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(cosmos_sdktypes.Coins) - } +// DeleteSendEnabled mocks base method. +func (m *BankKeeper) DeleteSendEnabled(ctx context.Context, denoms ...string) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range denoms { + varargs = append(varargs, a) } + m.ctrl.Call(m, "DeleteSendEnabled", varargs...) +} - if rf, ok := ret.Get(1).(func(cosmos_sdktypes.Context, *query.PageRequest) *query.PageResponse); ok { - r1 = rf(ctx, pagination) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*query.PageResponse) - } - } +// DeleteSendEnabled indicates an expected call of DeleteSendEnabled. +func (mr *MockBankKeeperMockRecorder) DeleteSendEnabled(ctx interface{}, denoms ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, denoms...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSendEnabled", reflect.TypeOf((*BankKeeper)(nil).DeleteSendEnabled), varargs...) +} - if rf, ok := ret.Get(2).(func(cosmos_sdktypes.Context, *query.PageRequest) error); ok { - r2 = rf(ctx, pagination) - } else { - r2 = ret.Error(2) - } +// DenomMetadata mocks base method. +func (m *BankKeeper) DenomMetadata(arg0 context.Context, arg1 *types0.QueryDenomMetadataRequest) (*types0.QueryDenomMetadataResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DenomMetadata", arg0, arg1) + ret0, _ := ret[0].(*types0.QueryDenomMetadataResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} - return r0, r1, r2 +// DenomMetadata indicates an expected call of DenomMetadata. +func (mr *MockBankKeeperMockRecorder) DenomMetadata(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DenomMetadata", reflect.TypeOf((*BankKeeper)(nil).DenomMetadata), arg0, arg1) } -// GetParams provides a mock function with given fields: ctx -func (_m *BankKeeper) GetParams(ctx cosmos_sdktypes.Context) types.Params { - ret := _m.Called(ctx) +// DenomMetadataByQueryString mocks base method. +func (m *BankKeeper) DenomMetadataByQueryString(arg0 context.Context, arg1 *types0.QueryDenomMetadataByQueryStringRequest) (*types0.QueryDenomMetadataByQueryStringResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DenomMetadataByQueryString", arg0, arg1) + ret0, _ := ret[0].(*types0.QueryDenomMetadataByQueryStringResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} - var r0 types.Params - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) types.Params); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(types.Params) - } +// DenomMetadataByQueryString indicates an expected call of DenomMetadataByQueryString. +func (mr *MockBankKeeperMockRecorder) DenomMetadataByQueryString(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DenomMetadataByQueryString", reflect.TypeOf((*BankKeeper)(nil).DenomMetadataByQueryString), arg0, arg1) +} - return r0 +// DenomOwners mocks base method. +func (m *BankKeeper) DenomOwners(arg0 context.Context, arg1 *types0.QueryDenomOwnersRequest) (*types0.QueryDenomOwnersResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DenomOwners", arg0, arg1) + ret0, _ := ret[0].(*types0.QueryDenomOwnersResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// GetSendEnabledEntry provides a mock function with given fields: ctx, denom -func (_m *BankKeeper) GetSendEnabledEntry(ctx cosmos_sdktypes.Context, denom string) (types.SendEnabled, bool) { - ret := _m.Called(ctx, denom) +// DenomOwners indicates an expected call of DenomOwners. +func (mr *MockBankKeeperMockRecorder) DenomOwners(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DenomOwners", reflect.TypeOf((*BankKeeper)(nil).DenomOwners), arg0, arg1) +} - var r0 types.SendEnabled - var r1 bool - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string) (types.SendEnabled, bool)); ok { - return rf(ctx, denom) - } - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string) types.SendEnabled); ok { - r0 = rf(ctx, denom) - } else { - r0 = ret.Get(0).(types.SendEnabled) - } +// DenomsMetadata mocks base method. +func (m *BankKeeper) DenomsMetadata(arg0 context.Context, arg1 *types0.QueryDenomsMetadataRequest) (*types0.QueryDenomsMetadataResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DenomsMetadata", arg0, arg1) + ret0, _ := ret[0].(*types0.QueryDenomsMetadataResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} - if rf, ok := ret.Get(1).(func(cosmos_sdktypes.Context, string) bool); ok { - r1 = rf(ctx, denom) - } else { - r1 = ret.Get(1).(bool) - } +// DenomsMetadata indicates an expected call of DenomsMetadata. +func (mr *MockBankKeeperMockRecorder) DenomsMetadata(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DenomsMetadata", reflect.TypeOf((*BankKeeper)(nil).DenomsMetadata), arg0, arg1) +} - return r0, r1 +// ExportGenesis mocks base method. +func (m *BankKeeper) ExportGenesis(arg0 context.Context) *types0.GenesisState { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ExportGenesis", arg0) + ret0, _ := ret[0].(*types0.GenesisState) + return ret0 } -// GetSupply provides a mock function with given fields: ctx, denom -func (_m *BankKeeper) GetSupply(ctx cosmos_sdktypes.Context, denom string) cosmos_sdktypes.Coin { - ret := _m.Called(ctx, denom) +// ExportGenesis indicates an expected call of ExportGenesis. +func (mr *MockBankKeeperMockRecorder) ExportGenesis(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*BankKeeper)(nil).ExportGenesis), arg0) +} - var r0 cosmos_sdktypes.Coin - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string) cosmos_sdktypes.Coin); ok { - r0 = rf(ctx, denom) - } else { - r0 = ret.Get(0).(cosmos_sdktypes.Coin) - } +// GetAccountsBalances mocks base method. +func (m *BankKeeper) GetAccountsBalances(ctx context.Context) []types0.Balance { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccountsBalances", ctx) + ret0, _ := ret[0].([]types0.Balance) + return ret0 +} - return r0 +// GetAccountsBalances indicates an expected call of GetAccountsBalances. +func (mr *MockBankKeeperMockRecorder) GetAccountsBalances(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountsBalances", reflect.TypeOf((*BankKeeper)(nil).GetAccountsBalances), ctx) } -// HasBalance provides a mock function with given fields: ctx, addr, amt -func (_m *BankKeeper) HasBalance(ctx cosmos_sdktypes.Context, addr cosmos_sdktypes.AccAddress, amt cosmos_sdktypes.Coin) bool { - ret := _m.Called(ctx, addr, amt) +// GetAllBalances mocks base method. +func (m *BankKeeper) GetAllBalances(ctx context.Context, addr types.AccAddress) types.Coins { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllBalances", ctx, addr) + ret0, _ := ret[0].(types.Coins) + return ret0 +} - var r0 bool - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.AccAddress, cosmos_sdktypes.Coin) bool); ok { - r0 = rf(ctx, addr, amt) - } else { - r0 = ret.Get(0).(bool) - } +// GetAllBalances indicates an expected call of GetAllBalances. +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*BankKeeper)(nil).GetAllBalances), ctx, addr) +} - return r0 +// GetAllDenomMetaData mocks base method. +func (m *BankKeeper) GetAllDenomMetaData(ctx context.Context) []types0.Metadata { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllDenomMetaData", ctx) + ret0, _ := ret[0].([]types0.Metadata) + return ret0 } -// HasDenomMetaData provides a mock function with given fields: ctx, denom -func (_m *BankKeeper) HasDenomMetaData(ctx cosmos_sdktypes.Context, denom string) bool { - ret := _m.Called(ctx, denom) +// GetAllDenomMetaData indicates an expected call of GetAllDenomMetaData. +func (mr *MockBankKeeperMockRecorder) GetAllDenomMetaData(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllDenomMetaData", reflect.TypeOf((*BankKeeper)(nil).GetAllDenomMetaData), ctx) +} - var r0 bool - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string) bool); ok { - r0 = rf(ctx, denom) - } else { - r0 = ret.Get(0).(bool) - } +// GetAllSendEnabledEntries mocks base method. +func (m *BankKeeper) GetAllSendEnabledEntries(ctx context.Context) []types0.SendEnabled { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllSendEnabledEntries", ctx) + ret0, _ := ret[0].([]types0.SendEnabled) + return ret0 +} - return r0 +// GetAllSendEnabledEntries indicates an expected call of GetAllSendEnabledEntries. +func (mr *MockBankKeeperMockRecorder) GetAllSendEnabledEntries(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllSendEnabledEntries", reflect.TypeOf((*BankKeeper)(nil).GetAllSendEnabledEntries), ctx) } -// HasSupply provides a mock function with given fields: ctx, denom -func (_m *BankKeeper) HasSupply(ctx cosmos_sdktypes.Context, denom string) bool { - ret := _m.Called(ctx, denom) +// GetAuthority mocks base method. +func (m *BankKeeper) GetAuthority() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthority") + ret0, _ := ret[0].(string) + return ret0 +} - var r0 bool - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string) bool); ok { - r0 = rf(ctx, denom) - } else { - r0 = ret.Get(0).(bool) - } +// GetAuthority indicates an expected call of GetAuthority. +func (mr *MockBankKeeperMockRecorder) GetAuthority() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthority", reflect.TypeOf((*BankKeeper)(nil).GetAuthority)) +} - return r0 +// GetBalance mocks base method. +func (m *BankKeeper) GetBalance(ctx context.Context, addr types.AccAddress, denom string) types.Coin { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBalance", ctx, addr, denom) + ret0, _ := ret[0].(types.Coin) + return ret0 } -// InitGenesis provides a mock function with given fields: _a0, _a1 -func (_m *BankKeeper) InitGenesis(_a0 cosmos_sdktypes.Context, _a1 *types.GenesisState) { - _m.Called(_a0, _a1) +// GetBalance indicates an expected call of GetBalance. +func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalance", reflect.TypeOf((*BankKeeper)(nil).GetBalance), ctx, addr, denom) } -// InputOutputCoins provides a mock function with given fields: ctx, inputs, outputs -func (_m *BankKeeper) InputOutputCoins(ctx cosmos_sdktypes.Context, inputs []types.Input, outputs []types.Output) error { - ret := _m.Called(ctx, inputs, outputs) +// GetBlockedAddresses mocks base method. +func (m *BankKeeper) GetBlockedAddresses() map[string]bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBlockedAddresses") + ret0, _ := ret[0].(map[string]bool) + return ret0 +} - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, []types.Input, []types.Output) error); ok { - r0 = rf(ctx, inputs, outputs) - } else { - r0 = ret.Error(0) - } +// GetBlockedAddresses indicates an expected call of GetBlockedAddresses. +func (mr *MockBankKeeperMockRecorder) GetBlockedAddresses() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockedAddresses", reflect.TypeOf((*BankKeeper)(nil).GetBlockedAddresses)) +} - return r0 +// GetDenomMetaData mocks base method. +func (m *BankKeeper) GetDenomMetaData(ctx context.Context, denom string) (types0.Metadata, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDenomMetaData", ctx, denom) + ret0, _ := ret[0].(types0.Metadata) + ret1, _ := ret[1].(bool) + return ret0, ret1 } -// IsSendEnabledCoin provides a mock function with given fields: ctx, coin -func (_m *BankKeeper) IsSendEnabledCoin(ctx cosmos_sdktypes.Context, coin cosmos_sdktypes.Coin) bool { - ret := _m.Called(ctx, coin) +// GetDenomMetaData indicates an expected call of GetDenomMetaData. +func (mr *MockBankKeeperMockRecorder) GetDenomMetaData(ctx, denom interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDenomMetaData", reflect.TypeOf((*BankKeeper)(nil).GetDenomMetaData), ctx, denom) +} - var r0 bool - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.Coin) bool); ok { - r0 = rf(ctx, coin) - } else { - r0 = ret.Get(0).(bool) - } +// GetPaginatedTotalSupply mocks base method. +func (m *BankKeeper) GetPaginatedTotalSupply(ctx context.Context, pagination *query.PageRequest) (types.Coins, *query.PageResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPaginatedTotalSupply", ctx, pagination) + ret0, _ := ret[0].(types.Coins) + ret1, _ := ret[1].(*query.PageResponse) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} - return r0 +// GetPaginatedTotalSupply indicates an expected call of GetPaginatedTotalSupply. +func (mr *MockBankKeeperMockRecorder) GetPaginatedTotalSupply(ctx, pagination interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPaginatedTotalSupply", reflect.TypeOf((*BankKeeper)(nil).GetPaginatedTotalSupply), ctx, pagination) } -// IsSendEnabledCoins provides a mock function with given fields: ctx, coins -func (_m *BankKeeper) IsSendEnabledCoins(ctx cosmos_sdktypes.Context, coins ...cosmos_sdktypes.Coin) error { - _va := make([]interface{}, len(coins)) - for _i := range coins { - _va[_i] = coins[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, ...cosmos_sdktypes.Coin) error); ok { - r0 = rf(ctx, coins...) - } else { - r0 = ret.Error(0) - } +// GetParams mocks base method. +func (m *BankKeeper) GetParams(ctx context.Context) types0.Params { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetParams", ctx) + ret0, _ := ret[0].(types0.Params) + return ret0 +} - return r0 +// GetParams indicates an expected call of GetParams. +func (mr *MockBankKeeperMockRecorder) GetParams(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParams", reflect.TypeOf((*BankKeeper)(nil).GetParams), ctx) } -// IsSendEnabledDenom provides a mock function with given fields: ctx, denom -func (_m *BankKeeper) IsSendEnabledDenom(ctx cosmos_sdktypes.Context, denom string) bool { - ret := _m.Called(ctx, denom) +// GetSendEnabledEntry mocks base method. +func (m *BankKeeper) GetSendEnabledEntry(ctx context.Context, denom string) (types0.SendEnabled, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSendEnabledEntry", ctx, denom) + ret0, _ := ret[0].(types0.SendEnabled) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} - var r0 bool - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string) bool); ok { - r0 = rf(ctx, denom) - } else { - r0 = ret.Get(0).(bool) - } +// GetSendEnabledEntry indicates an expected call of GetSendEnabledEntry. +func (mr *MockBankKeeperMockRecorder) GetSendEnabledEntry(ctx, denom interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSendEnabledEntry", reflect.TypeOf((*BankKeeper)(nil).GetSendEnabledEntry), ctx, denom) +} - return r0 +// GetSupply mocks base method. +func (m *BankKeeper) GetSupply(ctx context.Context, denom string) types.Coin { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSupply", ctx, denom) + ret0, _ := ret[0].(types.Coin) + return ret0 } -// IterateAccountBalances provides a mock function with given fields: ctx, addr, cb -func (_m *BankKeeper) IterateAccountBalances(ctx cosmos_sdktypes.Context, addr cosmos_sdktypes.AccAddress, cb func(cosmos_sdktypes.Coin) bool) { - _m.Called(ctx, addr, cb) +// GetSupply indicates an expected call of GetSupply. +func (mr *MockBankKeeperMockRecorder) GetSupply(ctx, denom interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSupply", reflect.TypeOf((*BankKeeper)(nil).GetSupply), ctx, denom) } -// IterateAllBalances provides a mock function with given fields: ctx, cb -func (_m *BankKeeper) IterateAllBalances(ctx cosmos_sdktypes.Context, cb func(cosmos_sdktypes.AccAddress, cosmos_sdktypes.Coin) bool) { - _m.Called(ctx, cb) +// HasBalance mocks base method. +func (m *BankKeeper) HasBalance(ctx context.Context, addr types.AccAddress, amt types.Coin) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HasBalance", ctx, addr, amt) + ret0, _ := ret[0].(bool) + return ret0 } -// IterateAllDenomMetaData provides a mock function with given fields: ctx, cb -func (_m *BankKeeper) IterateAllDenomMetaData(ctx cosmos_sdktypes.Context, cb func(types.Metadata) bool) { - _m.Called(ctx, cb) +// HasBalance indicates an expected call of HasBalance. +func (mr *MockBankKeeperMockRecorder) HasBalance(ctx, addr, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasBalance", reflect.TypeOf((*BankKeeper)(nil).HasBalance), ctx, addr, amt) } -// IterateSendEnabledEntries provides a mock function with given fields: ctx, cb -func (_m *BankKeeper) IterateSendEnabledEntries(ctx cosmos_sdktypes.Context, cb func(string, bool) bool) { - _m.Called(ctx, cb) +// HasDenomMetaData mocks base method. +func (m *BankKeeper) HasDenomMetaData(ctx context.Context, denom string) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HasDenomMetaData", ctx, denom) + ret0, _ := ret[0].(bool) + return ret0 } -// IterateTotalSupply provides a mock function with given fields: ctx, cb -func (_m *BankKeeper) IterateTotalSupply(ctx cosmos_sdktypes.Context, cb func(cosmos_sdktypes.Coin) bool) { - _m.Called(ctx, cb) +// HasDenomMetaData indicates an expected call of HasDenomMetaData. +func (mr *MockBankKeeperMockRecorder) HasDenomMetaData(ctx, denom interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasDenomMetaData", reflect.TypeOf((*BankKeeper)(nil).HasDenomMetaData), ctx, denom) } -// LockedCoins provides a mock function with given fields: ctx, addr -func (_m *BankKeeper) LockedCoins(ctx cosmos_sdktypes.Context, addr cosmos_sdktypes.AccAddress) cosmos_sdktypes.Coins { - ret := _m.Called(ctx, addr) +// HasSupply mocks base method. +func (m *BankKeeper) HasSupply(ctx context.Context, denom string) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HasSupply", ctx, denom) + ret0, _ := ret[0].(bool) + return ret0 +} - var r0 cosmos_sdktypes.Coins - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.AccAddress) cosmos_sdktypes.Coins); ok { - r0 = rf(ctx, addr) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(cosmos_sdktypes.Coins) - } - } +// HasSupply indicates an expected call of HasSupply. +func (mr *MockBankKeeperMockRecorder) HasSupply(ctx, denom interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasSupply", reflect.TypeOf((*BankKeeper)(nil).HasSupply), ctx, denom) +} - return r0 +// InitGenesis mocks base method. +func (m *BankKeeper) InitGenesis(arg0 context.Context, arg1 *types0.GenesisState) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "InitGenesis", arg0, arg1) } -// MintCoins provides a mock function with given fields: ctx, moduleName, amt -func (_m *BankKeeper) MintCoins(ctx cosmos_sdktypes.Context, moduleName string, amt cosmos_sdktypes.Coins) error { - ret := _m.Called(ctx, moduleName, amt) +// InitGenesis indicates an expected call of InitGenesis. +func (mr *MockBankKeeperMockRecorder) InitGenesis(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*BankKeeper)(nil).InitGenesis), arg0, arg1) +} - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string, cosmos_sdktypes.Coins) error); ok { - r0 = rf(ctx, moduleName, amt) - } else { - r0 = ret.Error(0) - } +// InputOutputCoins mocks base method. +func (m *BankKeeper) InputOutputCoins(ctx context.Context, input types0.Input, outputs []types0.Output) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InputOutputCoins", ctx, input, outputs) + ret0, _ := ret[0].(error) + return ret0 +} - return r0 +// InputOutputCoins indicates an expected call of InputOutputCoins. +func (mr *MockBankKeeperMockRecorder) InputOutputCoins(ctx, input, outputs interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InputOutputCoins", reflect.TypeOf((*BankKeeper)(nil).InputOutputCoins), ctx, input, outputs) } -// Params provides a mock function with given fields: _a0, _a1 -func (_m *BankKeeper) Params(_a0 context.Context, _a1 *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - ret := _m.Called(_a0, _a1) +// IsSendEnabledCoin mocks base method. +func (m *BankKeeper) IsSendEnabledCoin(ctx context.Context, coin types.Coin) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsSendEnabledCoin", ctx, coin) + ret0, _ := ret[0].(bool) + return ret0 +} - var r0 *types.QueryParamsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryParamsRequest) (*types.QueryParamsResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryParamsRequest) *types.QueryParamsResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryParamsResponse) - } - } +// IsSendEnabledCoin indicates an expected call of IsSendEnabledCoin. +func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoin(ctx, coin interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSendEnabledCoin", reflect.TypeOf((*BankKeeper)(nil).IsSendEnabledCoin), ctx, coin) +} - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryParamsRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) +// IsSendEnabledCoins mocks base method. +func (m *BankKeeper) IsSendEnabledCoins(ctx context.Context, coins ...types.Coin) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range coins { + varargs = append(varargs, a) } + ret := m.ctrl.Call(m, "IsSendEnabledCoins", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} - return r0, r1 +// IsSendEnabledCoins indicates an expected call of IsSendEnabledCoins. +func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoins(ctx interface{}, coins ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, coins...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSendEnabledCoins", reflect.TypeOf((*BankKeeper)(nil).IsSendEnabledCoins), varargs...) } -// SendCoins provides a mock function with given fields: ctx, fromAddr, toAddr, amt -func (_m *BankKeeper) SendCoins(ctx cosmos_sdktypes.Context, fromAddr cosmos_sdktypes.AccAddress, toAddr cosmos_sdktypes.AccAddress, amt cosmos_sdktypes.Coins) error { - ret := _m.Called(ctx, fromAddr, toAddr, amt) +// IsSendEnabledDenom mocks base method. +func (m *BankKeeper) IsSendEnabledDenom(ctx context.Context, denom string) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsSendEnabledDenom", ctx, denom) + ret0, _ := ret[0].(bool) + return ret0 +} - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.AccAddress, cosmos_sdktypes.AccAddress, cosmos_sdktypes.Coins) error); ok { - r0 = rf(ctx, fromAddr, toAddr, amt) - } else { - r0 = ret.Error(0) - } +// IsSendEnabledDenom indicates an expected call of IsSendEnabledDenom. +func (mr *MockBankKeeperMockRecorder) IsSendEnabledDenom(ctx, denom interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSendEnabledDenom", reflect.TypeOf((*BankKeeper)(nil).IsSendEnabledDenom), ctx, denom) +} - return r0 +// IterateAccountBalances mocks base method. +func (m *BankKeeper) IterateAccountBalances(ctx context.Context, addr types.AccAddress, cb func(types.Coin) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateAccountBalances", ctx, addr, cb) } -// SendCoinsFromAccountToModule provides a mock function with given fields: ctx, senderAddr, recipientModule, amt -func (_m *BankKeeper) SendCoinsFromAccountToModule(ctx cosmos_sdktypes.Context, senderAddr cosmos_sdktypes.AccAddress, recipientModule string, amt cosmos_sdktypes.Coins) error { - ret := _m.Called(ctx, senderAddr, recipientModule, amt) +// IterateAccountBalances indicates an expected call of IterateAccountBalances. +func (mr *MockBankKeeperMockRecorder) IterateAccountBalances(ctx, addr, cb interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccountBalances", reflect.TypeOf((*BankKeeper)(nil).IterateAccountBalances), ctx, addr, cb) +} - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.AccAddress, string, cosmos_sdktypes.Coins) error); ok { - r0 = rf(ctx, senderAddr, recipientModule, amt) - } else { - r0 = ret.Error(0) - } +// IterateAllBalances mocks base method. +func (m *BankKeeper) IterateAllBalances(ctx context.Context, cb func(types.AccAddress, types.Coin) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateAllBalances", ctx, cb) +} - return r0 +// IterateAllBalances indicates an expected call of IterateAllBalances. +func (mr *MockBankKeeperMockRecorder) IterateAllBalances(ctx, cb interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAllBalances", reflect.TypeOf((*BankKeeper)(nil).IterateAllBalances), ctx, cb) } -// SendCoinsFromModuleToAccount provides a mock function with given fields: ctx, senderModule, recipientAddr, amt -func (_m *BankKeeper) SendCoinsFromModuleToAccount(ctx cosmos_sdktypes.Context, senderModule string, recipientAddr cosmos_sdktypes.AccAddress, amt cosmos_sdktypes.Coins) error { - ret := _m.Called(ctx, senderModule, recipientAddr, amt) +// IterateAllDenomMetaData mocks base method. +func (m *BankKeeper) IterateAllDenomMetaData(ctx context.Context, cb func(types0.Metadata) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateAllDenomMetaData", ctx, cb) +} - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string, cosmos_sdktypes.AccAddress, cosmos_sdktypes.Coins) error); ok { - r0 = rf(ctx, senderModule, recipientAddr, amt) - } else { - r0 = ret.Error(0) - } +// IterateAllDenomMetaData indicates an expected call of IterateAllDenomMetaData. +func (mr *MockBankKeeperMockRecorder) IterateAllDenomMetaData(ctx, cb interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAllDenomMetaData", reflect.TypeOf((*BankKeeper)(nil).IterateAllDenomMetaData), ctx, cb) +} - return r0 +// IterateSendEnabledEntries mocks base method. +func (m *BankKeeper) IterateSendEnabledEntries(ctx context.Context, cb func(string, bool) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateSendEnabledEntries", ctx, cb) } -// SendCoinsFromModuleToModule provides a mock function with given fields: ctx, senderModule, recipientModule, amt -func (_m *BankKeeper) SendCoinsFromModuleToModule(ctx cosmos_sdktypes.Context, senderModule string, recipientModule string, amt cosmos_sdktypes.Coins) error { - ret := _m.Called(ctx, senderModule, recipientModule, amt) +// IterateSendEnabledEntries indicates an expected call of IterateSendEnabledEntries. +func (mr *MockBankKeeperMockRecorder) IterateSendEnabledEntries(ctx, cb interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateSendEnabledEntries", reflect.TypeOf((*BankKeeper)(nil).IterateSendEnabledEntries), ctx, cb) +} - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string, string, cosmos_sdktypes.Coins) error); ok { - r0 = rf(ctx, senderModule, recipientModule, amt) - } else { - r0 = ret.Error(0) - } +// IterateTotalSupply mocks base method. +func (m *BankKeeper) IterateTotalSupply(ctx context.Context, cb func(types.Coin) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateTotalSupply", ctx, cb) +} - return r0 +// IterateTotalSupply indicates an expected call of IterateTotalSupply. +func (mr *MockBankKeeperMockRecorder) IterateTotalSupply(ctx, cb interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateTotalSupply", reflect.TypeOf((*BankKeeper)(nil).IterateTotalSupply), ctx, cb) } -// SendEnabled provides a mock function with given fields: _a0, _a1 -func (_m *BankKeeper) SendEnabled(_a0 context.Context, _a1 *types.QuerySendEnabledRequest) (*types.QuerySendEnabledResponse, error) { - ret := _m.Called(_a0, _a1) +// LockedCoins mocks base method. +func (m *BankKeeper) LockedCoins(ctx context.Context, addr types.AccAddress) types.Coins { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LockedCoins", ctx, addr) + ret0, _ := ret[0].(types.Coins) + return ret0 +} - var r0 *types.QuerySendEnabledResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySendEnabledRequest) (*types.QuerySendEnabledResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySendEnabledRequest) *types.QuerySendEnabledResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QuerySendEnabledResponse) - } - } +// LockedCoins indicates an expected call of LockedCoins. +func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LockedCoins", reflect.TypeOf((*BankKeeper)(nil).LockedCoins), ctx, addr) +} - if rf, ok := ret.Get(1).(func(context.Context, *types.QuerySendEnabledRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } +// MintCoins mocks base method. +func (m *BankKeeper) MintCoins(ctx context.Context, moduleName string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MintCoins", ctx, moduleName, amt) + ret0, _ := ret[0].(error) + return ret0 +} - return r0, r1 +// MintCoins indicates an expected call of MintCoins. +func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MintCoins", reflect.TypeOf((*BankKeeper)(nil).MintCoins), ctx, moduleName, amt) } -// SetAllSendEnabled provides a mock function with given fields: ctx, sendEnableds -func (_m *BankKeeper) SetAllSendEnabled(ctx cosmos_sdktypes.Context, sendEnableds []*types.SendEnabled) { - _m.Called(ctx, sendEnableds) +// Params mocks base method. +func (m *BankKeeper) Params(arg0 context.Context, arg1 *types0.QueryParamsRequest) (*types0.QueryParamsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Params", arg0, arg1) + ret0, _ := ret[0].(*types0.QueryParamsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// SetDenomMetaData provides a mock function with given fields: ctx, denomMetaData -func (_m *BankKeeper) SetDenomMetaData(ctx cosmos_sdktypes.Context, denomMetaData types.Metadata) { - _m.Called(ctx, denomMetaData) +// Params indicates an expected call of Params. +func (mr *MockBankKeeperMockRecorder) Params(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Params", reflect.TypeOf((*BankKeeper)(nil).Params), arg0, arg1) } -// SetParams provides a mock function with given fields: ctx, params -func (_m *BankKeeper) SetParams(ctx cosmos_sdktypes.Context, params types.Params) error { - ret := _m.Called(ctx, params) +// PrependSendRestriction mocks base method. +func (m *BankKeeper) PrependSendRestriction(restriction types0.SendRestrictionFn) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "PrependSendRestriction", restriction) +} - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, types.Params) error); ok { - r0 = rf(ctx, params) - } else { - r0 = ret.Error(0) - } +// PrependSendRestriction indicates an expected call of PrependSendRestriction. +func (mr *MockBankKeeperMockRecorder) PrependSendRestriction(restriction interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrependSendRestriction", reflect.TypeOf((*BankKeeper)(nil).PrependSendRestriction), restriction) +} - return r0 +// SendCoins mocks base method. +func (m *BankKeeper) SendCoins(ctx context.Context, fromAddr, toAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoins", ctx, fromAddr, toAddr, amt) + ret0, _ := ret[0].(error) + return ret0 } -// SetSendEnabled provides a mock function with given fields: ctx, denom, value -func (_m *BankKeeper) SetSendEnabled(ctx cosmos_sdktypes.Context, denom string, value bool) { - _m.Called(ctx, denom, value) +// SendCoins indicates an expected call of SendCoins. +func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*BankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) } -// SpendableBalanceByDenom provides a mock function with given fields: _a0, _a1 -func (_m *BankKeeper) SpendableBalanceByDenom(_a0 context.Context, _a1 *types.QuerySpendableBalanceByDenomRequest) (*types.QuerySpendableBalanceByDenomResponse, error) { - ret := _m.Called(_a0, _a1) +// SendCoinsFromAccountToModule mocks base method. +func (m *BankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromAccountToModule", ctx, senderAddr, recipientModule, amt) + ret0, _ := ret[0].(error) + return ret0 +} - var r0 *types.QuerySpendableBalanceByDenomResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySpendableBalanceByDenomRequest) (*types.QuerySpendableBalanceByDenomResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySpendableBalanceByDenomRequest) *types.QuerySpendableBalanceByDenomResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QuerySpendableBalanceByDenomResponse) - } - } +// SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*BankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) +} - if rf, ok := ret.Get(1).(func(context.Context, *types.QuerySpendableBalanceByDenomRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } +// SendCoinsFromModuleToAccount mocks base method. +func (m *BankKeeper) SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromModuleToAccount", ctx, senderModule, recipientAddr, amt) + ret0, _ := ret[0].(error) + return ret0 +} - return r0, r1 +// SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*BankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } -// SpendableBalances provides a mock function with given fields: _a0, _a1 -func (_m *BankKeeper) SpendableBalances(_a0 context.Context, _a1 *types.QuerySpendableBalancesRequest) (*types.QuerySpendableBalancesResponse, error) { - ret := _m.Called(_a0, _a1) +// SendCoinsFromModuleToModule mocks base method. +func (m *BankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromModuleToModule", ctx, senderModule, recipientModule, amt) + ret0, _ := ret[0].(error) + return ret0 +} - var r0 *types.QuerySpendableBalancesResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySpendableBalancesRequest) (*types.QuerySpendableBalancesResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySpendableBalancesRequest) *types.QuerySpendableBalancesResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QuerySpendableBalancesResponse) - } - } +// SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToModule. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToModule", reflect.TypeOf((*BankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderModule, recipientModule, amt) +} - if rf, ok := ret.Get(1).(func(context.Context, *types.QuerySpendableBalancesRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } +// SendEnabled mocks base method. +func (m *BankKeeper) SendEnabled(arg0 context.Context, arg1 *types0.QuerySendEnabledRequest) (*types0.QuerySendEnabledResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendEnabled", arg0, arg1) + ret0, _ := ret[0].(*types0.QuerySendEnabledResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} - return r0, r1 +// SendEnabled indicates an expected call of SendEnabled. +func (mr *MockBankKeeperMockRecorder) SendEnabled(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendEnabled", reflect.TypeOf((*BankKeeper)(nil).SendEnabled), arg0, arg1) } -// SpendableCoin provides a mock function with given fields: ctx, addr, denom -func (_m *BankKeeper) SpendableCoin(ctx cosmos_sdktypes.Context, addr cosmos_sdktypes.AccAddress, denom string) cosmos_sdktypes.Coin { - ret := _m.Called(ctx, addr, denom) +// SetAllSendEnabled mocks base method. +func (m *BankKeeper) SetAllSendEnabled(ctx context.Context, sendEnableds []*types0.SendEnabled) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetAllSendEnabled", ctx, sendEnableds) +} - var r0 cosmos_sdktypes.Coin - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.AccAddress, string) cosmos_sdktypes.Coin); ok { - r0 = rf(ctx, addr, denom) - } else { - r0 = ret.Get(0).(cosmos_sdktypes.Coin) - } +// SetAllSendEnabled indicates an expected call of SetAllSendEnabled. +func (mr *MockBankKeeperMockRecorder) SetAllSendEnabled(ctx, sendEnableds interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAllSendEnabled", reflect.TypeOf((*BankKeeper)(nil).SetAllSendEnabled), ctx, sendEnableds) +} - return r0 +// SetDenomMetaData mocks base method. +func (m *BankKeeper) SetDenomMetaData(ctx context.Context, denomMetaData types0.Metadata) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetDenomMetaData", ctx, denomMetaData) } -// SpendableCoins provides a mock function with given fields: ctx, addr -func (_m *BankKeeper) SpendableCoins(ctx cosmos_sdktypes.Context, addr cosmos_sdktypes.AccAddress) cosmos_sdktypes.Coins { - ret := _m.Called(ctx, addr) +// SetDenomMetaData indicates an expected call of SetDenomMetaData. +func (mr *MockBankKeeperMockRecorder) SetDenomMetaData(ctx, denomMetaData interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDenomMetaData", reflect.TypeOf((*BankKeeper)(nil).SetDenomMetaData), ctx, denomMetaData) +} - var r0 cosmos_sdktypes.Coins - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.AccAddress) cosmos_sdktypes.Coins); ok { - r0 = rf(ctx, addr) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(cosmos_sdktypes.Coins) - } - } +// SetParams mocks base method. +func (m *BankKeeper) SetParams(ctx context.Context, params types0.Params) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetParams", ctx, params) + ret0, _ := ret[0].(error) + return ret0 +} - return r0 +// SetParams indicates an expected call of SetParams. +func (mr *MockBankKeeperMockRecorder) SetParams(ctx, params interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetParams", reflect.TypeOf((*BankKeeper)(nil).SetParams), ctx, params) } -// SupplyOf provides a mock function with given fields: _a0, _a1 -func (_m *BankKeeper) SupplyOf(_a0 context.Context, _a1 *types.QuerySupplyOfRequest) (*types.QuerySupplyOfResponse, error) { - ret := _m.Called(_a0, _a1) +// SetSendEnabled mocks base method. +func (m *BankKeeper) SetSendEnabled(ctx context.Context, denom string, value bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetSendEnabled", ctx, denom, value) +} - var r0 *types.QuerySupplyOfResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySupplyOfRequest) (*types.QuerySupplyOfResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySupplyOfRequest) *types.QuerySupplyOfResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QuerySupplyOfResponse) - } - } +// SetSendEnabled indicates an expected call of SetSendEnabled. +func (mr *MockBankKeeperMockRecorder) SetSendEnabled(ctx, denom, value interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSendEnabled", reflect.TypeOf((*BankKeeper)(nil).SetSendEnabled), ctx, denom, value) +} - if rf, ok := ret.Get(1).(func(context.Context, *types.QuerySupplyOfRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } +// SpendableBalanceByDenom mocks base method. +func (m *BankKeeper) SpendableBalanceByDenom(arg0 context.Context, arg1 *types0.QuerySpendableBalanceByDenomRequest) (*types0.QuerySpendableBalanceByDenomResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SpendableBalanceByDenom", arg0, arg1) + ret0, _ := ret[0].(*types0.QuerySpendableBalanceByDenomResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} - return r0, r1 +// SpendableBalanceByDenom indicates an expected call of SpendableBalanceByDenom. +func (mr *MockBankKeeperMockRecorder) SpendableBalanceByDenom(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableBalanceByDenom", reflect.TypeOf((*BankKeeper)(nil).SpendableBalanceByDenom), arg0, arg1) } -// TotalSupply provides a mock function with given fields: _a0, _a1 -func (_m *BankKeeper) TotalSupply(_a0 context.Context, _a1 *types.QueryTotalSupplyRequest) (*types.QueryTotalSupplyResponse, error) { - ret := _m.Called(_a0, _a1) +// SpendableBalances mocks base method. +func (m *BankKeeper) SpendableBalances(arg0 context.Context, arg1 *types0.QuerySpendableBalancesRequest) (*types0.QuerySpendableBalancesResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SpendableBalances", arg0, arg1) + ret0, _ := ret[0].(*types0.QuerySpendableBalancesResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} - var r0 *types.QueryTotalSupplyResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryTotalSupplyRequest) (*types.QueryTotalSupplyResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryTotalSupplyRequest) *types.QueryTotalSupplyResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryTotalSupplyResponse) - } - } +// SpendableBalances indicates an expected call of SpendableBalances. +func (mr *MockBankKeeperMockRecorder) SpendableBalances(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableBalances", reflect.TypeOf((*BankKeeper)(nil).SpendableBalances), arg0, arg1) +} - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryTotalSupplyRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } +// SpendableCoin mocks base method. +func (m *BankKeeper) SpendableCoin(ctx context.Context, addr types.AccAddress, denom string) types.Coin { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SpendableCoin", ctx, addr, denom) + ret0, _ := ret[0].(types.Coin) + return ret0 +} - return r0, r1 +// SpendableCoin indicates an expected call of SpendableCoin. +func (mr *MockBankKeeperMockRecorder) SpendableCoin(ctx, addr, denom interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoin", reflect.TypeOf((*BankKeeper)(nil).SpendableCoin), ctx, addr, denom) } -// UndelegateCoins provides a mock function with given fields: ctx, moduleAccAddr, delegatorAddr, amt -func (_m *BankKeeper) UndelegateCoins(ctx cosmos_sdktypes.Context, moduleAccAddr cosmos_sdktypes.AccAddress, delegatorAddr cosmos_sdktypes.AccAddress, amt cosmos_sdktypes.Coins) error { - ret := _m.Called(ctx, moduleAccAddr, delegatorAddr, amt) +// SpendableCoins mocks base method. +func (m *BankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddress) types.Coins { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SpendableCoins", ctx, addr) + ret0, _ := ret[0].(types.Coins) + return ret0 +} - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.AccAddress, cosmos_sdktypes.AccAddress, cosmos_sdktypes.Coins) error); ok { - r0 = rf(ctx, moduleAccAddr, delegatorAddr, amt) - } else { - r0 = ret.Error(0) - } +// SpendableCoins indicates an expected call of SpendableCoins. +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*BankKeeper)(nil).SpendableCoins), ctx, addr) +} - return r0 +// SupplyOf mocks base method. +func (m *BankKeeper) SupplyOf(arg0 context.Context, arg1 *types0.QuerySupplyOfRequest) (*types0.QuerySupplyOfResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SupplyOf", arg0, arg1) + ret0, _ := ret[0].(*types0.QuerySupplyOfResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// UndelegateCoinsFromModuleToAccount provides a mock function with given fields: ctx, senderModule, recipientAddr, amt -func (_m *BankKeeper) UndelegateCoinsFromModuleToAccount(ctx cosmos_sdktypes.Context, senderModule string, recipientAddr cosmos_sdktypes.AccAddress, amt cosmos_sdktypes.Coins) error { - ret := _m.Called(ctx, senderModule, recipientAddr, amt) +// SupplyOf indicates an expected call of SupplyOf. +func (mr *MockBankKeeperMockRecorder) SupplyOf(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SupplyOf", reflect.TypeOf((*BankKeeper)(nil).SupplyOf), arg0, arg1) +} - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, string, cosmos_sdktypes.AccAddress, cosmos_sdktypes.Coins) error); ok { - r0 = rf(ctx, senderModule, recipientAddr, amt) - } else { - r0 = ret.Error(0) - } +// TotalSupply mocks base method. +func (m *BankKeeper) TotalSupply(arg0 context.Context, arg1 *types0.QueryTotalSupplyRequest) (*types0.QueryTotalSupplyResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TotalSupply", arg0, arg1) + ret0, _ := ret[0].(*types0.QueryTotalSupplyResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} - return r0 +// TotalSupply indicates an expected call of TotalSupply. +func (mr *MockBankKeeperMockRecorder) TotalSupply(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TotalSupply", reflect.TypeOf((*BankKeeper)(nil).TotalSupply), arg0, arg1) } -// ValidateBalance provides a mock function with given fields: ctx, addr -func (_m *BankKeeper) ValidateBalance(ctx cosmos_sdktypes.Context, addr cosmos_sdktypes.AccAddress) error { - ret := _m.Called(ctx, addr) +// UndelegateCoins mocks base method. +func (m *BankKeeper) UndelegateCoins(ctx context.Context, moduleAccAddr, delegatorAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UndelegateCoins", ctx, moduleAccAddr, delegatorAddr, amt) + ret0, _ := ret[0].(error) + return ret0 +} - var r0 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, cosmos_sdktypes.AccAddress) error); ok { - r0 = rf(ctx, addr) - } else { - r0 = ret.Error(0) - } +// UndelegateCoins indicates an expected call of UndelegateCoins. +func (mr *MockBankKeeperMockRecorder) UndelegateCoins(ctx, moduleAccAddr, delegatorAddr, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UndelegateCoins", reflect.TypeOf((*BankKeeper)(nil).UndelegateCoins), ctx, moduleAccAddr, delegatorAddr, amt) +} - return r0 +// UndelegateCoinsFromModuleToAccount mocks base method. +func (m *BankKeeper) UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UndelegateCoinsFromModuleToAccount", ctx, senderModule, recipientAddr, amt) + ret0, _ := ret[0].(error) + return ret0 } -// WithMintCoinsRestriction provides a mock function with given fields: _a0 -func (_m *BankKeeper) WithMintCoinsRestriction(_a0 keeper.MintingRestrictionFn) keeper.BaseKeeper { - ret := _m.Called(_a0) +// UndelegateCoinsFromModuleToAccount indicates an expected call of UndelegateCoinsFromModuleToAccount. +func (mr *MockBankKeeperMockRecorder) UndelegateCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UndelegateCoinsFromModuleToAccount", reflect.TypeOf((*BankKeeper)(nil).UndelegateCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) +} - var r0 keeper.BaseKeeper - if rf, ok := ret.Get(0).(func(keeper.MintingRestrictionFn) keeper.BaseKeeper); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(keeper.BaseKeeper) - } +// ValidateBalance mocks base method. +func (m *BankKeeper) ValidateBalance(ctx context.Context, addr types.AccAddress) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidateBalance", ctx, addr) + ret0, _ := ret[0].(error) + return ret0 +} - return r0 +// ValidateBalance indicates an expected call of ValidateBalance. +func (mr *MockBankKeeperMockRecorder) ValidateBalance(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateBalance", reflect.TypeOf((*BankKeeper)(nil).ValidateBalance), ctx, addr) } -// NewKeeper creates a new instance of BankKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewKeeper(t interface { - mock.TestingT - Cleanup(func()) -}, -) *BankKeeper { - mock := &BankKeeper{} - mock.Mock.Test(t) +// WithMintCoinsRestriction mocks base method. +func (m *BankKeeper) WithMintCoinsRestriction(arg0 types0.MintingRestrictionFn) keeper.BaseKeeper { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WithMintCoinsRestriction", arg0) + ret0, _ := ret[0].(keeper.BaseKeeper) + return ret0 +} - t.Cleanup(func() { mock.AssertExpectations(t) }) +// WithMintCoinsRestriction indicates an expected call of WithMintCoinsRestriction. +func (mr *MockBankKeeperMockRecorder) WithMintCoinsRestriction(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithMintCoinsRestriction", reflect.TypeOf((*BankKeeper)(nil).WithMintCoinsRestriction), arg0) +} - return mock +// DenomOwnersByQuery mocks base method. +func (m *BankKeeper) DenomOwnersByQuery(arg0 context.Context, arg1 *types0.QueryDenomOwnersByQueryRequest) (*types0.QueryDenomOwnersByQueryResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DenomOwnersByQuery", arg0, arg1) + ret0, _ := ret[0].(*types0.QueryDenomOwnersByQueryResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 } diff --git a/x/erc20/types/mocks/EVMKeeper.go b/x/erc20/types/mocks/EVMKeeper.go index 412724b6..a5d4f780 100644 --- a/x/erc20/types/mocks/EVMKeeper.go +++ b/x/erc20/types/mocks/EVMKeeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks @@ -167,6 +167,26 @@ func (_m *EVMKeeper) EstimateGasInternal(c context.Context, req *evmtypes.EthCal return r0, r1 } +// GetAccount provides a mock function with given fields: ctx, address +func (_m *EVMKeeper) GetAccount(ctx types.Context, address common.Address) *statedb.Account { + ret := _m.Called(ctx, address) + + if len(ret) == 0 { + panic("no return value specified for GetAccount") + } + + var r0 *statedb.Account + if rf, ok := ret.Get(0).(func(types.Context, common.Address) *statedb.Account); ok { + r0 = rf(ctx, address) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*statedb.Account) + } + } + + return r0 +} + // GetAccountWithoutBalance provides a mock function with given fields: ctx, addr func (_m *EVMKeeper) GetAccountWithoutBalance(ctx types.Context, addr common.Address) *statedb.Account { ret := _m.Called(ctx, addr) @@ -187,6 +207,26 @@ func (_m *EVMKeeper) GetAccountWithoutBalance(ctx types.Context, addr common.Add return r0 } +// GetCode provides a mock function with given fields: ctx, hash +func (_m *EVMKeeper) GetCode(ctx types.Context, hash common.Hash) []byte { + ret := _m.Called(ctx, hash) + + if len(ret) == 0 { + panic("no return value specified for GetCode") + } + + var r0 []byte + if rf, ok := ret.Get(0).(func(types.Context, common.Hash) []byte); ok { + r0 = rf(ctx, hash) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + return r0 +} + // GetParams provides a mock function with given fields: ctx func (_m *EVMKeeper) GetParams(ctx types.Context) evmtypes.Params { ret := _m.Called(ctx) @@ -223,6 +263,29 @@ func (_m *EVMKeeper) IsAvailableStaticPrecompile(params *evmtypes.Params, addres return r0 } +// SetAccount provides a mock function with given fields: ctx, address, account +func (_m *EVMKeeper) SetAccount(ctx types.Context, address common.Address, account statedb.Account) error { + ret := _m.Called(ctx, address, account) + + if len(ret) == 0 { + panic("no return value specified for SetAccount") + } + + var r0 error + if rf, ok := ret.Get(0).(func(types.Context, common.Address, statedb.Account) error); ok { + r0 = rf(ctx, address, account) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SetCode provides a mock function with given fields: ctx, hash, bytecode +func (_m *EVMKeeper) SetCode(ctx types.Context, hash []byte, bytecode []byte) { + _m.Called(ctx, hash, bytecode) +} + // NewEVMKeeper creates a new instance of EVMKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewEVMKeeper(t interface { diff --git a/x/erc20/types/mocks/MsgClient.go b/x/erc20/types/mocks/MsgClient.go deleted file mode 100644 index df296db2..00000000 --- a/x/erc20/types/mocks/MsgClient.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. - -package mocks - -import ( - context "context" - - grpc "google.golang.org/grpc" - - mock "github.com/stretchr/testify/mock" - - types "github.com/evmos/os/x/erc20/types" -) - -// MsgClient is an autogenerated mock type for the MsgClient type -type MsgClient struct { - mock.Mock -} - -// ConvertERC20 provides a mock function with given fields: ctx, in, opts -func (_m *MsgClient) ConvertERC20(ctx context.Context, in *types.MsgConvertERC20, opts ...grpc.CallOption) (*types.MsgConvertERC20Response, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for ConvertERC20") - } - - var r0 *types.MsgConvertERC20Response - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.MsgConvertERC20, ...grpc.CallOption) (*types.MsgConvertERC20Response, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.MsgConvertERC20, ...grpc.CallOption) *types.MsgConvertERC20Response); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.MsgConvertERC20Response) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.MsgConvertERC20, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UpdateParams provides a mock function with given fields: ctx, in, opts -func (_m *MsgClient) UpdateParams(ctx context.Context, in *types.MsgUpdateParams, opts ...grpc.CallOption) (*types.MsgUpdateParamsResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for UpdateParams") - } - - var r0 *types.MsgUpdateParamsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.MsgUpdateParams, ...grpc.CallOption) (*types.MsgUpdateParamsResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.MsgUpdateParams, ...grpc.CallOption) *types.MsgUpdateParamsResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.MsgUpdateParamsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.MsgUpdateParams, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewMsgClient creates a new instance of MsgClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMsgClient(t interface { - mock.TestingT - Cleanup(func()) -}, -) *MsgClient { - mock := &MsgClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/x/erc20/types/mocks/MsgServer.go b/x/erc20/types/mocks/MsgServer.go deleted file mode 100644 index ba2ef8b9..00000000 --- a/x/erc20/types/mocks/MsgServer.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. - -package mocks - -import ( - context "context" - - types "github.com/evmos/os/x/erc20/types" - mock "github.com/stretchr/testify/mock" -) - -// MsgServer is an autogenerated mock type for the MsgServer type -type MsgServer struct { - mock.Mock -} - -// ConvertERC20 provides a mock function with given fields: _a0, _a1 -func (_m *MsgServer) ConvertERC20(_a0 context.Context, _a1 *types.MsgConvertERC20) (*types.MsgConvertERC20Response, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for ConvertERC20") - } - - var r0 *types.MsgConvertERC20Response - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.MsgConvertERC20) (*types.MsgConvertERC20Response, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.MsgConvertERC20) *types.MsgConvertERC20Response); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.MsgConvertERC20Response) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.MsgConvertERC20) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UpdateParams provides a mock function with given fields: _a0, _a1 -func (_m *MsgServer) UpdateParams(_a0 context.Context, _a1 *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateParams") - } - - var r0 *types.MsgUpdateParamsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.MsgUpdateParams) *types.MsgUpdateParamsResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.MsgUpdateParamsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.MsgUpdateParams) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewMsgServer creates a new instance of MsgServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMsgServer(t interface { - mock.TestingT - Cleanup(func()) -}, -) *MsgServer { - mock := &MsgServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/x/erc20/types/mocks/QueryClient.go b/x/erc20/types/mocks/QueryClient.go deleted file mode 100644 index e3d721a1..00000000 --- a/x/erc20/types/mocks/QueryClient.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. - -package mocks - -import ( - context "context" - - grpc "google.golang.org/grpc" - - mock "github.com/stretchr/testify/mock" - - types "github.com/evmos/os/x/erc20/types" -) - -// QueryClient is an autogenerated mock type for the QueryClient type -type QueryClient struct { - mock.Mock -} - -// Params provides a mock function with given fields: ctx, in, opts -func (_m *QueryClient) Params(ctx context.Context, in *types.QueryParamsRequest, opts ...grpc.CallOption) (*types.QueryParamsResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for Params") - } - - var r0 *types.QueryParamsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryParamsRequest, ...grpc.CallOption) (*types.QueryParamsResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryParamsRequest, ...grpc.CallOption) *types.QueryParamsResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryParamsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryParamsRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// TokenPair provides a mock function with given fields: ctx, in, opts -func (_m *QueryClient) TokenPair(ctx context.Context, in *types.QueryTokenPairRequest, opts ...grpc.CallOption) (*types.QueryTokenPairResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for TokenPair") - } - - var r0 *types.QueryTokenPairResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryTokenPairRequest, ...grpc.CallOption) (*types.QueryTokenPairResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryTokenPairRequest, ...grpc.CallOption) *types.QueryTokenPairResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryTokenPairResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryTokenPairRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// TokenPairs provides a mock function with given fields: ctx, in, opts -func (_m *QueryClient) TokenPairs(ctx context.Context, in *types.QueryTokenPairsRequest, opts ...grpc.CallOption) (*types.QueryTokenPairsResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for TokenPairs") - } - - var r0 *types.QueryTokenPairsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryTokenPairsRequest, ...grpc.CallOption) (*types.QueryTokenPairsResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryTokenPairsRequest, ...grpc.CallOption) *types.QueryTokenPairsResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryTokenPairsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryTokenPairsRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewQueryClient creates a new instance of QueryClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewQueryClient(t interface { - mock.TestingT - Cleanup(func()) -}, -) *QueryClient { - mock := &QueryClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/x/erc20/types/mocks/QueryServer.go b/x/erc20/types/mocks/QueryServer.go deleted file mode 100644 index e36b1a64..00000000 --- a/x/erc20/types/mocks/QueryServer.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. - -package mocks - -import ( - context "context" - - types "github.com/evmos/os/x/erc20/types" - mock "github.com/stretchr/testify/mock" -) - -// QueryServer is an autogenerated mock type for the QueryServer type -type QueryServer struct { - mock.Mock -} - -// Params provides a mock function with given fields: _a0, _a1 -func (_m *QueryServer) Params(_a0 context.Context, _a1 *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for Params") - } - - var r0 *types.QueryParamsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryParamsRequest) (*types.QueryParamsResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryParamsRequest) *types.QueryParamsResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryParamsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryParamsRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// TokenPair provides a mock function with given fields: _a0, _a1 -func (_m *QueryServer) TokenPair(_a0 context.Context, _a1 *types.QueryTokenPairRequest) (*types.QueryTokenPairResponse, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for TokenPair") - } - - var r0 *types.QueryTokenPairResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryTokenPairRequest) (*types.QueryTokenPairResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryTokenPairRequest) *types.QueryTokenPairResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryTokenPairResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryTokenPairRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// TokenPairs provides a mock function with given fields: _a0, _a1 -func (_m *QueryServer) TokenPairs(_a0 context.Context, _a1 *types.QueryTokenPairsRequest) (*types.QueryTokenPairsResponse, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for TokenPairs") - } - - var r0 *types.QueryTokenPairsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryTokenPairsRequest) (*types.QueryTokenPairsResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryTokenPairsRequest) *types.QueryTokenPairsResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryTokenPairsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryTokenPairsRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewQueryServer creates a new instance of QueryServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewQueryServer(t interface { - mock.TestingT - Cleanup(func()) -}, -) *QueryServer { - mock := &QueryServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/x/erc20/types/mocks/README.md b/x/erc20/types/mocks/README.md index bc9efbd7..5b7ac575 100644 --- a/x/erc20/types/mocks/README.md +++ b/x/erc20/types/mocks/README.md @@ -1,18 +1,33 @@ # Mocks The mocks in this folder have been generated using the [mockery](https://vektra.github.io/mockery/latest/) tool. -To regenerate the mocks, run the following commands: +To regenerate the mocks, run the following commands at the root of this repository: - `BankKeeper` (from used version of Cosmos SDK): ```bash -git clone https://github.com/evmos/cosmos-sdk.git -cd cosmos-sdk -git checkout v0.47.5 # or the version currently used +# update the currently used version +COSMOS_VERSION="v0.50.9-evmos" +CUR_DIR="$(pwd)" +TMP_DIR="/tmp/tmp-sdk-mocks-$(date +%s)" + +echo "Cloning Cosmos SDK $COSMOS_VERSION into $TMP_DIR..." && +git clone --depth 1 --branch "$COSMOS_VERSION" https://github.com/evmos/cosmos-sdk.git "$TMP_DIR" && +cd "$TMP_DIR" && # Go into bank module and generate mock -cd x/bank -mockery --name Keeper +echo "Generating mocks for bank keeper..." && +cd x/bank/keeper && +mockery --name Keeper && +sed -i '' 's/\([^a-zA-Z]\)Keeper/\1BankKeeper/g' mocks/Keeper.go && +mv mocks/Keeper.go "$CUR_DIR/x/erc20/types/mocks/BankKeeper.go" && + +# Clean up +echo "Cleaning up $TMP_DIR..." && +cd "$CUR_DIR" && +rm -rf "$TMP_DIR" + +echo "Done." ``` - `EVMKeeper` (reduced interface defined in ERC20 types): diff --git a/x/erc20/types/mocks/StakingKeeper.go b/x/erc20/types/mocks/StakingKeeper.go deleted file mode 100644 index f72791b9..00000000 --- a/x/erc20/types/mocks/StakingKeeper.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. - -package mocks - -import ( - types "github.com/cosmos/cosmos-sdk/types" - mock "github.com/stretchr/testify/mock" -) - -// StakingKeeper is an autogenerated mock type for the StakingKeeper type -type StakingKeeper struct { - mock.Mock -} - -// BondDenom provides a mock function with given fields: ctx -func (_m *StakingKeeper) BondDenom(ctx types.Context) string { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for BondDenom") - } - - var r0 string - if rf, ok := ret.Get(0).(func(types.Context) string); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// NewStakingKeeper creates a new instance of StakingKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewStakingKeeper(t interface { - mock.TestingT - Cleanup(func()) -}, -) *StakingKeeper { - mock := &StakingKeeper{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/x/erc20/types/mocks/Subspace.go b/x/erc20/types/mocks/Subspace.go deleted file mode 100644 index 4ea2d889..00000000 --- a/x/erc20/types/mocks/Subspace.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. - -package mocks - -import ( - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - mock "github.com/stretchr/testify/mock" - - types "github.com/cosmos/cosmos-sdk/types" -) - -// Subspace is an autogenerated mock type for the Subspace type -type Subspace struct { - mock.Mock -} - -// GetParamSet provides a mock function with given fields: ctx, ps -func (_m *Subspace) GetParamSet(ctx types.Context, ps paramstypes.ParamSet) { - _m.Called(ctx, ps) -} - -// WithKeyTable provides a mock function with given fields: table -func (_m *Subspace) WithKeyTable(table paramstypes.KeyTable) paramstypes.Subspace { - ret := _m.Called(table) - - if len(ret) == 0 { - panic("no return value specified for WithKeyTable") - } - - var r0 paramstypes.Subspace - if rf, ok := ret.Get(0).(func(paramstypes.KeyTable) paramstypes.Subspace); ok { - r0 = rf(table) - } else { - r0 = ret.Get(0).(paramstypes.Subspace) - } - - return r0 -} - -// NewSubspace creates a new instance of Subspace. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewSubspace(t interface { - mock.TestingT - Cleanup(func()) -}, -) *Subspace { - mock := &Subspace{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/x/erc20/types/msg.go b/x/erc20/types/msg.go index 8b3f735b..6fbb1121 100644 --- a/x/erc20/types/msg.go +++ b/x/erc20/types/msg.go @@ -6,21 +6,35 @@ package types import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" + txsigning "cosmossdk.io/x/tx/signing" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" + erc20api "github.com/evmos/os/api/os/erc20/v1" + protov2 "google.golang.org/protobuf/proto" "github.com/ethereum/go-ethereum/common" ) var ( - _ sdk.Msg = &MsgConvertERC20{} - _ sdk.Msg = &MsgUpdateParams{} + _ sdk.Msg = &MsgConvertERC20{} + _ sdk.Msg = &MsgUpdateParams{} + _ sdk.Msg = &MsgRegisterERC20{} + _ sdk.Msg = &MsgToggleConversion{} + _ sdk.HasValidateBasic = &MsgConvertERC20{} + _ sdk.HasValidateBasic = &MsgUpdateParams{} + _ sdk.HasValidateBasic = &MsgRegisterERC20{} + _ sdk.HasValidateBasic = &MsgToggleConversion{} ) const ( TypeMsgConvertERC20 = "convert_ERC20" ) +var MsgConvertERC20CustomGetSigner = txsigning.CustomGetSigner{ + MsgType: protov2.MessageName(&erc20api.MsgConvertERC20{}), + Fn: erc20api.GetSigners, +} + // NewMsgConvertERC20 creates a new instance of MsgConvertERC20 func NewMsgConvertERC20(amount math.Int, receiver sdk.AccAddress, contract, sender common.Address) *MsgConvertERC20 { //nolint: interfacer return &MsgConvertERC20{ @@ -60,18 +74,6 @@ func (msg MsgConvertERC20) GetSignBytes() []byte { return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) } -// GetSigners defines whose signature is required -func (msg MsgConvertERC20) GetSigners() []sdk.AccAddress { - addr := common.HexToAddress(msg.Sender) - return []sdk.AccAddress{addr.Bytes()} -} - -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { - addr := sdk.MustAccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} - // ValidateBasic does a sanity check of the provided data func (m *MsgUpdateParams) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { @@ -85,3 +87,22 @@ func (m *MsgUpdateParams) ValidateBasic() error { func (m MsgUpdateParams) GetSignBytes() []byte { return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m)) } + +// ValidateBasic does a sanity check of the provided data +func (m *MsgRegisterERC20) ValidateBasic() error { + for _, addr := range m.Erc20Addresses { + if !common.IsHexAddress(addr) { + return errortypes.ErrInvalidAddress.Wrapf("invalid ERC20 contract address: %s", addr) + } + } + return nil +} + +// ValidateBasic does a sanity check of the provided data +func (m *MsgToggleConversion) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "Invalid authority address") + } + + return nil +} diff --git a/x/erc20/types/msg_test.go b/x/erc20/types/msg_test.go index b0ec4145..26dc5370 100644 --- a/x/erc20/types/msg_test.go +++ b/x/erc20/types/msg_test.go @@ -35,7 +35,6 @@ func (suite *MsgsTestSuite) TestMsgConvertERC20Getters() { suite.Require().Equal(types.RouterKey, msg.Route()) suite.Require().Equal(types.TypeMsgConvertERC20, msg.Type()) suite.Require().NotNil(msgInvalid.GetSignBytes()) - suite.Require().NotNil(msg.GetSigners()) } func (suite *MsgsTestSuite) TestMsgConvertERC20New() { diff --git a/x/erc20/types/params_test.go b/x/erc20/types/params_test.go index c31ce484..c70c1868 100644 --- a/x/erc20/types/params_test.go +++ b/x/erc20/types/params_test.go @@ -5,7 +5,8 @@ import ( "testing" "github.com/ethereum/go-ethereum/common" - "github.com/evmos/os/testutil" + exampleapp "github.com/evmos/os/example_chain" + testconstants "github.com/evmos/os/testutil/constants" "github.com/evmos/os/x/erc20/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -41,7 +42,7 @@ func (suite *ParamsTestSuite) TestParamsValidate() { { "valid address - dynamic precompile", func() types.Params { - return types.NewParams(true, []string{}, []string{testutil.WEVMOSContractMainnet}) + return types.NewParams(true, []string{}, []string{testconstants.WEVMOSContractMainnet}) }, false, "", @@ -49,7 +50,7 @@ func (suite *ParamsTestSuite) TestParamsValidate() { { "valid address - native precompile", func() types.Params { - return types.NewParams(true, []string{testutil.WEVMOSContractMainnet}, []string{}) + return types.NewParams(true, []string{testconstants.WEVMOSContractMainnet}, []string{}) }, false, "", @@ -58,7 +59,7 @@ func (suite *ParamsTestSuite) TestParamsValidate() { "sorted address", // order of creation shouldn't matter since it should be sorted when defining new param func() types.Params { - return types.NewParams(true, []string{testutil.WEVMOSContractTestnet, testutil.WEVMOSContractMainnet}, []string{}) + return types.NewParams(true, []string{testconstants.WEVMOSContractTestnet, testconstants.WEVMOSContractMainnet}, []string{}) }, false, "", @@ -67,7 +68,7 @@ func (suite *ParamsTestSuite) TestParamsValidate() { "unsorted address", // order of creation shouldn't matter since it should be sorted when defining new param func() types.Params { - return types.NewParams(true, []string{testutil.WEVMOSContractMainnet, testutil.WEVMOSContractTestnet}, []string{}) + return types.NewParams(true, []string{testconstants.WEVMOSContractMainnet, testconstants.WEVMOSContractTestnet}, []string{}) }, false, "", @@ -97,7 +98,7 @@ func (suite *ParamsTestSuite) TestParamsValidate() { { "repeated address in different params", func() types.Params { - return types.NewParams(true, []string{testutil.WEVMOSContractMainnet}, []string{testutil.WEVMOSContractMainnet}) + return types.NewParams(true, []string{testconstants.WEVMOSContractMainnet}, []string{testconstants.WEVMOSContractMainnet}) }, true, "duplicate precompile", @@ -105,7 +106,7 @@ func (suite *ParamsTestSuite) TestParamsValidate() { { "repeated address - native precompiles", func() types.Params { - return types.NewParams(true, []string{testutil.WEVMOSContractMainnet, testutil.WEVMOSContractMainnet}, []string{}) + return types.NewParams(true, []string{testconstants.WEVMOSContractMainnet, testconstants.WEVMOSContractMainnet}, []string{}) }, true, "duplicate precompile", @@ -113,7 +114,7 @@ func (suite *ParamsTestSuite) TestParamsValidate() { { "repeated address - dynamic precompiles", func() types.Params { - return types.NewParams(true, []string{}, []string{testutil.WEVMOSContractMainnet, testutil.WEVMOSContractMainnet}) + return types.NewParams(true, []string{}, []string{testconstants.WEVMOSContractMainnet, testconstants.WEVMOSContractMainnet}) }, true, "duplicate precompile", @@ -130,7 +131,7 @@ func (suite *ParamsTestSuite) TestParamsValidate() { "unsorted addresses", func() types.Params { params := types.DefaultParams() - params.NativePrecompiles = []string{testutil.WEVMOSContractTestnet, testutil.WEVMOSContractMainnet} + params.NativePrecompiles = []string{testconstants.WEVMOSContractTestnet, testconstants.WEVMOSContractMainnet} return params }, true, @@ -159,17 +160,15 @@ func (suite *ParamsTestSuite) TestIsNativePrecompile() { expRes bool }{ { - "native precompile", - func() types.Params { - return types.NewParams(true, []string{testutil.WEVMOSContractTestnet}, nil) - }, - common.HexToAddress(testutil.WEVMOSContractTestnet), + "default", + func() types.Params { return exampleapp.NewErc20GenesisState().Params }, + common.HexToAddress(testconstants.WEVMOSContractMainnet), true, }, { "not native precompile", func() types.Params { return types.NewParams(true, nil, nil) }, - common.HexToAddress(testutil.WEVMOSContractMainnet), + common.HexToAddress(testconstants.WEVMOSContractMainnet), false, }, { @@ -177,7 +176,7 @@ func (suite *ParamsTestSuite) TestIsNativePrecompile() { func() types.Params { return types.NewParams(true, []string{"0xcc491f589B45d4a3C679016195B3FB87D7848210"}, nil) }, - common.HexToAddress(testutil.WEVMOSContractTestnet), + common.HexToAddress(testconstants.WEVMOSContractTestnet), true, }, { @@ -185,14 +184,16 @@ func (suite *ParamsTestSuite) TestIsNativePrecompile() { func() types.Params { return types.NewParams(true, []string{"0xcc491f589b45d4a3c679016195b3fb87d7848210"}, nil) }, - common.HexToAddress(testutil.WEVMOSContractTestnet), + common.HexToAddress(testconstants.WEVMOSContractTestnet), true, }, } for _, tc := range testCases { - p := tc.malleate() - suite.Require().Equal(tc.expRes, p.IsNativePrecompile(tc.addr), tc.name) + suite.Run(tc.name, func() { + p := tc.malleate() + suite.Require().Equal(tc.expRes, p.IsNativePrecompile(tc.addr), tc.name) + }) } } @@ -206,13 +207,13 @@ func (suite *ParamsTestSuite) TestIsDynamicPrecompile() { { "default - not dynamic precompile", types.DefaultParams, - common.HexToAddress(testutil.WEVMOSContractMainnet), + common.HexToAddress(testconstants.WEVMOSContractMainnet), false, }, { "no dynamic precompiles", func() types.Params { return types.NewParams(true, nil, nil) }, - common.HexToAddress(testutil.WEVMOSContractMainnet), + common.HexToAddress(testconstants.WEVMOSContractMainnet), false, }, { @@ -220,7 +221,7 @@ func (suite *ParamsTestSuite) TestIsDynamicPrecompile() { func() types.Params { return types.NewParams(true, nil, []string{"0xcc491f589B45d4a3C679016195B3FB87D7848210"}) }, - common.HexToAddress(testutil.WEVMOSContractTestnet), + common.HexToAddress(testconstants.WEVMOSContractTestnet), true, }, { @@ -228,14 +229,16 @@ func (suite *ParamsTestSuite) TestIsDynamicPrecompile() { func() types.Params { return types.NewParams(true, nil, []string{"0xcc491f589b45d4a3c679016195b3fb87d7848210"}) }, - common.HexToAddress(testutil.WEVMOSContractTestnet), + common.HexToAddress(testconstants.WEVMOSContractTestnet), true, }, } for _, tc := range testCases { - p := tc.malleate() - suite.Require().Equal(tc.expRes, p.IsDynamicPrecompile(tc.addr), tc.name) + suite.Run(tc.name, func() { + p := tc.malleate() + suite.Require().Equal(tc.expRes, p.IsDynamicPrecompile(tc.addr), tc.name) + }) } } diff --git a/x/erc20/types/proposal.go b/x/erc20/types/proposal.go index 98400774..1d9cce5c 100644 --- a/x/erc20/types/proposal.go +++ b/x/erc20/types/proposal.go @@ -10,7 +10,6 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - govcdc "github.com/cosmos/cosmos-sdk/x/gov/codec" v1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" evmostypes "github.com/evmos/os/types" ) @@ -34,8 +33,6 @@ var ( func init() { v1beta1.RegisterProposalType(ProposalTypeRegisterERC20) v1beta1.RegisterProposalType(ProposalTypeToggleTokenConversion) - govcdc.ModuleCdc.Amino.RegisterConcrete(&RegisterERC20Proposal{}, "erc20/RegisterERC20Proposal", nil) - govcdc.ModuleCdc.Amino.RegisterConcrete(&ToggleTokenConversionProposal{}, "erc20/ToggleTokenConversionProposal", nil) } // CreateDenomDescription generates a string with the coin description diff --git a/x/erc20/types/query.pb.go b/x/erc20/types/query.pb.go index 1e80c87b..adbe9b27 100644 --- a/x/erc20/types/query.pb.go +++ b/x/erc20/types/query.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -324,39 +325,40 @@ func init() { func init() { proto.RegisterFile("os/erc20/v1/query.proto", fileDescriptor_6dc61b2ef2b66c23) } var fileDescriptor_6dc61b2ef2b66c23 = []byte{ - // 498 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x94, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0xc7, 0x9b, 0xc2, 0x2a, 0xf5, 0xf5, 0xe6, 0x76, 0x5b, 0x09, 0x28, 0x0b, 0x19, 0x82, 0x0a, - 0x09, 0x9b, 0x94, 0xe3, 0xc4, 0x65, 0x07, 0xe0, 0x58, 0x2a, 0xb8, 0x70, 0x01, 0xb7, 0xb2, 0xbc, - 0x08, 0x1a, 0x67, 0xb1, 0x5b, 0x51, 0x21, 0x38, 0xf0, 0x09, 0x90, 0xf8, 0x04, 0x7c, 0x9b, 0x1d, - 0x27, 0x71, 0xe1, 0x84, 0x50, 0xcb, 0x91, 0x0f, 0x81, 0x62, 0xbb, 0x69, 0xcc, 0x58, 0x76, 0x4b, - 0x9e, 0xdf, 0xff, 0xfd, 0xfe, 0xff, 0xe7, 0xb4, 0xb0, 0x2f, 0x24, 0x61, 0xf9, 0x74, 0xf8, 0x90, - 0x2c, 0x62, 0x72, 0x3a, 0x67, 0xf9, 0x12, 0x67, 0xb9, 0x50, 0x02, 0x75, 0x84, 0xc4, 0xfa, 0x00, - 0x2f, 0x62, 0xff, 0xfe, 0x54, 0xc8, 0x99, 0x90, 0x64, 0x42, 0x25, 0x33, 0x5d, 0x64, 0x11, 0x4f, - 0x98, 0xa2, 0x31, 0xc9, 0x28, 0x4f, 0x52, 0xaa, 0x12, 0x91, 0x1a, 0xa1, 0xdf, 0xe3, 0x82, 0x0b, - 0xfd, 0x48, 0x8a, 0x27, 0x5b, 0xbd, 0xc5, 0x85, 0xe0, 0xef, 0x18, 0xa1, 0x59, 0x42, 0x68, 0x9a, - 0x0a, 0xa5, 0x25, 0xd2, 0x9e, 0x3a, 0x2e, 0x0c, 0xd5, 0x1c, 0xdc, 0xa8, 0x1e, 0x70, 0x96, 0x32, - 0x99, 0x58, 0x4d, 0xf4, 0x06, 0xf6, 0x9e, 0x17, 0x4e, 0x5e, 0x88, 0xb7, 0x2c, 0x1d, 0xd1, 0x24, - 0x97, 0x63, 0x76, 0x3a, 0x67, 0x52, 0xa1, 0x27, 0x00, 0x5b, 0x57, 0x7d, 0x2f, 0xf4, 0x06, 0x9d, - 0xe1, 0x5d, 0x6c, 0x22, 0xe0, 0x22, 0x02, 0x36, 0x41, 0x6d, 0x04, 0x3c, 0xa2, 0x9c, 0x59, 0xed, - 0xb8, 0xa2, 0x8c, 0xbe, 0x79, 0xb0, 0x7f, 0x01, 0x21, 0x33, 0x91, 0x4a, 0x86, 0x1e, 0x43, 0x47, - 0x15, 0xd5, 0xd7, 0x59, 0x51, 0xee, 0x7b, 0xe1, 0xb5, 0x41, 0x67, 0xb8, 0x87, 0x2b, 0x4b, 0xc3, - 0xa5, 0xea, 0xf8, 0xfa, 0xd9, 0xcf, 0x83, 0xc6, 0x18, 0x54, 0x39, 0x06, 0x3d, 0x75, 0x2c, 0x36, - 0xb5, 0xc5, 0x7b, 0x57, 0x5a, 0x34, 0x6c, 0xc7, 0xe3, 0x03, 0xd8, 0x75, 0x2d, 0x6e, 0x96, 0xd0, - 0x83, 0x1d, 0xcd, 0xd3, 0xf9, 0xdb, 0x63, 0xf3, 0x12, 0xbd, 0xfc, 0x77, 0x69, 0x65, 0xa0, 0x23, - 0x80, 0x6d, 0x20, 0xbb, 0xb4, 0xfa, 0x3c, 0xed, 0x32, 0x4f, 0xd4, 0x03, 0xa4, 0xc7, 0x8e, 0x68, - 0x4e, 0x67, 0x9b, 0x7b, 0x88, 0x9e, 0x41, 0xd7, 0xa9, 0x5a, 0x52, 0x0c, 0xad, 0x4c, 0x57, 0x2c, - 0xa5, 0xeb, 0x50, 0x4c, 0xb3, 0x45, 0xd8, 0xc6, 0xe1, 0x9f, 0x26, 0xec, 0xe8, 0x51, 0x68, 0x09, - 0xb0, 0xbd, 0x0d, 0x74, 0xe8, 0x48, 0xff, 0xff, 0x39, 0xf8, 0x77, 0xea, 0x9b, 0x8c, 0xab, 0x28, - 0xfc, 0xfc, 0xfd, 0xf7, 0xd7, 0xa6, 0x8f, 0xfa, 0xa4, 0xfa, 0xc9, 0x55, 0xee, 0x18, 0x7d, 0x82, - 0x76, 0xa9, 0x43, 0x51, 0xcd, 0xd0, 0x0d, 0xf8, 0xb0, 0xb6, 0xc7, 0x72, 0x07, 0x9a, 0x1b, 0xa1, - 0xf0, 0x32, 0x2e, 0xf9, 0xa0, 0x5f, 0x3e, 0xa2, 0x13, 0x68, 0x99, 0xe5, 0xa0, 0x83, 0x8b, 0x83, - 0x9d, 0xcd, 0xfb, 0xe1, 0xe5, 0x0d, 0x16, 0x7b, 0x53, 0x63, 0x77, 0x51, 0xd7, 0xc1, 0x9a, 0x75, - 0x1f, 0x1f, 0x9d, 0xad, 0x02, 0xef, 0x7c, 0x15, 0x78, 0xbf, 0x56, 0x81, 0xf7, 0x65, 0x1d, 0x34, - 0xce, 0xd7, 0x41, 0xe3, 0xc7, 0x3a, 0x68, 0xbc, 0xba, 0xcd, 0x13, 0x75, 0x32, 0x9f, 0xe0, 0xa9, - 0x98, 0x11, 0xb6, 0x28, 0xfe, 0x12, 0x84, 0x24, 0xef, 0xed, 0x00, 0xb5, 0xcc, 0x98, 0x9c, 0xb4, - 0xf4, 0xcf, 0xf3, 0xd1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x08, 0x9e, 0x3c, 0x6f, 0x5a, 0x04, - 0x00, 0x00, + // 516 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4f, 0x8b, 0xd3, 0x40, + 0x14, 0x6f, 0x2a, 0x5b, 0xe8, 0xeb, 0xc9, 0x69, 0x77, 0xb7, 0x46, 0xc9, 0xc6, 0xac, 0x68, 0x59, + 0x70, 0xc6, 0x56, 0xf0, 0xe2, 0x45, 0x7a, 0xd0, 0x93, 0x50, 0x8b, 0xa7, 0xbd, 0xe8, 0xb4, 0x0c, + 0xd9, 0xa0, 0xcd, 0xcb, 0x66, 0xd2, 0x62, 0x11, 0x3d, 0xf8, 0x09, 0x04, 0xbf, 0x83, 0x78, 0xf4, + 0x63, 0xec, 0x71, 0xc1, 0x8b, 0x27, 0x91, 0x56, 0xf0, 0xe2, 0x87, 0x90, 0xcc, 0x4c, 0xd3, 0x8c, + 0x6b, 0xab, 0x97, 0x92, 0xbc, 0xf7, 0x7e, 0xef, 0xf7, 0x67, 0xa6, 0x81, 0x7d, 0x94, 0x4c, 0xa4, + 0xe3, 0xde, 0x1d, 0x36, 0xeb, 0xb2, 0xd3, 0xa9, 0x48, 0xe7, 0x34, 0x49, 0x31, 0x43, 0xd2, 0x40, + 0x49, 0x55, 0x83, 0xce, 0xba, 0xee, 0x65, 0x3e, 0x89, 0x62, 0x64, 0xea, 0x57, 0xf7, 0xdd, 0xa3, + 0x31, 0xca, 0x09, 0x4a, 0x36, 0xe2, 0x52, 0x68, 0x20, 0x9b, 0x75, 0x47, 0x22, 0xe3, 0x5d, 0x96, + 0xf0, 0x30, 0x8a, 0x79, 0x16, 0x61, 0x6c, 0x66, 0x5b, 0x21, 0x86, 0xa8, 0x1e, 0x59, 0xfe, 0x64, + 0xaa, 0xd7, 0x42, 0xc4, 0xf0, 0xa5, 0x60, 0x3c, 0x89, 0x18, 0x8f, 0x63, 0xcc, 0x14, 0x44, 0x9a, + 0xae, 0x25, 0x4c, 0x0b, 0xd1, 0x8d, 0x2b, 0xe5, 0x46, 0x28, 0x62, 0x21, 0x23, 0x83, 0x09, 0x9e, + 0xc3, 0xde, 0x93, 0x5c, 0xc9, 0x53, 0x7c, 0x21, 0xe2, 0x01, 0x8f, 0x52, 0x39, 0x14, 0xa7, 0x53, + 0x21, 0x33, 0xf2, 0x10, 0x60, 0xad, 0xaa, 0xed, 0xf8, 0x4e, 0xa7, 0xd1, 0xbb, 0x49, 0xb5, 0x05, + 0x9a, 0x5b, 0xa0, 0xda, 0xbb, 0xb1, 0x40, 0x07, 0x3c, 0x14, 0x06, 0x3b, 0x2c, 0x21, 0x83, 0x8f, + 0x0e, 0xec, 0x5f, 0xa0, 0x90, 0x09, 0xc6, 0x52, 0x90, 0x3e, 0x34, 0xb2, 0xbc, 0xfa, 0x2c, 0xc9, + 0xcb, 0x6d, 0xc7, 0xbf, 0xd4, 0x69, 0xf4, 0xf6, 0x68, 0x29, 0x47, 0x5a, 0xa0, 0xfa, 0xf5, 0xb3, + 0x6f, 0x07, 0x95, 0x4f, 0x3f, 0x3f, 0x1f, 0x39, 0x43, 0xc8, 0x8a, 0x5d, 0xe4, 0x91, 0xa5, 0xb3, + 0xaa, 0x74, 0xde, 0xfa, 0xa7, 0x4e, 0x2d, 0xc0, 0x12, 0x7a, 0x1b, 0x76, 0x6d, 0x9d, 0xab, 0x24, + 0x5a, 0xb0, 0xa3, 0xf8, 0x54, 0x08, 0xf5, 0xa1, 0x7e, 0x09, 0x8e, 0xff, 0x4c, 0xae, 0x70, 0xf5, + 0x00, 0x60, 0xed, 0xca, 0x24, 0xf7, 0x1f, 0xa6, 0xea, 0x85, 0xa9, 0xa0, 0x05, 0x44, 0xed, 0x1e, + 0xf0, 0x94, 0x4f, 0x56, 0x27, 0x12, 0x3c, 0x86, 0xa6, 0x55, 0x35, 0x74, 0xf7, 0xa0, 0x96, 0xa8, + 0x8a, 0xa1, 0x6a, 0x5a, 0x54, 0x7a, 0xb8, 0xcc, 0x63, 0xa6, 0x7b, 0xbf, 0xaa, 0xb0, 0xa3, 0xf6, + 0x91, 0x39, 0xc0, 0xfa, 0x70, 0xc8, 0xa1, 0x85, 0xff, 0xfb, 0xed, 0x70, 0x6f, 0x6c, 0x1f, 0xd2, + 0xd2, 0x02, 0xff, 0xdd, 0x97, 0x1f, 0x1f, 0xaa, 0x2e, 0x69, 0xb3, 0xf2, 0x0d, 0x2c, 0x1d, 0x39, + 0x79, 0x0b, 0xf5, 0x02, 0x47, 0x82, 0x2d, 0x4b, 0x57, 0xc4, 0x87, 0x5b, 0x67, 0x0c, 0x6f, 0x47, + 0xf1, 0x06, 0xc4, 0xdf, 0xc4, 0xcb, 0x5e, 0xab, 0x97, 0x37, 0xe4, 0x04, 0x6a, 0x3a, 0x21, 0x72, + 0x70, 0x71, 0xb1, 0x15, 0xbf, 0xeb, 0x6f, 0x1e, 0x30, 0xb4, 0x57, 0x15, 0xed, 0x2e, 0x69, 0x5a, + 0xb4, 0x3a, 0xee, 0xfe, 0xfd, 0xb3, 0x85, 0xe7, 0x9c, 0x2f, 0x3c, 0xe7, 0xfb, 0xc2, 0x73, 0xde, + 0x2f, 0xbd, 0xca, 0xf9, 0xd2, 0xab, 0x7c, 0x5d, 0x7a, 0x95, 0xe3, 0xeb, 0x61, 0x94, 0x9d, 0x4c, + 0x47, 0x74, 0x8c, 0x13, 0x26, 0x66, 0xf9, 0x17, 0x02, 0x25, 0x7b, 0x65, 0x16, 0x64, 0xf3, 0x44, + 0xc8, 0x51, 0x4d, 0xfd, 0x5b, 0xef, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x6e, 0xa6, 0xd0, 0xd4, + 0x7c, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/erc20/types/tx.pb.go b/x/erc20/types/tx.pb.go index 6ee75208..5c3a87c4 100644 --- a/x/erc20/types/tx.pb.go +++ b/x/erc20/types/tx.pb.go @@ -10,6 +10,7 @@ import ( _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -337,6 +338,195 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +// MsgRegisterERC20 is the Msg/RegisterERC20 request type for registering +// an Erc20 contract token pair. +type MsgRegisterERC20 struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // erc20addresses is a slice of ERC20 token contract hex addresses + Erc20Addresses []string `protobuf:"bytes,2,rep,name=erc20addresses,proto3" json:"erc20addresses,omitempty"` +} + +func (m *MsgRegisterERC20) Reset() { *m = MsgRegisterERC20{} } +func (m *MsgRegisterERC20) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterERC20) ProtoMessage() {} +func (*MsgRegisterERC20) Descriptor() ([]byte, []int) { + return fileDescriptor_cb23aa3d391d3b1f, []int{6} +} +func (m *MsgRegisterERC20) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterERC20) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterERC20.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRegisterERC20) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterERC20.Merge(m, src) +} +func (m *MsgRegisterERC20) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterERC20) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterERC20.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterERC20 proto.InternalMessageInfo + +func (m *MsgRegisterERC20) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgRegisterERC20) GetErc20Addresses() []string { + if m != nil { + return m.Erc20Addresses + } + return nil +} + +// MsgRegisterERC20Response defines the response structure for executing a +// MsgRegisterERC20 message. +type MsgRegisterERC20Response struct { +} + +func (m *MsgRegisterERC20Response) Reset() { *m = MsgRegisterERC20Response{} } +func (m *MsgRegisterERC20Response) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterERC20Response) ProtoMessage() {} +func (*MsgRegisterERC20Response) Descriptor() ([]byte, []int) { + return fileDescriptor_cb23aa3d391d3b1f, []int{7} +} +func (m *MsgRegisterERC20Response) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterERC20Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterERC20Response.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRegisterERC20Response) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterERC20Response.Merge(m, src) +} +func (m *MsgRegisterERC20Response) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterERC20Response) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterERC20Response.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterERC20Response proto.InternalMessageInfo + +// MsgToggleConversion is the Msg/MsgToggleConversion request type for toggling +// an Erc20 contract conversion capability. +type MsgToggleConversion struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // token identifier can be either the hex contract address of the ERC20 or the + // Cosmos base denomination + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` +} + +func (m *MsgToggleConversion) Reset() { *m = MsgToggleConversion{} } +func (m *MsgToggleConversion) String() string { return proto.CompactTextString(m) } +func (*MsgToggleConversion) ProtoMessage() {} +func (*MsgToggleConversion) Descriptor() ([]byte, []int) { + return fileDescriptor_cb23aa3d391d3b1f, []int{8} +} +func (m *MsgToggleConversion) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgToggleConversion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgToggleConversion.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgToggleConversion) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgToggleConversion.Merge(m, src) +} +func (m *MsgToggleConversion) XXX_Size() int { + return m.Size() +} +func (m *MsgToggleConversion) XXX_DiscardUnknown() { + xxx_messageInfo_MsgToggleConversion.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgToggleConversion proto.InternalMessageInfo + +func (m *MsgToggleConversion) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgToggleConversion) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +// MsgToggleConversionResponse defines the response structure for executing a +// ToggleConversion message. +type MsgToggleConversionResponse struct { +} + +func (m *MsgToggleConversionResponse) Reset() { *m = MsgToggleConversionResponse{} } +func (m *MsgToggleConversionResponse) String() string { return proto.CompactTextString(m) } +func (*MsgToggleConversionResponse) ProtoMessage() {} +func (*MsgToggleConversionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cb23aa3d391d3b1f, []int{9} +} +func (m *MsgToggleConversionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgToggleConversionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgToggleConversionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgToggleConversionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgToggleConversionResponse.Merge(m, src) +} +func (m *MsgToggleConversionResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgToggleConversionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgToggleConversionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgToggleConversionResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgConvertERC20)(nil), "os.erc20.v1.MsgConvertERC20") proto.RegisterType((*MsgConvertERC20Response)(nil), "os.erc20.v1.MsgConvertERC20Response") @@ -344,46 +534,62 @@ func init() { proto.RegisterType((*MsgConvertCoinResponse)(nil), "os.erc20.v1.MsgConvertCoinResponse") proto.RegisterType((*MsgUpdateParams)(nil), "os.erc20.v1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "os.erc20.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgRegisterERC20)(nil), "os.erc20.v1.MsgRegisterERC20") + proto.RegisterType((*MsgRegisterERC20Response)(nil), "os.erc20.v1.MsgRegisterERC20Response") + proto.RegisterType((*MsgToggleConversion)(nil), "os.erc20.v1.MsgToggleConversion") + proto.RegisterType((*MsgToggleConversionResponse)(nil), "os.erc20.v1.MsgToggleConversionResponse") } func init() { proto.RegisterFile("os/erc20/v1/tx.proto", fileDescriptor_cb23aa3d391d3b1f) } var fileDescriptor_cb23aa3d391d3b1f = []byte{ - // 543 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xbf, 0x6e, 0x13, 0x4d, - 0x14, 0xc5, 0xbd, 0xb1, 0x65, 0x7d, 0x19, 0x47, 0xc9, 0xa7, 0xc1, 0x24, 0x6b, 0x2b, 0x59, 0x83, - 0x05, 0x12, 0x20, 0x31, 0x13, 0x3b, 0x82, 0x02, 0x2a, 0x6c, 0x51, 0x50, 0x44, 0x42, 0x8b, 0x68, - 0x68, 0xac, 0xf1, 0x7a, 0x34, 0x5e, 0xc1, 0xce, 0x5d, 0xcd, 0x8c, 0x57, 0x71, 0x9b, 0x9a, 0x02, - 0x89, 0x87, 0xa0, 0xa5, 0xe0, 0x21, 0x52, 0x46, 0x40, 0x81, 0x28, 0x22, 0x64, 0x23, 0xf1, 0x1a, - 0x68, 0x77, 0xc7, 0x7f, 0x36, 0x01, 0x3a, 0xdf, 0x7b, 0x8e, 0xef, 0xfd, 0xed, 0x99, 0x19, 0x54, - 0x07, 0x4d, 0xb9, 0x0a, 0xba, 0x87, 0x34, 0xe9, 0x50, 0x73, 0x42, 0x62, 0x05, 0x06, 0x70, 0x0d, - 0x34, 0xc9, 0xba, 0x24, 0xe9, 0x34, 0xbd, 0x00, 0x74, 0x04, 0x9a, 0x0e, 0x99, 0xe6, 0x34, 0xe9, - 0x0c, 0xb9, 0x61, 0x1d, 0x1a, 0x40, 0x28, 0x73, 0x73, 0x73, 0xcf, 0xea, 0x91, 0x16, 0xe9, 0x90, - 0x48, 0x0b, 0x2b, 0x34, 0x72, 0x61, 0x90, 0x55, 0x34, 0x2f, 0xac, 0x54, 0x17, 0x20, 0x20, 0xef, - 0xa7, 0xbf, 0x6c, 0x77, 0x5f, 0x00, 0x88, 0x37, 0x9c, 0xb2, 0x38, 0xa4, 0x4c, 0x4a, 0x30, 0xcc, - 0x84, 0x20, 0x17, 0xff, 0x69, 0xac, 0xa3, 0x0a, 0x2e, 0xb9, 0x0e, 0xad, 0xd4, 0xfe, 0xe0, 0xa0, - 0x9d, 0x63, 0x2d, 0xfa, 0x20, 0x13, 0xae, 0xcc, 0x53, 0xbf, 0xdf, 0x3d, 0xc4, 0x77, 0xd1, 0xff, - 0x01, 0x48, 0xa3, 0x58, 0x60, 0x06, 0x6c, 0x34, 0x52, 0x5c, 0x6b, 0xd7, 0xb9, 0xe1, 0xdc, 0xd9, - 0xf4, 0x77, 0x16, 0xfd, 0x27, 0x79, 0x1b, 0x3f, 0x40, 0x55, 0x16, 0xc1, 0x44, 0x1a, 0x77, 0x23, - 0x35, 0xf4, 0x0e, 0xce, 0x2e, 0x5a, 0xa5, 0xef, 0x17, 0xad, 0xeb, 0x39, 0xb3, 0x1e, 0xbd, 0x26, - 0x21, 0xd0, 0x88, 0x99, 0x31, 0x79, 0x26, 0x8d, 0x6f, 0xcd, 0xb8, 0x89, 0xfe, 0x53, 0x3c, 0xe0, - 0x61, 0xc2, 0x95, 0x5b, 0xce, 0x26, 0x2f, 0x6b, 0xbc, 0x8b, 0xaa, 0x9a, 0xcb, 0x11, 0x57, 0x6e, - 0x25, 0x53, 0x6c, 0xd5, 0x6e, 0xa0, 0xbd, 0x4b, 0xa0, 0x3e, 0xd7, 0x31, 0x48, 0xcd, 0xdb, 0x53, - 0xb4, 0xbd, 0x92, 0xfa, 0x10, 0x4a, 0x7c, 0x84, 0x2a, 0x69, 0xce, 0x19, 0x76, 0xad, 0xdb, 0x20, - 0x36, 0xc2, 0xf4, 0x20, 0x88, 0x3d, 0x08, 0x92, 0x1a, 0x7b, 0x95, 0x14, 0xd8, 0xcf, 0xcc, 0x05, - 0xaa, 0x8d, 0xbf, 0x52, 0x95, 0x0b, 0x54, 0x2e, 0xda, 0x2d, 0xae, 0x5e, 0x42, 0xbd, 0xcd, 0x93, - 0x7d, 0x19, 0x8f, 0x98, 0xe1, 0xcf, 0x99, 0x62, 0x91, 0xc6, 0x0f, 0xd1, 0x26, 0x9b, 0x98, 0x31, - 0xa8, 0xd0, 0x4c, 0xf3, 0x48, 0x7b, 0xee, 0xe7, 0x4f, 0xf7, 0xeb, 0x16, 0xcf, 0xa6, 0xfa, 0xc2, - 0xa8, 0x50, 0x0a, 0x7f, 0x65, 0xc5, 0x1d, 0x54, 0x8d, 0xb3, 0x09, 0x19, 0x57, 0xad, 0x7b, 0x8d, - 0xac, 0x5d, 0x33, 0x92, 0x0f, 0xb7, 0x9f, 0x62, 0x8d, 0x8f, 0xb6, 0x4f, 0x7f, 0x7d, 0xbc, 0xb7, - 0x1a, 0x61, 0xe3, 0x5b, 0xa7, 0x59, 0x90, 0x76, 0xbf, 0x3a, 0xa8, 0x7c, 0xac, 0x05, 0x9e, 0xa2, - 0xad, 0xc2, 0x3d, 0xd8, 0x2f, 0x6c, 0xb9, 0x14, 0x7e, 0xf3, 0xd6, 0xbf, 0xd4, 0x65, 0x0a, 0xb7, - 0x4f, 0xbf, 0xfc, 0x7c, 0xbf, 0xd1, 0xc2, 0x07, 0xb4, 0xf8, 0x5c, 0x68, 0x90, 0xbb, 0x07, 0x59, - 0x0f, 0xfb, 0x68, 0xab, 0x10, 0xd4, 0x95, 0xd5, 0xeb, 0xea, 0xd5, 0xd5, 0x7f, 0xfa, 0xac, 0xde, - 0xe3, 0xb3, 0x99, 0xe7, 0x9c, 0xcf, 0x3c, 0xe7, 0xc7, 0xcc, 0x73, 0xde, 0xcd, 0xbd, 0xd2, 0xf9, - 0xdc, 0x2b, 0x7d, 0x9b, 0x7b, 0xa5, 0x57, 0x37, 0x45, 0x68, 0xc6, 0x93, 0x21, 0x09, 0x20, 0xa2, - 0x3c, 0x49, 0x5f, 0x20, 0x68, 0x7a, 0x62, 0xf1, 0xcc, 0x34, 0xe6, 0x7a, 0x58, 0xcd, 0x9e, 0xc7, - 0xd1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xca, 0x03, 0xda, 0xdb, 0xe6, 0x03, 0x00, 0x00, + // 721 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x41, 0x4f, 0xdb, 0x4a, + 0x10, 0x8e, 0x09, 0x44, 0x2f, 0x0b, 0x0f, 0x78, 0x26, 0x0f, 0x1c, 0x03, 0x86, 0x67, 0x3d, 0x2a, + 0x8a, 0x84, 0x97, 0x04, 0x89, 0x43, 0x7a, 0x6a, 0x50, 0x0f, 0x3d, 0x44, 0xaa, 0xdc, 0x72, 0xe9, + 0xa1, 0xc8, 0x71, 0x56, 0x8b, 0x05, 0xde, 0x89, 0xbc, 0x4b, 0x44, 0x6e, 0x15, 0xc7, 0x9e, 0xaa, + 0x56, 0xea, 0x0f, 0xe8, 0xa9, 0xc7, 0x1c, 0xfa, 0x23, 0x38, 0xa2, 0xf6, 0x52, 0xf5, 0x80, 0x2a, + 0xa8, 0xc4, 0xdf, 0xa8, 0xec, 0xdd, 0x84, 0xd8, 0xa1, 0x54, 0xe2, 0x82, 0x98, 0xef, 0x9b, 0x9d, + 0xfd, 0x66, 0xe6, 0x5b, 0x07, 0x95, 0x80, 0x63, 0x12, 0xf9, 0xd5, 0x2d, 0xdc, 0xa9, 0x60, 0x71, + 0xe2, 0xb4, 0x23, 0x10, 0xa0, 0x4f, 0x02, 0x77, 0x12, 0xd4, 0xe9, 0x54, 0xcc, 0x7f, 0xbc, 0x30, + 0x60, 0x80, 0x93, 0xbf, 0x92, 0x37, 0x2d, 0x1f, 0x78, 0x08, 0x1c, 0x37, 0x3d, 0x4e, 0x70, 0xa7, + 0xd2, 0x24, 0xc2, 0xab, 0x60, 0x1f, 0x02, 0xa6, 0xf8, 0x05, 0xc5, 0x87, 0x9c, 0xc6, 0x75, 0x43, + 0x4e, 0x15, 0x51, 0x96, 0xc4, 0x7e, 0x12, 0x61, 0x19, 0x28, 0xaa, 0x44, 0x81, 0x82, 0xc4, 0xe3, + 0xff, 0x14, 0xba, 0x44, 0x01, 0xe8, 0x11, 0xc1, 0x5e, 0x3b, 0xc0, 0x1e, 0x63, 0x20, 0x3c, 0x11, + 0x00, 0xeb, 0x9f, 0x29, 0x0f, 0xab, 0xa7, 0x84, 0x11, 0x1e, 0x28, 0xca, 0x3e, 0xd7, 0xd0, 0x4c, + 0x83, 0xd3, 0x5d, 0x60, 0x1d, 0x12, 0x89, 0x27, 0xee, 0x6e, 0x75, 0x4b, 0x7f, 0x88, 0x66, 0x7d, + 0x60, 0x22, 0xf2, 0x7c, 0xb1, 0xef, 0xb5, 0x5a, 0x11, 0xe1, 0xdc, 0xd0, 0x56, 0xb5, 0xf5, 0xa2, + 0x3b, 0xd3, 0xc7, 0x1f, 0x4b, 0x58, 0xaf, 0xa1, 0x82, 0x17, 0xc2, 0x31, 0x13, 0xc6, 0x58, 0x9c, + 0x50, 0xb7, 0xcf, 0x2e, 0x56, 0x72, 0xdf, 0x2f, 0x56, 0xfe, 0x95, 0x9a, 0x79, 0xeb, 0xd0, 0x09, + 0x00, 0x87, 0x9e, 0x38, 0x70, 0x9e, 0x32, 0xf1, 0xe9, 0xba, 0xb7, 0xa1, 0xb9, 0xea, 0x84, 0x6e, + 0xa2, 0xbf, 0x22, 0xe2, 0x93, 0xa0, 0x43, 0x22, 0x23, 0x9f, 0x94, 0x1f, 0xc4, 0xfa, 0x3c, 0x2a, + 0x70, 0xc2, 0x5a, 0x24, 0x32, 0xc6, 0x13, 0x46, 0x45, 0x35, 0xfb, 0xf4, 0xba, 0xb7, 0xa1, 0x82, + 0x37, 0xd7, 0xbd, 0x0d, 0x1d, 0x38, 0xce, 0xc8, 0xb7, 0xcb, 0x68, 0x21, 0x03, 0xb9, 0x84, 0xb7, + 0x81, 0x71, 0x62, 0x77, 0xd1, 0xf4, 0x0d, 0xb5, 0x0b, 0x01, 0xd3, 0xb7, 0xd1, 0x78, 0xbc, 0x90, + 0xa4, 0xbf, 0xc9, 0x6a, 0xd9, 0x51, 0xb3, 0x8e, 0x37, 0xe6, 0xa8, 0x8d, 0x39, 0x71, 0x62, 0x7d, + 0x3c, 0xee, 0xcc, 0x4d, 0x92, 0x53, 0xca, 0xc7, 0x7e, 0xab, 0x3c, 0x3f, 0xac, 0xdc, 0x36, 0xd0, + 0x7c, 0xfa, 0xea, 0x81, 0xa8, 0x9e, 0x5c, 0xc1, 0x5e, 0xbb, 0xe5, 0x09, 0xf2, 0xcc, 0x8b, 0xbc, + 0x90, 0xeb, 0x3b, 0xa8, 0xe8, 0x1d, 0x8b, 0x03, 0x88, 0x02, 0xd1, 0x95, 0xb3, 0xaf, 0x1b, 0x5f, + 0x3e, 0x6f, 0x96, 0x94, 0x3c, 0x35, 0xfe, 0xe7, 0x22, 0x0a, 0x18, 0x75, 0x6f, 0x52, 0xf5, 0x1d, + 0x54, 0x68, 0x27, 0x15, 0x12, 0x5d, 0x93, 0xd5, 0x39, 0x67, 0xc8, 0xa2, 0x8e, 0x2c, 0x5e, 0x2f, + 0xc6, 0xad, 0xa8, 0x5d, 0xc8, 0xec, 0xda, 0x66, 0x3c, 0xd7, 0x9b, 0x3a, 0xf1, 0x68, 0x4d, 0xe0, + 0xf8, 0x44, 0xd9, 0x26, 0x23, 0x4f, 0x8d, 0x78, 0x18, 0x1a, 0x74, 0xf3, 0x51, 0x43, 0xb3, 0x0d, + 0x4e, 0x5d, 0x42, 0x03, 0x2e, 0x48, 0x24, 0x1d, 0x75, 0xdf, 0x76, 0x1e, 0xa0, 0xe9, 0x44, 0x80, + 0x72, 0x21, 0x89, 0xdb, 0xca, 0xaf, 0x17, 0xdd, 0x0c, 0x5a, 0x73, 0x46, 0xe5, 0x2f, 0xa6, 0xe5, + 0xa7, 0xf4, 0xd8, 0x26, 0x32, 0xb2, 0xd8, 0xa0, 0x81, 0x0f, 0x1a, 0x9a, 0x6b, 0x70, 0xfa, 0x02, + 0x28, 0x3d, 0x22, 0x72, 0x5f, 0x3c, 0x00, 0x76, 0xef, 0x1e, 0x4a, 0x68, 0x42, 0xc0, 0x21, 0x61, + 0xca, 0x29, 0x32, 0xa8, 0x55, 0x46, 0x15, 0x5b, 0x69, 0xc5, 0x59, 0x01, 0xf6, 0x32, 0x5a, 0xbc, + 0x05, 0xee, 0xeb, 0xae, 0xbe, 0xcb, 0xa3, 0x7c, 0x83, 0x53, 0xbd, 0x8b, 0xa6, 0x52, 0xaf, 0x79, + 0x29, 0x65, 0x81, 0xcc, 0xcb, 0x30, 0xff, 0xbf, 0x8b, 0x1d, 0xcc, 0x64, 0xed, 0xf4, 0xeb, 0xcf, + 0xf7, 0x63, 0x2b, 0xfa, 0x32, 0x4e, 0x7f, 0x07, 0xb1, 0x2f, 0xb3, 0xf7, 0x13, 0x4c, 0x77, 0xd1, + 0x54, 0xca, 0xc5, 0x23, 0x57, 0x0f, 0xb3, 0xa3, 0x57, 0xdf, 0xe6, 0x27, 0x7d, 0x0f, 0xfd, 0x9d, + 0xf6, 0xd2, 0x72, 0xf6, 0x58, 0x8a, 0x36, 0xd7, 0xee, 0xa4, 0x07, 0x65, 0x5f, 0xa1, 0xd9, 0x91, + 0x0d, 0xaf, 0x66, 0x8f, 0x66, 0x33, 0xcc, 0xf5, 0x3f, 0x65, 0xf4, 0xeb, 0x9b, 0x13, 0xaf, 0xe3, + 0xf7, 0x55, 0x7f, 0x74, 0x76, 0x69, 0x69, 0xe7, 0x97, 0x96, 0xf6, 0xe3, 0xd2, 0xd2, 0xde, 0x5e, + 0x59, 0xb9, 0xf3, 0x2b, 0x2b, 0xf7, 0xed, 0xca, 0xca, 0xbd, 0xfc, 0x8f, 0x06, 0xe2, 0xe0, 0xb8, + 0xe9, 0xf8, 0x10, 0x62, 0xd2, 0x89, 0x7f, 0x05, 0x86, 0xd6, 0x2f, 0xba, 0x6d, 0xc2, 0x9b, 0x85, + 0xe4, 0x13, 0xbd, 0xfd, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x6a, 0x19, 0x40, 0x28, 0x7d, 0x06, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -401,10 +607,18 @@ type MsgClient interface { // ConvertERC20 mints a native Cosmos coin representation of the ERC20 token // contract that is registered on the token mapping. ConvertERC20(ctx context.Context, in *MsgConvertERC20, opts ...grpc.CallOption) (*MsgConvertERC20Response, error) - // UpdateParams defined a governance operation for updating the x/erc20 module + // UpdateParams defines a governance operation for updating the x/erc20 module // parameters. The authority is hard-coded to the Cosmos SDK x/gov module // account UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // RegisterERC20 defines a governance operation for registering a token pair + // for the specified erc20 contract. The authority is hard-coded to the Cosmos + // SDK x/gov module account + RegisterERC20(ctx context.Context, in *MsgRegisterERC20, opts ...grpc.CallOption) (*MsgRegisterERC20Response, error) + // ToggleConversion defines a governance operation for enabling/disablen a + // token pair conversion. The authority is hard-coded to the Cosmos SDK x/gov + // module account + ToggleConversion(ctx context.Context, in *MsgToggleConversion, opts ...grpc.CallOption) (*MsgToggleConversionResponse, error) } type msgClient struct { @@ -433,15 +647,41 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) RegisterERC20(ctx context.Context, in *MsgRegisterERC20, opts ...grpc.CallOption) (*MsgRegisterERC20Response, error) { + out := new(MsgRegisterERC20Response) + err := c.cc.Invoke(ctx, "/os.erc20.v1.Msg/RegisterERC20", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ToggleConversion(ctx context.Context, in *MsgToggleConversion, opts ...grpc.CallOption) (*MsgToggleConversionResponse, error) { + out := new(MsgToggleConversionResponse) + err := c.cc.Invoke(ctx, "/os.erc20.v1.Msg/ToggleConversion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // ConvertERC20 mints a native Cosmos coin representation of the ERC20 token // contract that is registered on the token mapping. ConvertERC20(context.Context, *MsgConvertERC20) (*MsgConvertERC20Response, error) - // UpdateParams defined a governance operation for updating the x/erc20 module + // UpdateParams defines a governance operation for updating the x/erc20 module // parameters. The authority is hard-coded to the Cosmos SDK x/gov module // account UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // RegisterERC20 defines a governance operation for registering a token pair + // for the specified erc20 contract. The authority is hard-coded to the Cosmos + // SDK x/gov module account + RegisterERC20(context.Context, *MsgRegisterERC20) (*MsgRegisterERC20Response, error) + // ToggleConversion defines a governance operation for enabling/disablen a + // token pair conversion. The authority is hard-coded to the Cosmos SDK x/gov + // module account + ToggleConversion(context.Context, *MsgToggleConversion) (*MsgToggleConversionResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -454,6 +694,12 @@ func (*UnimplementedMsgServer) ConvertERC20(ctx context.Context, req *MsgConvert func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (*UnimplementedMsgServer) RegisterERC20(ctx context.Context, req *MsgRegisterERC20) (*MsgRegisterERC20Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterERC20 not implemented") +} +func (*UnimplementedMsgServer) ToggleConversion(ctx context.Context, req *MsgToggleConversion) (*MsgToggleConversionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ToggleConversion not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -495,6 +741,42 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_RegisterERC20_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRegisterERC20) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RegisterERC20(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/os.erc20.v1.Msg/RegisterERC20", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RegisterERC20(ctx, req.(*MsgRegisterERC20)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ToggleConversion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgToggleConversion) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ToggleConversion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/os.erc20.v1.Msg/ToggleConversion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ToggleConversion(ctx, req.(*MsgToggleConversion)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "os.erc20.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -507,6 +789,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "RegisterERC20", + Handler: _Msg_RegisterERC20_Handler, + }, + { + MethodName: "ToggleConversion", + Handler: _Msg_ToggleConversion_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "os/erc20/v1/tx.proto", @@ -722,6 +1012,128 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgRegisterERC20) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRegisterERC20) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterERC20) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Erc20Addresses) > 0 { + for iNdEx := len(m.Erc20Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Erc20Addresses[iNdEx]) + copy(dAtA[i:], m.Erc20Addresses[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Erc20Addresses[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterERC20Response) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRegisterERC20Response) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterERC20Response) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgToggleConversion) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgToggleConversion) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgToggleConversion) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgToggleConversionResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgToggleConversionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgToggleConversionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -803,27 +1215,311 @@ func (m *MsgUpdateParams) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRegisterERC20) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Erc20Addresses) > 0 { + for _, s := range m.Erc20Addresses { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgRegisterERC20Response) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgToggleConversion) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgToggleConversionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgConvertERC20) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConvertERC20: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConvertERC20: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConvertERC20Response) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConvertERC20Response: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConvertERC20Response: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 + if iNdEx > l { + return io.ErrUnexpectedEOF } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return nil } -func (m *MsgConvertERC20) Unmarshal(dAtA []byte) error { +func (m *MsgConvertCoin) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -846,49 +1542,17 @@ func (m *MsgConvertERC20) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConvertERC20: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConvertCoin: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConvertERC20: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConvertCoin: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Coin", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -898,27 +1562,26 @@ func (m *MsgConvertERC20) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Coin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) } @@ -950,7 +1613,7 @@ func (m *MsgConvertERC20) Unmarshal(dAtA []byte) error { } m.Receiver = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) } @@ -1003,7 +1666,7 @@ func (m *MsgConvertERC20) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConvertERC20Response) Unmarshal(dAtA []byte) error { +func (m *MsgConvertCoinResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1026,10 +1689,10 @@ func (m *MsgConvertERC20Response) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConvertERC20Response: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConvertCoinResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConvertERC20Response: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConvertCoinResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1053,7 +1716,7 @@ func (m *MsgConvertERC20Response) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConvertCoin) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1076,15 +1739,47 @@ func (m *MsgConvertCoin) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConvertCoin: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConvertCoin: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1111,13 +1806,113 @@ func (m *MsgConvertCoin) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Coin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRegisterERC20) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRegisterERC20: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterERC20: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1145,11 +1940,11 @@ func (m *MsgConvertCoin) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Receiver = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Erc20Addresses", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1177,7 +1972,7 @@ func (m *MsgConvertCoin) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.Erc20Addresses = append(m.Erc20Addresses, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -1200,7 +1995,7 @@ func (m *MsgConvertCoin) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConvertCoinResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRegisterERC20Response) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1223,10 +2018,10 @@ func (m *MsgConvertCoinResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConvertCoinResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterERC20Response: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConvertCoinResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterERC20Response: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1250,7 +2045,7 @@ func (m *MsgConvertCoinResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { +func (m *MsgToggleConversion) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1273,10 +2068,10 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + return fmt.Errorf("proto: MsgToggleConversion: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgToggleConversion: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1313,9 +2108,9 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1325,24 +2120,23 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1365,7 +2159,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { +func (m *MsgToggleConversionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1388,10 +2182,10 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgToggleConversionResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgToggleConversionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/x/erc20/types/utils.go b/x/erc20/types/utils.go index d798980a..509288f5 100644 --- a/x/erc20/types/utils.go +++ b/x/erc20/types/utils.go @@ -6,9 +6,10 @@ package types import ( "fmt" "regexp" + "slices" "strings" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -87,7 +88,23 @@ func EqualStringSlice(aliasesA, aliasesB []string) bool { } // IsModuleAccount returns true if the given account is a module account -func IsModuleAccount(acc authtypes.AccountI) bool { - _, isModuleAccount := acc.(authtypes.ModuleAccountI) +func IsModuleAccount(acc sdk.AccountI) bool { + _, isModuleAccount := acc.(sdk.ModuleAccountI) return isModuleAccount } + +func GetDisabledAndEnabledPrecompiles(oldDynamicPrecompiles, newDynamicPrecompiles []string) (disabledPrecompiles, enabledPrecompiles []string) { + for _, precompile := range oldDynamicPrecompiles { + if !slices.Contains(newDynamicPrecompiles, precompile) { + disabledPrecompiles = append(disabledPrecompiles, precompile) + } + } + + for _, precompile := range newDynamicPrecompiles { + if !slices.Contains(oldDynamicPrecompiles, precompile) { + enabledPrecompiles = append(enabledPrecompiles, precompile) + } + } + + return disabledPrecompiles, enabledPrecompiles +} diff --git a/x/evm/ante/ctx.go b/x/evm/ante/ctx.go index b14a917b..128e8f77 100644 --- a/x/evm/ante/ctx.go +++ b/x/evm/ante/ctx.go @@ -4,7 +4,7 @@ package ante import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" sdktypes "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/evm/ante/ctx_test.go b/x/evm/ante/ctx_test.go index 86c88a60..3ddd7915 100644 --- a/x/evm/ante/ctx_test.go +++ b/x/evm/ante/ctx_test.go @@ -4,7 +4,7 @@ package ante_test import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" "github.com/evmos/os/testutil/integration/os/network" evmante "github.com/evmos/os/x/evm/ante" ) diff --git a/x/evm/client/cli/query.go b/x/evm/client/cli/query.go index be071caf..112807f9 100644 --- a/x/evm/client/cli/query.go +++ b/x/evm/client/cli/query.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package cli import ( @@ -23,6 +24,7 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand( GetStorageCmd(), GetCodeCmd(), + GetAccountCmd(), GetParamsCmd(), ) return cmd @@ -105,6 +107,43 @@ func GetCodeCmd() *cobra.Command { return cmd } +// GetAccountCmd queries the account of a given address +func GetAccountCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "account ADDRESS", + Short: "Gets account info from an address", + Long: "Gets account info from an address. If the height is not provided, it will use the latest height from context.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + address, err := accountToHex(args[0]) + if err != nil { + return err + } + + req := &types.QueryAccountRequest{ + Address: address, + } + + res, err := queryClient.Account(rpctypes.ContextWithHeight(clientCtx.Height), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + // GetParamsCmd queries the fee market params func GetParamsCmd() *cobra.Command { cmd := &cobra.Command{ diff --git a/x/evm/client/cli/tx.go b/x/evm/client/cli/tx.go index 3392ecaa..7ff5e727 100644 --- a/x/evm/client/cli/tx.go +++ b/x/evm/client/cli/tx.go @@ -18,17 +18,20 @@ import ( "github.com/evmos/os/x/evm/types" ) -// GetTxCmd returns the transaction commands for this module -func GetTxCmd() *cobra.Command { - cmd := &cobra.Command{ +// NewTxCmd returns a root CLI command handler for evm module transaction commands +func NewTxCmd() *cobra.Command { + txCmd := &cobra.Command{ Use: types.ModuleName, - Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + Short: "evm subcommands", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, RunE: client.ValidateCmd, } - cmd.AddCommand(NewRawTxCmd()) - return cmd + + txCmd.AddCommand( + NewRawTxCmd(), + ) + return txCmd } // NewRawTxCmd command build cosmos transaction from raw ethereum transaction diff --git a/x/evm/client/cli/utils.go b/x/evm/client/cli/utils.go index c702dc35..df9a491c 100644 --- a/x/evm/client/cli/utils.go +++ b/x/evm/client/cli/utils.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package cli import ( diff --git a/x/evm/config/configurator.go b/x/evm/config/configurator.go index 4083620c..c71152e7 100644 --- a/x/evm/config/configurator.go +++ b/x/evm/config/configurator.go @@ -1,15 +1,14 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) // -// The config package provides a convinient way to modify x/evm params and values. +// The config package provides a convenient way to modify x/evm params and values. // Its primary purpose is to be used during application initialization. package config import ( "fmt" - - "golang.org/x/exp/slices" + "slices" "github.com/evmos/os/x/evm/core/vm" "github.com/evmos/os/x/evm/types" diff --git a/x/evm/core/vm/common.go b/x/evm/core/vm/common.go index 90ba4a4a..a83fe604 100644 --- a/x/evm/core/vm/common.go +++ b/x/evm/core/vm/common.go @@ -22,6 +22,12 @@ import ( "github.com/holiman/uint256" ) +// CalcMemSize64 calculates the required memory size, and returns +// the size and whether the result overflowed uint64 +func CalcMemSize64(off, l *uint256.Int) (uint64, bool) { + return calcMemSize64(off, l) +} + // calcMemSize64 calculates the required memory size, and returns // the size and whether the result overflowed uint64 func calcMemSize64(off, l *uint256.Int) (uint64, bool) { diff --git a/x/evm/core/vm/interface.go b/x/evm/core/vm/interface.go index 6a407a08..b67f71b7 100644 --- a/x/evm/core/vm/interface.go +++ b/x/evm/core/vm/interface.go @@ -94,6 +94,16 @@ type CallContext interface { // The Interpreter will run the byte code VM based on the passed // configuration. type Interpreter interface { + // EVM returns the EVM instance + EVM() *EVM + // Config returns the configuration of the interpreter + Config() Config + // ReadOnly returns whether the interpreter is in read-only mode + ReadOnly() bool + // ReturnData gets the last CALL's return data for subsequent reuse + ReturnData() []byte + // SetReturnData sets the last CALL's return data + SetReturnData([]byte) // Run loops and evaluates the contract's code with the given input data and returns // the return byte-slice and an error if one occurred. Run(contract *Contract, input []byte, static bool) ([]byte, error) diff --git a/x/evm/core/vm/interpreter.go b/x/evm/core/vm/interpreter.go index f4055e42..b133384d 100644 --- a/x/evm/core/vm/interpreter.go +++ b/x/evm/core/vm/interpreter.go @@ -72,6 +72,12 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter { if cfg.JumpTable == nil { cfg.JumpTable = DefaultJumpTable(evm.chainRules) for i, eip := range cfg.ExtraEips { + // TODO: I think this only relates to Evmos and can be skipped on evmOS repo + if len(cfg.ExtraEips) == 1 && eip == "\x8f\x1e" { + // The protobuf params changed so need to update the EIP for archive calls + eip = "ethereum_3855" + } + // Deep-copy jumptable to prevent modification of opcodes in other tables copy := CopyJumpTable(cfg.JumpTable) if err := EnableEIP(eip, copy); err != nil { @@ -89,6 +95,31 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter { } } +// EVM returns the EVM instance +func (in *EVMInterpreter) EVM() *EVM { + return in.evm +} + +// Config returns the configuration of the interpreter +func (in EVMInterpreter) Config() Config { + return in.cfg +} + +// ReadOnly returns whether the interpreter is in read-only mode +func (in EVMInterpreter) ReadOnly() bool { + return in.readOnly +} + +// ReturnData gets the last CALL's return data for subsequent reuse +func (in *EVMInterpreter) ReturnData() []byte { + return in.returnData +} + +// SetReturnData sets the last CALL's return data +func (in *EVMInterpreter) SetReturnData(data []byte) { + in.returnData = data +} + // Run loops and evaluates the contract's code with the given input data and returns // the return byte-slice and an error if one occurred. // diff --git a/x/evm/core/vm/memory.go b/x/evm/core/vm/memory.go index 35b72999..ea757a17 100644 --- a/x/evm/core/vm/memory.go +++ b/x/evm/core/vm/memory.go @@ -103,3 +103,9 @@ func (m *Memory) Len() int { func (m *Memory) Data() []byte { return m.store } + +// GasCost calculates the quadratic gas for memory expansion. It does so +// only for the memory region that is expanded, not the total memory. +func (m *Memory) GasCost(newMemSize uint64) (uint64, error) { + return memoryGasCost(m, newMemSize) +} diff --git a/x/evm/genesis_test.go b/x/evm/genesis_test.go index 0c84d344..29a17e46 100644 --- a/x/evm/genesis_test.go +++ b/x/evm/genesis_test.go @@ -4,11 +4,13 @@ import ( "math/big" "testing" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/evmos/os/testutil/constants" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/evmos/os/contracts" "github.com/evmos/os/crypto/ethsecp256k1" - "github.com/evmos/os/testutil" testfactory "github.com/evmos/os/testutil/integration/os/factory" testhandler "github.com/evmos/os/testutil/integration/os/grpc" testkeyring "github.com/evmos/os/testutil/integration/os/keyring" @@ -49,9 +51,12 @@ func TestInitGenesis(t *testing.T) { address := common.HexToAddress(privkey.PubKey().Address().String()) defaultGenesisWithEVMDenom := types.DefaultGenesisState() - defaultGenesisWithEVMDenom.Params.EvmDenom = testutil.ExampleAttoDenom + defaultGenesisWithEVMDenom.Params.EvmDenom = constants.ExampleAttoDenom - var vmdb *statedb.StateDB + var ( + vmdb *statedb.StateDB + ctx sdk.Context + ) testCases := []struct { name string @@ -78,7 +83,7 @@ func TestInitGenesis(t *testing.T) { vmdb.AddBalance(address, big.NewInt(1)) }, genState: &types.GenesisState{ - Params: types.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom), + Params: types.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom), Accounts: []types.GenesisAccount{ { Address: address.String(), @@ -94,7 +99,7 @@ func TestInitGenesis(t *testing.T) { name: "account not found", malleate: func(_ *testnetwork.UnitTestNetwork) {}, genState: &types.GenesisState{ - Params: types.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom), + Params: types.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom), Accounts: []types.GenesisAccount{ { Address: address.String(), @@ -106,12 +111,11 @@ func TestInitGenesis(t *testing.T) { { name: "ignore empty account code checking", malleate: func(network *testnetwork.UnitTestNetwork) { - ctx := network.GetContext() acc := network.App.AccountKeeper.NewAccountWithAddress(ctx, address.Bytes()) network.App.AccountKeeper.SetAccount(ctx, acc) }, genState: &types.GenesisState{ - Params: types.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom), + Params: types.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom), Accounts: []types.GenesisAccount{ { Address: address.String(), @@ -124,12 +128,11 @@ func TestInitGenesis(t *testing.T) { { name: "valid account with code", malleate: func(network *testnetwork.UnitTestNetwork) { - ctx := network.GetContext() acc := network.App.AccountKeeper.NewAccountWithAddress(ctx, address.Bytes()) network.App.AccountKeeper.SetAccount(ctx, acc) }, genState: &types.GenesisState{ - Params: types.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom), + Params: types.DefaultParamsWithEVMDenom(constants.ExampleAttoDenom), Accounts: []types.GenesisAccount{ { Address: address.String(), @@ -144,12 +147,12 @@ func TestInitGenesis(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { ts := SetupTest() - ctx := ts.network.GetContext() + ctx = ts.network.GetContext() vmdb = statedb.New( ctx, ts.network.App.EVMKeeper, - statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash().Bytes())), + statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash())), ) tc.malleate(ts.network) diff --git a/x/evm/keeper/abci.go b/x/evm/keeper/abci.go index df9e2979..2a082d3f 100644 --- a/x/evm/keeper/abci.go +++ b/x/evm/keeper/abci.go @@ -1,29 +1,30 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package keeper import ( - abci "github.com/cometbft/cometbft/abci/types" - + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - ethtypes "github.com/ethereum/go-ethereum/core/types" ) // BeginBlock sets the sdk Context and EIP155 chain id to the Keeper. -func (k *Keeper) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { +func (k *Keeper) BeginBlock(ctx sdk.Context) error { k.WithChainID(ctx) + + return nil } // EndBlock also retrieves the bloom filter value from the transient store and commits it to the // KVStore. The EVM end block logic doesn't update the validator set, thus it returns // an empty slice. -func (k *Keeper) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (k *Keeper) EndBlock(ctx sdk.Context) error { // Gas costs are handled within msg handler so costs should be ignored - infCtx := ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) + infCtx := ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()) bloom := ethtypes.BytesToBloom(k.GetBlockBloomTransient(infCtx).Bytes()) k.EmitBlockBloomEvent(infCtx, bloom) - return []abci.ValidatorUpdate{} + return nil } diff --git a/x/evm/keeper/abci_test.go b/x/evm/keeper/abci_test.go index eefd4cde..cf17beb3 100644 --- a/x/evm/keeper/abci_test.go +++ b/x/evm/keeper/abci_test.go @@ -1,18 +1,25 @@ package keeper_test import ( - "github.com/cometbft/cometbft/abci/types" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" + "github.com/evmos/os/testutil/integration/os/network" evmtypes "github.com/evmos/os/x/evm/types" ) func (suite *KeeperTestSuite) TestEndBlock() { - em := suite.ctx.EventManager() - suite.Require().Equal(0, len(em.Events())) + keyring := testkeyring.New(2) + unitNetwork := network.NewUnitTestNetwork( + network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), + ) + ctx := unitNetwork.GetContext() + preEventManager := ctx.EventManager() + suite.Require().Equal(0, len(preEventManager.Events())) - res := suite.app.EVMKeeper.EndBlock(suite.ctx, types.RequestEndBlock{}) - suite.Require().Equal([]types.ValidatorUpdate{}, res) + err := unitNetwork.App.EVMKeeper.EndBlock(ctx) + suite.Require().NoError(err) + postEventManager := unitNetwork.GetContext().EventManager() // should emit 1 EventTypeBlockBloom event on EndBlock - suite.Require().Equal(1, len(em.Events())) - suite.Require().Equal(evmtypes.EventTypeBlockBloom, em.Events()[0].Type) + suite.Require().Equal(1, len(postEventManager.Events())) + suite.Require().Equal(evmtypes.EventTypeBlockBloom, postEventManager.Events()[0].Type) } diff --git a/x/evm/keeper/benchmark_test.go b/x/evm/keeper/benchmark_test.go index 97b85b50..df90b6e6 100644 --- a/x/evm/keeper/benchmark_test.go +++ b/x/evm/keeper/benchmark_test.go @@ -9,7 +9,8 @@ import ( authante "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/evmos/os/testutil" + testconstants "github.com/evmos/os/testutil/constants" + utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/evm/keeper/testdata" "github.com/evmos/os/x/evm/types" "github.com/stretchr/testify/require" @@ -17,32 +18,34 @@ import ( func SetupContract(b *testing.B) (*KeeperTestSuite, common.Address) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() - amt := sdk.Coins{sdk.NewCoin(testutil.ExampleAttoDenom, sdk.NewIntFromUint64(1000000000000000000))} - err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt) + amt := sdk.Coins{sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 1000000000000000000)} + err := suite.network.App.BankKeeper.MintCoins(suite.network.GetContext(), types.ModuleName, amt) require.NoError(b, err) - err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, suite.address.Bytes(), amt) + err = suite.network.App.BankKeeper.SendCoinsFromModuleToAccount(suite.network.GetContext(), types.ModuleName, suite.keyring.GetAddr(0).Bytes(), amt) require.NoError(b, err) - contractAddr := suite.DeployTestContract(b, suite.address, sdkmath.NewIntWithDecimal(1000, 18).BigInt()) - suite.Commit() + contractAddr := suite.DeployTestContract(b, suite.network.GetContext(), suite.keyring.GetAddr(0), sdkmath.NewIntWithDecimal(1000, 18).BigInt()) + err = suite.network.NextBlock() + require.NoError(b, err) return &suite, contractAddr } func SetupTestMessageCall(b *testing.B) (*KeeperTestSuite, common.Address) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() - amt := sdk.Coins{sdk.NewCoin(testutil.ExampleAttoDenom, sdk.NewIntFromUint64(1000000000000000000))} - err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt) + amt := sdk.Coins{sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 1000000000000000000)} + err := suite.network.App.BankKeeper.MintCoins(suite.network.GetContext(), types.ModuleName, amt) require.NoError(b, err) - err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, suite.address.Bytes(), amt) + err = suite.network.App.BankKeeper.SendCoinsFromModuleToAccount(suite.network.GetContext(), types.ModuleName, suite.keyring.GetAddr(0).Bytes(), amt) require.NoError(b, err) contractAddr := suite.DeployTestMessageCall(b) - suite.Commit() + err = suite.network.NextBlock() + require.NoError(b, err) return &suite, contractAddr } @@ -52,40 +55,41 @@ type TxBuilder func(suite *KeeperTestSuite, contract common.Address) *types.MsgE func DoBenchmark(b *testing.B, txBuilder TxBuilder) { suite, contractAddr := SetupContract(b) + krSigner := utiltx.NewSigner(suite.keyring.GetPrivKey(0)) msg := txBuilder(suite, contractAddr) - msg.From = suite.address.Hex() - err := msg.Sign(ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()), suite.signer) + msg.From = suite.keyring.GetAddr(0).Hex() + err := msg.Sign(ethtypes.LatestSignerForChainID(suite.network.App.EVMKeeper.ChainID()), krSigner) require.NoError(b, err) b.ResetTimer() b.StartTimer() for i := 0; i < b.N; i++ { - ctx, _ := suite.ctx.CacheContext() + ctx, _ := suite.network.GetContext().CacheContext() // deduct fee first txData, err := types.UnpackTxData(msg.Data) require.NoError(b, err) fees := sdk.Coins{sdk.NewCoin(suite.EvmDenom(), sdkmath.NewIntFromBigInt(txData.Fee()))} - err = authante.DeductFees(suite.app.BankKeeper, suite.ctx, suite.app.AccountKeeper.GetAccount(ctx, msg.GetFrom()), fees) + err = authante.DeductFees(suite.network.App.BankKeeper, suite.network.GetContext(), suite.network.App.AccountKeeper.GetAccount(ctx, msg.GetFrom()), fees) require.NoError(b, err) - rsp, err := suite.app.EVMKeeper.EthereumTx(sdk.WrapSDKContext(ctx), msg) + rsp, err := suite.network.App.EVMKeeper.EthereumTx(ctx, msg) require.NoError(b, err) require.False(b, rsp.Failed()) } } -func BenchmarkTokenTransfer(b *testing.B) { +func BenchmarkTokenTransfer(b *testing.B) { //nolint:dupl erc20Contract, err := testdata.LoadERC20Contract() require.NoError(b, err, "failed to load erc20 contract") DoBenchmark(b, func(suite *KeeperTestSuite, contract common.Address) *types.MsgEthereumTx { input, err := erc20Contract.ABI.Pack("transfer", common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), big.NewInt(1000)) require.NoError(b, err) - nonce := suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address) + nonce := suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), suite.keyring.GetAddr(0)) ethTxParams := &types.EvmTxArgs{ - ChainID: suite.app.EVMKeeper.ChainID(), + ChainID: suite.network.App.EVMKeeper.ChainID(), Nonce: nonce, To: &contract, Amount: big.NewInt(0), @@ -104,9 +108,9 @@ func BenchmarkEmitLogs(b *testing.B) { DoBenchmark(b, func(suite *KeeperTestSuite, contract common.Address) *types.MsgEthereumTx { input, err := erc20Contract.ABI.Pack("benchmarkLogs", big.NewInt(1000)) require.NoError(b, err) - nonce := suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address) + nonce := suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), suite.keyring.GetAddr(0)) ethTxParams := &types.EvmTxArgs{ - ChainID: suite.app.EVMKeeper.ChainID(), + ChainID: suite.network.App.EVMKeeper.ChainID(), Nonce: nonce, To: &contract, Amount: big.NewInt(0), @@ -123,11 +127,11 @@ func BenchmarkTokenTransferFrom(b *testing.B) { require.NoError(b, err) DoBenchmark(b, func(suite *KeeperTestSuite, contract common.Address) *types.MsgEthereumTx { - input, err := erc20Contract.ABI.Pack("transferFrom", suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), big.NewInt(0)) + input, err := erc20Contract.ABI.Pack("transferFrom", suite.keyring.GetAddr(0), common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), big.NewInt(0)) require.NoError(b, err) - nonce := suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address) + nonce := suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), suite.keyring.GetAddr(0)) ethTxParams := &types.EvmTxArgs{ - ChainID: suite.app.EVMKeeper.ChainID(), + ChainID: suite.network.App.EVMKeeper.ChainID(), Nonce: nonce, To: &contract, Amount: big.NewInt(0), @@ -139,16 +143,16 @@ func BenchmarkTokenTransferFrom(b *testing.B) { }) } -func BenchmarkTokenMint(b *testing.B) { +func BenchmarkTokenMint(b *testing.B) { //nolint:dupl erc20Contract, err := testdata.LoadERC20Contract() require.NoError(b, err, "failed to load erc20 contract") DoBenchmark(b, func(suite *KeeperTestSuite, contract common.Address) *types.MsgEthereumTx { input, err := erc20Contract.ABI.Pack("mint", common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), big.NewInt(1000)) require.NoError(b, err) - nonce := suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address) + nonce := suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), suite.keyring.GetAddr(0)) ethTxParams := &types.EvmTxArgs{ - ChainID: suite.app.EVMKeeper.ChainID(), + ChainID: suite.network.App.EVMKeeper.ChainID(), Nonce: nonce, To: &contract, Amount: big.NewInt(0), @@ -168,9 +172,9 @@ func BenchmarkMessageCall(b *testing.B) { input, err := messageCallContract.ABI.Pack("benchmarkMessageCall", big.NewInt(10000)) require.NoError(b, err) - nonce := suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address) + nonce := suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), suite.keyring.GetAddr(0)) ethTxParams := &types.EvmTxArgs{ - ChainID: suite.app.EVMKeeper.ChainID(), + ChainID: suite.network.App.EVMKeeper.ChainID(), Nonce: nonce, To: &contract, Amount: big.NewInt(0), @@ -180,24 +184,25 @@ func BenchmarkMessageCall(b *testing.B) { } msg := types.NewTx(ethTxParams) - msg.From = suite.address.Hex() - err = msg.Sign(ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()), suite.signer) + msg.From = suite.keyring.GetAddr(0).Hex() + krSigner := utiltx.NewSigner(suite.keyring.GetPrivKey(0)) + err = msg.Sign(ethtypes.LatestSignerForChainID(suite.network.App.EVMKeeper.ChainID()), krSigner) require.NoError(b, err) b.ResetTimer() b.StartTimer() for i := 0; i < b.N; i++ { - ctx, _ := suite.ctx.CacheContext() + ctx, _ := suite.network.GetContext().CacheContext() // deduct fee first txData, err := types.UnpackTxData(msg.Data) require.NoError(b, err) fees := sdk.Coins{sdk.NewCoin(suite.EvmDenom(), sdkmath.NewIntFromBigInt(txData.Fee()))} - err = authante.DeductFees(suite.app.BankKeeper, suite.ctx, suite.app.AccountKeeper.GetAccount(ctx, msg.GetFrom()), fees) + err = authante.DeductFees(suite.network.App.BankKeeper, suite.network.GetContext(), suite.network.App.AccountKeeper.GetAccount(ctx, msg.GetFrom()), fees) require.NoError(b, err) - rsp, err := suite.app.EVMKeeper.EthereumTx(sdk.WrapSDKContext(ctx), msg) + rsp, err := suite.network.App.EVMKeeper.EthereumTx(ctx, msg) require.NoError(b, err) require.False(b, rsp.Failed()) } diff --git a/x/evm/keeper/block_proposer.go b/x/evm/keeper/block_proposer.go index a0e9cb17..0f345154 100644 --- a/x/evm/keeper/block_proposer.go +++ b/x/evm/keeper/block_proposer.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package keeper import ( @@ -11,16 +12,17 @@ import ( // GetCoinbaseAddress returns the block proposer's validator operator address. func (k Keeper) GetCoinbaseAddress(ctx sdk.Context, proposerAddress sdk.ConsAddress) (common.Address, error) { - validator, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, GetProposerAddress(ctx, proposerAddress)) - if !found { + validator, err := k.stakingKeeper.GetValidatorByConsAddr(ctx, GetProposerAddress(ctx, proposerAddress)) + if err != nil { return common.Address{}, errorsmod.Wrapf( stakingtypes.ErrNoValidatorFound, - "failed to retrieve validator from block proposer address %s", + "failed to retrieve validator from block proposer address %s. Error: %s", proposerAddress.String(), + err.Error(), ) } - coinbase := common.BytesToAddress(validator.GetOperator()) + coinbase := common.BytesToAddress([]byte(validator.GetOperator())) return coinbase, nil } diff --git a/x/evm/keeper/call_evm.go b/x/evm/keeper/call_evm.go index 5cf46045..74568491 100644 --- a/x/evm/keeper/call_evm.go +++ b/x/evm/keeper/call_evm.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package keeper import ( @@ -65,7 +66,7 @@ func (k Keeper) CallEVMWithData( return nil, errorsmod.Wrapf(errortypes.ErrJSONMarshal, "failed to marshal tx args: %s", err.Error()) } - gasRes, err := k.EstimateGasInternal(sdk.WrapSDKContext(ctx), &types.EthCallRequest{ + gasRes, err := k.EstimateGasInternal(ctx, &types.EthCallRequest{ Args: args, GasCap: config.DefaultGasCap, }, types.Internal) diff --git a/x/evm/keeper/call_evm_test.go b/x/evm/keeper/call_evm_test.go index 90014f9f..be7124e8 100644 --- a/x/evm/keeper/call_evm_test.go +++ b/x/evm/keeper/call_evm_test.go @@ -5,30 +5,14 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/contracts" - chainutil "github.com/evmos/os/example_chain/testutil" + testconstants "github.com/evmos/os/testutil/constants" utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/erc20/types" evmtypes "github.com/evmos/os/x/evm/types" ) -const erc20Decimals = uint8(18) - -// DeployContract deploys the ERC20MinterBurnerDecimalsContract. -func (suite *KeeperTestSuite) DeployContract(name, symbol string, decimals uint8) (common.Address, error) { - suite.Commit() - addr, err := chainutil.DeployContract( - suite.ctx, - suite.app, - suite.priv, - suite.queryClient, - contracts.ERC20MinterBurnerDecimalsContract, - name, symbol, decimals, - ) - suite.Commit() - return addr, err -} - func (suite *KeeperTestSuite) TestCallEVM() { + wevmosContract := common.HexToAddress(testconstants.WEVMOSContractMainnet) testCases := []struct { name string method string @@ -49,11 +33,8 @@ func (suite *KeeperTestSuite) TestCallEVM() { suite.SetupTest() // reset erc20 := contracts.ERC20MinterBurnerDecimalsContract.ABI - contract, err := suite.DeployContract("coin", "token", erc20Decimals) - suite.Require().NoError(err) account := utiltx.GenerateAddress() - - res, err := suite.app.EVMKeeper.CallEVM(suite.ctx, erc20, types.ModuleAddress, contract, true, tc.method, account) + res, err := suite.network.App.EVMKeeper.CallEVM(suite.network.GetContext(), erc20, types.ModuleAddress, wevmosContract, false, tc.method, account) if tc.expPass { suite.Require().IsTypef(&evmtypes.MsgEthereumTxResponse{}, res, tc.name) suite.Require().NoError(err) @@ -65,80 +46,80 @@ func (suite *KeeperTestSuite) TestCallEVM() { func (suite *KeeperTestSuite) TestCallEVMWithData() { erc20 := contracts.ERC20MinterBurnerDecimalsContract.ABI + wevmosContract := common.HexToAddress(testconstants.WEVMOSContractMainnet) testCases := []struct { name string from common.Address - malleate func() ([]byte, *common.Address) + malleate func() []byte + deploy bool expPass bool }{ { "unknown method", types.ModuleAddress, - func() ([]byte, *common.Address) { - contract, err := suite.DeployContract("coin", "token", erc20Decimals) - suite.Require().NoError(err) + func() []byte { account := utiltx.GenerateAddress() data, _ := erc20.Pack("", account) - return data, &contract + return data }, false, + false, }, { "pass", types.ModuleAddress, - func() ([]byte, *common.Address) { - contract, err := suite.DeployContract("coin", "token", erc20Decimals) - suite.Require().NoError(err) + func() []byte { account := utiltx.GenerateAddress() data, _ := erc20.Pack("balanceOf", account) - return data, &contract + return data }, + false, true, }, { "fail empty data", types.ModuleAddress, - func() ([]byte, *common.Address) { - contract, err := suite.DeployContract("coin", "token", erc20Decimals) - suite.Require().NoError(err) - return []byte{}, &contract + func() []byte { + return []byte{} }, false, + false, }, { "fail empty sender", common.Address{}, - func() ([]byte, *common.Address) { - contract, err := suite.DeployContract("coin", "token", erc20Decimals) - suite.Require().NoError(err) - return []byte{}, &contract + func() []byte { + return []byte{} }, false, + false, }, { "deploy", types.ModuleAddress, - func() ([]byte, *common.Address) { + func() []byte { ctorArgs, _ := contracts.ERC20MinterBurnerDecimalsContract.ABI.Pack("", "test", "test", uint8(18)) data := append(contracts.ERC20MinterBurnerDecimalsContract.Bin, ctorArgs...) //nolint:gocritic - return data, nil + return data }, true, + true, }, { "fail deploy", types.ModuleAddress, - func() ([]byte, *common.Address) { - params := suite.app.EVMKeeper.GetParams(suite.ctx) + func() []byte { + params := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) params.AccessControl.Create = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypeRestricted, } - _ = suite.app.EVMKeeper.SetParams(suite.ctx, params) + _ = suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), params) ctorArgs, _ := contracts.ERC20MinterBurnerDecimalsContract.ABI.Pack("", "test", "test", uint8(18)) data := append(contracts.ERC20MinterBurnerDecimalsContract.Bin, ctorArgs...) //nolint:gocritic - return data, nil + return data }, + true, false, }, } @@ -147,9 +128,16 @@ func (suite *KeeperTestSuite) TestCallEVMWithData() { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { suite.SetupTest() // reset - data, contract := tc.malleate() + data := tc.malleate() + var res *evmtypes.MsgEthereumTxResponse + var err error + + if tc.deploy { + res, err = suite.network.App.EVMKeeper.CallEVMWithData(suite.network.GetContext(), tc.from, nil, data, true) + } else { + res, err = suite.network.App.EVMKeeper.CallEVMWithData(suite.network.GetContext(), tc.from, &wevmosContract, data, false) + } - res, err := suite.app.EVMKeeper.CallEVMWithData(suite.ctx, tc.from, contract, data, true) if tc.expPass { suite.Require().IsTypef(&evmtypes.MsgEthereumTxResponse{}, res, tc.name) suite.Require().NoError(err) diff --git a/x/evm/keeper/fees_test.go b/x/evm/keeper/fees_test.go index a803d944..1ceeabcd 100644 --- a/x/evm/keeper/fees_test.go +++ b/x/evm/keeper/fees_test.go @@ -8,7 +8,8 @@ import ( "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" ethparams "github.com/ethereum/go-ethereum/params" - "github.com/evmos/os/testutil" + testconstants "github.com/evmos/os/testutil/constants" + utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/evm/keeper" evmtypes "github.com/evmos/os/x/evm/types" ) @@ -20,6 +21,7 @@ func (suite *KeeperTestSuite) TestCheckSenderBalance() { fiveInt := sdkmath.NewInt(5) fiftyInt := sdkmath.NewInt(50) negInt := sdkmath.NewInt(-10) + addr := utiltx.GenerateAddress() testCases := []struct { name string @@ -36,168 +38,168 @@ func (suite *KeeperTestSuite) TestCheckSenderBalance() { }{ { name: "Enough balance", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 10, gasPrice: &oneInt, cost: &oneInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: true, }, { name: "Equal balance", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 99, gasPrice: &oneInt, cost: &oneInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: true, }, { name: "negative cost", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 1, gasPrice: &oneInt, cost: &negInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: false, }, { name: "Higher gas limit, not enough balance", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 100, gasPrice: &oneInt, cost: &oneInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: false, }, { name: "Higher gas price, enough balance", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 10, gasPrice: &fiveInt, cost: &oneInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: true, }, { name: "Higher gas price, not enough balance", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 20, gasPrice: &fiveInt, cost: &oneInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: false, }, { name: "Higher cost, enough balance", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 10, gasPrice: &fiveInt, cost: &fiftyInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: true, }, { name: "Higher cost, not enough balance", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 10, gasPrice: &fiveInt, cost: &hundredInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: false, }, { name: "Enough balance w/ enableFeemarket", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 10, gasFeeCap: big.NewInt(1), cost: &oneInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: true, enableFeemarket: true, }, { name: "Equal balance w/ enableFeemarket", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 99, gasFeeCap: big.NewInt(1), cost: &oneInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: true, enableFeemarket: true, }, { name: "negative cost w/ enableFeemarket", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 1, gasFeeCap: big.NewInt(1), cost: &negInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: false, enableFeemarket: true, }, { name: "Higher gas limit, not enough balance w/ enableFeemarket", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 100, gasFeeCap: big.NewInt(1), cost: &oneInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: false, enableFeemarket: true, }, { name: "Higher gas price, enough balance w/ enableFeemarket", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 10, gasFeeCap: big.NewInt(5), cost: &oneInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: true, enableFeemarket: true, }, { name: "Higher gas price, not enough balance w/ enableFeemarket", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 20, gasFeeCap: big.NewInt(5), cost: &oneInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: false, enableFeemarket: true, }, { name: "Higher cost, enough balance w/ enableFeemarket", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 10, gasFeeCap: big.NewInt(5), cost: &fiftyInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: true, enableFeemarket: true, }, { name: "Higher cost, not enough balance w/ enableFeemarket", - to: suite.address.String(), + to: suite.keyring.GetAddr(0).String(), gasLimit: 10, gasFeeCap: big.NewInt(5), cost: &hundredInt, - from: suite.address.String(), + from: addr.String(), accessList: ðtypes.AccessList{}, expectPass: false, enableFeemarket: true, @@ -205,8 +207,8 @@ func (suite *KeeperTestSuite) TestCheckSenderBalance() { } vmdb := suite.StateDB() - vmdb.AddBalance(suite.address, hundredInt.BigInt()) - balance := vmdb.GetBalance(suite.address) + vmdb.AddBalance(addr, hundredInt.BigInt()) + balance := vmdb.GetBalance(addr) suite.Require().Equal(balance, hundredInt.BigInt()) err := vmdb.Commit() suite.Require().NoError(err, "Unexpected error while committing to vmdb: %d", err) @@ -247,7 +249,7 @@ func (suite *KeeperTestSuite) TestCheckSenderBalance() { txData, _ := evmtypes.UnpackTxData(tx.Data) - acct := suite.app.EVMKeeper.GetAccountOrEmpty(suite.ctx, suite.address) + acct := suite.network.App.EVMKeeper.GetAccountOrEmpty(suite.network.GetContext(), addr) err := keeper.CheckSenderBalance( sdkmath.NewIntFromBigInt(acct.Balance), txData, @@ -274,6 +276,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { oneInt := sdkmath.NewInt(1) fiveInt := sdkmath.NewInt(5) fiftyInt := sdkmath.NewInt(50) + addr, _ := utiltx.NewAddrKey() // should be enough to cover all test cases initBalance := sdkmath.NewInt((ethparams.InitialBaseFee + 10) * 105) @@ -300,7 +303,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { accessList: ðtypes.AccessList{}, expectPassVerify: true, expectPassDeduct: true, - from: suite.address.String(), + from: addr.String(), }, { name: "Equal balance", @@ -310,7 +313,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { accessList: ðtypes.AccessList{}, expectPassVerify: true, expectPassDeduct: true, - from: suite.address.String(), + from: addr.String(), }, { name: "Higher gas limit, not enough balance", @@ -320,7 +323,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { accessList: ðtypes.AccessList{}, expectPassVerify: true, expectPassDeduct: false, - from: suite.address.String(), + from: addr.String(), }, { name: "Higher gas price, enough balance", @@ -330,7 +333,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { accessList: ðtypes.AccessList{}, expectPassVerify: true, expectPassDeduct: true, - from: suite.address.String(), + from: addr.String(), }, { name: "Higher gas price, not enough balance", @@ -340,7 +343,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { accessList: ðtypes.AccessList{}, expectPassVerify: true, expectPassDeduct: false, - from: suite.address.String(), + from: addr.String(), }, // This case is expected to be true because the fees can be deducted, but the tx // execution is going to fail because there is no more balance to pay the cost @@ -352,7 +355,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { accessList: ðtypes.AccessList{}, expectPassVerify: true, expectPassDeduct: true, - from: suite.address.String(), + from: addr.String(), }, // testcases with enableFeemarket enabled. { @@ -365,7 +368,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { expectPassVerify: false, expectPassDeduct: true, enableFeemarket: true, - from: suite.address.String(), + from: addr.String(), }, { name: "empty tip fee is valid to deduct", @@ -377,7 +380,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { expectPassVerify: true, expectPassDeduct: true, enableFeemarket: true, - from: suite.address.String(), + from: addr.String(), }, { name: "effectiveTip equal to gasTipCap", @@ -388,7 +391,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { expectPassVerify: true, expectPassDeduct: true, enableFeemarket: true, - from: suite.address.String(), + from: addr.String(), }, { name: "effectiveTip equal to (gasFeeCap - baseFee)", @@ -400,7 +403,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { expectPassVerify: true, expectPassDeduct: true, enableFeemarket: true, - from: suite.address.String(), + from: addr.String(), }, { name: "Invalid from address", @@ -419,13 +422,13 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { cost: &oneInt, accessList: ðtypes.AccessList{ ethtypes.AccessTuple{ - Address: suite.address, + Address: suite.keyring.GetAddr(0), StorageKeys: []common.Hash{}, }, }, expectPassVerify: true, expectPassDeduct: true, - from: suite.address.String(), + from: addr.String(), }, { name: "gasLimit < intrinsicGas during IsCheckTx", @@ -435,9 +438,9 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { accessList: ðtypes.AccessList{}, expectPassVerify: false, expectPassDeduct: true, - from: suite.address.String(), + from: addr.String(), malleate: func() { - suite.ctx = suite.ctx.WithIsCheckTx(true) + suite.network.WithIsCheckTxCtx(true) }, }, } @@ -465,25 +468,26 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { } else { gasTipCap = tc.gasTipCap } - vmdb.AddBalance(suite.address, initBalance.BigInt()) - balance := vmdb.GetBalance(suite.address) + vmdb.AddBalance(addr, initBalance.BigInt()) + balance := vmdb.GetBalance(addr) suite.Require().Equal(balance, initBalance.BigInt()) } else { if tc.gasPrice != nil { gasPrice = tc.gasPrice.BigInt() } - vmdb.AddBalance(suite.address, hundredInt.BigInt()) - balance := vmdb.GetBalance(suite.address) + vmdb.AddBalance(addr, hundredInt.BigInt()) + balance := vmdb.GetBalance(addr) suite.Require().Equal(balance, hundredInt.BigInt()) } err := vmdb.Commit() suite.Require().NoError(err, "Unexpected error while committing to vmdb: %d", err) + toAddr := suite.keyring.GetAddr(0) ethTxParams := &evmtypes.EvmTxArgs{ ChainID: zeroInt.BigInt(), Nonce: 1, - To: &suite.address, + To: &toAddr, Amount: amount, GasLimit: tc.gasLimit, GasPrice: gasPrice, @@ -496,20 +500,20 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { txData, _ := evmtypes.UnpackTxData(tx.Data) - evmParams := suite.app.EVMKeeper.GetParams(suite.ctx) + evmParams := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) ethCfg := evmParams.GetChainConfig().EthereumConfig(nil) - baseFee := suite.app.EVMKeeper.GetBaseFee(suite.ctx, ethCfg) + baseFee := suite.network.App.EVMKeeper.GetBaseFee(suite.network.GetContext(), ethCfg) priority := evmtypes.GetTxPriority(txData, baseFee) - fees, err := keeper.VerifyFee(txData, testutil.ExampleAttoDenom, baseFee, false, false, suite.ctx.IsCheckTx()) + fees, err := keeper.VerifyFee(txData, testconstants.ExampleAttoDenom, baseFee, false, false, suite.network.GetContext().IsCheckTx()) if tc.expectPassVerify { suite.Require().NoError(err, "valid test %d failed - '%s'", i, tc.name) if tc.enableFeemarket { - baseFee := suite.app.FeeMarketKeeper.GetBaseFee(suite.ctx) + baseFee := suite.network.App.FeeMarketKeeper.GetBaseFee(suite.network.GetContext()) suite.Require().Equal( fees, sdk.NewCoins( - sdk.NewCoin(testutil.ExampleAttoDenom, sdkmath.NewIntFromBigInt(txData.EffectiveFee(baseFee))), + sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewIntFromBigInt(txData.EffectiveFee(baseFee))), ), "valid test %d failed, fee value is wrong - '%s'", i, tc.name, ) @@ -518,7 +522,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { suite.Require().Equal( fees, sdk.NewCoins( - sdk.NewCoin(testutil.ExampleAttoDenom, tc.gasPrice.Mul(sdkmath.NewIntFromUint64(tc.gasLimit))), + sdk.NewCoin(testconstants.ExampleAttoDenom, tc.gasPrice.Mul(sdkmath.NewIntFromUint64(tc.gasLimit))), ), "valid test %d failed, fee value is wrong - '%s'", i, tc.name, ) @@ -528,7 +532,7 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { suite.Require().Nil(fees, "invalid test %d passed. fees value must be nil - '%s'", i, tc.name) } - err = suite.app.EVMKeeper.DeductTxCostsFromUserBalance(suite.ctx, fees, common.HexToAddress(tx.From)) + err = suite.network.App.EVMKeeper.DeductTxCostsFromUserBalance(suite.network.GetContext(), fees, common.HexToAddress(tx.From)) if tc.expectPassDeduct { suite.Require().NoError(err, "valid test %d failed - '%s'", i, tc.name) } else { diff --git a/x/evm/keeper/grpc_query.go b/x/evm/keeper/grpc_query.go index 6a2b97bb..9d753fd8 100644 --- a/x/evm/keeper/grpc_query.go +++ b/x/evm/keeper/grpc_query.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package keeper import ( @@ -107,18 +108,22 @@ func (k Keeper) ValidatorAccount(c context.Context, req *types.QueryValidatorAcc ctx := sdk.UnwrapSDKContext(c) - validator, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, consAddr) - if !found { - return nil, fmt.Errorf("validator not found for %s", consAddr.String()) + validator, err := k.stakingKeeper.GetValidatorByConsAddr(ctx, consAddr) + if err != nil { + return nil, fmt.Errorf("error while getting validator %s. %w", consAddr.String(), err) } - accAddr := sdk.AccAddress(validator.GetOperator()) + valAddr := validator.GetOperator() + addrBz, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(valAddr) + if err != nil { + return nil, fmt.Errorf("error while getting validator %s. %w", consAddr.String(), err) + } res := types.QueryValidatorAccountResponse{ - AccountAddress: accAddr.String(), + AccountAddress: sdk.AccAddress(addrBz).String(), } - account := k.accountKeeper.GetAccount(ctx, accAddr) + account := k.accountKeeper.GetAccount(ctx, addrBz) if account != nil { res.Sequence = account.GetSequence() res.AccountNumber = account.GetAccountNumber() @@ -261,8 +266,7 @@ func (k Keeper) EstimateGas(c context.Context, req *types.EthCallRequest) (*type } // EstimateGasInternal returns the gas estimation for the corresponding request. -// This function is called from the RPC client (eth_estimateGas) and internally -// by the CallEVMWithData function in the x/erc20 module keeper. +// This function is called from the RPC client (eth_estimateGas) and internally. // When called from the RPC client, we need to reset the gas meter before // simulating the transaction to have // an accurate gas estimation for EVM extensions transactions. @@ -300,15 +304,13 @@ func (k Keeper) EstimateGasInternal(c context.Context, req *types.EthCallRequest } else { // Query block gas limit params := ctx.ConsensusParams() - if params != nil && params.Block != nil && params.Block.MaxGas > 0 { - hi = uint64(params.Block.MaxGas) + if params.Block != nil && params.Block.MaxGas > 0 { + hi = uint64(params.Block.MaxGas) //nolint:gosec // G115 // won't exceed uint64 } else { hi = req.GasCap } } - // TODO: Recap the highest gas limit with account's available balance. - // Recap the highest gas allowance with specified gascap. if req.GasCap != 0 && hi > req.GasCap { hi = req.GasCap @@ -324,7 +326,7 @@ func (k Keeper) EstimateGasInternal(c context.Context, req *types.EthCallRequest nonce := k.GetNonce(ctx, args.GetFrom()) args.Nonce = (*hexutil.Uint64)(&nonce) - txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash().Bytes())) + txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash())) // convert the tx args to an ethereum message msg, err := args.ToMessage(req.GasCap, cfg.BaseFee) @@ -332,6 +334,32 @@ func (k Keeper) EstimateGasInternal(c context.Context, req *types.EthCallRequest return nil, status.Error(codes.Internal, err.Error()) } + // Recap the highest gas limit with account's available balance. + if msg.GasFeeCap().BitLen() != 0 { + balance := k.bankKeeper.GetBalance(ctx, sdk.AccAddress(args.From.Bytes()), k.GetParams(ctx).EvmDenom) + available := balance.Amount + transfer := "0" + if args.Value != nil { + if args.Value.ToInt().Cmp(available.BigInt()) >= 0 { + return nil, core.ErrInsufficientFundsForTransfer + } + available = available.Sub(sdkmath.NewIntFromBigInt(args.Value.ToInt())) + transfer = args.Value.String() + } + allowance := available.Quo(sdkmath.NewIntFromBigInt(msg.GasFeeCap())) + + // If the allowance is larger than maximum uint64, skip checking + if allowance.IsUint64() && hi > allowance.Uint64() { + k.Logger(ctx).Debug("Gas estimation capped by limited funds", "original", hi, "balance", balance, + "sent", transfer, "maxFeePerGas", msg.GasFeeCap().String(), "fundable", allowance) + + hi = allowance.Uint64() + if hi < ethparams.TxGas { + return nil, core.ErrInsufficientFunds + } + } + } + // NOTE: the errors from the executable below should be consistent with go-ethereum, // so we don't wrap them with the gRPC status code @@ -437,7 +465,7 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ ctx = ctx.WithHeaderHash(common.Hex2Bytes(req.BlockHash)) // to get the base fee we only need the block max gas in the consensus params - ctx = ctx.WithConsensusParams(&tmproto.ConsensusParams{ + ctx = ctx.WithConsensusParams(tmproto.ConsensusParams{ Block: &tmproto.BlockParams{MaxGas: req.BlockMaxGas}, }) @@ -458,7 +486,7 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ signer := ethtypes.MakeSigner(cfg.ChainConfig, big.NewInt(ctx.BlockHeight())) - txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash().Bytes())) + txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash())) // gas used at this point corresponds to GetProposerAddress & CalculateBaseFee // need to reset gas meter per transaction to be consistent with tx execution @@ -471,7 +499,7 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ continue } txConfig.TxHash = ethTx.Hash() - txConfig.TxIndex = uint(i) + txConfig.TxIndex = uint(i) //nolint:gosec // G115 // won't exceed uint64 // reset gas meter for each transaction ctx = evmante.BuildEvmExecutionCtx(ctx). WithGasMeter(evmostypes.NewInfiniteGasMeterWithLimit(msg.Gas())) @@ -535,7 +563,7 @@ func (k Keeper) TraceBlock(c context.Context, req *types.QueryTraceBlockRequest) ctx = ctx.WithHeaderHash(common.Hex2Bytes(req.BlockHash)) // to get the base fee we only need the block max gas in the consensus params - ctx = ctx.WithConsensusParams(&tmproto.ConsensusParams{ + ctx = ctx.WithConsensusParams(tmproto.ConsensusParams{ Block: &tmproto.BlockParams{MaxGas: req.BlockMaxGas}, }) @@ -559,13 +587,13 @@ func (k Keeper) TraceBlock(c context.Context, req *types.QueryTraceBlockRequest) txsLength := len(req.Txs) results := make([]*types.TxTraceResult, 0, txsLength) - txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash().Bytes())) + txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash())) for i, tx := range req.Txs { result := types.TxTraceResult{} ethTx := tx.AsTransaction() txConfig.TxHash = ethTx.Hash() - txConfig.TxIndex = uint(i) + txConfig.TxIndex = uint(i) //nolint:gosec // G115 // won't exceed uint64 traceResult, logIndex, err := k.traceTx(ctx, cfg, txConfig, signer, ethTx, req.TraceConfig, true, nil) if err != nil { result.Error = err.Error() diff --git a/x/evm/keeper/grpc_query_test.go b/x/evm/keeper/grpc_query_test.go index 19c9f9fe..ad83d5c5 100644 --- a/x/evm/keeper/grpc_query_test.go +++ b/x/evm/keeper/grpc_query_test.go @@ -3,97 +3,99 @@ package keeper_test import ( "encoding/json" "fmt" + "math" "math/big" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" ethparams "github.com/ethereum/go-ethereum/params" - exampleapp "github.com/evmos/os/example_chain" "github.com/evmos/os/server/config" - "github.com/evmos/os/testutil" - utiltx "github.com/evmos/os/testutil/tx" + testconstants "github.com/evmos/os/testutil/constants" + "github.com/evmos/os/testutil/integration/os/factory" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" + "github.com/evmos/os/testutil/integration/os/network" ethlogger "github.com/evmos/os/x/evm/core/logger" "github.com/evmos/os/x/evm/core/vm" "github.com/evmos/os/x/evm/keeper/testdata" "github.com/evmos/os/x/evm/statedb" "github.com/evmos/os/x/evm/types" - - // TODO: why is this necessary? shouldn't be required t do this dummy import because it's not required on Evmos? - _ "github.com/evmos/os/x/evm/core/tracers/js" + feemarkettypes "github.com/evmos/os/x/feemarket/types" ) // Not valid Ethereum address const invalidAddress = "0x0000" -// expGasConsumed is the gas consumed in traceTx setup (GetProposerAddr + CalculateBaseFee) -const expGasConsumed = 7346 - -// expGasConsumedWithFeeMkt is the gas consumed in traceTx setup (GetProposerAddr + CalculateBaseFee) with enabled feemarket -const expGasConsumedWithFeeMkt = 7340 - func (suite *KeeperTestSuite) TestQueryAccount() { - var ( - req *types.QueryAccountRequest - expAccount *types.QueryAccountResponse - ) - testCases := []struct { - msg string - malleate func() - expPass bool + msg string + getReq func() *types.QueryAccountRequest + expResponse *types.QueryAccountResponse + expPass bool }{ { "invalid address", - func() { - expAccount = &types.QueryAccountResponse{ - Balance: "0", - CodeHash: common.BytesToHash(crypto.Keccak256(nil)).Hex(), - Nonce: 0, - } - req = &types.QueryAccountRequest{ + func() *types.QueryAccountRequest { + return &types.QueryAccountRequest{ Address: invalidAddress, } }, + nil, false, }, { "success", - func() { - amt := sdk.Coins{sdk.NewInt64Coin(testutil.ExampleAttoDenom, 100)} - err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt) + func() *types.QueryAccountRequest { + amt := sdk.Coins{sdk.NewInt64Coin(testconstants.ExampleAttoDenom, 100)} + + // Add new unfunded key + index := suite.keyring.AddKey() + addr := suite.keyring.GetAddr(index) + + err := suite.network.App.BankKeeper.MintCoins( + suite.network.GetContext(), + types.ModuleName, + amt, + ) suite.Require().NoError(err) - err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, suite.address.Bytes(), amt) + + err = suite.network.App.BankKeeper.SendCoinsFromModuleToAccount( + suite.network.GetContext(), + types.ModuleName, + addr.Bytes(), + amt, + ) suite.Require().NoError(err) - expAccount = &types.QueryAccountResponse{ - Balance: "100", - CodeHash: common.BytesToHash(crypto.Keccak256(nil)).Hex(), - Nonce: 0, - } - req = &types.QueryAccountRequest{ - Address: suite.address.String(), + return &types.QueryAccountRequest{ + Address: addr.String(), } }, + &types.QueryAccountResponse{ + Balance: "100", + CodeHash: common.BytesToHash(crypto.Keccak256(nil)).Hex(), + Nonce: 0, + }, true, }, } for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.SetupTest() // reset + req := tc.getReq() + expectedResponse := tc.expResponse + + ctx := suite.network.GetContext() + // Function under test + res, err := suite.network.GetEvmClient().Account(ctx, req) - tc.malleate() - ctx := sdk.WrapSDKContext(suite.ctx) - res, err := suite.queryClient.Account(ctx, req) + suite.Require().Equal(expectedResponse, res) if tc.expPass { suite.Require().NoError(err) - suite.Require().NotNil(res) - - suite.Require().Equal(expAccount, res) } else { suite.Require().Error(err) } @@ -102,58 +104,63 @@ func (suite *KeeperTestSuite) TestQueryAccount() { } func (suite *KeeperTestSuite) TestQueryCosmosAccount() { - var ( - req *types.QueryCosmosAccountRequest - expAccount *types.QueryCosmosAccountResponse - ) - testCases := []struct { - msg string - malleate func() - expPass bool + msg string + getReqAndResp func() (*types.QueryCosmosAccountRequest, *types.QueryCosmosAccountResponse) + expPass bool }{ { "invalid address", - func() { - expAccount = &types.QueryCosmosAccountResponse{ - CosmosAddress: sdk.AccAddress(common.Address{}.Bytes()).String(), - } - req = &types.QueryCosmosAccountRequest{ + func() (*types.QueryCosmosAccountRequest, *types.QueryCosmosAccountResponse) { + req := &types.QueryCosmosAccountRequest{ Address: invalidAddress, } + return req, nil }, false, }, { "success", - func() { - expAccount = &types.QueryCosmosAccountResponse{ - CosmosAddress: sdk.AccAddress(suite.address.Bytes()).String(), + func() (*types.QueryCosmosAccountRequest, *types.QueryCosmosAccountResponse) { + key := suite.keyring.GetKey(0) + expAccount := &types.QueryCosmosAccountResponse{ + CosmosAddress: key.AccAddr.String(), Sequence: 0, AccountNumber: 0, } - req = &types.QueryCosmosAccountRequest{ - Address: suite.address.String(), + req := &types.QueryCosmosAccountRequest{ + Address: key.Addr.String(), } + + return req, expAccount }, true, }, { "success with seq and account number", - func() { - acc := suite.app.AccountKeeper.GetAccount(suite.ctx, suite.address.Bytes()) + func() (*types.QueryCosmosAccountRequest, *types.QueryCosmosAccountResponse) { + index := suite.keyring.AddKey() + newKey := suite.keyring.GetKey(index) + accountNumber := uint64(100) + acc := suite.network.App.AccountKeeper.NewAccountWithAddress( + suite.network.GetContext(), + newKey.AccAddr, + ) + suite.Require().NoError(acc.SetSequence(10)) - suite.Require().NoError(acc.SetAccountNumber(1)) - suite.app.AccountKeeper.SetAccount(suite.ctx, acc) + suite.Require().NoError(acc.SetAccountNumber(accountNumber)) + suite.network.App.AccountKeeper.SetAccount(suite.network.GetContext(), acc) - expAccount = &types.QueryCosmosAccountResponse{ - CosmosAddress: sdk.AccAddress(suite.address.Bytes()).String(), + expAccount := &types.QueryCosmosAccountResponse{ + CosmosAddress: newKey.AccAddr.String(), Sequence: 10, - AccountNumber: 1, + AccountNumber: accountNumber, } - req = &types.QueryCosmosAccountRequest{ - Address: suite.address.String(), + + req := &types.QueryCosmosAccountRequest{ + Address: newKey.Addr.String(), } + return req, expAccount }, true, }, @@ -161,17 +168,17 @@ func (suite *KeeperTestSuite) TestQueryCosmosAccount() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.SetupTest() // reset + req, expectedResponse := tc.getReqAndResp() + + ctx := suite.network.GetContext() + + // Function under test + res, err := suite.network.GetEvmClient().CosmosAccount(ctx, req) - tc.malleate() - ctx := sdk.WrapSDKContext(suite.ctx) - res, err := suite.queryClient.CosmosAccount(ctx, req) + suite.Require().Equal(expectedResponse, res) if tc.expPass { suite.Require().NoError(err) - suite.Require().NotNil(res) - - suite.Require().Equal(expAccount, res) } else { suite.Require().Error(err) } @@ -180,38 +187,40 @@ func (suite *KeeperTestSuite) TestQueryCosmosAccount() { } func (suite *KeeperTestSuite) TestQueryBalance() { - var ( - req *types.QueryBalanceRequest - expBalance string - ) - testCases := []struct { - msg string - malleate func() - expPass bool + msg string + getReqAndResp func() (*types.QueryBalanceRequest, *types.QueryBalanceResponse) + expPass bool }{ { "invalid address", - func() { - expBalance = "0" - req = &types.QueryBalanceRequest{ + func() (*types.QueryBalanceRequest, *types.QueryBalanceResponse) { + req := &types.QueryBalanceRequest{ Address: invalidAddress, } + return req, nil }, false, }, { "success", - func() { - amt := sdk.Coins{sdk.NewInt64Coin(testutil.ExampleAttoDenom, 100)} - err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt) + func() (*types.QueryBalanceRequest, *types.QueryBalanceResponse) { + newIndex := suite.keyring.AddKey() + addr := suite.keyring.GetAddr(newIndex) + + balance := int64(100) + amt := sdk.Coins{sdk.NewInt64Coin(testconstants.ExampleAttoDenom, balance)} + + err := suite.network.App.BankKeeper.MintCoins(suite.network.GetContext(), types.ModuleName, amt) suite.Require().NoError(err) - err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, suite.address.Bytes(), amt) + err = suite.network.App.BankKeeper.SendCoinsFromModuleToAccount(suite.network.GetContext(), types.ModuleName, addr.Bytes(), amt) suite.Require().NoError(err) - expBalance = "100" - req = &types.QueryBalanceRequest{ - Address: suite.address.String(), + req := &types.QueryBalanceRequest{ + Address: addr.String(), + } + return req, &types.QueryBalanceResponse{ + Balance: fmt.Sprint(balance), } }, true, @@ -220,17 +229,14 @@ func (suite *KeeperTestSuite) TestQueryBalance() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.SetupTest() // reset + req, resp := tc.getReqAndResp() - tc.malleate() - ctx := sdk.WrapSDKContext(suite.ctx) - res, err := suite.queryClient.Balance(ctx, req) + ctx := suite.network.GetContext() + res, err := suite.network.GetEvmClient().Balance(ctx, req) + suite.Require().Equal(resp, res) if tc.expPass { suite.Require().NoError(err) - suite.Require().NotNil(res) - - suite.Require().Equal(expBalance, res.Balance) } else { suite.Require().Error(err) } @@ -239,36 +245,45 @@ func (suite *KeeperTestSuite) TestQueryBalance() { } func (suite *KeeperTestSuite) TestQueryStorage() { - var ( - req *types.QueryStorageRequest - expValue string - ) - testCases := []struct { - msg string - malleate func(vm.StateDB) - expPass bool + msg string + getReqAndResp func() (*types.QueryStorageRequest, *types.QueryStorageResponse) + expPass bool }{ { "invalid address", - func(vm.StateDB) { - req = &types.QueryStorageRequest{ + func() (*types.QueryStorageRequest, *types.QueryStorageResponse) { + req := &types.QueryStorageRequest{ Address: invalidAddress, } + return req, nil }, false, }, { "success", - func(vmdb vm.StateDB) { + func() (*types.QueryStorageRequest, *types.QueryStorageResponse) { key := common.BytesToHash([]byte("key")) - value := common.BytesToHash([]byte("value")) - expValue = value.String() - vmdb.SetState(suite.address, key, value) - req = &types.QueryStorageRequest{ - Address: suite.address.String(), + value := []byte("value") + expValue := common.BytesToHash(value) + + newIndex := suite.keyring.AddKey() + addr := suite.keyring.GetAddr(newIndex) + + suite.network.App.EVMKeeper.SetState( + suite.network.GetContext(), + addr, + key, + value, + ) + + req := &types.QueryStorageRequest{ + Address: addr.String(), Key: key.String(), } + return req, &types.QueryStorageResponse{ + Value: expValue.String(), + } }, true, }, @@ -276,20 +291,15 @@ func (suite *KeeperTestSuite) TestQueryStorage() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.SetupTest() // reset + req, expectedResp := tc.getReqAndResp() - vmdb := suite.StateDB() - tc.malleate(vmdb) - suite.Require().NoError(vmdb.Commit()) + ctx := suite.network.GetContext() + res, err := suite.network.GetEvmClient().Storage(ctx, req) - ctx := sdk.WrapSDKContext(suite.ctx) - res, err := suite.queryClient.Storage(ctx, req) + suite.Require().Equal(expectedResp, res) if tc.expPass { suite.Require().NoError(err) - suite.Require().NotNil(res) - - suite.Require().Equal(expValue, res.Value) } else { suite.Require().Error(err) } @@ -304,29 +314,36 @@ func (suite *KeeperTestSuite) TestQueryCode() { ) testCases := []struct { - msg string - malleate func(vm.StateDB) - expPass bool + msg string + getReqAndResp func() (*types.QueryCodeRequest, *types.QueryCodeResponse) + expPass bool }{ { "invalid address", - func(vm.StateDB) { + func() (*types.QueryCodeRequest, *types.QueryCodeResponse) { req = &types.QueryCodeRequest{ Address: invalidAddress, } - exp := &types.QueryCodeResponse{} - expCode = exp.Code + return req, nil }, false, }, { "success", - func(vmdb vm.StateDB) { + func() (*types.QueryCodeRequest, *types.QueryCodeResponse) { + newIndex := suite.keyring.AddKey() + addr := suite.keyring.GetAddr(newIndex) + expCode = []byte("code") - vmdb.SetCode(suite.address, expCode) + stateDB := suite.network.GetStateDB() + stateDB.SetCode(addr, expCode) + suite.Require().NoError(stateDB.Commit()) req = &types.QueryCodeRequest{ - Address: suite.address.String(), + Address: addr.String(), + } + return req, &types.QueryCodeResponse{ + Code: hexutil.Bytes(expCode), } }, true, @@ -335,20 +352,14 @@ func (suite *KeeperTestSuite) TestQueryCode() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.SetupTest() // reset + req, expectedResponse := tc.getReqAndResp() - vmdb := suite.StateDB() - tc.malleate(vmdb) - suite.Require().NoError(vmdb.Commit()) - - ctx := sdk.WrapSDKContext(suite.ctx) - res, err := suite.queryClient.Code(ctx, req) + ctx := suite.network.GetContext() + res, err := suite.network.GetEvmClient().Code(ctx, req) + suite.Require().Equal(expectedResponse, res) if tc.expPass { suite.Require().NoError(err) - suite.Require().NotNil(res) - - suite.Require().Equal(expCode, res.Code) } else { suite.Require().Error(err) } @@ -356,8 +367,9 @@ func (suite *KeeperTestSuite) TestQueryCode() { } } +// TODO: Fix this one func (suite *KeeperTestSuite) TestQueryTxLogs() { - var expLogs []*types.Log + expLogs := []*types.Log{} txHash := common.BytesToHash([]byte("tx_hash")) txIndex := uint(1) logIndex := uint(1) @@ -375,15 +387,16 @@ func (suite *KeeperTestSuite) TestQueryTxLogs() { { "success", func(vmdb vm.StateDB) { + addr := suite.keyring.GetAddr(0) expLogs = []*types.Log{ { - Address: suite.address.String(), + Address: addr.String(), Topics: []string{common.BytesToHash([]byte("topic")).String()}, Data: []byte("data"), BlockNumber: 1, TxHash: txHash.String(), TxIndex: uint64(txIndex), - BlockHash: common.BytesToHash(suite.ctx.HeaderHash()).Hex(), + BlockHash: common.BytesToHash(suite.network.GetContext().HeaderHash()).Hex(), Index: uint64(logIndex), Removed: false, }, @@ -398,9 +411,18 @@ func (suite *KeeperTestSuite) TestQueryTxLogs() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.SetupTest() // reset + txCfg := statedb.NewTxConfig( + common.BytesToHash(suite.network.GetContext().HeaderHash()), + txHash, + txIndex, + logIndex, + ) + vmdb := statedb.New( + suite.network.GetContext(), + suite.network.App.EVMKeeper, + txCfg, + ) - vmdb := statedb.New(suite.ctx, suite.app.EVMKeeper, statedb.NewTxConfig(common.BytesToHash(suite.ctx.HeaderHash().Bytes()), txHash, txIndex, logIndex)) tc.malleate(vmdb) suite.Require().NoError(vmdb.Commit()) @@ -411,70 +433,87 @@ func (suite *KeeperTestSuite) TestQueryTxLogs() { } func (suite *KeeperTestSuite) TestQueryParams() { - ctx := sdk.WrapSDKContext(suite.ctx) + ctx := suite.network.GetContext() + expParams := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) + expParams.ActiveStaticPrecompiles = types.AvailableStaticPrecompiles - // NOTE: we are using the EVM genesis state for the example app here, because - // we have different assumptions for the evmOS offering and the example chain. - expParams := exampleapp.NewEVMGenesisState().Params - - res, err := suite.queryClient.Params(ctx, &types.QueryParamsRequest{}) + res, err := suite.network.GetEvmClient().Params(ctx, &types.QueryParamsRequest{}) suite.Require().NoError(err) suite.Require().Equal(expParams, res.Params) } func (suite *KeeperTestSuite) TestQueryValidatorAccount() { - var ( - req *types.QueryValidatorAccountRequest - expAccount *types.QueryValidatorAccountResponse - ) - testCases := []struct { - msg string - malleate func() - expPass bool + msg string + getReqAndResp func() (*types.QueryValidatorAccountRequest, *types.QueryValidatorAccountResponse) + expPass bool }{ { "invalid address", - func() { - expAccount = &types.QueryValidatorAccountResponse{ - AccountAddress: sdk.AccAddress(common.Address{}.Bytes()).String(), - } - req = &types.QueryValidatorAccountRequest{ + func() (*types.QueryValidatorAccountRequest, *types.QueryValidatorAccountResponse) { + req := &types.QueryValidatorAccountRequest{ ConsAddress: "", } + return req, nil }, false, }, { "success", - func() { - expAccount = &types.QueryValidatorAccountResponse{ - AccountAddress: sdk.AccAddress(suite.address.Bytes()).String(), - Sequence: 0, - AccountNumber: 0, + func() (*types.QueryValidatorAccountRequest, *types.QueryValidatorAccountResponse) { + val := suite.network.GetValidators()[0] + consAddr, err := val.GetConsAddr() + suite.Require().NoError(err) + + req := &types.QueryValidatorAccountRequest{ + ConsAddress: sdk.ConsAddress(consAddr).String(), } - req = &types.QueryValidatorAccountRequest{ - ConsAddress: suite.consAddress.String(), + + addrBz, err := suite.network.App.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.OperatorAddress) + suite.Require().NoError(err) + + resp := &types.QueryValidatorAccountResponse{ + AccountAddress: sdk.AccAddress(addrBz).String(), + Sequence: 0, + AccountNumber: 2, } + + return req, resp }, true, }, { "success with seq and account number", - func() { - acc := suite.app.AccountKeeper.GetAccount(suite.ctx, suite.address.Bytes()) - suite.Require().NoError(acc.SetSequence(10)) - suite.Require().NoError(acc.SetAccountNumber(1)) - suite.app.AccountKeeper.SetAccount(suite.ctx, acc) + func() (*types.QueryValidatorAccountRequest, *types.QueryValidatorAccountResponse) { + val := suite.network.GetValidators()[0] + consAddr, err := val.GetConsAddr() + suite.Require().NoError(err) + + // Create validator account and set sequence and account number + accNumber := uint64(100) + accSeq := uint64(10) + + addrBz, err := suite.network.App.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.OperatorAddress) + suite.Require().NoError(err) - expAccount = &types.QueryValidatorAccountResponse{ - AccountAddress: sdk.AccAddress(suite.address.Bytes()).String(), - Sequence: 10, - AccountNumber: 1, + accAddrStr := sdk.AccAddress(addrBz).String() + + baseAcc := &authtypes.BaseAccount{Address: accAddrStr} + acc := suite.network.App.AccountKeeper.NewAccount(suite.network.GetContext(), baseAcc) + suite.Require().NoError(acc.SetSequence(accSeq)) + suite.Require().NoError(acc.SetAccountNumber(accNumber)) + suite.network.App.AccountKeeper.SetAccount(suite.network.GetContext(), acc) + + resp := &types.QueryValidatorAccountResponse{ + AccountAddress: accAddrStr, + Sequence: accSeq, + AccountNumber: accNumber, } - req = &types.QueryValidatorAccountRequest{ - ConsAddress: suite.consAddress.String(), + req := &types.QueryValidatorAccountRequest{ + ConsAddress: sdk.ConsAddress(consAddr).String(), } + + return req, resp }, true, }, @@ -482,17 +521,13 @@ func (suite *KeeperTestSuite) TestQueryValidatorAccount() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.SetupTest() // reset - - tc.malleate() - ctx := sdk.WrapSDKContext(suite.ctx) - res, err := suite.queryClient.ValidatorAccount(ctx, req) + req, resp := tc.getReqAndResp() + ctx := suite.network.GetContext() + res, err := suite.network.GetEvmClient().ValidatorAccount(ctx, req) + suite.Require().Equal(resp, res) if tc.expPass { suite.Require().NoError(err) - suite.Require().NotNil(res) - - suite.Require().Equal(expAccount, res) } else { suite.Require().Error(err) } @@ -503,216 +538,336 @@ func (suite *KeeperTestSuite) TestQueryValidatorAccount() { func (suite *KeeperTestSuite) TestEstimateGas() { gasHelper := hexutil.Uint64(20000) higherGas := hexutil.Uint64(25000) - hexBigInt := hexutil.Big(*big.NewInt(1)) + // Hardcode recipient address to avoid non determinism in tests + hardcodedRecipient := common.HexToAddress("0xC6Fe5D33615a1C52c08018c47E8Bc53646A0E101") erc20Contract, err := testdata.LoadERC20Contract() - suite.Require().NoError(err, "failed to load erc20 contract") + suite.Require().NoError(err) - var ( - args interface{} - gasCap uint64 - ) testCases := []struct { msg string - malleate func() + getArgs func() types.TransactionArgs expPass bool expGas uint64 enableFeemarket bool + gasCap uint64 }{ // should success, because transfer value is zero { - "default args - special case for ErrIntrinsicGas on contract creation, raise gas limit", - func() { - args = types.TransactionArgs{} + "success - default args - special case for ErrIntrinsicGas on contract creation, raise gas limit", + func() types.TransactionArgs { + return types.TransactionArgs{} }, true, ethparams.TxGasContractCreation, false, + config.DefaultGasCap, }, // should success, because transfer value is zero { - "default args with 'to' address", - func() { - args = types.TransactionArgs{To: &common.Address{}} + "success - default args with 'to' address", + func() types.TransactionArgs { + return types.TransactionArgs{To: &common.Address{}} }, true, ethparams.TxGas, false, + config.DefaultGasCap, }, // should fail, because the default From address(zero address) don't have fund { - "not enough balance", - func() { - args = types.TransactionArgs{To: &common.Address{}, Value: (*hexutil.Big)(big.NewInt(100))} + "fail - not enough balance", + func() types.TransactionArgs { + return types.TransactionArgs{ + To: &common.Address{}, + Value: (*hexutil.Big)(big.NewInt(100)), + } }, false, 0, false, + config.DefaultGasCap, }, // should success, enough balance now { - "enough balance", - func() { - args = types.TransactionArgs{To: &common.Address{}, From: &suite.address, Value: (*hexutil.Big)(big.NewInt(100))} - }, false, 0, false, + "success - enough balance", + func() types.TransactionArgs { + addr := suite.keyring.GetAddr(0) + return types.TransactionArgs{ + To: &common.Address{}, + From: &addr, + Value: (*hexutil.Big)(big.NewInt(100)), + } + }, + true, + ethparams.TxGas, + false, + config.DefaultGasCap, + }, + { + "fail - not enough balance w/ gas fee cap", + func() types.TransactionArgs { + addr := suite.keyring.GetAddr(0) + hexBigInt := hexutil.Big(*big.NewInt(1)) + balance := suite.network.App.BankKeeper.GetBalance(suite.network.GetContext(), sdk.AccAddress(addr.Bytes()), "aevmos") + value := balance.Amount.Add(sdkmath.NewInt(1)) + return types.TransactionArgs{ + To: &common.Address{}, + From: &addr, + Value: (*hexutil.Big)(value.BigInt()), + MaxFeePerGas: &hexBigInt, + } + }, + false, + 0, + false, + config.DefaultGasCap, + }, + { + "fail - insufficient funds for gas * price + value w/ gas fee cap", + func() types.TransactionArgs { + addr := suite.keyring.GetAddr(0) + hexBigInt := hexutil.Big(*big.NewInt(1)) + balance := suite.network.App.BankKeeper.GetBalance(suite.network.GetContext(), sdk.AccAddress(addr.Bytes()), "aevmos") + value := balance.Amount.Sub(sdkmath.NewInt(1)) + return types.TransactionArgs{ + To: &common.Address{}, + From: &addr, + Value: (*hexutil.Big)(value.BigInt()), + MaxFeePerGas: &hexBigInt, + } + }, + false, + 0, + false, + config.DefaultGasCap, }, // should success, because gas limit lower than 21000 is ignored { "gas exceed allowance", - func() { - args = types.TransactionArgs{To: &common.Address{}, Gas: &gasHelper} + func() types.TransactionArgs { + return types.TransactionArgs{To: &common.Address{}, Gas: &gasHelper} }, true, ethparams.TxGas, false, + config.DefaultGasCap, }, // should fail, invalid gas cap { "gas exceed global allowance", - func() { - args = types.TransactionArgs{To: &common.Address{}} - gasCap = 20000 + func() types.TransactionArgs { + return types.TransactionArgs{To: &common.Address{}} }, false, 0, false, + 20000, }, // estimate gas of an erc20 contract deployment, the exact gas number is checked with geth { "contract deployment", - func() { - ctorArgs, err := erc20Contract.ABI.Pack("", &suite.address, sdkmath.NewIntWithDecimal(1000, 18).BigInt()) + func() types.TransactionArgs { + ctorArgs, err := erc20Contract.ABI.Pack( + "", + &hardcodedRecipient, + sdkmath.NewIntWithDecimal(1000, 18).BigInt(), + ) suite.Require().NoError(err) - data := erc20Contract.Bin data = append(data, ctorArgs...) - args = types.TransactionArgs{ - From: &suite.address, + + addr := suite.keyring.GetAddr(0) + return types.TransactionArgs{ Data: (*hexutil.Bytes)(&data), + From: &addr, } }, true, 1186778, false, + config.DefaultGasCap, }, // estimate gas of an erc20 transfer, the exact gas number is checked with geth { "erc20 transfer", - func() { - contractAddr := suite.DeployTestContract(suite.T(), suite.address, sdkmath.NewIntWithDecimal(1000, 18).BigInt()) - suite.Commit() - transferData, err := erc20Contract.ABI.Pack("transfer", common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), big.NewInt(1000)) + func() types.TransactionArgs { + key := suite.keyring.GetKey(0) + contractAddr, err := deployErc20Contract(key, suite.factory) suite.Require().NoError(err) - args = types.TransactionArgs{To: &contractAddr, From: &suite.address, Data: (*hexutil.Bytes)(&transferData)} + + err = suite.network.NextBlock() + suite.Require().NoError(err) + + transferData, err := erc20Contract.ABI.Pack( + "transfer", + hardcodedRecipient, + big.NewInt(1000), + ) + suite.Require().NoError(err) + return types.TransactionArgs{ + To: &contractAddr, + Data: (*hexutil.Bytes)(&transferData), + From: &key.Addr, + } }, true, 51880, false, + config.DefaultGasCap, }, // repeated tests with enableFeemarket { "default args w/ enableFeemarket", - func() { - args = types.TransactionArgs{To: &common.Address{}} + func() types.TransactionArgs { + return types.TransactionArgs{To: &common.Address{}} }, true, ethparams.TxGas, true, + config.DefaultGasCap, }, { "not enough balance w/ enableFeemarket", - func() { - args = types.TransactionArgs{To: &common.Address{}, Value: (*hexutil.Big)(big.NewInt(100))} + func() types.TransactionArgs { + return types.TransactionArgs{ + To: &common.Address{}, + Value: (*hexutil.Big)(big.NewInt(100)), + } }, false, 0, true, + config.DefaultGasCap, }, { "enough balance w/ enableFeemarket", - func() { - args = types.TransactionArgs{To: &common.Address{}, From: &suite.address, Value: (*hexutil.Big)(big.NewInt(100))} + func() types.TransactionArgs { + addr := suite.keyring.GetAddr(0) + return types.TransactionArgs{ + To: &common.Address{}, + From: &addr, + Value: (*hexutil.Big)(big.NewInt(100)), + } }, - false, - 0, true, + ethparams.TxGas, + true, + config.DefaultGasCap, }, { "gas exceed allowance w/ enableFeemarket", - func() { - args = types.TransactionArgs{To: &common.Address{}, Gas: &gasHelper} + func() types.TransactionArgs { + return types.TransactionArgs{To: &common.Address{}, Gas: &gasHelper} }, true, ethparams.TxGas, true, + config.DefaultGasCap, }, { "gas exceed global allowance w/ enableFeemarket", - func() { - args = types.TransactionArgs{To: &common.Address{}} - gasCap = 20000 + func() types.TransactionArgs { + return types.TransactionArgs{To: &common.Address{}} }, false, 0, true, + 20000, }, { "contract deployment w/ enableFeemarket", - func() { - ctorArgs, err := erc20Contract.ABI.Pack("", &suite.address, sdkmath.NewIntWithDecimal(1000, 18).BigInt()) + func() types.TransactionArgs { + ctorArgs, err := erc20Contract.ABI.Pack( + "", + &hardcodedRecipient, + sdkmath.NewIntWithDecimal(1000, 18).BigInt(), + ) suite.Require().NoError(err) data := erc20Contract.Bin data = append(data, ctorArgs...) - args = types.TransactionArgs{ - From: &suite.address, + + sender := suite.keyring.GetAddr(0) + return types.TransactionArgs{ Data: (*hexutil.Bytes)(&data), + From: &sender, } }, true, 1186778, true, + config.DefaultGasCap, }, { "erc20 transfer w/ enableFeemarket", - func() { - contractAddr := suite.DeployTestContract(suite.T(), suite.address, sdkmath.NewIntWithDecimal(1000, 18).BigInt()) - suite.Commit() - transferData, err := erc20Contract.ABI.Pack("transfer", common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), big.NewInt(1000)) + func() types.TransactionArgs { + key := suite.keyring.GetKey(1) + + contractAddr, err := deployErc20Contract(key, suite.factory) + suite.Require().NoError(err) + + err = suite.network.NextBlock() suite.Require().NoError(err) - args = types.TransactionArgs{To: &contractAddr, From: &suite.address, Data: (*hexutil.Bytes)(&transferData)} + + transferData, err := erc20Contract.ABI.Pack( + "transfer", + hardcodedRecipient, + big.NewInt(1000), + ) + suite.Require().NoError(err) + + return types.TransactionArgs{ + To: &contractAddr, + From: &key.Addr, + Data: (*hexutil.Bytes)(&transferData), + } }, true, 51880, true, + config.DefaultGasCap, }, { "contract creation but 'create' param disabled", - func() { - ctorArgs, err := erc20Contract.ABI.Pack("", &suite.address, sdkmath.NewIntWithDecimal(1000, 18).BigInt()) + func() types.TransactionArgs { + addr := suite.keyring.GetAddr(0) + ctorArgs, err := erc20Contract.ABI.Pack( + "", + &addr, + sdkmath.NewIntWithDecimal(1000, 18).BigInt(), + ) suite.Require().NoError(err) + data := erc20Contract.Bin data = append(data, ctorArgs...) - args = types.TransactionArgs{ - From: &suite.address, + + args := types.TransactionArgs{ + From: &addr, Data: (*hexutil.Bytes)(&data), } - params := suite.app.EVMKeeper.GetParams(suite.ctx) + params := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) params.AccessControl = types.AccessControl{ Create: types.AccessControlType{ AccessType: types.AccessTypeRestricted, }, } - err = suite.app.EVMKeeper.SetParams(suite.ctx, params) + err = suite.network.App.EVMKeeper.SetParams( + suite.network.GetContext(), + params, + ) suite.Require().NoError(err) + + return args }, false, 0, false, + config.DefaultGasCap, }, { "specified gas in args higher than ethparams.TxGas (21,000)", - func() { - args = types.TransactionArgs{ + func() types.TransactionArgs { + return types.TransactionArgs{ To: &common.Address{}, Gas: &higherGas, } @@ -720,12 +875,12 @@ func (suite *KeeperTestSuite) TestEstimateGas() { true, ethparams.TxGas, false, + config.DefaultGasCap, }, { "specified gas in args higher than request gasCap", - func() { - gasCap = 22_000 - args = types.TransactionArgs{ + func() types.TransactionArgs { + return types.TransactionArgs{ To: &common.Address{}, Gas: &higherGas, } @@ -733,11 +888,14 @@ func (suite *KeeperTestSuite) TestEstimateGas() { true, ethparams.TxGas, false, + 22_000, }, { "invalid args - specified both gasPrice and maxFeePerGas", - func() { - args = types.TransactionArgs{ + func() types.TransactionArgs { + hexBigInt := hexutil.Big(*big.NewInt(1)) + + return types.TransactionArgs{ To: &common.Address{}, GasPrice: &hexBigInt, MaxFeePerGas: &hexBigInt, @@ -746,266 +904,324 @@ func (suite *KeeperTestSuite) TestEstimateGas() { false, 0, false, + config.DefaultGasCap, }, } for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.enableFeemarket = tc.enableFeemarket - suite.SetupTest() - gasCap = 25_000_000 - tc.malleate() + // Start from a clean state + suite.Require().NoError(suite.network.NextBlock()) + + // Update feemarket params per test + evmParams := feemarkettypes.DefaultParams() + if !tc.enableFeemarket { + evmParams := suite.network.App.FeeMarketKeeper.GetParams( + suite.network.GetContext(), + ) + evmParams.NoBaseFee = true + } + + err := suite.network.App.FeeMarketKeeper.SetParams( + suite.network.GetContext(), + evmParams, + ) + suite.Require().NoError(err) - args, err := json.Marshal(&args) + // Get call args + args := tc.getArgs() + marshalArgs, err := json.Marshal(args) suite.Require().NoError(err) + req := types.EthCallRequest{ - Args: args, - GasCap: gasCap, - ProposerAddress: suite.ctx.BlockHeader().ProposerAddress, + Args: marshalArgs, + GasCap: tc.gasCap, + ProposerAddress: suite.network.GetContext().BlockHeader().ProposerAddress, } - rsp, err := suite.queryClient.EstimateGas(sdk.WrapSDKContext(suite.ctx), &req) + // Function under test + rsp, err := suite.network.GetEvmClient().EstimateGas( + suite.network.GetContext(), + &req, + ) if tc.expPass { suite.Require().NoError(err) - suite.Require().Equal(int64(tc.expGas), int64(rsp.Gas)) //#nosec G115 -- int overflow is not a concern here -- gas is not going to exceed int64 max value + suite.Require().Equal(int64(tc.expGas), int64(rsp.Gas)) //#nosec G115 } else { suite.Require().Error(err) } }) } - suite.enableFeemarket = false // reset flag +} + +func getDefaultTraceTxRequest(unitNetwork network.Network) types.QueryTraceTxRequest { + ctx := unitNetwork.GetContext() + chainID := unitNetwork.GetEIP155ChainID().Int64() + return types.QueryTraceTxRequest{ + BlockMaxGas: ctx.ConsensusParams().Block.MaxGas, + ChainId: chainID, + BlockTime: ctx.BlockTime(), + TraceConfig: &types.TraceConfig{}, + } } func (suite *KeeperTestSuite) TestTraceTx() { - // TODO deploy contract that triggers internal transactions - var ( - txMsg *types.MsgEthereumTx - traceConfig *types.TraceConfig - predecessors []*types.MsgEthereumTx - chainID *sdkmath.Int - ) + suite.enableFeemarket = true + defer func() { suite.enableFeemarket = false }() + suite.SetupTest() + + // Hardcode recipient address to avoid non determinism in tests + hardcodedRecipient := common.HexToAddress("0xC6Fe5D33615a1C52c08018c47E8Bc53646A0E101") erc20Contract, err := testdata.LoadERC20Contract() - suite.Require().NoError(err, "failed to load erc20 contract") + suite.Require().NoError(err) testCases := []struct { msg string malleate func() + getRequest func() types.QueryTraceTxRequest + getPredecessors func() []*types.MsgEthereumTx expPass bool - traceResponse string - enableFeemarket bool - expFinalGas uint64 + expectedTrace string }{ { msg: "default trace", - malleate: func() { - traceConfig = nil - predecessors = []*types.MsgEthereumTx{} + getRequest: func() types.QueryTraceTxRequest { + return getDefaultTraceTxRequest(suite.network) + }, + getPredecessors: func() []*types.MsgEthereumTx { + return nil }, expPass: true, - traceResponse: "{\"gas\":34828,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PUSH1\",\"gas\":", - expFinalGas: expGasConsumed, + expectedTrace: "{\"gas\":34780,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PUSH1\",\"gas\":", }, { msg: "default trace with filtered response", - malleate: func() { - traceConfig = &types.TraceConfig{ + getRequest: func() types.QueryTraceTxRequest { + defaultRequest := getDefaultTraceTxRequest(suite.network) + defaultRequest.TraceConfig = &types.TraceConfig{ DisableStack: true, DisableStorage: true, EnableMemory: false, } - predecessors = []*types.MsgEthereumTx{} + return defaultRequest }, - expPass: true, - traceResponse: "{\"gas\":34828,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PUSH1\",\"gas\":", - enableFeemarket: false, - expFinalGas: expGasConsumed, - }, - { - msg: "javascript tracer", - malleate: func() { - traceConfig = &types.TraceConfig{ - Tracer: "{data: [], fault: function(log) {}, step: function(log) { if(log.op.toString() == \"CALL\") this.data.push(log.stack.peek(0)); }, result: function() { return this.data; }}", - } - predecessors = []*types.MsgEthereumTx{} + getPredecessors: func() []*types.MsgEthereumTx { + return nil }, expPass: true, - traceResponse: "[]", - expFinalGas: expGasConsumed, + expectedTrace: "{\"gas\":34780,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PUSH1\",\"gas\":", }, { - msg: "default trace with enableFeemarket", - malleate: func() { - traceConfig = &types.TraceConfig{ - DisableStack: true, - DisableStorage: true, - EnableMemory: false, - } - predecessors = []*types.MsgEthereumTx{} - }, - expPass: true, - traceResponse: "{\"gas\":34828,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PUSH1\",\"gas\":", - enableFeemarket: true, - expFinalGas: expGasConsumedWithFeeMkt, - }, - { - msg: "javascript tracer with enableFeemarket", - malleate: func() { - traceConfig = &types.TraceConfig{ + msg: "javascript tracer", + getRequest: func() types.QueryTraceTxRequest { + traceConfig := &types.TraceConfig{ Tracer: "{data: [], fault: function(log) {}, step: function(log) { if(log.op.toString() == \"CALL\") this.data.push(log.stack.peek(0)); }, result: function() { return this.data; }}", } - predecessors = []*types.MsgEthereumTx{} + defaultRequest := getDefaultTraceTxRequest(suite.network) + defaultRequest.TraceConfig = traceConfig + return defaultRequest + }, + getPredecessors: func() []*types.MsgEthereumTx { + return nil }, - expPass: true, - traceResponse: "[]", - enableFeemarket: true, - expFinalGas: expGasConsumedWithFeeMkt, + expPass: true, + expectedTrace: "[]", }, { msg: "default tracer with predecessors", - malleate: func() { - traceConfig = nil + getRequest: func() types.QueryTraceTxRequest { + return getDefaultTraceTxRequest(suite.network) + }, + getPredecessors: func() []*types.MsgEthereumTx { + // Create predecessor tx + // Use different address to avoid nonce collision + senderKey := suite.keyring.GetKey(1) + contractAddr, err := deployErc20Contract(senderKey, suite.factory) + suite.Require().NoError(err) - // increase nonce to avoid address collision - vmdb := suite.StateDB() - vmdb.SetNonce(suite.address, vmdb.GetNonce(suite.address)+1) - suite.Require().NoError(vmdb.Commit()) + err = suite.network.NextBlock() + suite.Require().NoError(err) - contractAddr := suite.DeployTestContract(suite.T(), suite.address, sdkmath.NewIntWithDecimal(1000, 18).BigInt()) - suite.Commit() - // Generate token transfer transaction - firstTx := suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdkmath.NewIntWithDecimal(1, 18).BigInt()) - txMsg = suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdkmath.NewIntWithDecimal(1, 18).BigInt()) - suite.Commit() + txMsg, err := executeTransferCall( + transferParams{ + senderKey: senderKey, + contractAddr: contractAddr, + recipientAddr: hardcodedRecipient, + }, + suite.factory, + ) + suite.Require().NoError(err) - predecessors = append(predecessors, firstTx) + return []*types.MsgEthereumTx{txMsg} }, - expPass: true, - traceResponse: "{\"gas\":34828,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PUSH1\",\"gas\":", - enableFeemarket: false, - expFinalGas: expGasConsumed, + expPass: true, + expectedTrace: "{\"gas\":34780,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PUSH1\",\"gas\":", }, { msg: "invalid trace config - Negative Limit", - malleate: func() { - traceConfig = &types.TraceConfig{ + getRequest: func() types.QueryTraceTxRequest { + defaultRequest := getDefaultTraceTxRequest(suite.network) + defaultRequest.TraceConfig = &types.TraceConfig{ DisableStack: true, DisableStorage: true, EnableMemory: false, Limit: -1, } + return defaultRequest + }, + getPredecessors: func() []*types.MsgEthereumTx { + return nil }, - expPass: false, - expFinalGas: 0, + expPass: false, }, { msg: "invalid trace config - Invalid Tracer", - malleate: func() { - traceConfig = &types.TraceConfig{ - DisableStack: true, - DisableStorage: true, - EnableMemory: false, - Tracer: "invalid_tracer", + getRequest: func() types.QueryTraceTxRequest { + defaultRequest := getDefaultTraceTxRequest(suite.network) + defaultRequest.TraceConfig = &types.TraceConfig{ + Tracer: "invalid_tracer", } + return defaultRequest + }, + getPredecessors: func() []*types.MsgEthereumTx { + return nil }, - expPass: false, - expFinalGas: expGasConsumed, + expPass: false, }, { msg: "invalid trace config - Invalid Timeout", - malleate: func() { - traceConfig = &types.TraceConfig{ + getRequest: func() types.QueryTraceTxRequest { + defaultRequest := getDefaultTraceTxRequest(suite.network) + defaultRequest.TraceConfig = &types.TraceConfig{ DisableStack: true, DisableStorage: true, EnableMemory: false, Timeout: "wrong_time", } + return defaultRequest }, - expPass: false, - expFinalGas: expGasConsumed, + getPredecessors: func() []*types.MsgEthereumTx { + return nil + }, + expPass: false, }, { msg: "default tracer with contract creation tx as predecessor but 'create' param disabled", - malleate: func() { - traceConfig = nil - - // increase nonce to avoid address collision - vmdb := suite.StateDB() - vmdb.SetNonce(suite.address, vmdb.GetNonce(suite.address)+1) - suite.Require().NoError(vmdb.Commit()) + getRequest: func() types.QueryTraceTxRequest { + return getDefaultTraceTxRequest(suite.network) + }, + getPredecessors: func() []*types.MsgEthereumTx { + // use different address to avoid nonce collision + senderKey := suite.keyring.GetKey(1) - chainID := suite.app.EVMKeeper.ChainID() - nonce := suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address) - data := erc20Contract.Bin - ethTxParams := &types.EvmTxArgs{ - ChainID: chainID, - Nonce: nonce, - GasLimit: ethparams.TxGasContractCreation, - Input: data, + constructorArgs := []interface{}{ + senderKey.Addr, + sdkmath.NewIntWithDecimal(1000, 18).BigInt(), + } + compiledContract := erc20Contract + deploymentData := factory.ContractDeploymentData{ + Contract: compiledContract, + ConstructorArgs: constructorArgs, } - contractTx := types.NewTx(ethTxParams) - predecessors = append(predecessors, contractTx) - suite.Commit() + txArgs, err := suite.factory.GenerateDeployContractArgs(senderKey.Addr, types.EvmTxArgs{}, deploymentData) + suite.Require().NoError(err) + + txMsg, err := suite.factory.GenerateMsgEthereumTx(senderKey.Priv, txArgs) + suite.Require().NoError(err) - params := suite.app.EVMKeeper.GetParams(suite.ctx) + _, err = suite.factory.ExecuteEthTx( + senderKey.Priv, + txArgs, // Default values + ) + suite.Require().NoError(err) + + params := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) params.AccessControl = types.AccessControl{ Create: types.AccessControlType{ AccessType: types.AccessTypeRestricted, }, } - err := suite.app.EVMKeeper.SetParams(suite.ctx, params) + err = suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), params) suite.Require().NoError(err) + return []*types.MsgEthereumTx{&txMsg} }, expPass: true, - traceResponse: "{\"gas\":34828,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PUSH1\",\"gas\":", - expFinalGas: 25823, // gas consumed in traceTx setup (GetProposerAddr + CalculateBaseFee) + gas consumed in malleate func + expectedTrace: "{\"gas\":34780,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PUSH1\",\"gas\":", + // expFinalGas: 26744, // gas consumed in traceTx setup (GetProposerAddr + CalculateBaseFee) + gas consumed in malleate func }, { msg: "invalid chain id", - malleate: func() { - traceConfig = nil - predecessors = []*types.MsgEthereumTx{} - tmp := sdkmath.NewInt(1) - chainID = &tmp + getRequest: func() types.QueryTraceTxRequest { + defaultRequest := getDefaultTraceTxRequest(suite.network) + defaultRequest.ChainId = -1 + return defaultRequest + }, + getPredecessors: func() []*types.MsgEthereumTx { + return nil }, - expPass: false, - expFinalGas: expGasConsumed, + expPass: false, }, } for _, tc := range testCases { + tc := tc suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.enableFeemarket = tc.enableFeemarket - suite.SetupTest() - // Deploy contract - contractAddr := suite.DeployTestContract(suite.T(), suite.address, sdkmath.NewIntWithDecimal(1000, 18).BigInt()) - suite.Commit() - // Generate token transfer transaction - txMsg = suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdkmath.NewIntWithDecimal(1, 18).BigInt()) - suite.Commit() - - tc.malleate() - traceReq := types.QueryTraceTxRequest{ - Msg: txMsg, - TraceConfig: traceConfig, - Predecessors: predecessors, - } + // Clean up per test + defaultEvmParams := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) + err := suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), defaultEvmParams) + suite.Require().NoError(err) - if chainID != nil { - traceReq.ChainId = chainID.Int64() - } - res, err := suite.queryClient.TraceTx(sdk.WrapSDKContext(suite.ctx), &traceReq) + err = suite.network.NextBlock() + suite.Require().NoError(err) + + // ----- Contract Deployment ----- + senderKey := suite.keyring.GetKey(0) + contractAddr, err := deployErc20Contract(senderKey, suite.factory) + suite.Require().NoError(err) + + err = suite.network.NextBlock() + suite.Require().NoError(err) + + // --- Add predecessor --- + predecessors := tc.getPredecessors() + + // Get the message to trace + msgToTrace, err := executeTransferCall( + transferParams{ + senderKey: senderKey, + contractAddr: contractAddr, + recipientAddr: hardcodedRecipient, + }, + suite.factory, + ) + suite.Require().NoError(err) + + suite.Require().NoError(suite.network.NextBlock()) + + // Get the trace request + traceReq := tc.getRequest() + // Add predecessor to trace request + traceReq.Predecessors = predecessors + traceReq.Msg = msgToTrace + + // Function under test + res, err := suite.network.GetEvmClient().TraceTx( + suite.network.GetContext(), + &traceReq, + ) if tc.expPass { suite.Require().NoError(err) - // if data is too big, slice the result + + // if data is to big, slice the result if len(res.Data) > 150 { - suite.Require().Equal(tc.traceResponse, string(res.Data[:150])) + suite.Require().Equal(tc.expectedTrace, string(res.Data[:150])) } else { - suite.Require().Equal(tc.traceResponse, string(res.Data)) + suite.Require().Equal(tc.expectedTrace, string(res.Data)) } - if traceConfig == nil || traceConfig.Tracer == "" { + if traceReq.TraceConfig == nil || traceReq.TraceConfig.Tracer == "" { var result ethlogger.ExecutionResult suite.Require().NoError(json.Unmarshal(res.Data, &result)) suite.Require().Positive(result.Gas) @@ -1013,178 +1229,178 @@ func (suite *KeeperTestSuite) TestTraceTx() { } else { suite.Require().Error(err) } - suite.Require().Equal(int(tc.expFinalGas), int(suite.ctx.GasMeter().GasConsumed()), "expected different gas consumption") //#nosec G115 -- int overflow is not a concern here - // Reset for next test case - chainID = nil }) } - - suite.enableFeemarket = false // reset flag } func (suite *KeeperTestSuite) TestTraceBlock() { - var ( - txs []*types.MsgEthereumTx - traceConfig *types.TraceConfig - chainID *sdkmath.Int - ) + suite.enableFeemarket = true + defer func() { suite.enableFeemarket = false }() + suite.SetupTest() + + // Hardcode recipient to make gas estimation deterministic + hardcodedTransferRecipient := common.HexToAddress("0xC6Fe5D33615a1C52c08018c47E8Bc53646A0E101") testCases := []struct { - msg string - malleate func() - expPass bool - traceResponse string - enableFeemarket bool - expFinalGas uint64 + msg string + getRequest func() types.QueryTraceBlockRequest + getAdditionalTxs func() []*types.MsgEthereumTx + expPass bool + traceResponse string }{ { msg: "default trace", - malleate: func() { - traceConfig = nil + getRequest: func() types.QueryTraceBlockRequest { + return getDefaultTraceBlockRequest(suite.network) + }, + getAdditionalTxs: func() []*types.MsgEthereumTx { + return nil }, expPass: true, - traceResponse: "[{\"result\":{\"gas\":34828,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PU", - expFinalGas: expGasConsumed, + traceResponse: "[{\"result\":{\"gas\":34780,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PU", }, { msg: "filtered trace", - malleate: func() { - traceConfig = &types.TraceConfig{ + getRequest: func() types.QueryTraceBlockRequest { + defaultReq := getDefaultTraceBlockRequest(suite.network) + defaultReq.TraceConfig = &types.TraceConfig{ DisableStack: true, DisableStorage: true, EnableMemory: false, } + return defaultReq + }, + getAdditionalTxs: func() []*types.MsgEthereumTx { + return nil }, expPass: true, - traceResponse: "[{\"result\":{\"gas\":34828,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PU", - expFinalGas: expGasConsumed, + traceResponse: "[{\"result\":{\"gas\":34780,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PU", }, { msg: "javascript tracer", - malleate: func() { - traceConfig = &types.TraceConfig{ + getRequest: func() types.QueryTraceBlockRequest { + defaultReq := getDefaultTraceBlockRequest(suite.network) + defaultReq.TraceConfig = &types.TraceConfig{ Tracer: "{data: [], fault: function(log) {}, step: function(log) { if(log.op.toString() == \"CALL\") this.data.push(log.stack.peek(0)); }, result: function() { return this.data; }}", } + return defaultReq + }, + getAdditionalTxs: func() []*types.MsgEthereumTx { + return nil }, expPass: true, traceResponse: "[{\"result\":[]}]", - expFinalGas: expGasConsumed, - }, - { - msg: "default trace with enableFeemarket and filtered return", - malleate: func() { - traceConfig = &types.TraceConfig{ - DisableStack: true, - DisableStorage: true, - EnableMemory: false, - } - }, - expPass: true, - traceResponse: "[{\"result\":{\"gas\":34828,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PU", - enableFeemarket: true, - expFinalGas: expGasConsumedWithFeeMkt, - }, - { - msg: "javascript tracer with enableFeemarket", - malleate: func() { - traceConfig = &types.TraceConfig{ - Tracer: "{data: [], fault: function(log) {}, step: function(log) { if(log.op.toString() == \"CALL\") this.data.push(log.stack.peek(0)); }, result: function() { return this.data; }}", - } - }, - expPass: true, - traceResponse: "[{\"result\":[]}]", - enableFeemarket: true, - expFinalGas: expGasConsumedWithFeeMkt, }, { msg: "tracer with multiple transactions", - malleate: func() { - traceConfig = nil + getRequest: func() types.QueryTraceBlockRequest { + return getDefaultTraceBlockRequest(suite.network) + }, + getAdditionalTxs: func() []*types.MsgEthereumTx { + // Create predecessor tx + // Use different address to avoid nonce collision + senderKey := suite.keyring.GetKey(1) + contractAddr, err := deployErc20Contract(senderKey, suite.factory) + suite.Require().NoError(err) - // increase nonce to avoid address collision - vmdb := suite.StateDB() - vmdb.SetNonce(suite.address, vmdb.GetNonce(suite.address)+1) - suite.Require().NoError(vmdb.Commit()) + err = suite.network.NextBlock() + suite.Require().NoError(err) - contractAddr := suite.DeployTestContract(suite.T(), suite.address, sdkmath.NewIntWithDecimal(1000, 18).BigInt()) - suite.Commit() - // create multiple transactions in the same block - firstTx := suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdkmath.NewIntWithDecimal(1, 18).BigInt()) - secondTx := suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdkmath.NewIntWithDecimal(1, 18).BigInt()) - suite.Commit() - // overwrite txs to include only the ones on new block - txs = append([]*types.MsgEthereumTx{}, firstTx, secondTx) + firstTransferMessage, err := executeTransferCall( + transferParams{ + senderKey: suite.keyring.GetKey(1), + contractAddr: contractAddr, + recipientAddr: hardcodedTransferRecipient, + }, + suite.factory, + ) + suite.Require().NoError(err) + return []*types.MsgEthereumTx{firstTransferMessage} }, - expPass: true, - traceResponse: "[{\"result\":{\"gas\":34828,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PU", - enableFeemarket: false, - expFinalGas: expGasConsumed, + expPass: true, + traceResponse: "[{\"result\":{\"gas\":34780,\"failed\":false,\"returnValue\":\"0000000000000000000000000000000000000000000000000000000000000001\",\"structLogs\":[{\"pc\":0,\"op\":\"PU", }, { msg: "invalid trace config - Negative Limit", - malleate: func() { - traceConfig = &types.TraceConfig{ - DisableStack: true, - DisableStorage: true, - EnableMemory: false, - Limit: -1, + getRequest: func() types.QueryTraceBlockRequest { + defaultReq := getDefaultTraceBlockRequest(suite.network) + defaultReq.TraceConfig = &types.TraceConfig{ + Limit: -1, } + return defaultReq + }, + getAdditionalTxs: func() []*types.MsgEthereumTx { + return nil }, - expPass: false, - expFinalGas: 0, + expPass: false, }, { msg: "invalid trace config - Invalid Tracer", - malleate: func() { - traceConfig = &types.TraceConfig{ - DisableStack: true, - DisableStorage: true, - EnableMemory: false, - Tracer: "invalid_tracer", + getRequest: func() types.QueryTraceBlockRequest { + defaultReq := getDefaultTraceBlockRequest(suite.network) + defaultReq.TraceConfig = &types.TraceConfig{ + Tracer: "invalid_tracer", } + return defaultReq + }, + getAdditionalTxs: func() []*types.MsgEthereumTx { + return nil }, expPass: true, traceResponse: "[{\"error\":\"rpc error: code = Internal desc = tracer not found\"}]", - expFinalGas: expGasConsumed, }, { msg: "invalid chain id", - malleate: func() { - traceConfig = nil - tmp := sdkmath.NewInt(1) - chainID = &tmp + getRequest: func() types.QueryTraceBlockRequest { + defaultReq := getDefaultTraceBlockRequest(suite.network) + defaultReq.ChainId = -1 + return defaultReq + }, + getAdditionalTxs: func() []*types.MsgEthereumTx { + return nil }, expPass: true, traceResponse: "[{\"error\":\"rpc error: code = Internal desc = invalid chain id for signer\"}]", - expFinalGas: expGasConsumed, }, } for _, tc := range testCases { + tc := tc suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - txs = []*types.MsgEthereumTx{} - suite.enableFeemarket = tc.enableFeemarket - suite.SetupTest() - // Deploy contract - contractAddr := suite.DeployTestContract(suite.T(), suite.address, sdkmath.NewIntWithDecimal(1000, 18).BigInt()) - suite.Commit() - // Generate token transfer transaction - txMsg := suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdkmath.NewIntWithDecimal(1, 18).BigInt()) - suite.Commit() - - txs = append(txs, txMsg) - - tc.malleate() - traceReq := types.QueryTraceBlockRequest{ - Txs: txs, - TraceConfig: traceConfig, - } + // Start from fresh block + suite.Require().NoError(suite.network.NextBlock()) - if chainID != nil { - traceReq.ChainId = chainID.Int64() - } + // ----- Contract Deployment ----- + senderKey := suite.keyring.GetKey(0) + contractAddr, err := deployErc20Contract(senderKey, suite.factory) + suite.Require().NoError(err) + + err = suite.network.NextBlock() + suite.Require().NoError(err) + + // --- Add predecessor --- + txs := tc.getAdditionalTxs() + + // --- Contract Call --- + msgToTrace, err := executeTransferCall( + transferParams{ + senderKey: senderKey, + contractAddr: contractAddr, + recipientAddr: hardcodedTransferRecipient, + }, + suite.factory, + ) + suite.Require().NoError(err) + txs = append(txs, msgToTrace) - res, err := suite.queryClient.TraceBlock(sdk.WrapSDKContext(suite.ctx), &traceReq) + suite.Require().NoError(suite.network.NextBlock()) + + // Get the trace request + traceReq := tc.getRequest() + // Add txs to trace request + traceReq.Txs = txs + + res, err := suite.network.GetEvmClient().TraceBlock(suite.network.GetContext(), &traceReq) if tc.expPass { suite.Require().NoError(err) @@ -1197,234 +1413,269 @@ func (suite *KeeperTestSuite) TestTraceBlock() { } else { suite.Require().Error(err) } - suite.Require().Equal(int64(tc.expFinalGas), int64(suite.ctx.GasMeter().GasConsumed()), "expected different gas consumption") //#nosec G115 -- int overflow is not a concern here -- gas is not going to exceed int64 max value - // Reset for next case - chainID = nil }) } - - suite.enableFeemarket = false // reset flag } func (suite *KeeperTestSuite) TestNonceInQuery() { - address := utiltx.GenerateAddress() - suite.Require().Equal(uint64(0), suite.app.EVMKeeper.GetNonce(suite.ctx, address)) - supply := sdkmath.NewIntWithDecimal(1000, 18).BigInt() + suite.enableFeemarket = true + defer func() { suite.enableFeemarket = false }() + suite.SetupTest() + + senderKey := suite.keyring.GetKey(0) + nonce := suite.network.App.EVMKeeper.GetNonce( + suite.network.GetContext(), + senderKey.Addr, + ) + suite.Require().Equal(uint64(0), nonce) - // occupy nonce 0 - _ = suite.DeployTestContract(suite.T(), address, supply) + // accupy nonce 0 + _, err := deployErc20Contract(suite.keyring.GetKey(0), suite.factory) + suite.Require().NoError(err) erc20Contract, err := testdata.LoadERC20Contract() suite.Require().NoError(err, "failed to load erc20 contract") // do an EthCall/EstimateGas with nonce 0 - ctorArgs, err := erc20Contract.ABI.Pack("", address, supply) + ctorArgs, err := erc20Contract.ABI.Pack("", senderKey.Addr, big.NewInt(1000)) suite.Require().NoError(err) data := erc20Contract.Bin data = append(data, ctorArgs...) args, err := json.Marshal(&types.TransactionArgs{ - From: &address, + From: &senderKey.Addr, Data: (*hexutil.Bytes)(&data), }) suite.Require().NoError(err) - proposerAddress := suite.ctx.BlockHeader().ProposerAddress - _, err = suite.queryClient.EstimateGas(sdk.WrapSDKContext(suite.ctx), &types.EthCallRequest{ - Args: args, - GasCap: config.DefaultGasCap, - ProposerAddress: proposerAddress, - }) + + proposerAddress := suite.network.GetContext().BlockHeader().ProposerAddress + _, err = suite.network.GetEvmClient().EstimateGas( + suite.network.GetContext(), + &types.EthCallRequest{ + Args: args, + GasCap: config.DefaultGasCap, + ProposerAddress: proposerAddress, + }, + ) suite.Require().NoError(err) - _, err = suite.queryClient.EthCall(sdk.WrapSDKContext(suite.ctx), &types.EthCallRequest{ - Args: args, - GasCap: config.DefaultGasCap, - ProposerAddress: proposerAddress, - }) + _, err = suite.network.GetEvmClient().EthCall( + suite.network.GetContext(), + &types.EthCallRequest{ + Args: args, + GasCap: config.DefaultGasCap, + ProposerAddress: proposerAddress, + }, + ) suite.Require().NoError(err) } func (suite *KeeperTestSuite) TestQueryBaseFee() { - var ( - aux sdkmath.Int - expRes *types.QueryBaseFeeResponse - ) + suite.enableFeemarket = true + defer func() { suite.enableFeemarket = false }() + suite.SetupTest() testCases := []struct { - name string - malleate func() - expPass bool - enableFeemarket bool - enableLondonHF bool + name string + getExpResp func() *types.QueryBaseFeeResponse + setParams func() + expPass bool }{ { "pass - default Base Fee", - func() { + func() *types.QueryBaseFeeResponse { initialBaseFee := sdkmath.NewInt(ethparams.InitialBaseFee) - expRes = &types.QueryBaseFeeResponse{BaseFee: &initialBaseFee} + return &types.QueryBaseFeeResponse{BaseFee: &initialBaseFee} }, - true, true, true, - }, - { - "pass - non-nil Base Fee", func() { - baseFee := sdkmath.OneInt().BigInt() - suite.app.FeeMarketKeeper.SetBaseFee(suite.ctx, baseFee) + feemarketDefault := feemarkettypes.DefaultParams() + suite.Require().NoError(suite.network.App.FeeMarketKeeper.SetParams(suite.network.GetContext(), feemarketDefault)) - aux = sdkmath.NewIntFromBigInt(baseFee) - expRes = &types.QueryBaseFeeResponse{BaseFee: &aux} + evmDefault := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) + suite.Require().NoError(suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), evmDefault)) }, - true, true, true, + + true, }, { - "pass - nil Base Fee when london hard-fork not activated", + "pass - nil Base Fee when london hardfork not activated", + func() *types.QueryBaseFeeResponse { + return &types.QueryBaseFeeResponse{} + }, func() { - baseFee := sdkmath.OneInt().BigInt() - suite.app.FeeMarketKeeper.SetBaseFee(suite.ctx, baseFee) - - expRes = &types.QueryBaseFeeResponse{} + feemarketDefault := feemarkettypes.DefaultParams() + suite.Require().NoError(suite.network.App.FeeMarketKeeper.SetParams(suite.network.GetContext(), feemarketDefault)) + + evmDefault := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) + maxInt := sdkmath.NewInt(math.MaxInt64) + evmDefault.ChainConfig.LondonBlock = &maxInt + evmDefault.ChainConfig.LondonBlock = &maxInt + evmDefault.ChainConfig.ArrowGlacierBlock = &maxInt + evmDefault.ChainConfig.GrayGlacierBlock = &maxInt + evmDefault.ChainConfig.MergeNetsplitBlock = &maxInt + evmDefault.ChainConfig.ShanghaiBlock = &maxInt + evmDefault.ChainConfig.CancunBlock = &maxInt + suite.Require().NoError(suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), evmDefault)) }, - true, true, false, + true, }, { "pass - zero Base Fee when feemarket not activated", - func() { + func() *types.QueryBaseFeeResponse { baseFee := sdkmath.ZeroInt() - expRes = &types.QueryBaseFeeResponse{BaseFee: &baseFee} + return &types.QueryBaseFeeResponse{BaseFee: &baseFee} }, - true, false, true, + func() { + feemarketDefault := feemarkettypes.DefaultParams() + feemarketDefault.NoBaseFee = true + suite.Require().NoError(suite.network.App.FeeMarketKeeper.SetParams(suite.network.GetContext(), feemarketDefault)) + + evmDefault := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) + suite.Require().NoError(suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), evmDefault)) + }, + true, }, } for _, tc := range testCases { + tc := tc suite.Run(tc.name, func() { - suite.enableFeemarket = tc.enableFeemarket - suite.enableLondonHF = tc.enableLondonHF - suite.SetupTest() + // Set necessary params + tc.setParams() + + // Get the expected response + expResp := tc.getExpResp() - tc.malleate() + // Function under test + res, err := suite.network.GetEvmClient().BaseFee( + suite.network.GetContext(), + &types.QueryBaseFeeRequest{}, + ) - res, err := suite.queryClient.BaseFee(suite.ctx.Context(), &types.QueryBaseFeeRequest{}) if tc.expPass { suite.Require().NotNil(res) - suite.Require().Equal(expRes, res, tc.name) + suite.Require().Equal(expResp, res, tc.name) suite.Require().NoError(err) } else { suite.Require().Error(err) } + + suite.Require().NoError(suite.network.NextBlock()) }) } - suite.enableFeemarket = false - suite.enableLondonHF = true } func (suite *KeeperTestSuite) TestEthCall() { - var req *types.EthCallRequest - - address := utiltx.GenerateAddress() - suite.Require().Equal(uint64(0), suite.app.EVMKeeper.GetNonce(suite.ctx, address)) - supply := sdkmath.NewIntWithDecimal(1000, 18).BigInt() - - hexBigInt := hexutil.Big(*big.NewInt(1)) + suite.SetupTest() erc20Contract, err := testdata.LoadERC20Contract() - suite.Require().NoError(err, "failed to load erc20 contract") - - ctorArgs, err := erc20Contract.ABI.Pack("", address, supply) suite.Require().NoError(err) + // Generate common data for requests + sender := suite.keyring.GetAddr(0) + supply := sdkmath.NewIntWithDecimal(1000, 18).BigInt() + ctorArgs, err := erc20Contract.ABI.Pack("", sender, supply) + suite.Require().NoError(err) data := erc20Contract.Bin data = append(data, ctorArgs...) testCases := []struct { name string - malleate func() + getReq func() *types.EthCallRequest expVMError bool }{ { "invalid args", - func() { - req = &types.EthCallRequest{Args: []byte("invalid args"), GasCap: config.DefaultGasCap} + func() *types.EthCallRequest { + return &types.EthCallRequest{Args: []byte("invalid args"), GasCap: config.DefaultGasCap} }, false, }, { "invalid args - specified both gasPrice and maxFeePerGas", - func() { + func() *types.EthCallRequest { + hexBigInt := hexutil.Big(*big.NewInt(1)) args, err := json.Marshal(&types.TransactionArgs{ - From: &address, + From: &sender, Data: (*hexutil.Bytes)(&data), GasPrice: &hexBigInt, MaxFeePerGas: &hexBigInt, }) - suite.Require().NoError(err) - req = &types.EthCallRequest{Args: args, GasCap: config.DefaultGasCap} + + return &types.EthCallRequest{Args: args, GasCap: config.DefaultGasCap} }, false, }, { "set param AccessControl - no Access", - func() { + func() *types.EthCallRequest { args, err := json.Marshal(&types.TransactionArgs{ - From: &address, + From: &sender, Data: (*hexutil.Bytes)(&data), }) suite.Require().NoError(err) - req = &types.EthCallRequest{Args: args, GasCap: config.DefaultGasCap} + req := &types.EthCallRequest{Args: args, GasCap: config.DefaultGasCap} - params := suite.app.EVMKeeper.GetParams(suite.ctx) + params := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) params.AccessControl = types.AccessControl{ Create: types.AccessControlType{ AccessType: types.AccessTypeRestricted, }, } - err = suite.app.EVMKeeper.SetParams(suite.ctx, params) + err = suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), params) suite.Require().NoError(err) + return req }, true, }, { "set param AccessControl = non whitelist", - func() { + func() *types.EthCallRequest { args, err := json.Marshal(&types.TransactionArgs{ - From: &address, + From: &sender, Data: (*hexutil.Bytes)(&data), }) suite.Require().NoError(err) - req = &types.EthCallRequest{Args: args, GasCap: config.DefaultGasCap} + req := &types.EthCallRequest{Args: args, GasCap: config.DefaultGasCap} - params := suite.app.EVMKeeper.GetParams(suite.ctx) + params := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) params.AccessControl = types.AccessControl{ Create: types.AccessControlType{ AccessType: types.AccessTypePermissioned, }, } - err = suite.app.EVMKeeper.SetParams(suite.ctx, params) + err = suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), params) suite.Require().NoError(err) + return req }, true, }, } for _, tc := range testCases { suite.Run(tc.name, func() { - suite.SetupTest() - tc.malleate() + req := tc.getReq() - res, err := suite.queryClient.EthCall(suite.ctx, req) + res, err := suite.network.GetEvmClient().EthCall(suite.network.GetContext(), req) if tc.expVMError { suite.Require().NotNil(res) suite.Require().Contains(res.VmError, "does not have permission to deploy contracts") } else { suite.Require().Error(err) } + + // Reset params + defaultEvmParams := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) + err = suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), defaultEvmParams) + suite.Require().NoError(err) }) } } func (suite *KeeperTestSuite) TestEmptyRequest() { - k := suite.app.EVMKeeper + suite.SetupTest() + k := suite.network.App.EVMKeeper testCases := []struct { name string @@ -1433,70 +1684,150 @@ func (suite *KeeperTestSuite) TestEmptyRequest() { { "Account method", func() (interface{}, error) { - return k.Account(suite.ctx, nil) + return k.Account(suite.network.GetContext(), nil) }, }, { "CosmosAccount method", func() (interface{}, error) { - return k.CosmosAccount(suite.ctx, nil) + return k.CosmosAccount(suite.network.GetContext(), nil) }, }, { "ValidatorAccount method", func() (interface{}, error) { - return k.ValidatorAccount(suite.ctx, nil) + return k.ValidatorAccount(suite.network.GetContext(), nil) }, }, { "Balance method", func() (interface{}, error) { - return k.Balance(suite.ctx, nil) + return k.Balance(suite.network.GetContext(), nil) }, }, { "Storage method", func() (interface{}, error) { - return k.Storage(suite.ctx, nil) + return k.Storage(suite.network.GetContext(), nil) }, }, { "Code method", func() (interface{}, error) { - return k.Code(suite.ctx, nil) + return k.Code(suite.network.GetContext(), nil) }, }, { "EthCall method", func() (interface{}, error) { - return k.EthCall(suite.ctx, nil) + return k.EthCall(suite.network.GetContext(), nil) }, }, { "EstimateGas method", func() (interface{}, error) { - return k.EstimateGas(suite.ctx, nil) + return k.EstimateGas(suite.network.GetContext(), nil) }, }, { "TraceTx method", func() (interface{}, error) { - return k.TraceTx(suite.ctx, nil) + return k.TraceTx(suite.network.GetContext(), nil) }, }, { "TraceBlock method", func() (interface{}, error) { - return k.TraceBlock(suite.ctx, nil) + return k.TraceBlock(suite.network.GetContext(), nil) }, }, } for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { - suite.SetupTest() _, err := tc.queryFunc() suite.Require().Error(err) }) } } + +func getDefaultTraceBlockRequest(unitNetwork network.Network) types.QueryTraceBlockRequest { + ctx := unitNetwork.GetContext() + chainID := unitNetwork.GetEIP155ChainID().Int64() + return types.QueryTraceBlockRequest{ + BlockMaxGas: ctx.ConsensusParams().Block.MaxGas, + ChainId: chainID, + BlockTime: ctx.BlockTime(), + } +} + +func deployErc20Contract(from testkeyring.Key, txFactory factory.TxFactory) (common.Address, error) { + erc20Contract, err := testdata.LoadERC20Contract() + if err != nil { + return common.Address{}, err + } + + constructorArgs := []interface{}{ + from.Addr, + sdkmath.NewIntWithDecimal(1000, 18).BigInt(), + } + compiledContract := erc20Contract + contractAddr, err := txFactory.DeployContract( + from.Priv, + types.EvmTxArgs{}, // Default values + factory.ContractDeploymentData{ + Contract: compiledContract, + ConstructorArgs: constructorArgs, + }, + ) + if err != nil { + return common.Address{}, err + } + return contractAddr, nil +} + +type transferParams struct { + senderKey testkeyring.Key + contractAddr common.Address + recipientAddr common.Address +} + +func executeTransferCall( + transferParams transferParams, + txFactory factory.TxFactory, +) (msgEthereumTx *types.MsgEthereumTx, err error) { + erc20Contract, err := testdata.LoadERC20Contract() + if err != nil { + return nil, err + } + + transferArgs := types.EvmTxArgs{ + To: &transferParams.contractAddr, + } + callArgs := factory.CallArgs{ + ContractABI: erc20Contract.ABI, + MethodName: "transfer", + Args: []interface{}{transferParams.recipientAddr, big.NewInt(1000)}, + } + + transferArgs, err = txFactory.GenerateContractCallArgs(transferArgs, callArgs) + if err != nil { + return nil, err + } + + // We need to get access to the message + firstSignedTX, err := txFactory.GenerateSignedEthTx(transferParams.senderKey.Priv, transferArgs) + if err != nil { + return nil, err + } + txMsg, ok := firstSignedTX.GetMsgs()[0].(*types.MsgEthereumTx) + if !ok { + return nil, fmt.Errorf("invalid type") + } + + result, err := txFactory.ExecuteContractCall(transferParams.senderKey.Priv, transferArgs, callArgs) + if err != nil || !result.IsOK() { + return nil, err + } + return txMsg, nil +} diff --git a/x/evm/keeper/integration_test.go b/x/evm/keeper/integration_test.go index 1b4e29bd..75ce1561 100644 --- a/x/evm/keeper/integration_test.go +++ b/x/evm/keeper/integration_test.go @@ -17,6 +17,7 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/evmos/os/contracts" "github.com/evmos/os/precompiles/staking" + testconstants "github.com/evmos/os/testutil/constants" "github.com/evmos/os/testutil/integration/os/factory" "github.com/evmos/os/testutil/integration/os/grpc" testkeyring "github.com/evmos/os/testutil/integration/os/keyring" @@ -68,14 +69,17 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func When("the params have default values", Ordered, func() { BeforeAll(func() { // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) - err := s.network.UpdateEvmParams(defaultParams) - Expect(err).To(BeNil()) - - err = s.network.NextBlock() + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) + err := integrationutils.UpdateEvmParams( + integrationutils.UpdateParamsInput{ + Tf: s.factory, + Network: s.network, + Pk: s.keyring.GetPrivKey(0), + Params: defaultParams, + }, + ) Expect(err).To(BeNil()) }) - DescribeTable("Executes a transfer transaction", func(getTxArgs func() evmtypes.EvmTxArgs) { senderKey := s.keyring.GetKey(0) receiverKey := s.keyring.GetKey(1) @@ -283,13 +287,20 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Expect(err).NotTo(BeNil()) Expect(err.Error()).To(ContainSubstring("invalid chain id")) // Transaction fails before being broadcasted - Expect(res).To(Equal(abcitypes.ResponseDeliverTx{})) + Expect(res).To(Equal(abcitypes.ExecTxResult{})) }) }) DescribeTable("Performs transfer and contract call", func(getTestParams func() evmtypes.Params, transferParams, contractCallParams PermissionsTableTest) { params := getTestParams() - err := s.network.UpdateEvmParams(params) + err := integrationutils.UpdateEvmParams( + integrationutils.UpdateParamsInput{ + Tf: s.factory, + Network: s.network, + Pk: s.keyring.GetPrivKey(0), + Params: params, + }, + ) Expect(err).To(BeNil()) err = s.network.NextBlock() @@ -369,7 +380,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func }, // Entry("transfer and call fail with CALL permission policy set to restricted", func() evmtypes.Params { // // Set params to default values - // defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + // defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) // defaultParams.AccessControl.Call = evmtypes.AccessControlType{ // AccessType: evmtypes.AccessTypeRestricted, // } @@ -381,7 +392,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("transfer and call succeed with CALL permission policy set to default and CREATE permission policy set to restricted", func() evmtypes.Params { blockedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Create = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypeRestricted, AccessControlList: []string{s.keyring.GetAddr(blockedSignerIndex).String()}, @@ -394,7 +405,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("transfer and call are successful with CALL permission policy set to permissionless and address not blocked", func() evmtypes.Params { blockedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Call = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissionless, AccessControlList: []string{s.keyring.GetAddr(blockedSignerIndex).String()}, @@ -407,7 +418,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("transfer fails with signer blocked and call succeeds with signer NOT blocked permission policy set to permissionless", func() evmtypes.Params { blockedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Call = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissionless, AccessControlList: []string{s.keyring.GetAddr(blockedSignerIndex).String()}, @@ -420,7 +431,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("transfer succeeds with signer NOT blocked and call fails with signer blocked permission policy set to permissionless", func() evmtypes.Params { blockedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Call = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissionless, AccessControlList: []string{s.keyring.GetAddr(blockedSignerIndex).String()}, @@ -433,7 +444,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("transfer and call succeeds with CALL permission policy set to permissioned and signer whitelisted on both", func() evmtypes.Params { blockedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Call = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissioned, AccessControlList: []string{s.keyring.GetAddr(blockedSignerIndex).String()}, @@ -446,7 +457,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("transfer and call fails with CALL permission policy set to permissioned and signer not whitelisted on both", func() evmtypes.Params { blockedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Call = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissioned, AccessControlList: []string{s.keyring.GetAddr(blockedSignerIndex).String()}, @@ -460,7 +471,14 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func DescribeTable("Performs contract deployment and contract call with AccessControl", func(getTestParams func() evmtypes.Params, createParams, callParams PermissionsTableTest) { params := getTestParams() - err := s.network.UpdateEvmParams(params) + err := integrationutils.UpdateEvmParams( + integrationutils.UpdateParamsInput{ + Tf: s.factory, + Network: s.network, + Pk: s.keyring.GetPrivKey(0), + Params: params, + }, + ) Expect(err).To(BeNil()) err = s.network.NextBlock() @@ -512,7 +530,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("Create and call is successful with create permission policy set to permissionless and address not blocked ", func() evmtypes.Params { blockedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Create = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissionless, AccessControlList: []string{s.keyring.GetAddr(blockedSignerIndex).String()}, @@ -525,7 +543,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("Create fails with create permission policy set to permissionless and signer is blocked ", func() evmtypes.Params { blockedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Create = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissionless, AccessControlList: []string{s.keyring.GetAddr(blockedSignerIndex).String()}, @@ -538,7 +556,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("Create and call is successful with call permission policy set to permissionless and address not blocked ", func() evmtypes.Params { blockedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Call = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissionless, AccessControlList: []string{s.keyring.GetAddr(blockedSignerIndex).String()}, @@ -551,7 +569,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("Create is successful and call fails with call permission policy set to permissionless and address blocked ", func() evmtypes.Params { blockedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Call = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissionless, AccessControlList: []string{s.keyring.GetAddr(blockedSignerIndex).String()}, @@ -563,7 +581,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func ), Entry("Create fails create permission policy set to restricted", func() evmtypes.Params { // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Create = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypeRestricted, } @@ -574,7 +592,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func ), Entry("Create succeeds and call fails when call permission policy set to restricted", func() evmtypes.Params { // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Call = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypeRestricted, } @@ -586,7 +604,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("Create and call are successful with create permission policy set to permissioned and signer whitelisted", func() evmtypes.Params { whitelistedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Create = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissioned, AccessControlList: []string{s.keyring.GetAddr(whitelistedSignerIndex).String()}, @@ -599,7 +617,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("Create fails with create permission policy set to permissioned and signer NOT whitelisted", func() evmtypes.Params { whitelistedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Create = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissioned, AccessControlList: []string{s.keyring.GetAddr(whitelistedSignerIndex).String()}, @@ -612,7 +630,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("Create and call are successful with call permission policy set to permissioned and signer whitelisted", func() evmtypes.Params { whitelistedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Call = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissioned, AccessControlList: []string{s.keyring.GetAddr(whitelistedSignerIndex).String()}, @@ -625,7 +643,7 @@ var _ = Describe("Handling a MsgEthereumTx message", Label("EVM"), Ordered, func Entry("Create succeeds and call fails with call permission policy set to permissioned and signer NOT whitelisted", func() evmtypes.Params { whitelistedSignerIndex := 1 // Set params to default values - defaultParams := evmtypes.DefaultParamsWithEVMDenom(s.network.GetDenom()) + defaultParams := evmtypes.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) defaultParams.AccessControl.Call = evmtypes.AccessControlType{ AccessType: evmtypes.AccessTypePermissioned, AccessControlList: []string{s.keyring.GetAddr(whitelistedSignerIndex).String()}, @@ -643,7 +661,7 @@ type PermissionsTableTest struct { SignerIndex int } -func checkMintTopics(res abcitypes.ResponseDeliverTx) error { +func checkMintTopics(res abcitypes.ExecTxResult) error { // Check contract call response has the expected topics for a mint // call within an ERC20 contract expectedTopics := []string{ diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index d806b5c0..07097d4d 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -1,25 +1,25 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package keeper import ( "math/big" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" "cosmossdk.io/math" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" - "github.com/evmos/os/x/evm/core/vm" - evmostypes "github.com/evmos/os/types" + "github.com/evmos/os/x/evm/core/vm" "github.com/evmos/os/x/evm/statedb" "github.com/evmos/os/x/evm/types" ) @@ -153,7 +153,7 @@ func (k Keeper) GetAuthority() sdk.AccAddress { // GetBlockBloomTransient returns bloom bytes for the current block height func (k Keeper) GetBlockBloomTransient(ctx sdk.Context) *big.Int { store := prefix.NewStore(ctx.TransientStore(k.transientKey), types.KeyPrefixTransientBloom) - heightBz := sdk.Uint64ToBigEndian(uint64(ctx.BlockHeight())) + heightBz := sdk.Uint64ToBigEndian(uint64(ctx.BlockHeight())) //nolint:gosec // G115 // won't exceed uint64 bz := store.Get(heightBz) if len(bz) == 0 { return big.NewInt(0) @@ -166,7 +166,7 @@ func (k Keeper) GetBlockBloomTransient(ctx sdk.Context) *big.Int { // every block. func (k Keeper) SetBlockBloomTransient(ctx sdk.Context, bloom *big.Int) { store := prefix.NewStore(ctx.TransientStore(k.transientKey), types.KeyPrefixTransientBloom) - heightBz := sdk.Uint64ToBigEndian(uint64(ctx.BlockHeight())) + heightBz := sdk.Uint64ToBigEndian(uint64(ctx.BlockHeight())) //nolint:gosec // G115 // won't exceed uint64 store.Set(heightBz, bloom.Bytes()) } diff --git a/x/evm/keeper/keeper_test.go b/x/evm/keeper/keeper_test.go index ec40107d..09aa3eb0 100644 --- a/x/evm/keeper/keeper_test.go +++ b/x/evm/keeper/keeper_test.go @@ -4,6 +4,7 @@ import ( "fmt" "math/big" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/evmos/os/utils" @@ -12,8 +13,6 @@ import ( evmtypes "github.com/evmos/os/x/evm/types" "github.com/ethereum/go-ethereum/common" - - abci "github.com/cometbft/cometbft/abci/types" ) func (suite *KeeperTestSuite) TestWithChainID() { @@ -46,7 +45,7 @@ func (suite *KeeperTestSuite) TestWithChainID() { for _, tc := range testCases { suite.Run(tc.name, func() { keeper := keeper.Keeper{} - ctx := suite.ctx.WithChainID(tc.chainID) + ctx := suite.network.GetContext().WithChainID(tc.chainID) if tc.expPanic { suite.Require().Panics(func() { @@ -80,10 +79,10 @@ func (suite *KeeperTestSuite) TestBaseFee() { suite.enableFeemarket = tc.enableFeemarket suite.enableLondonHF = tc.enableLondonHF suite.SetupTest() - suite.app.EVMKeeper.BeginBlock(suite.ctx, abci.RequestBeginBlock{}) - params := suite.app.EVMKeeper.GetParams(suite.ctx) - ethCfg := params.ChainConfig.EthereumConfig(suite.app.EVMKeeper.ChainID()) - baseFee := suite.app.EVMKeeper.GetBaseFee(suite.ctx, ethCfg) + suite.Require().NoError(suite.network.App.EVMKeeper.BeginBlock(suite.network.GetContext())) + params := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) + ethCfg := params.ChainConfig.EthereumConfig(suite.network.App.EVMKeeper.ChainID()) + baseFee := suite.network.App.EVMKeeper.GetBaseFee(suite.network.GetContext(), ethCfg) suite.Require().Equal(tc.expectBaseFee, baseFee) }) } @@ -92,6 +91,7 @@ func (suite *KeeperTestSuite) TestBaseFee() { } func (suite *KeeperTestSuite) TestGetAccountStorage() { + var ctx sdk.Context testCases := []struct { name string malleate func() common.Address @@ -104,7 +104,7 @@ func (suite *KeeperTestSuite) TestGetAccountStorage() { name: "One contract (with storage) and other EOAs", malleate: func() common.Address { supply := big.NewInt(100) - contractAddr := suite.DeployTestContract(suite.T(), suite.address, supply) + contractAddr := suite.DeployTestContract(suite.T(), ctx, suite.keyring.GetAddr(0), supply) return contractAddr }, }, @@ -113,6 +113,7 @@ func (suite *KeeperTestSuite) TestGetAccountStorage() { for _, tc := range testCases { suite.Run(tc.name, func() { suite.SetupTest() + ctx = suite.network.GetContext() var contractAddr common.Address if tc.malleate != nil { @@ -120,7 +121,7 @@ func (suite *KeeperTestSuite) TestGetAccountStorage() { } i := 0 - suite.app.AccountKeeper.IterateAccounts(suite.ctx, func(account authtypes.AccountI) bool { + suite.network.App.AccountKeeper.IterateAccounts(ctx, func(account sdk.AccountI) bool { acc, ok := account.(*authtypes.BaseAccount) if !ok { // Ignore e.g. module accounts @@ -134,7 +135,7 @@ func (suite *KeeperTestSuite) TestGetAccountStorage() { panic(fmt.Sprintf("failed to convert %s to hex address", err)) } - storage := suite.app.EVMKeeper.GetAccountStorage(suite.ctx, address) + storage := suite.network.App.EVMKeeper.GetAccountStorage(ctx, address) if address == contractAddr { suite.Require().NotEqual(0, len(storage), @@ -156,13 +157,14 @@ func (suite *KeeperTestSuite) TestGetAccountStorage() { } func (suite *KeeperTestSuite) TestGetAccountOrEmpty() { + ctx := suite.network.GetContext() empty := statedb.Account{ Balance: new(big.Int), CodeHash: evmtypes.EmptyCodeHash, } supply := big.NewInt(100) - contractAddr := suite.DeployTestContract(suite.T(), suite.address, supply) + contractAddr := suite.DeployTestContract(suite.T(), ctx, suite.keyring.GetAddr(0), supply) testCases := []struct { name string @@ -183,7 +185,7 @@ func (suite *KeeperTestSuite) TestGetAccountOrEmpty() { for _, tc := range testCases { suite.Run(tc.name, func() { - res := suite.app.EVMKeeper.GetAccountOrEmpty(suite.ctx, tc.addr) + res := suite.network.App.EVMKeeper.GetAccountOrEmpty(ctx, tc.addr) if tc.expEmpty { suite.Require().Equal(empty, res) } else { diff --git a/x/evm/keeper/msg_server.go b/x/evm/keeper/msg_server.go index e57d170a..ed20338a 100644 --- a/x/evm/keeper/msg_server.go +++ b/x/evm/keeper/msg_server.go @@ -1,25 +1,23 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package keeper import ( "context" + "encoding/hex" "encoding/json" "fmt" "strconv" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - - tmbytes "github.com/cometbft/cometbft/libs/bytes" - tmtypes "github.com/cometbft/cometbft/types" - errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" - "github.com/armon/go-metrics" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/evmos/os/x/evm/types" + "github.com/hashicorp/go-metrics" ) var _ types.MsgServer = &Keeper{} @@ -89,8 +87,8 @@ func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*t if len(ctx.TxBytes()) > 0 { // add event for tendermint transaction hash format - hash := tmbytes.HexBytes(tmtypes.Tx(ctx.TxBytes()).Hash()) - attrs = append(attrs, sdk.NewAttribute(types.AttributeKeyTxHash, hash.String())) + hash := cmttypes.Tx(ctx.TxBytes()).Hash() + attrs = append(attrs, sdk.NewAttribute(types.AttributeKeyTxHash, hex.EncodeToString(hash))) } if to := tx.To(); to != nil { diff --git a/x/evm/keeper/msg_server_test.go b/x/evm/keeper/msg_server_test.go index 7ef112df..66ec3c92 100644 --- a/x/evm/keeper/msg_server_test.go +++ b/x/evm/keeper/msg_server_test.go @@ -1,111 +1,127 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) package keeper_test import ( "math/big" + sdktypes "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/evmos/os/testutil" - "github.com/evmos/os/x/evm/statedb" + testconstants "github.com/evmos/os/testutil/constants" + "github.com/evmos/os/testutil/integration/os/utils" "github.com/evmos/os/x/evm/types" ) func (suite *KeeperTestSuite) TestEthereumTx() { - var ( - err error - msg *types.MsgEthereumTx - signer ethtypes.Signer - vmdb *statedb.StateDB - expectedGasUsed uint64 - ) - + suite.enableFeemarket = true + defer func() { suite.enableFeemarket = false }() + suite.SetupTest() testCases := []struct { - name string - malleate func() - expErr bool + name string + getMsg func() *types.MsgEthereumTx + expectedErr error }{ { - "Deploy contract tx - insufficient gas", - func() { - msg, err = suite.createContractMsgTx( - vmdb.GetNonce(suite.address), - signer, - big.NewInt(1), - ) + "fail - insufficient gas", + func() *types.MsgEthereumTx { + args := types.EvmTxArgs{ + // Have insufficient gas + GasLimit: 10, + } + tx, err := suite.factory.GenerateSignedEthTx(suite.keyring.GetPrivKey(0), args) suite.Require().NoError(err) + return tx.GetMsgs()[0].(*types.MsgEthereumTx) }, - true, + types.ErrInvalidGasCap, }, { - "Transfer funds tx", - func() { - msg, _, err = newEthMsgTx( - vmdb.GetNonce(suite.address), - suite.address, - suite.signer, - signer, - ethtypes.AccessListTxType, - nil, - nil, - ) + "success - transfer funds tx", + func() *types.MsgEthereumTx { + recipient := suite.keyring.GetAddr(1) + args := types.EvmTxArgs{ + To: &recipient, + Amount: big.NewInt(1e18), + } + tx, err := suite.factory.GenerateSignedEthTx(suite.keyring.GetPrivKey(0), args) suite.Require().NoError(err) - expectedGasUsed = params.TxGas + return tx.GetMsgs()[0].(*types.MsgEthereumTx) }, - false, + nil, }, } for _, tc := range testCases { + tc := tc suite.Run(tc.name, func() { - suite.SetupTest() - signer = ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) - vmdb = suite.StateDB() + msg := tc.getMsg() + + // Function to be tested + res, err := suite.network.App.EVMKeeper.EthereumTx(suite.network.GetContext(), msg) - tc.malleate() - res, err := suite.app.EVMKeeper.EthereumTx(suite.ctx, msg) - if tc.expErr { + events := suite.network.GetContext().EventManager().Events() + if tc.expectedErr != nil { suite.Require().Error(err) - return + // no events should have been emitted + suite.Require().Empty(events) + } else { + suite.Require().NoError(err) + suite.Require().False(res.Failed()) + + // check expected events were emitted + suite.Require().NotEmpty(events) + suite.Require().True(utils.ContainsEventType(events.ToABCIEvents(), types.EventTypeEthereumTx)) + suite.Require().True(utils.ContainsEventType(events.ToABCIEvents(), types.EventTypeTxLog)) + suite.Require().True(utils.ContainsEventType(events.ToABCIEvents(), sdktypes.EventTypeMessage)) } + + err = suite.network.NextBlock() suite.Require().NoError(err) - suite.Require().Equal(expectedGasUsed, res.GasUsed) - suite.Require().False(res.Failed()) }) } + suite.enableFeemarket = false } func (suite *KeeperTestSuite) TestUpdateParams() { + suite.SetupTest() testCases := []struct { - name string - request *types.MsgUpdateParams - expectErr bool + name string + getMsg func() *types.MsgUpdateParams + expectedErr error }{ { - name: "fail - invalid authority", - request: &types.MsgUpdateParams{Authority: "foobar"}, - expectErr: true, + name: "fail - invalid authority", + getMsg: func() *types.MsgUpdateParams { + return &types.MsgUpdateParams{Authority: "foobar"} + }, + expectedErr: govtypes.ErrInvalidSigner, }, { name: "pass - valid Update msg", - request: &types.MsgUpdateParams{ - Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), - Params: types.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom), + getMsg: func() *types.MsgUpdateParams { + return &types.MsgUpdateParams{ + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + Params: types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom), + } }, - expectErr: false, + expectedErr: nil, }, } for _, tc := range testCases { tc := tc suite.Run("MsgUpdateParams", func() { - _, err := suite.app.EVMKeeper.UpdateParams(suite.ctx, tc.request) - if tc.expectErr { + msg := tc.getMsg() + _, err := suite.network.App.EVMKeeper.UpdateParams(suite.network.GetContext(), msg) + if tc.expectedErr != nil { suite.Require().Error(err) + suite.Contains(err.Error(), tc.expectedErr.Error()) } else { suite.Require().NoError(err) } }) + + err := suite.network.NextBlock() + suite.Require().NoError(err) } } diff --git a/x/evm/keeper/params_benchmark_test.go b/x/evm/keeper/params_benchmark_test.go index 0edc8f0a..8c1bd02f 100644 --- a/x/evm/keeper/params_benchmark_test.go +++ b/x/evm/keeper/params_benchmark_test.go @@ -3,28 +3,29 @@ package keeper_test import ( "testing" + testconstants "github.com/evmos/os/testutil/constants" "github.com/evmos/os/x/evm/types" ) func BenchmarkSetParams(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) - params := types.DefaultParams() + suite.SetupTest() + params := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - _ = suite.app.EVMKeeper.SetParams(suite.ctx, params) + _ = suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), params) } } func BenchmarkGetParams(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - _ = suite.app.EVMKeeper.GetParams(suite.ctx) + _ = suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) } } diff --git a/x/evm/keeper/params_test.go b/x/evm/keeper/params_test.go index 96d6cd6b..7c86d02e 100644 --- a/x/evm/keeper/params_test.go +++ b/x/evm/keeper/params_test.go @@ -1,15 +1,13 @@ package keeper_test import ( - "reflect" - exampleapp "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" "github.com/evmos/os/x/evm/types" ) func (suite *KeeperTestSuite) TestParams() { - params := types.DefaultParamsWithEVMDenom(testutil.ExampleAttoDenom) + defaultChainEVMParams := exampleapp.NewEVMGenesisState().Params + defaultChainEVMParams.ActiveStaticPrecompiles = types.AvailableStaticPrecompiles testCases := []struct { name string @@ -20,25 +18,24 @@ func (suite *KeeperTestSuite) TestParams() { { "success - Checks if the default params are set correctly", func() interface{} { - // NOTE: we are using the EVM genesis state for the example app here, because - // we have different assumptions for the evmOS offering and the example chain. - return exampleapp.NewEVMGenesisState().Params + return defaultChainEVMParams }, func() interface{} { - return suite.app.EVMKeeper.GetParams(suite.ctx) + return suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) }, true, }, { "success - EvmDenom param is set to \"inj\" and can be retrieved correctly", func() interface{} { + params := defaultChainEVMParams params.EvmDenom = "inj" - err := suite.app.EVMKeeper.SetParams(suite.ctx, params) + err := suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), params) suite.Require().NoError(err) return params.EvmDenom }, func() interface{} { - evmParams := suite.app.EVMKeeper.GetParams(suite.ctx) + evmParams := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) return evmParams.GetEvmDenom() }, true, @@ -46,17 +43,18 @@ func (suite *KeeperTestSuite) TestParams() { { "success - Check Access Control Create param is set to restricted and can be retrieved correctly", func() interface{} { + params := defaultChainEVMParams params.AccessControl = types.AccessControl{ Create: types.AccessControlType{ AccessType: types.AccessTypeRestricted, }, } - err := suite.app.EVMKeeper.SetParams(suite.ctx, params) + err := suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), params) suite.Require().NoError(err) return types.AccessTypeRestricted }, func() interface{} { - evmParams := suite.app.EVMKeeper.GetParams(suite.ctx) + evmParams := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) return evmParams.GetAccessControl().Create.AccessType }, true, @@ -64,17 +62,18 @@ func (suite *KeeperTestSuite) TestParams() { { "success - Check Access control param is set to restricted and can be retrieved correctly", func() interface{} { + params := defaultChainEVMParams params.AccessControl = types.AccessControl{ Call: types.AccessControlType{ AccessType: types.AccessTypeRestricted, }, } - err := suite.app.EVMKeeper.SetParams(suite.ctx, params) + err := suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), params) suite.Require().NoError(err) return types.AccessTypeRestricted }, func() interface{} { - evmParams := suite.app.EVMKeeper.GetParams(suite.ctx) + evmParams := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) return evmParams.GetAccessControl().Call.AccessType }, true, @@ -82,13 +81,14 @@ func (suite *KeeperTestSuite) TestParams() { { "success - Check AllowUnprotectedTxs param is set to false and can be retrieved correctly", func() interface{} { + params := defaultChainEVMParams params.AllowUnprotectedTxs = false - err := suite.app.EVMKeeper.SetParams(suite.ctx, params) + err := suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), params) suite.Require().NoError(err) return params.AllowUnprotectedTxs }, func() interface{} { - evmParams := suite.app.EVMKeeper.GetParams(suite.ctx) + evmParams := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) return evmParams.GetAllowUnprotectedTxs() }, true, @@ -96,13 +96,14 @@ func (suite *KeeperTestSuite) TestParams() { { "success - Check ChainConfig param is set to the default value and can be retrieved correctly", func() interface{} { + params := defaultChainEVMParams params.ChainConfig = types.DefaultChainConfig() - err := suite.app.EVMKeeper.SetParams(suite.ctx, params) + err := suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), params) suite.Require().NoError(err) return params.ChainConfig }, func() interface{} { - evmParams := suite.app.EVMKeeper.GetParams(suite.ctx) + evmParams := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) return evmParams.GetChainConfig() }, true, @@ -110,11 +111,12 @@ func (suite *KeeperTestSuite) TestParams() { { name: "success - Active precompiles are sorted when setting params", paramsFun: func() interface{} { + params := defaultChainEVMParams params.ActiveStaticPrecompiles = []string{ "0x0000000000000000000000000000000000000801", "0x0000000000000000000000000000000000000800", } - err := suite.app.EVMKeeper.SetParams(suite.ctx, params) + err := suite.network.App.EVMKeeper.SetParams(suite.network.GetContext(), params) suite.Require().NoError(err, "expected no error when setting params") // NOTE: return sorted slice here because the precompiles should be sorted when setting the params @@ -124,7 +126,7 @@ func (suite *KeeperTestSuite) TestParams() { } }, getFun: func() interface{} { - evmParams := suite.app.EVMKeeper.GetParams(suite.ctx) + evmParams := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) return evmParams.GetActiveStaticPrecompiles() }, expected: true, @@ -134,8 +136,7 @@ func (suite *KeeperTestSuite) TestParams() { suite.Run(tc.name, func() { suite.SetupTest() - outcome := reflect.DeepEqual(tc.paramsFun(), tc.getFun()) - suite.Require().Equal(tc.expected, outcome) + suite.Require().Equal(tc.paramsFun(), tc.getFun(), "expected different params") }) } } diff --git a/x/evm/keeper/setup_test.go b/x/evm/keeper/setup_test.go index 82275798..25e555a4 100644 --- a/x/evm/keeper/setup_test.go +++ b/x/evm/keeper/setup_test.go @@ -3,59 +3,33 @@ package keeper_test import ( "math" "testing" - "time" sdkmath "cosmossdk.io/math" - "cosmossdk.io/simapp" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/crypto/tmhash" - tmjson "github.com/cometbft/cometbft/libs/json" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/params" - "github.com/evmos/os/crypto/ethsecp256k1" - "github.com/evmos/os/encoding" - exampleapp "github.com/evmos/os/example_chain" - chainutil "github.com/evmos/os/example_chain/testutil" - "github.com/evmos/os/testutil" - utiltx "github.com/evmos/os/testutil/tx" + testconstants "github.com/evmos/os/testutil/constants" + "github.com/evmos/os/testutil/integration/os/factory" + "github.com/evmos/os/testutil/integration/os/grpc" + "github.com/evmos/os/testutil/integration/os/keyring" + "github.com/evmos/os/testutil/integration/os/network" evmtypes "github.com/evmos/os/x/evm/types" feemarkettypes "github.com/evmos/os/x/feemarket/types" - "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) type KeeperTestSuite struct { suite.Suite - ctx sdk.Context - app *exampleapp.ExampleChain - priv cryptotypes.PrivKey - queryClient evmtypes.QueryClient - address common.Address - consAddress sdk.ConsAddress - - // for generate test tx - clientCtx client.Context - ethSigner ethtypes.Signer - - appCodec codec.Codec - signer keyring.Signer + network *network.UnitTestNetwork + handler grpc.Handler + keyring keyring.Keyring + factory factory.TxFactory enableFeemarket bool enableLondonHF bool mintFeeCollector bool - denom string } type UnitTestSuite struct { @@ -76,126 +50,54 @@ func TestKeeperTestSuite(t *testing.T) { } func (suite *KeeperTestSuite) SetupTest() { - checkTx := false - chainID := testutil.ExampleChainID - suite.app = exampleapp.Setup(suite.T(), checkTx, chainID) - suite.SetupApp(checkTx, chainID) -} - -func (suite *KeeperTestSuite) SetupTestWithT(t require.TestingT) { - checkTx := false - chainID := testutil.ExampleChainID - suite.app = exampleapp.Setup(t.(*testing.T), checkTx, chainID) - suite.SetupAppWithT(checkTx, t, chainID) -} - -func (suite *KeeperTestSuite) SetupApp(checkTx bool, chainID string) { - suite.SetupAppWithT(checkTx, suite.T(), chainID) -} - -// SetupApp setup test environment, it uses`require.TestingT` to support both `testing.T` and `testing.B`. -func (suite *KeeperTestSuite) SetupAppWithT(checkTx bool, t require.TestingT, chainID string) { - // account key, use a constant account to keep unit test deterministic. - ecdsaPriv, err := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") - require.NoError(t, err) - priv := ðsecp256k1.PrivKey{ - Key: crypto.FromECDSA(ecdsaPriv), + keys := keyring.New(2) + // Set custom balance based on test params + customGenesis := network.CustomGenesisState{} + feemarketGenesis := feemarkettypes.DefaultGenesisState() + if s.enableFeemarket { + feemarketGenesis.Params.EnableHeight = 1 + feemarketGenesis.Params.NoBaseFee = false + } else { + feemarketGenesis.Params.NoBaseFee = true + } + customGenesis[feemarkettypes.ModuleName] = feemarketGenesis + + if !s.enableLondonHF { + evmGenesis := evmtypes.DefaultGenesisState() + maxInt := sdkmath.NewInt(math.MaxInt64) + evmGenesis.Params.EvmDenom = testconstants.ExampleAttoDenom + evmGenesis.Params.ChainConfig.LondonBlock = &maxInt + evmGenesis.Params.ChainConfig.ArrowGlacierBlock = &maxInt + evmGenesis.Params.ChainConfig.GrayGlacierBlock = &maxInt + evmGenesis.Params.ChainConfig.MergeNetsplitBlock = &maxInt + evmGenesis.Params.ChainConfig.ShanghaiBlock = &maxInt + evmGenesis.Params.ChainConfig.CancunBlock = &maxInt + customGenesis[evmtypes.ModuleName] = evmGenesis } - suite.priv = priv - suite.address = common.BytesToAddress(priv.PubKey().Address().Bytes()) - suite.signer = utiltx.NewSigner(priv) - - // consensus key - priv, err = ethsecp256k1.GenerateKey() - require.NoError(t, err) - suite.consAddress = sdk.ConsAddress(priv.PubKey().Address()) - - suite.app = chainutil.EthSetup(checkTx, chainID, func(app *exampleapp.ExampleChain, genesis simapp.GenesisState) simapp.GenesisState { - feemarketGenesis := feemarkettypes.DefaultGenesisState() - if suite.enableFeemarket { - feemarketGenesis.Params.EnableHeight = 1 - feemarketGenesis.Params.NoBaseFee = false - } else { - feemarketGenesis.Params.NoBaseFee = true - } - genesis[feemarkettypes.ModuleName] = app.AppCodec().MustMarshalJSON(feemarketGenesis) - if !suite.enableLondonHF { - evmGenesis := evmtypes.DefaultGenesisState() - evmGenesis.Params.EvmDenom = exampleapp.ExampleChainDenom // NOTE: use chain-specific denomination here for testing - maxInt := sdkmath.NewInt(math.MaxInt64) - evmGenesis.Params.ChainConfig.LondonBlock = &maxInt - evmGenesis.Params.ChainConfig.ArrowGlacierBlock = &maxInt - evmGenesis.Params.ChainConfig.GrayGlacierBlock = &maxInt - evmGenesis.Params.ChainConfig.MergeNetsplitBlock = &maxInt - evmGenesis.Params.ChainConfig.ShanghaiBlock = &maxInt - evmGenesis.Params.ChainConfig.CancunBlock = &maxInt - genesis[evmtypes.ModuleName] = app.AppCodec().MustMarshalJSON(evmGenesis) - } - return genesis - }) - if suite.mintFeeCollector { + if s.mintFeeCollector { // mint some coin to fee collector - coins := sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, sdkmath.NewInt(int64(params.TxGas)-1))) - genesisState := chainutil.NewTestGenesisState(suite.app.AppCodec()) + coins := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(int64(params.TxGas)-1))) balances := []banktypes.Balance{ { - Address: suite.app.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName).String(), + Address: authtypes.NewModuleAddress(authtypes.FeeCollectorName).String(), Coins: coins, }, } - var bankGenesis banktypes.GenesisState - suite.app.AppCodec().MustUnmarshalJSON(genesisState[banktypes.ModuleName], &bankGenesis) - // Update balances and total supply - bankGenesis.Balances = append(bankGenesis.Balances, balances...) - bankGenesis.Supply = bankGenesis.Supply.Add(coins...) - genesisState[banktypes.ModuleName] = suite.app.AppCodec().MustMarshalJSON(&bankGenesis) - - // we marshal the genesisState of all module to a byte array - stateBytes, err := tmjson.MarshalIndent(genesisState, "", " ") - require.NoError(t, err) - - // Initialize the chain - suite.app.InitChain( - abci.RequestInitChain{ - ChainId: chainID, - Validators: []abci.ValidatorUpdate{}, - ConsensusParams: chainutil.DefaultConsensusParams, - AppStateBytes: stateBytes, - }, - ) + bankGenesis := banktypes.DefaultGenesisState() + bankGenesis.Balances = balances + customGenesis[banktypes.ModuleName] = bankGenesis } - header := testutil.NewHeader( - 1, time.Now().UTC(), chainID, suite.consAddress, - tmhash.Sum([]byte("app")), tmhash.Sum([]byte("validators")), + nw := network.NewUnitTestNetwork( + network.WithPreFundedAccounts(keys.GetAllAccAddrs()...), + network.WithCustomGenesis(customGenesis), ) - suite.ctx = suite.app.NewContext(checkTx, header) - - queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) - evmtypes.RegisterQueryServer(queryHelper, suite.app.EVMKeeper) - suite.queryClient = evmtypes.NewQueryClient(queryHelper) - - acc := authtypes.NewBaseAccount(sdk.AccAddress(suite.address.Bytes()), nil, 0, 0) - suite.app.AccountKeeper.SetAccount(suite.ctx, acc) - - valAddr := sdk.ValAddress(suite.address.Bytes()) - validator, err := stakingtypes.NewValidator(valAddr, priv.PubKey(), stakingtypes.Description{}) - require.NoError(t, err) - err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) - require.NoError(t, err) - err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) - require.NoError(t, err) - suite.app.StakingKeeper.SetValidator(suite.ctx, validator) - - stakingParams := stakingtypes.DefaultParams() - stakingParams.BondDenom = testutil.ExampleAttoDenom - err = suite.app.StakingKeeper.SetParams(suite.ctx, stakingParams) - require.NoError(t, err) + gh := grpc.NewIntegrationHandler(nw) + tf := factory.New(nw, gh) - encodingConfig := encoding.MakeConfig(exampleapp.ModuleBasics) - suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) - suite.ethSigner = ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) - suite.appCodec = encodingConfig.Codec - suite.denom = testutil.ExampleAttoDenom + s.network = nw + s.factory = tf + s.handler = gh + s.keyring = keys } diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 7ed5ad8f..2fcbaeef 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -1,11 +1,12 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package keeper import ( "math/big" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" @@ -97,7 +98,7 @@ func (k Keeper) GetHashFn(ctx sdk.Context) vm.GetHashFunc { // only recompute the hash if not set (eg: checkTxState) contextBlockHeader := ctx.BlockHeader() - header, err := tmtypes.HeaderFromProto(&contextBlockHeader) + header, err := cmttypes.HeaderFromProto(&contextBlockHeader) if err != nil { k.Logger(ctx).Error("failed to cast tendermint header from proto", "error", err) return common.Hash{} @@ -109,13 +110,13 @@ func (k Keeper) GetHashFn(ctx sdk.Context) vm.GetHashFunc { case ctx.BlockHeight() > h: // Case 2: if the chain is not the current height we need to retrieve the hash from the store for the // current chain epoch. This only applies if the current height is greater than the requested height. - histInfo, found := k.stakingKeeper.GetHistoricalInfo(ctx, h) - if !found { - k.Logger(ctx).Debug("historical info not found", "height", h) + histInfo, err := k.stakingKeeper.GetHistoricalInfo(ctx, h) + if err != nil { + k.Logger(ctx).Debug("error while getting historical info", "height", h, "error", err.Error()) return common.Hash{} } - header, err := tmtypes.HeaderFromProto(&histInfo.Header) + header, err := cmttypes.HeaderFromProto(&histInfo.Header) if err != nil { k.Logger(ctx).Error("failed to cast tendermint header from proto", "error", err) return common.Hash{} diff --git a/x/evm/keeper/state_transition_benchmark_test.go b/x/evm/keeper/state_transition_benchmark_test.go index e27025d8..4892fdb4 100644 --- a/x/evm/keeper/state_transition_benchmark_test.go +++ b/x/evm/keeper/state_transition_benchmark_test.go @@ -7,10 +7,12 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" + utiltx "github.com/evmos/os/testutil/tx" evmtypes "github.com/evmos/os/x/evm/types" "github.com/stretchr/testify/require" ) @@ -62,7 +64,7 @@ func newSignedEthTx( return nil, errors.New("unknown transaction type") } - sig, _, err := krSigner.SignByAddress(addr, ethTx.Hash().Bytes()) + sig, _, err := krSigner.SignByAddress(addr, ethTx.Hash().Bytes(), signingtypes.SignMode_SIGN_MODE_TEXTUAL) if err != nil { return nil, err } @@ -157,26 +159,28 @@ func newNativeMessage( return m, nil } -func BenchmarkApplyTransaction(b *testing.B) { +func BenchmarkApplyTransaction(b *testing.B) { //nolint:dupl suite := KeeperTestSuite{enableLondonHF: true} - suite.SetupTestWithT(b) + suite.SetupTest() - ethSigner := ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) + ethSigner := ethtypes.LatestSignerForChainID(suite.network.App.EVMKeeper.ChainID()) b.ResetTimer() b.ReportAllocs() for i := 0; i < b.N; i++ { b.StopTimer() + addr := suite.keyring.GetAddr(0) + krSigner := utiltx.NewSigner(suite.keyring.GetPrivKey(0)) tx, err := newSignedEthTx(templateAccessListTx, - suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address), - sdk.AccAddress(suite.address.Bytes()), - suite.signer, + suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), addr), + sdk.AccAddress(addr.Bytes()), + krSigner, ethSigner, ) require.NoError(b, err) b.StartTimer() - resp, err := suite.app.EVMKeeper.ApplyTransaction(suite.ctx, tx) + resp, err := suite.network.App.EVMKeeper.ApplyTransaction(suite.network.GetContext(), tx) b.StopTimer() require.NoError(b, err) @@ -184,26 +188,28 @@ func BenchmarkApplyTransaction(b *testing.B) { } } -func BenchmarkApplyTransactionWithLegacyTx(b *testing.B) { +func BenchmarkApplyTransactionWithLegacyTx(b *testing.B) { //nolint:dupl suite := KeeperTestSuite{enableLondonHF: true} - suite.SetupTestWithT(b) + suite.SetupTest() - ethSigner := ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) + ethSigner := ethtypes.LatestSignerForChainID(suite.network.App.EVMKeeper.ChainID()) b.ResetTimer() b.ReportAllocs() for i := 0; i < b.N; i++ { b.StopTimer() + addr := suite.keyring.GetAddr(0) + krSigner := utiltx.NewSigner(suite.keyring.GetPrivKey(0)) tx, err := newSignedEthTx(templateLegacyTx, - suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address), - sdk.AccAddress(suite.address.Bytes()), - suite.signer, + suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), addr), + sdk.AccAddress(addr.Bytes()), + krSigner, ethSigner, ) require.NoError(b, err) b.StartTimer() - resp, err := suite.app.EVMKeeper.ApplyTransaction(suite.ctx, tx) + resp, err := suite.network.App.EVMKeeper.ApplyTransaction(suite.network.GetContext(), tx) b.StopTimer() require.NoError(b, err) @@ -213,24 +219,26 @@ func BenchmarkApplyTransactionWithLegacyTx(b *testing.B) { func BenchmarkApplyTransactionWithDynamicFeeTx(b *testing.B) { suite := KeeperTestSuite{enableFeemarket: true, enableLondonHF: true} - suite.SetupTestWithT(b) + suite.SetupTest() - ethSigner := ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) + ethSigner := ethtypes.LatestSignerForChainID(suite.network.App.EVMKeeper.ChainID()) b.ResetTimer() b.ReportAllocs() for i := 0; i < b.N; i++ { b.StopTimer() + addr := suite.keyring.GetAddr(0) + krSigner := utiltx.NewSigner(suite.keyring.GetPrivKey(0)) tx, err := newSignedEthTx(templateDynamicFeeTx, - suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address), - sdk.AccAddress(suite.address.Bytes()), - suite.signer, + suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), addr), + sdk.AccAddress(addr.Bytes()), + krSigner, ethSigner, ) require.NoError(b, err) b.StartTimer() - resp, err := suite.app.EVMKeeper.ApplyTransaction(suite.ctx, tx) + resp, err := suite.network.App.EVMKeeper.ApplyTransaction(suite.network.GetContext(), tx) b.StopTimer() require.NoError(b, err) @@ -241,23 +249,24 @@ func BenchmarkApplyTransactionWithDynamicFeeTx(b *testing.B) { //nolint:all func BenchmarkApplyMessage(b *testing.B) { suite := KeeperTestSuite{enableLondonHF: true} - suite.SetupTestWithT(b) + suite.SetupTest() - params := suite.app.EVMKeeper.GetParams(suite.ctx) - ethCfg := params.ChainConfig.EthereumConfig(suite.app.EVMKeeper.ChainID()) - signer := ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) + params := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) + ethCfg := params.ChainConfig.EthereumConfig(suite.network.App.EVMKeeper.ChainID()) + signer := ethtypes.LatestSignerForChainID(suite.network.App.EVMKeeper.ChainID()) b.ResetTimer() b.ReportAllocs() for i := 0; i < b.N; i++ { b.StopTimer() - + addr := suite.keyring.GetAddr(0) + krSigner := utiltx.NewSigner(suite.keyring.GetPrivKey(0)) m, err := newNativeMessage( - suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address), - suite.ctx.BlockHeight(), - suite.address, + suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), addr), + suite.network.GetContext().BlockHeight(), + addr, ethCfg, - suite.signer, + krSigner, signer, ethtypes.AccessListTxType, nil, @@ -266,7 +275,7 @@ func BenchmarkApplyMessage(b *testing.B) { require.NoError(b, err) b.StartTimer() - resp, err := suite.app.EVMKeeper.ApplyMessage(suite.ctx, m, nil, true) + resp, err := suite.network.App.EVMKeeper.ApplyMessage(suite.network.GetContext(), m, nil, true) b.StopTimer() require.NoError(b, err) @@ -277,23 +286,24 @@ func BenchmarkApplyMessage(b *testing.B) { //nolint:all func BenchmarkApplyMessageWithLegacyTx(b *testing.B) { suite := KeeperTestSuite{enableLondonHF: true} - suite.SetupTestWithT(b) + suite.SetupTest() - params := suite.app.EVMKeeper.GetParams(suite.ctx) - ethCfg := params.ChainConfig.EthereumConfig(suite.app.EVMKeeper.ChainID()) - signer := ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) + params := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) + ethCfg := params.ChainConfig.EthereumConfig(suite.network.App.EVMKeeper.ChainID()) + signer := ethtypes.LatestSignerForChainID(suite.network.App.EVMKeeper.ChainID()) b.ResetTimer() b.ReportAllocs() for i := 0; i < b.N; i++ { b.StopTimer() - + addr := suite.keyring.GetAddr(0) + krSigner := utiltx.NewSigner(suite.keyring.GetPrivKey(0)) m, err := newNativeMessage( - suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address), - suite.ctx.BlockHeight(), - suite.address, + suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), addr), + suite.network.GetContext().BlockHeight(), + addr, ethCfg, - suite.signer, + krSigner, signer, ethtypes.LegacyTxType, nil, @@ -302,7 +312,7 @@ func BenchmarkApplyMessageWithLegacyTx(b *testing.B) { require.NoError(b, err) b.StartTimer() - resp, err := suite.app.EVMKeeper.ApplyMessage(suite.ctx, m, nil, true) + resp, err := suite.network.App.EVMKeeper.ApplyMessage(suite.network.GetContext(), m, nil, true) b.StopTimer() require.NoError(b, err) @@ -312,23 +322,24 @@ func BenchmarkApplyMessageWithLegacyTx(b *testing.B) { func BenchmarkApplyMessageWithDynamicFeeTx(b *testing.B) { suite := KeeperTestSuite{enableFeemarket: true, enableLondonHF: true} - suite.SetupTestWithT(b) + suite.SetupTest() - params := suite.app.EVMKeeper.GetParams(suite.ctx) - ethCfg := params.ChainConfig.EthereumConfig(suite.app.EVMKeeper.ChainID()) - signer := ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) + params := suite.network.App.EVMKeeper.GetParams(suite.network.GetContext()) + ethCfg := params.ChainConfig.EthereumConfig(suite.network.App.EVMKeeper.ChainID()) + signer := ethtypes.LatestSignerForChainID(suite.network.App.EVMKeeper.ChainID()) b.ResetTimer() b.ReportAllocs() for i := 0; i < b.N; i++ { b.StopTimer() - + addr := suite.keyring.GetAddr(0) + krSigner := utiltx.NewSigner(suite.keyring.GetPrivKey(0)) m, err := newNativeMessage( - suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address), - suite.ctx.BlockHeight(), - suite.address, + suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), addr), + suite.network.GetContext().BlockHeight(), + addr, ethCfg, - suite.signer, + krSigner, signer, ethtypes.DynamicFeeTxType, nil, @@ -337,7 +348,7 @@ func BenchmarkApplyMessageWithDynamicFeeTx(b *testing.B) { require.NoError(b, err) b.StartTimer() - resp, err := suite.app.EVMKeeper.ApplyMessage(suite.ctx, m, nil, true) + resp, err := suite.network.App.EVMKeeper.ApplyMessage(suite.network.GetContext(), m, nil, true) b.StopTimer() require.NoError(b, err) diff --git a/x/evm/keeper/state_transition_test.go b/x/evm/keeper/state_transition_test.go index 508568d2..a00b3fa1 100644 --- a/x/evm/keeper/state_transition_test.go +++ b/x/evm/keeper/state_transition_test.go @@ -6,153 +6,147 @@ import ( "math/big" sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" "github.com/cometbft/cometbft/crypto/tmhash" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + cmttypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" - ethtypes "github.com/ethereum/go-ethereum/core/types" + gethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" exampleapp "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" + testconstants "github.com/evmos/os/testutil/constants" + "github.com/evmos/os/testutil/integration/os/factory" + "github.com/evmos/os/testutil/integration/os/grpc" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" + "github.com/evmos/os/testutil/integration/os/network" + "github.com/evmos/os/testutil/integration/os/utils" utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/evm/keeper" - "github.com/evmos/os/x/evm/statedb" - evmtypes "github.com/evmos/os/x/evm/types" + "github.com/evmos/os/x/evm/types" + feemarkettypes "github.com/evmos/os/x/feemarket/types" ) func (suite *KeeperTestSuite) TestGetHashFn() { - header := suite.ctx.BlockHeader() - h, _ := tmtypes.HeaderFromProto(&header) + suite.SetupTest() + header := suite.network.GetContext().BlockHeader() + h, _ := cmttypes.HeaderFromProto(&header) hash := h.Hash() testCases := []struct { msg string height uint64 - malleate func() + malleate func() sdk.Context expHash common.Hash }{ { "case 1.1: context hash cached", - uint64(suite.ctx.BlockHeight()), - func() { - suite.ctx = suite.ctx.WithHeaderHash(tmhash.Sum([]byte("header"))) + uint64(suite.network.GetContext().BlockHeight()), //nolint:gosec // G115 + func() sdk.Context { + return suite.network.GetContext().WithHeaderHash( + tmhash.Sum([]byte("header")), + ) }, common.BytesToHash(tmhash.Sum([]byte("header"))), }, { "case 1.2: failed to cast Tendermint header", - uint64(suite.ctx.BlockHeight()), - func() { + uint64(suite.network.GetContext().BlockHeight()), //nolint:gosec // G115 + func() sdk.Context { header := tmproto.Header{} - header.Height = suite.ctx.BlockHeight() - suite.ctx = suite.ctx.WithBlockHeader(header) + header.Height = suite.network.GetContext().BlockHeight() + return suite.network.GetContext().WithBlockHeader(header) }, common.Hash{}, }, { "case 1.3: hash calculated from Tendermint header", - uint64(suite.ctx.BlockHeight()), - func() { - suite.ctx = suite.ctx.WithBlockHeader(header) + uint64(suite.network.GetContext().BlockHeight()), //nolint:gosec // G115 + func() sdk.Context { + return suite.network.GetContext().WithBlockHeader(header) }, common.BytesToHash(hash), }, { "case 2.1: height lower than current one, hist info not found", 1, - func() { - suite.ctx = suite.ctx.WithBlockHeight(10) + func() sdk.Context { + return suite.network.GetContext().WithBlockHeight(10) }, common.Hash{}, }, { "case 2.2: height lower than current one, invalid hist info header", 1, - func() { - suite.app.StakingKeeper.SetHistoricalInfo(suite.ctx, 1, &stakingtypes.HistoricalInfo{}) - suite.ctx = suite.ctx.WithBlockHeight(10) + func() sdk.Context { + suite.Require().NoError(suite.network.App.StakingKeeper.SetHistoricalInfo(suite.network.GetContext(), 1, &stakingtypes.HistoricalInfo{})) + return suite.network.GetContext().WithBlockHeight(10) }, common.Hash{}, }, { "case 2.3: height lower than current one, calculated from hist info header", 1, - func() { + func() sdk.Context { histInfo := &stakingtypes.HistoricalInfo{ Header: header, } - suite.app.StakingKeeper.SetHistoricalInfo(suite.ctx, 1, histInfo) - suite.ctx = suite.ctx.WithBlockHeight(10) + suite.Require().NoError(suite.network.App.StakingKeeper.SetHistoricalInfo(suite.network.GetContext(), 1, histInfo)) + return suite.network.GetContext().WithBlockHeight(10) }, common.BytesToHash(hash), }, { "case 3: height greater than current one", 200, - func() {}, + func() sdk.Context { return suite.network.GetContext() }, common.Hash{}, }, } for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.SetupTest() // reset - - tc.malleate() + ctx := tc.malleate() - hash := suite.app.EVMKeeper.GetHashFn(suite.ctx)(tc.height) + // Function being tested + hash := suite.network.App.EVMKeeper.GetHashFn(ctx)(tc.height) suite.Require().Equal(tc.expHash, hash) + + err := suite.network.NextBlock() + suite.Require().NoError(err) }) } } func (suite *KeeperTestSuite) TestGetCoinbaseAddress() { - valOpAddr := utiltx.GenerateAddress() + suite.SetupTest() + validators := suite.network.GetValidators() + proposerAddressHex := utils.ValidatorConsAddressToHex( + validators[0].OperatorAddress, + ) testCases := []struct { msg string - malleate func() + malleate func() sdk.Context expPass bool }{ { "validator not found", - func() { - header := suite.ctx.BlockHeader() + func() sdk.Context { + header := suite.network.GetContext().BlockHeader() header.ProposerAddress = []byte{} - suite.ctx = suite.ctx.WithBlockHeader(header) + return suite.network.GetContext().WithBlockHeader(header) }, false, }, { "success", - func() { - valConsAddr, privkey := utiltx.NewAddrKey() - - pkAny, err := codectypes.NewAnyWithValue(privkey.PubKey()) - suite.Require().NoError(err) - - validator := stakingtypes.Validator{ - OperatorAddress: sdk.ValAddress(valOpAddr.Bytes()).String(), - ConsensusPubkey: pkAny, - } - - suite.app.StakingKeeper.SetValidator(suite.ctx, validator) - err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) - suite.Require().NoError(err) - - header := suite.ctx.BlockHeader() - header.ProposerAddress = valConsAddr.Bytes() - suite.ctx = suite.ctx.WithBlockHeader(header) - - _, found := suite.app.StakingKeeper.GetValidatorByConsAddr(suite.ctx, valConsAddr.Bytes()) - suite.Require().True(found) - - suite.Require().NotEmpty(suite.ctx.BlockHeader().ProposerAddress) + func() sdk.Context { + return suite.network.GetContext() }, true, }, @@ -160,14 +154,18 @@ func (suite *KeeperTestSuite) TestGetCoinbaseAddress() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.SetupTest() // reset + ctx := tc.malleate() + proposerAddress := ctx.BlockHeader().ProposerAddress + + // Function being tested + coinbase, err := suite.network.App.EVMKeeper.GetCoinbaseAddress( + ctx, + sdk.ConsAddress(proposerAddress), + ) - tc.malleate() - proposerAddress := suite.ctx.BlockHeader().ProposerAddress - coinbase, err := suite.app.EVMKeeper.GetCoinbaseAddress(suite.ctx, sdk.ConsAddress(proposerAddress)) if tc.expPass { suite.Require().NoError(err) - suite.Require().Equal(valOpAddr, coinbase) + suite.Require().Equal(proposerAddressHex, coinbase) } else { suite.Require().Error(err) } @@ -176,10 +174,11 @@ func (suite *KeeperTestSuite) TestGetCoinbaseAddress() { } func (suite *KeeperTestSuite) TestGetEthIntrinsicGas() { + suite.SetupTest() testCases := []struct { name string data []byte - accessList ethtypes.AccessList + accessList gethtypes.AccessList height int64 isContractCreation bool noError bool @@ -215,7 +214,7 @@ func (suite *KeeperTestSuite) TestGetEthIntrinsicGas() { { "no data, one accesslist, not contract creation, not homestead, not istanbul", nil, - []ethtypes.AccessTuple{ + []gethtypes.AccessTuple{ {}, }, 1, @@ -226,7 +225,7 @@ func (suite *KeeperTestSuite) TestGetEthIntrinsicGas() { { "no data, one accesslist with one storageKey, not contract creation, not homestead, not istanbul", nil, - []ethtypes.AccessTuple{ + []gethtypes.AccessTuple{ {StorageKeys: make([]common.Hash, 1)}, }, 1, @@ -256,31 +255,42 @@ func (suite *KeeperTestSuite) TestGetEthIntrinsicGas() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { - suite.SetupTest() // reset - - params := suite.app.EVMKeeper.GetParams(suite.ctx) - ethCfg := params.ChainConfig.EthereumConfig(suite.app.EVMKeeper.ChainID()) + params := suite.network.App.EVMKeeper.GetParams( + suite.network.GetContext(), + ) + ethCfg := params.ChainConfig.EthereumConfig( + suite.network.App.EVMKeeper.ChainID(), + ) ethCfg.HomesteadBlock = big.NewInt(2) ethCfg.IstanbulBlock = big.NewInt(3) - signer := ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) + signer := gethtypes.LatestSignerForChainID(suite.network.App.EVMKeeper.ChainID()) - suite.ctx = suite.ctx.WithBlockHeight(tc.height) + ctx := suite.network.GetContext().WithBlockHeight(tc.height) - nonce := suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address) + addr := suite.keyring.GetAddr(0) + krSigner := utiltx.NewSigner(suite.keyring.GetPrivKey(0)) + nonce := suite.network.App.EVMKeeper.GetNonce(ctx, addr) m, err := newNativeMessage( nonce, - suite.ctx.BlockHeight(), - suite.address, + ctx.BlockHeight(), + addr, ethCfg, - suite.signer, + krSigner, signer, - ethtypes.AccessListTxType, + gethtypes.AccessListTxType, tc.data, tc.accessList, ) suite.Require().NoError(err) - gas, err := suite.app.EVMKeeper.GetEthIntrinsicGas(suite.ctx, m, ethCfg, tc.isContractCreation) + // Function being tested + gas, err := suite.network.App.EVMKeeper.GetEthIntrinsicGas( + ctx, + m, + ethCfg, + tc.isContractCreation, + ) + if tc.noError { suite.Require().NoError(err) } else { @@ -293,6 +303,7 @@ func (suite *KeeperTestSuite) TestGetEthIntrinsicGas() { } func (suite *KeeperTestSuite) TestGasToRefund() { + suite.SetupTest() testCases := []struct { name string gasconsumed uint64 @@ -332,9 +343,7 @@ func (suite *KeeperTestSuite) TestGasToRefund() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { - suite.mintFeeCollector = true - suite.SetupTest() // reset - vmdb := suite.StateDB() + vmdb := suite.network.GetStateDB() vmdb.AddRefund(10) if tc.expPanic { @@ -349,14 +358,38 @@ func (suite *KeeperTestSuite) TestGasToRefund() { } }) } - suite.mintFeeCollector = false } func (suite *KeeperTestSuite) TestRefundGas() { - var ( - m core.Message - err error + // FeeCollector account is pre-funded with enough tokens + // for refund to work + // NOTE: everything should happen within the same block for + // feecollector account to remain funded + coins := sdk.NewCoins(sdk.NewCoin( + testconstants.ExampleAttoDenom, + sdkmath.NewInt(6e18), + )) + balances := []banktypes.Balance{ + { + Address: authtypes.NewModuleAddress(authtypes.FeeCollectorName).String(), + Coins: coins, + }, + } + bankGenesis := banktypes.DefaultGenesisState() + bankGenesis.Balances = balances + customGenesis := network.CustomGenesisState{} + customGenesis[banktypes.ModuleName] = bankGenesis + + keyring := testkeyring.New(2) + unitNetwork := network.NewUnitTestNetwork( + network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), + network.WithCustomGenesis(customGenesis), ) + grpcHandler := grpc.NewIntegrationHandler(unitNetwork) + txFactory := factory.New(unitNetwork, grpcHandler) + + sender := keyring.GetKey(0) + recipient := keyring.GetAddr(1) testCases := []struct { name string @@ -364,7 +397,7 @@ func (suite *KeeperTestSuite) TestRefundGas() { refundQuotient uint64 noError bool expGasRefund uint64 - malleate func() + gasPrice *big.Int }{ { name: "leftoverGas more than tx gas limit", @@ -395,62 +428,46 @@ func (suite *KeeperTestSuite) TestRefundGas() { expGasRefund: params.TxGas / params.RefundQuotient, }, { - name: "invalid Gas value in msg", + name: "invalid GasPrice in message", leftoverGas: 0, refundQuotient: params.RefundQuotient, noError: false, - expGasRefund: params.TxGas, - malleate: func() { - keeperParams := suite.app.EVMKeeper.GetParams(suite.ctx) - m, err = suite.createContractGethMsg( - suite.StateDB().GetNonce(suite.address), - ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()), - keeperParams.ChainConfig.EthereumConfig(suite.app.EVMKeeper.ChainID()), - big.NewInt(-100), - ) - suite.Require().NoError(err) - }, + expGasRefund: params.TxGas / params.RefundQuotient, + gasPrice: big.NewInt(-100), }, } for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { - suite.mintFeeCollector = true - suite.SetupTest() // reset - - keeperParams := suite.app.EVMKeeper.GetParams(suite.ctx) - ethCfg := keeperParams.ChainConfig.EthereumConfig(suite.app.EVMKeeper.ChainID()) - signer := ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) - vmdb := suite.StateDB() - - m, err = newNativeMessage( - vmdb.GetNonce(suite.address), - suite.ctx.BlockHeight(), - suite.address, - ethCfg, - suite.signer, - signer, - ethtypes.AccessListTxType, - nil, - nil, + coreMsg, err := txFactory.GenerateGethCoreMsg( + sender.Priv, + types.EvmTxArgs{ + To: &recipient, + Amount: big.NewInt(100), + GasPrice: tc.gasPrice, + }, ) suite.Require().NoError(err) + transactionGas := coreMsg.Gas() + vmdb := unitNetwork.GetStateDB() vmdb.AddRefund(params.TxGas) - if tc.leftoverGas > m.Gas() { + if tc.leftoverGas > transactionGas { return } - if tc.malleate != nil { - tc.malleate() - } - - gasUsed := m.Gas() - tc.leftoverGas + gasUsed := transactionGas - tc.leftoverGas refund := keeper.GasToRefund(vmdb.GetRefund(), gasUsed, tc.refundQuotient) suite.Require().Equal(tc.expGasRefund, refund) - err = suite.app.EVMKeeper.RefundGas(suite.ctx, m, refund, testutil.ExampleAttoDenom) + err = unitNetwork.App.EVMKeeper.RefundGas( + unitNetwork.GetContext(), + coreMsg, + refund, + unitNetwork.GetDenom(), + ) + if tc.noError { suite.Require().NoError(err) } else { @@ -458,10 +475,10 @@ func (suite *KeeperTestSuite) TestRefundGas() { } }) } - suite.mintFeeCollector = false } func (suite *KeeperTestSuite) TestResetGasMeterAndConsumeGas() { + suite.SetupTest() testCases := []struct { name string gasConsumed uint64 @@ -502,13 +519,11 @@ func (suite *KeeperTestSuite) TestResetGasMeterAndConsumeGas() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { - suite.SetupTest() // reset - panicF := func() { gm := storetypes.NewGasMeter(10) gm.ConsumeGas(tc.gasConsumed, "") - ctx := suite.ctx.WithGasMeter(gm) - suite.app.EVMKeeper.ResetGasMeterAndConsumeGas(ctx, tc.gasUsed) + ctx := suite.network.GetContext().WithGasMeter(gm) + suite.network.App.EVMKeeper.ResetGasMeterAndConsumeGas(ctx, tc.gasUsed) } if tc.expPanic { @@ -521,182 +536,239 @@ func (suite *KeeperTestSuite) TestResetGasMeterAndConsumeGas() { } func (suite *KeeperTestSuite) TestEVMConfig() { - proposerAddress := suite.ctx.BlockHeader().ProposerAddress - cfg, err := suite.app.EVMKeeper.EVMConfig(suite.ctx, proposerAddress, big.NewInt(testutil.ExampleEIP155ChainID)) - suite.Require().NoError(err) + suite.SetupTest() - // NOTE: since we are using different defaults for the app and the evmOS in general, we are getting the - // default parameters from the EVM genesis state for the example app here. - defaultParams := exampleapp.NewEVMGenesisState().Params - suite.Require().Equal(defaultParams, cfg.Params) + defaultChainEVMParams := exampleapp.NewEVMGenesisState().Params + proposerAddress := suite.network.GetContext().BlockHeader().ProposerAddress + eip155ChainID := suite.network.GetEIP155ChainID() + cfg, err := suite.network.App.EVMKeeper.EVMConfig( + suite.network.GetContext(), + proposerAddress, + eip155ChainID, + ) + suite.Require().NoError(err) + suite.Require().Equal(defaultChainEVMParams, cfg.Params) // london hardfork is enabled by default suite.Require().Equal(big.NewInt(0), cfg.BaseFee) - suite.Require().Equal(suite.address, cfg.CoinBase) - suite.Require().Equal(defaultParams.ChainConfig.EthereumConfig(big.NewInt(testutil.ExampleEIP155ChainID)), cfg.ChainConfig) -} + suite.Require().Equal(defaultChainEVMParams.ChainConfig.EthereumConfig(big.NewInt(testconstants.ExampleEIP155ChainID)), cfg.ChainConfig) + + validators := suite.network.GetValidators() + proposerHextAddress := utils.ValidatorConsAddressToHex(validators[0].OperatorAddress) + suite.Require().Equal(proposerHextAddress, cfg.CoinBase) -func (suite *KeeperTestSuite) TestContractDeployment() { - contractAddress := suite.DeployTestContract(suite.T(), suite.address, big.NewInt(10000000000000)) - db := suite.StateDB() - suite.Require().Greater(db.GetCodeSize(contractAddress), 0) + networkChainID := suite.network.GetEIP155ChainID() + networkConfig := defaultChainEVMParams.ChainConfig.EthereumConfig(networkChainID) + suite.Require().Equal(networkConfig, cfg.ChainConfig) } func (suite *KeeperTestSuite) TestApplyMessage() { - expectedGasUsed := params.TxGas - var msg core.Message - - proposerAddress := suite.ctx.BlockHeader().ProposerAddress - config, err := suite.app.EVMKeeper.EVMConfig(suite.ctx, proposerAddress, big.NewInt(testutil.ExampleEIP155ChainID)) + suite.enableFeemarket = true + defer func() { suite.enableFeemarket = false }() + suite.SetupTest() + + proposerAddress := suite.network.GetContext().BlockHeader().ProposerAddress + config, err := suite.network.App.EVMKeeper.EVMConfig( + suite.network.GetContext(), + proposerAddress, + suite.network.GetEIP155ChainID(), + ) suite.Require().NoError(err) - keeperParams := suite.app.EVMKeeper.GetParams(suite.ctx) - chainCfg := keeperParams.ChainConfig.EthereumConfig(suite.app.EVMKeeper.ChainID()) - signer := ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) - tracer := suite.app.EVMKeeper.Tracer(suite.ctx, msg, config.ChainConfig) - vmdb := suite.StateDB() - - msg, err = newNativeMessage( - vmdb.GetNonce(suite.address), - suite.ctx.BlockHeight(), - suite.address, - chainCfg, - suite.signer, - signer, - ethtypes.AccessListTxType, - nil, - nil, + // Generate a transfer tx message + sender := suite.keyring.GetKey(0) + recipient := suite.keyring.GetAddr(1) + transferArgs := types.EvmTxArgs{ + To: &recipient, + Amount: big.NewInt(100), + } + coreMsg, err := suite.factory.GenerateGethCoreMsg( + sender.Priv, + transferArgs, ) suite.Require().NoError(err) - res, err := suite.app.EVMKeeper.ApplyMessage(suite.ctx, msg, tracer, true) - + tracer := suite.network.App.EVMKeeper.Tracer( + suite.network.GetContext(), + coreMsg, + config.ChainConfig, + ) + res, err := suite.network.App.EVMKeeper.ApplyMessage( + suite.network.GetContext(), + coreMsg, + tracer, + true, + ) suite.Require().NoError(err) - suite.Require().Equal(expectedGasUsed, res.GasUsed) suite.Require().False(res.Failed()) + + // Compare gas to a transfer tx gas + expectedGasUsed := params.TxGas + suite.Require().Equal(expectedGasUsed, res.GasUsed) } func (suite *KeeperTestSuite) TestApplyMessageWithConfig() { - var ( - msg core.Message - err error - expectedGasUsed uint64 - config *statedb.EVMConfig - keeperParams evmtypes.Params - signer ethtypes.Signer - vmdb *statedb.StateDB - txConfig statedb.TxConfig - chainCfg *params.ChainConfig - ) - + suite.enableFeemarket = true + defer func() { suite.enableFeemarket = false }() + suite.SetupTest() testCases := []struct { - name string - malleate func() - expErr bool - expVMErr bool + name string + getMessage func() core.Message + getEVMParams func() types.Params + getFeeMarketParams func() feemarkettypes.Params + expErr bool + expVMErr bool + expectedGasUsed uint64 }{ { - "message applied ok", - func() { - msg, err = newNativeMessage( - vmdb.GetNonce(suite.address), - suite.ctx.BlockHeight(), - suite.address, - chainCfg, - suite.signer, - signer, - ethtypes.AccessListTxType, - nil, - nil, - ) + "success - messsage applied ok with default params", + func() core.Message { + sender := suite.keyring.GetKey(0) + recipient := suite.keyring.GetAddr(1) + msg, err := suite.factory.GenerateGethCoreMsg(sender.Priv, types.EvmTxArgs{ + To: &recipient, + Amount: big.NewInt(100), + }) suite.Require().NoError(err) + return msg }, + func() types.Params { + return types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) + }, + feemarkettypes.DefaultParams, false, false, + params.TxGas, }, { "call contract tx with config param EnableCall = false", - func() { - config.Params.AccessControl = evmtypes.AccessControl{ - Call: evmtypes.AccessControlType{ - AccessType: evmtypes.AccessTypeRestricted, + func() core.Message { + sender := suite.keyring.GetKey(0) + recipient := suite.keyring.GetAddr(1) + msg, err := suite.factory.GenerateGethCoreMsg(sender.Priv, types.EvmTxArgs{ + To: &recipient, + Amount: big.NewInt(100), + Input: []byte("contract_data"), + }) + suite.Require().NoError(err) + return msg + }, + func() types.Params { + defaultParams := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) + defaultParams.AccessControl = types.AccessControl{ + Call: types.AccessControlType{ + AccessType: types.AccessTypeRestricted, }, } - msg, err = newNativeMessage( - vmdb.GetNonce(suite.address), - suite.ctx.BlockHeight(), - suite.address, - chainCfg, - suite.signer, - signer, - ethtypes.AccessListTxType, - nil, - nil, - ) - suite.Require().NoError(err) + return defaultParams }, + feemarkettypes.DefaultParams, false, true, + 0, }, { "create contract tx with config param EnableCreate = false", - func() { - msg, err = suite.createContractGethMsg(vmdb.GetNonce(suite.address), signer, chainCfg, big.NewInt(2)) + func() core.Message { + sender := suite.keyring.GetKey(0) + msg, err := suite.factory.GenerateGethCoreMsg(sender.Priv, types.EvmTxArgs{ + Amount: big.NewInt(100), + Input: []byte("contract_data"), + }) suite.Require().NoError(err) - config.Params.AccessControl = evmtypes.AccessControl{ - Create: evmtypes.AccessControlType{ - AccessType: evmtypes.AccessTypeRestricted, + return msg + }, + func() types.Params { + defaultParams := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) + defaultParams.AccessControl = types.AccessControl{ + Create: types.AccessControlType{ + AccessType: types.AccessTypeRestricted, }, } + return defaultParams }, + feemarkettypes.DefaultParams, false, true, + 0, }, { - "fix panic when minimumGasUsed is not uint64", - func() { - msg, err = newNativeMessage( - vmdb.GetNonce(suite.address), - suite.ctx.BlockHeight(), - suite.address, - chainCfg, - suite.signer, - signer, - ethtypes.AccessListTxType, - nil, - nil, - ) + "fail - fix panic when minimumGasUsed is not uint64", + func() core.Message { + sender := suite.keyring.GetKey(0) + recipient := suite.keyring.GetAddr(1) + msg, err := suite.factory.GenerateGethCoreMsg(sender.Priv, types.EvmTxArgs{ + To: &recipient, + Amount: big.NewInt(100), + }) suite.Require().NoError(err) - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) - params.MinGasMultiplier = sdkmath.LegacyNewDec(math.MaxInt64).MulInt64(100) - err = suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) + return msg + }, + func() types.Params { + return types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom) + }, + func() feemarkettypes.Params { + paramsRes, err := suite.handler.GetFeeMarketParams() suite.Require().NoError(err) + params := paramsRes.GetParams() + params.MinGasMultiplier = sdkmath.LegacyNewDec(math.MaxInt64).MulInt64(100) + return params }, true, false, + 0, }, } for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { - suite.SetupTest() - expectedGasUsed = params.TxGas - - proposerAddress := suite.ctx.BlockHeader().ProposerAddress - config, err = suite.app.EVMKeeper.EVMConfig(suite.ctx, proposerAddress, big.NewInt(testutil.ExampleEIP155ChainID)) + msg := tc.getMessage() + evmParams := tc.getEVMParams() + err := suite.network.App.EVMKeeper.SetParams( + suite.network.GetContext(), + evmParams, + ) + suite.Require().NoError(err) + feeMarketparams := tc.getFeeMarketParams() + err = suite.network.App.FeeMarketKeeper.SetParams( + suite.network.GetContext(), + feeMarketparams, + ) suite.Require().NoError(err) - keeperParams = suite.app.EVMKeeper.GetParams(suite.ctx) - chainCfg = keeperParams.ChainConfig.EthereumConfig(suite.app.EVMKeeper.ChainID()) - signer = ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) - vmdb = suite.StateDB() - txConfig = suite.app.EVMKeeper.TxConfig(suite.ctx, common.Hash{}) + txConfig := suite.network.App.EVMKeeper.TxConfig( + suite.network.GetContext(), + common.Hash{}, + ) + proposerAddress := suite.network.GetContext().BlockHeader().ProposerAddress + config, err := suite.network.App.EVMKeeper.EVMConfig( + suite.network.GetContext(), + proposerAddress, + suite.network.GetEIP155ChainID(), + ) + suite.Require().NoError(err) - tc.malleate() - res, err := suite.app.EVMKeeper.ApplyMessageWithConfig(suite.ctx, msg, nil, true, config, txConfig) + // Function being tested + res, err := suite.network.App.EVMKeeper.ApplyMessageWithConfig( + suite.network.GetContext(), + msg, + nil, + true, + config, + txConfig, + ) if tc.expErr { suite.Require().Error(err) + } else if !tc.expVMErr { + suite.Require().NoError(err) + suite.Require().False(res.Failed()) + suite.Require().Equal(tc.expectedGasUsed, res.GasUsed) + } + + err = suite.network.NextBlock() + if tc.expVMErr { + suite.Require().NotEmpty(res.VmError) return } @@ -706,46 +778,17 @@ func (suite *KeeperTestSuite) TestApplyMessageWithConfig() { } suite.Require().NoError(err) - suite.Require().False(res.Failed()) - suite.Require().Equal(expectedGasUsed, res.GasUsed) }) } } -func (suite *KeeperTestSuite) createContractGethMsg(nonce uint64, signer ethtypes.Signer, cfg *params.ChainConfig, gasPrice *big.Int) (core.Message, error) { - ethMsg, err := suite.createContractMsgTx(nonce, signer, gasPrice) - if err != nil { - return nil, err - } - - msgSigner := ethtypes.MakeSigner(cfg, big.NewInt(suite.ctx.BlockHeight())) - return ethMsg.AsMessage(msgSigner, nil) -} - -func (suite *KeeperTestSuite) createContractMsgTx(nonce uint64, signer ethtypes.Signer, gasPrice *big.Int) (*evmtypes.MsgEthereumTx, error) { - contractCreateTx := ðtypes.AccessListTx{ - GasPrice: gasPrice, - Gas: params.TxGasContractCreation + 1000, // account for data length - To: nil, - Data: []byte("contract_data"), - Nonce: nonce, - } - ethTx := ethtypes.NewTx(contractCreateTx) - ethMsg := &evmtypes.MsgEthereumTx{} - err := ethMsg.FromEthereumTx(ethTx) - suite.Require().NoError(err) - ethMsg.From = suite.address.Hex() - - return ethMsg, ethMsg.Sign(signer, suite.signer) -} - func (suite *KeeperTestSuite) TestGetProposerAddress() { - var a sdk.ConsAddress - address := sdk.ConsAddress(suite.address.Bytes()) - proposerAddress := sdk.ConsAddress(suite.ctx.BlockHeader().ProposerAddress) + suite.SetupTest() + address := sdk.ConsAddress(suite.keyring.GetAddr(0).Bytes()) + proposerAddress := sdk.ConsAddress(suite.network.GetContext().BlockHeader().ProposerAddress) testCases := []struct { msg string - adr sdk.ConsAddress + addr sdk.ConsAddress expAdr sdk.ConsAddress }{ { @@ -760,13 +803,16 @@ func (suite *KeeperTestSuite) TestGetProposerAddress() { }, { "typed nil proposer address provided", - a, + sdk.ConsAddress{}, proposerAddress, }, } for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - suite.Require().Equal(tc.expAdr, keeper.GetProposerAddress(suite.ctx, tc.adr)) + suite.Require().Equal( + tc.expAdr, + keeper.GetProposerAddress(suite.network.GetContext(), tc.addr), + ) }) } } diff --git a/x/evm/keeper/statedb.go b/x/evm/keeper/statedb.go index 4abb2640..9ea81b90 100644 --- a/x/evm/keeper/statedb.go +++ b/x/evm/keeper/statedb.go @@ -8,8 +8,8 @@ import ( "math/big" sdkmath "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/x/evm/statedb" @@ -69,7 +69,7 @@ func (k *Keeper) GetCodeHash(ctx sdk.Context, addr common.Address) common.Hash { // The iteration is stopped when the callback function returns true. func (k Keeper) IterateContracts(ctx sdk.Context, cb func(addr common.Address, codeHash common.Hash) (stop bool)) { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixCodeHash) + iterator := storetypes.KVStorePrefixIterator(store, types.KeyPrefixCodeHash) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { diff --git a/x/evm/keeper/statedb_benchmark_test.go b/x/evm/keeper/statedb_benchmark_test.go index 6a0091f1..7ab78525 100644 --- a/x/evm/keeper/statedb_benchmark_test.go +++ b/x/evm/keeper/statedb_benchmark_test.go @@ -15,7 +15,7 @@ import ( func BenchmarkCreateAccountNew(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() vmdb := suite.StateDB() b.ResetTimer() @@ -31,20 +31,20 @@ func BenchmarkCreateAccountNew(b *testing.B) { func BenchmarkCreateAccountExisting(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() vmdb := suite.StateDB() b.ResetTimer() b.ReportAllocs() for i := 0; i < b.N; i++ { - vmdb.CreateAccount(suite.address) + vmdb.CreateAccount(suite.keyring.GetAddr(0)) } } func BenchmarkAddBalance(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() vmdb := suite.StateDB() amt := big.NewInt(10) @@ -53,13 +53,13 @@ func BenchmarkAddBalance(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - vmdb.AddBalance(suite.address, amt) + vmdb.AddBalance(suite.keyring.GetAddr(0), amt) } } func BenchmarkSetCode(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() vmdb := suite.StateDB() hash := crypto.Keccak256Hash([]byte("code")).Bytes() @@ -68,13 +68,13 @@ func BenchmarkSetCode(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - vmdb.SetCode(suite.address, hash) + vmdb.SetCode(suite.keyring.GetAddr(0), hash) } } func BenchmarkSetState(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() vmdb := suite.StateDB() hash := crypto.Keccak256Hash([]byte("topic")).Bytes() @@ -83,13 +83,13 @@ func BenchmarkSetState(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - vmdb.SetCode(suite.address, hash) + vmdb.SetCode(suite.keyring.GetAddr(0), hash) } } func BenchmarkAddLog(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() vmdb := suite.StateDB() topic := crypto.Keccak256Hash([]byte("topic")) @@ -101,7 +101,7 @@ func BenchmarkAddLog(b *testing.B) { for i := 0; i < b.N; i++ { vmdb.AddLog(ðtypes.Log{ - Address: suite.address, + Address: suite.keyring.GetAddr(0), Topics: []common.Hash{topic}, Data: []byte("data"), BlockNumber: 1, @@ -116,7 +116,7 @@ func BenchmarkAddLog(b *testing.B) { func BenchmarkSnapshot(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() vmdb := suite.StateDB() b.ResetTimer() @@ -136,7 +136,7 @@ func BenchmarkSnapshot(b *testing.B) { func BenchmarkSubBalance(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() vmdb := suite.StateDB() amt := big.NewInt(10) @@ -145,26 +145,26 @@ func BenchmarkSubBalance(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - vmdb.SubBalance(suite.address, amt) + vmdb.SubBalance(suite.keyring.GetAddr(0), amt) } } func BenchmarkSetNonce(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() vmdb := suite.StateDB() b.ResetTimer() b.ReportAllocs() for i := 0; i < b.N; i++ { - vmdb.SetNonce(suite.address, 1) + vmdb.SetNonce(suite.keyring.GetAddr(0), 1) } } func BenchmarkAddRefund(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() vmdb := suite.StateDB() b.ResetTimer() @@ -177,7 +177,7 @@ func BenchmarkAddRefund(b *testing.B) { func BenchmarkSuicide(b *testing.B) { suite := KeeperTestSuite{} - suite.SetupTestWithT(b) + suite.SetupTest() vmdb := suite.StateDB() b.ResetTimer() diff --git a/x/evm/keeper/statedb_test.go b/x/evm/keeper/statedb_test.go index 4f28572c..3b33765d 100644 --- a/x/evm/keeper/statedb_test.go +++ b/x/evm/keeper/statedb_test.go @@ -5,22 +5,23 @@ import ( "math/big" "testing" + "cosmossdk.io/store/prefix" + "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/evmos/os/contracts" + testconstants "github.com/evmos/os/testutil/constants" testfactory "github.com/evmos/os/testutil/integration/os/factory" testhandler "github.com/evmos/os/testutil/integration/os/grpc" testkeyring "github.com/evmos/os/testutil/integration/os/keyring" - testnetwork "github.com/evmos/os/testutil/integration/os/network" + "github.com/evmos/os/testutil/integration/os/network" utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/evm/core/vm" "github.com/evmos/os/x/evm/statedb" @@ -37,7 +38,7 @@ func (suite *KeeperTestSuite) TestCreateAccount() { }{ { "reset account (keep balance)", - suite.address, + utiltx.GenerateAddress(), func(vmdb vm.StateDB, addr common.Address) { vmdb.AddBalance(addr, big.NewInt(100)) suite.Require().NotZero(vmdb.GetBalance(addr).Int64()) @@ -94,9 +95,9 @@ func (suite *KeeperTestSuite) TestAddBalance() { for _, tc := range testCases { suite.Run(tc.name, func() { vmdb := suite.StateDB() - prev := vmdb.GetBalance(suite.address) - vmdb.AddBalance(suite.address, tc.amount) - post := vmdb.GetBalance(suite.address) + prev := vmdb.GetBalance(suite.keyring.GetAddr(0)) + vmdb.AddBalance(suite.keyring.GetAddr(0), tc.amount) + post := vmdb.GetBalance(suite.keyring.GetAddr(0)) if tc.isNoOp { suite.Require().Equal(prev.Int64(), post.Int64()) @@ -124,7 +125,7 @@ func (suite *KeeperTestSuite) TestSubBalance() { "positive amount, above zero", big.NewInt(50), func(vmdb vm.StateDB) { - vmdb.AddBalance(suite.address, big.NewInt(100)) + vmdb.AddBalance(suite.keyring.GetAddr(0), big.NewInt(100)) }, false, }, @@ -147,9 +148,9 @@ func (suite *KeeperTestSuite) TestSubBalance() { vmdb := suite.StateDB() tc.malleate(vmdb) - prev := vmdb.GetBalance(suite.address) - vmdb.SubBalance(suite.address, tc.amount) - post := vmdb.GetBalance(suite.address) + prev := vmdb.GetBalance(suite.keyring.GetAddr(0)) + vmdb.SubBalance(suite.keyring.GetAddr(0), tc.amount) + post := vmdb.GetBalance(suite.keyring.GetAddr(0)) if tc.isNoOp { suite.Require().Equal(prev.Int64(), post.Int64()) @@ -175,10 +176,10 @@ func (suite *KeeperTestSuite) TestGetNonce() { }, { "existing account", - suite.address, + suite.keyring.GetAddr(0), 1, func(vmdb vm.StateDB) { - vmdb.SetNonce(suite.address, 1) + vmdb.SetNonce(suite.keyring.GetAddr(0), 1) }, }, } @@ -209,7 +210,7 @@ func (suite *KeeperTestSuite) TestSetNonce() { }, { "existing account", - suite.address, + suite.keyring.GetAddr(0), 99, func() {}, }, @@ -228,7 +229,8 @@ func (suite *KeeperTestSuite) TestSetNonce() { func (suite *KeeperTestSuite) TestGetCodeHash() { addr := utiltx.GenerateAddress() baseAcc := &authtypes.BaseAccount{Address: sdk.AccAddress(addr.Bytes()).String()} - suite.app.AccountKeeper.SetAccount(suite.ctx, baseAcc) + newAcc := suite.network.App.AccountKeeper.NewAccount(suite.network.GetContext(), baseAcc) + suite.network.App.AccountKeeper.SetAccount(suite.network.GetContext(), newAcc) testCases := []struct { name string @@ -250,10 +252,10 @@ func (suite *KeeperTestSuite) TestGetCodeHash() { }, { "existing account", - suite.address, + suite.keyring.GetAddr(0), crypto.Keccak256Hash([]byte("codeHash")), func(vmdb vm.StateDB) { - vmdb.SetCode(suite.address, []byte("codeHash")) + vmdb.SetCode(suite.keyring.GetAddr(0), []byte("codeHash")) }, }, } @@ -272,7 +274,8 @@ func (suite *KeeperTestSuite) TestGetCodeHash() { func (suite *KeeperTestSuite) TestSetCode() { addr := utiltx.GenerateAddress() baseAcc := &authtypes.BaseAccount{Address: sdk.AccAddress(addr.Bytes()).String()} - suite.app.AccountKeeper.SetAccount(suite.ctx, baseAcc) + newAcc := suite.network.App.AccountKeeper.NewAccount(suite.network.GetContext(), baseAcc) + suite.network.App.AccountKeeper.SetAccount(suite.network.GetContext(), newAcc) testCases := []struct { name string @@ -294,13 +297,13 @@ func (suite *KeeperTestSuite) TestSetCode() { }, { "existing account", - suite.address, + suite.keyring.GetAddr(0), []byte("code"), false, }, { "existing account, code deleted from store", - suite.address, + suite.keyring.GetAddr(0), nil, false, }, @@ -325,10 +328,6 @@ func (suite *KeeperTestSuite) TestSetCode() { } func (suite *KeeperTestSuite) TestKeeperSetOrDeleteCode() { - addr := utiltx.GenerateAddress() - baseAcc := &authtypes.BaseAccount{Address: sdk.AccAddress(addr.Bytes()).String()} - suite.app.AccountKeeper.SetAccount(suite.ctx, baseAcc) - testCases := []struct { name string codeHash []byte @@ -348,13 +347,18 @@ func (suite *KeeperTestSuite) TestKeeperSetOrDeleteCode() { for _, tc := range testCases { suite.Run(tc.name, func() { + suite.SetupTest() + addr := utiltx.GenerateAddress() + baseAcc := suite.network.App.AccountKeeper.NewAccountWithAddress(suite.network.GetContext(), addr.Bytes()) + suite.network.App.AccountKeeper.SetAccount(suite.network.GetContext(), baseAcc) + ctx := suite.network.GetContext() if len(tc.code) == 0 { - suite.app.EVMKeeper.DeleteCode(suite.ctx, tc.codeHash) + suite.network.App.EVMKeeper.DeleteCode(ctx, tc.codeHash) } else { - suite.app.EVMKeeper.SetCode(suite.ctx, tc.codeHash, tc.code) + suite.network.App.EVMKeeper.SetCode(ctx, tc.codeHash, tc.code) } - key := suite.app.GetKey(types.StoreKey) - store := prefix.NewStore(suite.ctx.KVStore(key), types.KeyPrefixCode) + key := suite.network.App.GetKey(types.StoreKey) + store := prefix.NewStore(ctx.KVStore(key), types.KeyPrefixCode) code := store.Get(tc.codeHash) suite.Require().Equal(tc.code, code) @@ -364,8 +368,8 @@ func (suite *KeeperTestSuite) TestKeeperSetOrDeleteCode() { func TestIterateContracts(t *testing.T) { keyring := testkeyring.New(1) - network := testnetwork.NewUnitTestNetwork( - testnetwork.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), + network := network.NewUnitTestNetwork( + network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), ) handler := testhandler.NewIntegrationHandler(network) factory := testfactory.New(network, handler) @@ -469,8 +473,8 @@ func (suite *KeeperTestSuite) TestState() { for _, tc := range testCases { suite.Run(tc.name, func() { vmdb := suite.StateDB() - vmdb.SetState(suite.address, tc.key, tc.value) - value := vmdb.GetState(suite.address, tc.key) + vmdb.SetState(suite.keyring.GetAddr(0), tc.key, tc.value) + value := vmdb.GetState(suite.keyring.GetAddr(0), tc.key) suite.Require().Equal(tc.value, value) }) } @@ -482,21 +486,21 @@ func (suite *KeeperTestSuite) TestCommittedState() { value2 := common.BytesToHash([]byte("value2")) vmdb := suite.StateDB() - vmdb.SetState(suite.address, key, value1) + vmdb.SetState(suite.keyring.GetAddr(0), key, value1) err := vmdb.Commit() suite.Require().NoError(err) vmdb = suite.StateDB() - vmdb.SetState(suite.address, key, value2) - tmp := vmdb.GetState(suite.address, key) + vmdb.SetState(suite.keyring.GetAddr(0), key, value2) + tmp := vmdb.GetState(suite.keyring.GetAddr(0), key) suite.Require().Equal(value2, tmp) - tmp = vmdb.GetCommittedState(suite.address, key) + tmp = vmdb.GetCommittedState(suite.keyring.GetAddr(0), key) suite.Require().Equal(value1, tmp) err = vmdb.Commit() suite.Require().NoError(err) vmdb = suite.StateDB() - tmp = vmdb.GetCommittedState(suite.address, key) + tmp = vmdb.GetCommittedState(suite.keyring.GetAddr(0), key) suite.Require().Equal(value2, tmp) } @@ -505,68 +509,70 @@ func (suite *KeeperTestSuite) TestSetAndGetCodeHash() { } func (suite *KeeperTestSuite) TestSuicide() { - suite.SetupTest() - - // Generate addresses for testing - addr1 := utiltx.GenerateAddress() - addr2 := utiltx.GenerateAddress() - - // Set the code in the code storage - code := []byte("code1") - codeHashBz := crypto.Keccak256(code) - suite.app.EVMKeeper.SetCodeHash(s.ctx, addr1.Bytes(), codeHashBz) - suite.app.EVMKeeper.SetCodeHash(s.ctx, addr2.Bytes(), codeHashBz) + keyring := testkeyring.New(1) + unitNetwork := network.NewUnitTestNetwork( + network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), + ) - // NOTE: we're instantiating the StateDB here to have the context already contain the - db := suite.StateDB() + firstAddressIndex := keyring.AddKey() + firstAddress := keyring.GetAddr(firstAddressIndex) + secondAddressIndex := keyring.AddKey() + secondAddress := keyring.GetAddr(secondAddressIndex) + code := []byte("code") + db := unitNetwork.GetStateDB() // Add code to account - db.SetCode(addr1, code) - - suite.Require().Equal(code, db.GetCode(addr1)) + db.SetCode(firstAddress, code) + suite.Require().Equal(code, db.GetCode(firstAddress)) // Add state to account for i := 0; i < 5; i++ { - db.SetState(addr1, common.BytesToHash([]byte(fmt.Sprintf("key%d", i))), common.BytesToHash([]byte(fmt.Sprintf("value%d", i)))) + db.SetState( + firstAddress, + common.BytesToHash([]byte(fmt.Sprintf("key%d", i))), + common.BytesToHash([]byte(fmt.Sprintf("value%d", i))), + ) } - suite.Require().NoError(db.Commit()) - db = suite.StateDB() + db = unitNetwork.GetStateDB() // Add code and state to account 2 - db.SetCode(addr2, code) - suite.Require().Equal(code, db.GetCode(addr2)) - + db.SetCode(secondAddress, code) + suite.Require().Equal(code, db.GetCode(secondAddress)) for i := 0; i < 5; i++ { - db.SetState(addr2, common.BytesToHash([]byte(fmt.Sprintf("key%d", i))), common.BytesToHash([]byte(fmt.Sprintf("value%d", i)))) + db.SetState( + secondAddress, + common.BytesToHash([]byte(fmt.Sprintf("key%d", i))), + common.BytesToHash([]byte(fmt.Sprintf("value%d", i))), + ) } // Call Suicide - suite.Require().Equal(true, db.Suicide(addr1)) + suite.Require().Equal(true, db.Suicide(firstAddress)) // Check suicided is marked - suite.Require().Equal(true, db.HasSuicided(addr1)) + suite.Require().Equal(true, db.HasSuicided(firstAddress)) // Commit state suite.Require().NoError(db.Commit()) - db = suite.StateDB() + db = unitNetwork.GetStateDB() // Check code is deleted - suite.Require().Nil(db.GetCode(addr1)) + suite.Require().Nil(db.GetCode(firstAddress)) // Check state is deleted var storage types.Storage - suite.app.EVMKeeper.ForEachStorage(suite.ctx, addr1, func(key, value common.Hash) bool { + unitNetwork.App.EVMKeeper.ForEachStorage(unitNetwork.GetContext(), firstAddress, func(key, value common.Hash) bool { storage = append(storage, types.NewState(key, value)) return true }) suite.Require().Equal(0, len(storage)) // Check account is deleted - suite.Require().Equal(common.Hash{}, db.GetCodeHash(addr1)) + suite.Require().Equal(common.Hash{}, db.GetCodeHash(firstAddress)) // Check code is still present in addr2 and suicided is false - suite.Require().NotNil(db.GetCode(addr2)) - suite.Require().Equal(false, db.HasSuicided(addr2)) + suite.Require().NotNil(db.GetCode(secondAddress)) + suite.Require().Equal(false, db.HasSuicided(secondAddress)) } func (suite *KeeperTestSuite) TestExist() { @@ -576,9 +582,9 @@ func (suite *KeeperTestSuite) TestExist() { malleate func(vm.StateDB) exists bool }{ - {"success, account exists", suite.address, func(vm.StateDB) {}, true}, - {"success, has suicided", suite.address, func(vmdb vm.StateDB) { - vmdb.Suicide(suite.address) + {"success, account exists", suite.keyring.GetAddr(0), func(vm.StateDB) {}, true}, + {"success, has suicided", suite.keyring.GetAddr(0), func(vmdb vm.StateDB) { + vmdb.Suicide(suite.keyring.GetAddr(0)) }, true}, {"success, account doesn't exist", utiltx.GenerateAddress(), func(vm.StateDB) {}, false}, } @@ -597,24 +603,24 @@ func (suite *KeeperTestSuite) TestEmpty() { testCases := []struct { name string address common.Address - malleate func(vm.StateDB) + malleate func(vm.StateDB, common.Address) empty bool }{ - {"empty, account exists", suite.address, func(vm.StateDB) {}, true}, + {"empty, account exists", utiltx.GenerateAddress(), func(vmdb vm.StateDB, addr common.Address) { vmdb.CreateAccount(addr) }, true}, { "not empty, positive balance", - suite.address, - func(vmdb vm.StateDB) { vmdb.AddBalance(suite.address, big.NewInt(100)) }, + utiltx.GenerateAddress(), + func(vmdb vm.StateDB, addr common.Address) { vmdb.AddBalance(addr, big.NewInt(100)) }, false, }, - {"empty, account doesn't exist", utiltx.GenerateAddress(), func(vm.StateDB) {}, true}, + {"empty, account doesn't exist", utiltx.GenerateAddress(), func(vm.StateDB, common.Address) {}, true}, } for _, tc := range testCases { suite.Run(tc.name, func() { suite.SetupTest() vmdb := suite.StateDB() - tc.malleate(vmdb) + tc.malleate(vmdb, tc.address) suite.Require().Equal(tc.empty, vmdb.Empty(tc.address)) }) @@ -634,38 +640,38 @@ func (suite *KeeperTestSuite) TestSnapshot() { revision := vmdb.Snapshot() suite.Require().Zero(revision) - vmdb.SetState(suite.address, key, value1) - suite.Require().Equal(value1, vmdb.GetState(suite.address, key)) + vmdb.SetState(suite.keyring.GetAddr(0), key, value1) + suite.Require().Equal(value1, vmdb.GetState(suite.keyring.GetAddr(0), key)) vmdb.RevertToSnapshot(revision) // reverted - suite.Require().Equal(common.Hash{}, vmdb.GetState(suite.address, key)) + suite.Require().Equal(common.Hash{}, vmdb.GetState(suite.keyring.GetAddr(0), key)) }}, {"nested snapshot/revert", func(vmdb vm.StateDB) { revision1 := vmdb.Snapshot() suite.Require().Zero(revision1) - vmdb.SetState(suite.address, key, value1) + vmdb.SetState(suite.keyring.GetAddr(0), key, value1) revision2 := vmdb.Snapshot() - vmdb.SetState(suite.address, key, value2) - suite.Require().Equal(value2, vmdb.GetState(suite.address, key)) + vmdb.SetState(suite.keyring.GetAddr(0), key, value2) + suite.Require().Equal(value2, vmdb.GetState(suite.keyring.GetAddr(0), key)) vmdb.RevertToSnapshot(revision2) - suite.Require().Equal(value1, vmdb.GetState(suite.address, key)) + suite.Require().Equal(value1, vmdb.GetState(suite.keyring.GetAddr(0), key)) vmdb.RevertToSnapshot(revision1) - suite.Require().Equal(common.Hash{}, vmdb.GetState(suite.address, key)) + suite.Require().Equal(common.Hash{}, vmdb.GetState(suite.keyring.GetAddr(0), key)) }}, {"jump revert", func(vmdb vm.StateDB) { revision1 := vmdb.Snapshot() - vmdb.SetState(suite.address, key, value1) + vmdb.SetState(suite.keyring.GetAddr(0), key, value1) vmdb.Snapshot() - vmdb.SetState(suite.address, key, value2) + vmdb.SetState(suite.keyring.GetAddr(0), key, value2) vmdb.RevertToSnapshot(revision1) - suite.Require().Equal(common.Hash{}, vmdb.GetState(suite.address, key)) + suite.Require().Equal(common.Hash{}, vmdb.GetState(suite.keyring.GetAddr(0), key)) }}, } @@ -682,13 +688,16 @@ func (suite *KeeperTestSuite) CreateTestTx(msg *types.MsgEthereumTx, priv crypto option, err := codectypes.NewAnyWithValue(&types.ExtensionOptionsEthereumTx{}) suite.Require().NoError(err) - txBuilder := suite.clientCtx.TxConfig.NewTxBuilder() + clientCtx := client.Context{}.WithTxConfig(suite.network.App.GetTxConfig()) + ethSigner := ethtypes.LatestSignerForChainID(suite.network.App.EVMKeeper.ChainID()) + + txBuilder := clientCtx.TxConfig.NewTxBuilder() builder, ok := txBuilder.(authtx.ExtensionOptionsTxBuilder) suite.Require().True(ok) builder.SetExtensionOptions(option) - err = msg.Sign(suite.ethSigner, utiltx.NewSigner(priv)) + err = msg.Sign(ethSigner, utiltx.NewSigner(priv)) suite.Require().NoError(err) err = txBuilder.SetMsgs(msg) @@ -699,10 +708,11 @@ func (suite *KeeperTestSuite) CreateTestTx(msg *types.MsgEthereumTx, priv crypto func (suite *KeeperTestSuite) TestAddLog() { addr, privKey := utiltx.NewAddrKey() + toAddr := suite.keyring.GetAddr(0) ethTxParams := &types.EvmTxArgs{ ChainID: big.NewInt(1), Nonce: 0, - To: &suite.address, + To: &toAddr, Amount: big.NewInt(1), GasLimit: 100000, GasPrice: big.NewInt(1), @@ -718,7 +728,7 @@ func (suite *KeeperTestSuite) TestAddLog() { ethTx2Params := &types.EvmTxArgs{ ChainID: big.NewInt(1), Nonce: 2, - To: &suite.address, + To: &toAddr, Amount: big.NewInt(1), GasLimit: 100000, GasPrice: big.NewInt(1), @@ -728,9 +738,9 @@ func (suite *KeeperTestSuite) TestAddLog() { msg2.From = addr.Hex() ethTx3Params := &types.EvmTxArgs{ - ChainID: big.NewInt(9000), + ChainID: big.NewInt(testconstants.ExampleEIP155ChainID), Nonce: 0, - To: &suite.address, + To: &toAddr, Amount: big.NewInt(1), GasLimit: 100000, GasFeeCap: big.NewInt(1), @@ -747,7 +757,7 @@ func (suite *KeeperTestSuite) TestAddLog() { ethTx4Params := &types.EvmTxArgs{ ChainID: big.NewInt(1), Nonce: 1, - To: &suite.address, + To: &toAddr, Amount: big.NewInt(1), GasLimit: 100000, GasFeeCap: big.NewInt(1), @@ -796,8 +806,8 @@ func (suite *KeeperTestSuite) TestAddLog() { for _, tc := range testCases { suite.Run(tc.name, func() { suite.SetupTest() - vmdb := statedb.New(suite.ctx, suite.app.EVMKeeper, statedb.NewTxConfig( - common.BytesToHash(suite.ctx.HeaderHash().Bytes()), + vmdb := statedb.New(suite.network.GetContext(), suite.network.App.EVMKeeper, statedb.NewTxConfig( + common.BytesToHash(suite.network.GetContext().HeaderHash()), tc.hash, 0, 0, )) @@ -820,9 +830,9 @@ func (suite *KeeperTestSuite) TestPrepareAccessList() { } vmdb := suite.StateDB() - vmdb.PrepareAccessList(suite.address, &dest, precompiles, accesses) + vmdb.PrepareAccessList(suite.keyring.GetAddr(0), &dest, precompiles, accesses) - suite.Require().True(vmdb.AddressInAccessList(suite.address)) + suite.Require().True(vmdb.AddressInAccessList(suite.keyring.GetAddr(0))) suite.Require().True(vmdb.AddressInAccessList(dest)) for _, precompile := range precompiles { @@ -843,8 +853,8 @@ func (suite *KeeperTestSuite) TestAddAddressToAccessList() { name string addr common.Address }{ - {"new address", suite.address}, - {"existing address", suite.address}, + {"new address", utiltx.GenerateAddress()}, + {"existing address", suite.keyring.GetAddr(0)}, } for _, tc := range testCases { @@ -857,16 +867,16 @@ func (suite *KeeperTestSuite) TestAddAddressToAccessList() { } } -func (suite *KeeperTestSuite) AddSlotToAccessList() { +func (suite *KeeperTestSuite) TestAddSlotToAccessList() { testCases := []struct { name string addr common.Address slot common.Hash }{ {"new address and slot (1)", utiltx.GenerateAddress(), common.BytesToHash([]byte("hash"))}, - {"new address and slot (2)", suite.address, common.Hash{}}, - {"existing address and slot", suite.address, common.Hash{}}, - {"existing address, new slot", suite.address, common.BytesToHash([]byte("hash"))}, + {"new address and slot (2)", utiltx.GenerateAddress(), common.Hash{}}, + {"existing address and slot", suite.keyring.GetAddr(0), common.Hash{}}, + {"existing address, new slot", suite.keyring.GetAddr(0), common.BytesToHash([]byte("hash"))}, } for _, tc := range testCases { @@ -894,7 +904,7 @@ func (suite *KeeperTestSuite) AddSlotToAccessList() { // "aggregate state", // func(vmdb vm.StateDB) { // for i := 0; i < 5; i++ { -// vmdb.SetState(suite.address, common.BytesToHash([]byte(fmt.Sprintf("key%d", i))), common.BytesToHash([]byte(fmt.Sprintf("value%d", i)))) +// vmdb.SetState(suite.keyring.GetAddr(0), common.BytesToHash([]byte(fmt.Sprintf("key%d", i))), common.BytesToHash([]byte(fmt.Sprintf("value%d", i)))) // } // }, // func(key, value common.Hash) bool { @@ -912,8 +922,8 @@ func (suite *KeeperTestSuite) AddSlotToAccessList() { // { // "filter state", // func(vmdb vm.StateDB) { -// vmdb.SetState(suite.address, common.BytesToHash([]byte("key")), common.BytesToHash([]byte("value"))) -// vmdb.SetState(suite.address, common.BytesToHash([]byte("filterkey")), common.BytesToHash([]byte("filtervalue"))) +// vmdb.SetState(suite.keyring.GetAddr(0), common.BytesToHash([]byte("key")), common.BytesToHash([]byte("value"))) +// vmdb.SetState(suite.keyring.GetAddr(0), common.BytesToHash([]byte("filterkey")), common.BytesToHash([]byte("filtervalue"))) // }, // func(key, value common.Hash) bool { // if value == common.BytesToHash([]byte("filtervalue")) { @@ -934,7 +944,7 @@ func (suite *KeeperTestSuite) AddSlotToAccessList() { // vmdb := suite.StateDB() // tc.malleate(vmdb) // -// err := vmdb.ForEachStorage(suite.address, tc.callback) +// err := vmdb.ForEachStorage(suite.keyring.GetAddr(0), tc.callback) // suite.Require().NoError(err) // suite.Require().Equal(len(tc.expValues), len(storage), fmt.Sprintf("Expected values:\n%v\nStorage Values\n%v", tc.expValues, storage)) // @@ -952,6 +962,7 @@ func (suite *KeeperTestSuite) AddSlotToAccessList() { func (suite *KeeperTestSuite) TestSetBalance() { amount := big.NewInt(-10) + addr := utiltx.GenerateAddress() testCases := []struct { name string @@ -961,13 +972,13 @@ func (suite *KeeperTestSuite) TestSetBalance() { }{ { "address without funds - invalid amount", - suite.address, + addr, func() {}, true, }, { "mint to address", - suite.address, + addr, func() { amount = big.NewInt(100) }, @@ -975,7 +986,7 @@ func (suite *KeeperTestSuite) TestSetBalance() { }, { "burn from address", - suite.address, + addr, func() { amount = big.NewInt(60) }, @@ -983,7 +994,7 @@ func (suite *KeeperTestSuite) TestSetBalance() { }, { "address with funds - invalid amount", - suite.address, + addr, func() { amount = big.NewInt(-10) }, @@ -995,11 +1006,11 @@ func (suite *KeeperTestSuite) TestSetBalance() { suite.Run(tc.name, func() { suite.SetupTest() tc.malleate() - err := suite.app.EVMKeeper.SetBalance(suite.ctx, tc.addr, amount) + err := suite.network.App.EVMKeeper.SetBalance(suite.network.GetContext(), tc.addr, amount) if tc.expErr { suite.Require().Error(err) } else { - balance := suite.app.EVMKeeper.GetBalance(suite.ctx, tc.addr) + balance := suite.network.App.EVMKeeper.GetBalance(suite.network.GetContext(), tc.addr) suite.Require().NoError(err) suite.Require().Equal(amount, balance) } @@ -1008,51 +1019,56 @@ func (suite *KeeperTestSuite) TestSetBalance() { } func (suite *KeeperTestSuite) TestDeleteAccount() { - suite.SetupTest() - + var ( + ctx sdk.Context + contractAddr common.Address + ) supply := big.NewInt(100) - contractAddr := suite.DeployTestContract(suite.T(), suite.address, supply) testCases := []struct { name string - addr common.Address + malleate func() common.Address expPass bool errContains string }{ { name: "remove address", - addr: suite.address, + malleate: func() common.Address { return suite.keyring.GetAddr(0) }, errContains: "only smart contracts can be self-destructed", }, { - name: "remove unexistent address - returns nil error", - addr: common.HexToAddress("unexistent_address"), - expPass: true, + name: "remove unexistent address - returns nil error", + malleate: func() common.Address { return common.HexToAddress("unexistent_address") }, + expPass: true, }, { - name: "remove deployed contract", - addr: contractAddr, - expPass: true, + name: "remove deployed contract", + malleate: func() common.Address { return contractAddr }, + expPass: true, }, } for _, tc := range testCases { suite.Run(tc.name, func() { suite.SetupTest() + ctx = suite.network.GetContext() + contractAddr = suite.DeployTestContract(suite.T(), ctx, suite.keyring.GetAddr(0), supply) + + addr := tc.malleate() - err := suite.app.EVMKeeper.DeleteAccount(suite.ctx, tc.addr) + err := suite.network.App.EVMKeeper.DeleteAccount(ctx, addr) if tc.expPass { suite.Require().NoError(err, "expected deleting account to succeed") - acc := suite.app.EVMKeeper.GetAccount(suite.ctx, tc.addr) + acc := suite.network.App.EVMKeeper.GetAccount(ctx, addr) suite.Require().Nil(acc, "expected no account to be found after deleting") - balance := suite.app.EVMKeeper.GetBalance(suite.ctx, tc.addr) + balance := suite.network.App.EVMKeeper.GetBalance(ctx, addr) suite.Require().Equal(new(big.Int), balance, "expected balance to be zero after deleting account") } else { suite.Require().ErrorContains(err, tc.errContains, "expected error to contain message") - acc := suite.app.EVMKeeper.GetAccount(suite.ctx, tc.addr) + acc := suite.network.App.EVMKeeper.GetAccount(ctx, addr) suite.Require().NotNil(acc, "expected account to still be found after failing to delete") } }) diff --git a/x/evm/keeper/utils.go b/x/evm/keeper/utils.go index 58b22bad..c8391035 100644 --- a/x/evm/keeper/utils.go +++ b/x/evm/keeper/utils.go @@ -4,7 +4,7 @@ package keeper import ( - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/x/evm/types" diff --git a/x/evm/keeper/utils_test.go b/x/evm/keeper/utils_test.go index 8353980a..a36b19bd 100644 --- a/x/evm/keeper/utils_test.go +++ b/x/evm/keeper/utils_test.go @@ -3,16 +3,14 @@ package keeper_test import ( "encoding/json" "math/big" - "time" - "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" - chainutil "github.com/evmos/os/example_chain/testutil" "github.com/evmos/os/server/config" + utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/evm/keeper/testdata" "github.com/evmos/os/x/evm/statedb" evmtypes "github.com/evmos/os/x/evm/types" @@ -20,30 +18,18 @@ import ( ) func (suite *KeeperTestSuite) EvmDenom() string { - ctx := sdk.WrapSDKContext(suite.ctx) - rsp, _ := suite.queryClient.Params(ctx, &evmtypes.QueryParamsRequest{}) + ctx := suite.network.GetContext() + rsp, _ := suite.network.GetEvmClient().Params(ctx, &evmtypes.QueryParamsRequest{}) return rsp.Params.EvmDenom } -// Commit and begin new block -func (suite *KeeperTestSuite) Commit() { - var err error - suite.ctx, err = chainutil.CommitAndCreateNewCtx(suite.ctx, suite.app, 0*time.Second, nil) - suite.Require().NoError(err) - - queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) - evmtypes.RegisterQueryServer(queryHelper, suite.app.EVMKeeper) - suite.queryClient = evmtypes.NewQueryClient(queryHelper) -} - func (suite *KeeperTestSuite) StateDB() *statedb.StateDB { - return statedb.New(suite.ctx, suite.app.EVMKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(suite.ctx.HeaderHash().Bytes()))) + return statedb.New(suite.network.GetContext(), suite.network.App.EVMKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(suite.network.GetContext().HeaderHash()))) } // DeployTestContract deploy a test erc20 contract and returns the contract address -func (suite *KeeperTestSuite) DeployTestContract(t require.TestingT, owner common.Address, supply *big.Int) common.Address { - ctx := sdk.WrapSDKContext(suite.ctx) - chainID := suite.app.EVMKeeper.ChainID() +func (suite *KeeperTestSuite) DeployTestContract(t require.TestingT, ctx sdk.Context, owner common.Address, supply *big.Int) common.Address { + chainID := suite.network.App.EVMKeeper.ChainID() erc20Contract, err := testdata.LoadERC20Contract() require.NoError(t, err, "failed to load contract") @@ -51,19 +37,20 @@ func (suite *KeeperTestSuite) DeployTestContract(t require.TestingT, owner commo ctorArgs, err := erc20Contract.ABI.Pack("", owner, supply) require.NoError(t, err) - nonce := suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address) + addr := suite.keyring.GetAddr(0) + nonce := suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), addr) data := erc20Contract.Bin data = append(data, ctorArgs...) args, err := json.Marshal(&evmtypes.TransactionArgs{ - From: &suite.address, + From: &addr, Data: (*hexutil.Bytes)(&data), }) require.NoError(t, err) - res, err := suite.queryClient.EstimateGas(ctx, &evmtypes.EthCallRequest{ + res, err := suite.network.GetEvmClient().EstimateGas(ctx, &evmtypes.EthCallRequest{ Args: args, GasCap: config.DefaultGasCap, - ProposerAddress: suite.ctx.BlockHeader().ProposerAddress, + ProposerAddress: suite.network.GetContext().BlockHeader().ProposerAddress, }) require.NoError(t, err) @@ -73,7 +60,7 @@ func (suite *KeeperTestSuite) DeployTestContract(t require.TestingT, owner commo ChainID: chainID, Nonce: nonce, GasLimit: res.Gas, - GasFeeCap: suite.app.FeeMarketKeeper.GetBaseFee(suite.ctx), + GasFeeCap: suite.network.App.FeeMarketKeeper.GetBaseFee(suite.network.GetContext()), GasTipCap: big.NewInt(1), Input: data, Accesses: ðtypes.AccessList{}, @@ -89,18 +76,19 @@ func (suite *KeeperTestSuite) DeployTestContract(t require.TestingT, owner commo erc20DeployTx = evmtypes.NewTx(ethTxParams) } - erc20DeployTx.From = suite.address.Hex() - err = erc20DeployTx.Sign(ethtypes.LatestSignerForChainID(chainID), suite.signer) + krSigner := utiltx.NewSigner(suite.keyring.GetPrivKey(0)) + erc20DeployTx.From = addr.Hex() + err = erc20DeployTx.Sign(ethtypes.LatestSignerForChainID(chainID), krSigner) require.NoError(t, err) - rsp, err := suite.app.EVMKeeper.EthereumTx(ctx, erc20DeployTx) + rsp, err := suite.network.App.EVMKeeper.EthereumTx(ctx, erc20DeployTx) require.NoError(t, err) require.Empty(t, rsp.VmError) - return crypto.CreateAddress(suite.address, nonce) + return crypto.CreateAddress(addr, nonce) } func (suite *KeeperTestSuite) TransferERC20Token(t require.TestingT, contractAddr, from, to common.Address, amount *big.Int) *evmtypes.MsgEthereumTx { - ctx := sdk.WrapSDKContext(suite.ctx) - chainID := suite.app.EVMKeeper.ChainID() + ctx := suite.network.GetContext() + chainID := suite.network.App.EVMKeeper.ChainID() erc20Contract, err := testdata.LoadERC20Contract() require.NoError(t, err, "failed to load contract") @@ -109,14 +97,14 @@ func (suite *KeeperTestSuite) TransferERC20Token(t require.TestingT, contractAdd require.NoError(t, err) args, err := json.Marshal(&evmtypes.TransactionArgs{To: &contractAddr, From: &from, Data: (*hexutil.Bytes)(&transferData)}) require.NoError(t, err) - res, err := suite.queryClient.EstimateGas(ctx, &evmtypes.EthCallRequest{ + res, err := suite.network.GetEvmClient().EstimateGas(ctx, &evmtypes.EthCallRequest{ Args: args, GasCap: 25_000_000, - ProposerAddress: suite.ctx.BlockHeader().ProposerAddress, + ProposerAddress: suite.network.GetContext().BlockHeader().ProposerAddress, }) require.NoError(t, err) - nonce := suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address) + nonce := suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), suite.keyring.GetAddr(0)) var ercTransferTx *evmtypes.MsgEthereumTx if suite.enableFeemarket { @@ -125,7 +113,7 @@ func (suite *KeeperTestSuite) TransferERC20Token(t require.TestingT, contractAdd Nonce: nonce, To: &contractAddr, GasLimit: res.Gas, - GasFeeCap: suite.app.FeeMarketKeeper.GetBaseFee(suite.ctx), + GasFeeCap: suite.network.App.FeeMarketKeeper.GetBaseFee(suite.network.GetContext()), GasTipCap: big.NewInt(1), Input: transferData, Accesses: ðtypes.AccessList{}, @@ -142,10 +130,12 @@ func (suite *KeeperTestSuite) TransferERC20Token(t require.TestingT, contractAdd ercTransferTx = evmtypes.NewTx(ethTxParams) } - ercTransferTx.From = suite.address.Hex() - err = ercTransferTx.Sign(ethtypes.LatestSignerForChainID(chainID), suite.signer) + addr := suite.keyring.GetAddr(0) + krSigner := utiltx.NewSigner(suite.keyring.GetPrivKey(0)) + ercTransferTx.From = addr.Hex() + err = ercTransferTx.Sign(ethtypes.LatestSignerForChainID(chainID), krSigner) require.NoError(t, err) - rsp, err := suite.app.EVMKeeper.EthereumTx(ctx, ercTransferTx) + rsp, err := suite.network.App.EVMKeeper.EthereumTx(ctx, ercTransferTx) require.NoError(t, err) require.Empty(t, rsp.VmError) return ercTransferTx @@ -153,27 +143,28 @@ func (suite *KeeperTestSuite) TransferERC20Token(t require.TestingT, contractAdd // DeployTestMessageCall deploy a test erc20 contract and returns the contract address func (suite *KeeperTestSuite) DeployTestMessageCall(t require.TestingT) common.Address { - ctx := sdk.WrapSDKContext(suite.ctx) - chainID := suite.app.EVMKeeper.ChainID() + ctx := suite.network.GetContext() + chainID := suite.network.App.EVMKeeper.ChainID() - testMessageCallContract, err := testdata.LoadMessageCallContract() - require.NoError(t, err, "failed to load contract") + testMsgCall, err := testdata.LoadMessageCallContract() + require.NoError(t, err) - data := testMessageCallContract.Bin + data := testMsgCall.Bin + addr := suite.keyring.GetAddr(0) args, err := json.Marshal(&evmtypes.TransactionArgs{ - From: &suite.address, + From: &addr, Data: (*hexutil.Bytes)(&data), }) require.NoError(t, err) - res, err := suite.queryClient.EstimateGas(ctx, &evmtypes.EthCallRequest{ + res, err := suite.network.GetEvmClient().EstimateGas(ctx, &evmtypes.EthCallRequest{ Args: args, GasCap: config.DefaultGasCap, - ProposerAddress: suite.ctx.BlockHeader().ProposerAddress, + ProposerAddress: suite.network.GetContext().BlockHeader().ProposerAddress, }) require.NoError(t, err) - nonce := suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address) + nonce := suite.network.App.EVMKeeper.GetNonce(suite.network.GetContext(), addr) var erc20DeployTx *evmtypes.MsgEthereumTx if suite.enableFeemarket { @@ -182,7 +173,7 @@ func (suite *KeeperTestSuite) DeployTestMessageCall(t require.TestingT) common.A Nonce: nonce, GasLimit: res.Gas, Input: data, - GasFeeCap: suite.app.FeeMarketKeeper.GetBaseFee(suite.ctx), + GasFeeCap: suite.network.App.FeeMarketKeeper.GetBaseFee(suite.network.GetContext()), Accesses: ðtypes.AccessList{}, GasTipCap: big.NewInt(1), } @@ -197,11 +188,12 @@ func (suite *KeeperTestSuite) DeployTestMessageCall(t require.TestingT) common.A erc20DeployTx = evmtypes.NewTx(ethTxParams) } - erc20DeployTx.From = suite.address.Hex() - err = erc20DeployTx.Sign(ethtypes.LatestSignerForChainID(chainID), suite.signer) + krSigner := utiltx.NewSigner(suite.keyring.GetPrivKey(0)) + erc20DeployTx.From = addr.Hex() + err = erc20DeployTx.Sign(ethtypes.LatestSignerForChainID(chainID), krSigner) require.NoError(t, err) - rsp, err := suite.app.EVMKeeper.EthereumTx(ctx, erc20DeployTx) + rsp, err := suite.network.App.EVMKeeper.EthereumTx(ctx, erc20DeployTx) require.NoError(t, err) require.Empty(t, rsp.VmError) - return crypto.CreateAddress(suite.address, nonce) + return crypto.CreateAddress(addr, nonce) } diff --git a/x/evm/module.go b/x/evm/module.go index 3db455b4..120c7175 100644 --- a/x/evm/module.go +++ b/x/evm/module.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package evm import ( @@ -7,6 +8,7 @@ import ( "encoding/json" "fmt" + "cosmossdk.io/core/appmodule" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -26,10 +28,12 @@ import ( const consensusVersion = 7 var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.EndBlockAppModule = AppModule{} - _ module.BeginBlockAppModule = AppModule{} + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.HasABCIGenesis = AppModule{} + + _ appmodule.HasBeginBlocker = AppModule{} + _ appmodule.HasEndBlocker = AppModule{} ) // AppModuleBasic defines the basic application module used by the evm module. @@ -77,21 +81,21 @@ func (b AppModuleBasic) RegisterGRPCGatewayRoutes(c client.Context, serveMux *ru } } -// GetTxCmd returns the root tx command for the evm module. +// RegisterInterfaces registers interfaces and implementations of the evm module. +func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} + +// GetTxCmd returns the root tx command for the erc20 module. func (AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() + return cli.NewTxCmd() } -// GetQueryCmd returns no root query command for the evm module. +// GetQueryCmd returns the root query command for the erc20 module. func (AppModuleBasic) GetQueryCmd() *cobra.Command { return cli.GetQueryCmd() } -// RegisterInterfaces registers interfaces and implementations of the evm module. -func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { - types.RegisterInterfaces(registry) -} - // ____________________________________________________________________________ // AppModule implements an application module for the evm module. @@ -131,14 +135,16 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { } // BeginBlock returns the begin block for the evm module. -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - am.keeper.BeginBlock(ctx, req) +func (am AppModule) BeginBlock(ctx context.Context) error { + c := sdk.UnwrapSDKContext(ctx) + return am.keeper.BeginBlock(c) } // EndBlock returns the end blocker for the evm module. It returns no validator // updates. -func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate { - return am.keeper.EndBlock(ctx, req) +func (am AppModule) EndBlock(ctx context.Context) error { + c := sdk.UnwrapSDKContext(ctx) + return am.keeper.EndBlock(c) } // InitGenesis performs genesis initialization for the evm module. It returns @@ -158,7 +164,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // RegisterStoreDecoder registers a decoder for evm module's types -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) { } // GenerateGenesisState creates a randomized GenState of the evm module. @@ -169,3 +175,9 @@ func (AppModule) GenerateGenesisState(_ *module.SimulationState) { func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/evm/statedb/config.go b/x/evm/statedb/config.go index c6bf7b88..1ed2bf45 100644 --- a/x/evm/statedb/config.go +++ b/x/evm/statedb/config.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package statedb import ( diff --git a/x/evm/statedb/integration_test.go b/x/evm/statedb/integration_test.go index edbaaba0..be48e278 100644 --- a/x/evm/statedb/integration_test.go +++ b/x/evm/statedb/integration_test.go @@ -105,6 +105,8 @@ var _ = Describe("testing the flash loan exploit", Ordered, func() { ) Expect(err).ToNot(HaveOccurred(), "failed to deploy ERC-20 contract") + Expect(network.NextBlock()).ToNot(HaveOccurred(), "failed to commit block") + // Mint some tokens to the deployer. _, err = factory.ExecuteContractCall( deployer.Priv, @@ -119,6 +121,8 @@ var _ = Describe("testing the flash loan exploit", Ordered, func() { ) Expect(err).ToNot(HaveOccurred(), "failed to mint tokens") + Expect(network.NextBlock()).ToNot(HaveOccurred(), "failed to commit block") + // Check the balance of the deployer on the ERC20 contract. res, err := factory.ExecuteContractCall( deployer.Priv, @@ -133,6 +137,8 @@ var _ = Describe("testing the flash loan exploit", Ordered, func() { ) Expect(err).ToNot(HaveOccurred(), "failed to get balance") + Expect(network.NextBlock()).ToNot(HaveOccurred(), "failed to commit block") + ethRes, err := evmtypes.DecodeTxResponse(res.Data) Expect(err).ToNot(HaveOccurred(), "failed to decode balance of tx response") @@ -156,6 +162,8 @@ var _ = Describe("testing the flash loan exploit", Ordered, func() { ) Expect(err).ToNot(HaveOccurred(), "failed to deploy flash loan contract") + Expect(network.NextBlock()).ToNot(HaveOccurred(), "failed to commit block") + // Approve the flash loan contract to spend tokens. This is required because // the contract will get funds from the caller to perform actions. _, err = factory.ExecuteContractCall( @@ -171,6 +179,8 @@ var _ = Describe("testing the flash loan exploit", Ordered, func() { ) Expect(err).ToNot(HaveOccurred(), "failed to approve flash loan contract") + Expect(network.NextBlock()).ToNot(HaveOccurred(), "failed to commit block") + // Check the allowance. res, err = factory.ExecuteContractCall( deployer.Priv, @@ -185,6 +195,8 @@ var _ = Describe("testing the flash loan exploit", Ordered, func() { ) Expect(err).ToNot(HaveOccurred(), "failed to get allowance") + Expect(network.NextBlock()).ToNot(HaveOccurred(), "failed to commit block") + ethRes, err = evmtypes.DecodeTxResponse(res.Data) Expect(err).ToNot(HaveOccurred(), "failed to decode allowance tx response") @@ -215,6 +227,8 @@ var _ = Describe("testing the flash loan exploit", Ordered, func() { ) Expect(err).ToNot(HaveOccurred(), "failed to approve flash loan contract") + Expect(network.NextBlock()).ToNot(HaveOccurred(), "failed to commit block") + // Check the allowance. res, err = factory.ExecuteContractCall( deployer.Priv, @@ -229,6 +243,8 @@ var _ = Describe("testing the flash loan exploit", Ordered, func() { ) Expect(err).ToNot(HaveOccurred(), "failed to get allowance") + Expect(network.NextBlock()).ToNot(HaveOccurred(), "failed to commit block") + ethRes, err = evmtypes.DecodeTxResponse(res.Data) Expect(err).ToNot(HaveOccurred(), "failed to decode allowance tx response") @@ -256,6 +272,8 @@ var _ = Describe("testing the flash loan exploit", Ordered, func() { ) Expect(err).ToNot(HaveOccurred(), "failed to execute flash loan") + Expect(network.NextBlock()).ToNot(HaveOccurred(), "failed to commit block") + delRes, err := handler.GetDelegation(deployer.AccAddr.String(), validatorToDelegateTo) Expect(err).ToNot(HaveOccurred(), "failed to get delegation") delAmtPost := delRes.DelegationResponse.Balance.Amount @@ -282,6 +300,8 @@ var _ = Describe("testing the flash loan exploit", Ordered, func() { ) Expect(err).ToNot(HaveOccurred(), "failed to get balance") + Expect(network.NextBlock()).ToNot(HaveOccurred(), "failed to commit block") + ethRes, err := evmtypes.DecodeTxResponse(res.Data) Expect(err).ToNot(HaveOccurred(), "failed to decode balance of tx response") @@ -309,6 +329,8 @@ var _ = Describe("testing the flash loan exploit", Ordered, func() { ) Expect(err).ToNot(HaveOccurred(), "failed to get balance") + Expect(network.NextBlock()).ToNot(HaveOccurred(), "failed to commit block") + ethRes, err = evmtypes.DecodeTxResponse(res.Data) Expect(err).ToNot(HaveOccurred(), "failed to decode balance of tx response") diff --git a/x/evm/statedb/journal.go b/x/evm/statedb/journal.go index 615b4627..d1919cb2 100644 --- a/x/evm/statedb/journal.go +++ b/x/evm/statedb/journal.go @@ -21,9 +21,9 @@ import ( "math/big" "sort" - "github.com/ethereum/go-ethereum/common" - + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" ) // JournalEntry is a modification entry in the state change journal that can be @@ -71,7 +71,7 @@ func (j *journal) append(entry JournalEntry) { } } -// Revert undoes a batch of journalled modifications along with any Reverted +// Revert undoes a batch of journaled modifications along with any Reverted // dirty handling too. func (j *journal) Revert(statedb *StateDB, snapshot int) { for i := len(j.entries) - 1; i >= snapshot; i-- { @@ -140,7 +140,7 @@ type ( slot *common.Hash } precompileCallChange struct { - multiStore sdk.CacheMultiStore + multiStore storetypes.CacheMultiStore events sdk.Events } ) diff --git a/x/evm/statedb/state_object.go b/x/evm/statedb/state_object.go index 73fb98c0..19d9646a 100644 --- a/x/evm/statedb/state_object.go +++ b/x/evm/statedb/state_object.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package statedb import ( @@ -7,6 +8,7 @@ import ( "math/big" "sort" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/x/evm/types" @@ -126,7 +128,7 @@ func (s *stateObject) SetBalance(amount *big.Int) { // AddPrecompileFn appends to the journal an entry // with a snapshot of the multi-store and events // previous to the precompile call -func (s *stateObject) AddPrecompileFn(cms sdk.CacheMultiStore, events sdk.Events) { +func (s *stateObject) AddPrecompileFn(cms storetypes.CacheMultiStore, events sdk.Events) { s.db.journal.append(precompileCallChange{ multiStore: cms, events: events, diff --git a/x/evm/statedb/statedb.go b/x/evm/statedb/statedb.go index b96b3e90..5916e9f9 100644 --- a/x/evm/statedb/statedb.go +++ b/x/evm/statedb/statedb.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package statedb import ( @@ -9,6 +10,7 @@ import ( "sort" errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -99,7 +101,7 @@ func (s *StateDB) GetCacheContext() (sdk.Context, error) { } // MultiStoreSnapshot returns a copy of the stateDB CacheMultiStore. -func (s *StateDB) MultiStoreSnapshot() sdk.CacheMultiStore { +func (s *StateDB) MultiStoreSnapshot() storetypes.CacheMultiStore { if s.writeCache == nil { err := s.cache() if err != nil { @@ -108,7 +110,7 @@ func (s *StateDB) MultiStoreSnapshot() sdk.CacheMultiStore { } // the cacheCtx multi store is already a CacheMultiStore // so we need to pass a copy of the current state of it - cms := s.cacheCtx.MultiStore().(sdk.CacheMultiStore) + cms := s.cacheCtx.MultiStore().(storetypes.CacheMultiStore) snapshot := cms.Copy() return snapshot @@ -343,7 +345,7 @@ func (s *StateDB) setStateObject(object *stateObject) { // AddPrecompileFn adds a precompileCall journal entry // with a snapshot of the multi-store and events previous // to the precompile call. -func (s *StateDB) AddPrecompileFn(addr common.Address, cms sdk.CacheMultiStore, events sdk.Events) error { +func (s *StateDB) AddPrecompileFn(addr common.Address, cms storetypes.CacheMultiStore, events sdk.Events) error { stateObject := s.getOrNewStateObject(addr) if stateObject == nil { return fmt.Errorf("could not add precompile call to address %s. State object not found", addr) diff --git a/x/evm/types/access_list_tx.go b/x/evm/types/access_list_tx.go index 31b94f12..a07f6ed3 100644 --- a/x/evm/types/access_list_tx.go +++ b/x/evm/types/access_list_tx.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package types import ( @@ -8,11 +9,10 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" errortypes "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/evmos/os/types" + ethutils "github.com/evmos/os/utils/eth" ) func newAccessListTx(tx *ethtypes.Transaction) (*AccessListTx, error) { @@ -162,7 +162,7 @@ func (tx *AccessListTx) AsEthereumData() ethtypes.TxData { // GetRawSignatureValues returns the V, R, S signature values of the transaction. // The return values should not be modified by the caller. func (tx *AccessListTx) GetRawSignatureValues() (v, r, s *big.Int) { - return rawSignatureValues(tx.V, tx.R, tx.S) + return ethutils.RawSignatureValues(tx.V, tx.R, tx.S) } // SetSignatureValues sets the signature values to the transaction. diff --git a/x/evm/types/codec.go b/x/evm/types/codec.go index 394d24b5..1fd7ad62 100644 --- a/x/evm/types/codec.go +++ b/x/evm/types/codec.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package types import ( @@ -20,12 +21,12 @@ var ( ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) // AminoCdc is a amino codec created to support amino JSON compatible msgs. - AminoCdc = codec.NewAminoCodec(amino) + AminoCdc = codec.NewAminoCodec(amino) //nolint:staticcheck ) const ( // Amino names - updateParamsName = "ethermint/MsgUpdateParams" + updateParamsName = "os/MsgUpdateParams" ) // NOTE: This is required for the GetSignBytes function diff --git a/x/evm/types/dynamic_fee_tx.go b/x/evm/types/dynamic_fee_tx.go index 235a4761..d050722f 100644 --- a/x/evm/types/dynamic_fee_tx.go +++ b/x/evm/types/dynamic_fee_tx.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package types import ( @@ -11,6 +12,7 @@ import ( "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/evmos/os/types" + ethutils "github.com/evmos/os/utils/eth" ) func NewDynamicFeeTx(tx *ethtypes.Transaction) (*DynamicFeeTx, error) { @@ -173,7 +175,7 @@ func (tx *DynamicFeeTx) AsEthereumData() ethtypes.TxData { // GetRawSignatureValues returns the V, R, S signature values of the transaction. // The return values should not be modified by the caller. func (tx *DynamicFeeTx) GetRawSignatureValues() (v, r, s *big.Int) { - return rawSignatureValues(tx.V, tx.R, tx.S) + return ethutils.RawSignatureValues(tx.V, tx.R, tx.S) } // SetSignatureValues sets the signature values to the transaction. diff --git a/x/evm/types/dynamic_fee_tx_test.go b/x/evm/types/dynamic_fee_tx_test.go index f0113cbe..e7f90311 100644 --- a/x/evm/types/dynamic_fee_tx_test.go +++ b/x/evm/types/dynamic_fee_tx_test.go @@ -5,11 +5,14 @@ import ( "testing" sdkmath "cosmossdk.io/math" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" + utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/evm/types" + "github.com/stretchr/testify/suite" ) diff --git a/x/evm/types/evm.pb.go b/x/evm/types/evm.pb.go index 5f33121d..b0642725 100644 --- a/x/evm/types/evm.pb.go +++ b/x/evm/types/evm.pb.go @@ -6,6 +6,7 @@ package types import ( cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -860,125 +861,127 @@ func init() { func init() { proto.RegisterFile("os/evm/v1/evm.proto", fileDescriptor_e8c4b25eb041133a) } var fileDescriptor_e8c4b25eb041133a = []byte{ - // 1881 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x58, 0xcd, 0x6f, 0xdb, 0xc8, - 0x15, 0xb7, 0x6c, 0xda, 0xa6, 0x46, 0xb2, 0xc4, 0x8c, 0x65, 0x47, 0x51, 0x16, 0xa6, 0x41, 0xf4, - 0x10, 0x14, 0x5b, 0x3b, 0x71, 0xe2, 0xad, 0x9b, 0x16, 0x2d, 0x2c, 0x5b, 0xdb, 0xda, 0xeb, 0x64, - 0x8d, 0x91, 0x37, 0xc5, 0x16, 0x0b, 0x10, 0x23, 0x72, 0x56, 0xe2, 0x9a, 0xe4, 0x08, 0x9c, 0x91, - 0x22, 0xf5, 0xda, 0x1e, 0x16, 0x39, 0xf5, 0xda, 0x43, 0x80, 0x02, 0xfd, 0x47, 0x7a, 0x5c, 0xf4, - 0xb4, 0xa7, 0xa2, 0xe8, 0x81, 0x28, 0x94, 0x9e, 0x7c, 0xf4, 0xbd, 0xc0, 0x62, 0x3e, 0x24, 0x51, - 0xb2, 0xd7, 0xf0, 0x49, 0x7c, 0x5f, 0xbf, 0xdf, 0x7b, 0x6f, 0x1e, 0x39, 0x33, 0x02, 0xeb, 0x94, - 0xed, 0x92, 0x7e, 0xb4, 0xdb, 0x7f, 0x26, 0x7e, 0x76, 0xba, 0x09, 0xe5, 0x14, 0xe6, 0x29, 0xdb, - 0x11, 0x52, 0xff, 0x59, 0xad, 0xd2, 0xa6, 0x6d, 0x2a, 0xb5, 0xbb, 0xe2, 0x49, 0x39, 0x38, 0xff, - 0x5b, 0x02, 0x2b, 0xe7, 0x38, 0xc1, 0x11, 0x83, 0xcf, 0x40, 0x9e, 0xf4, 0x23, 0xd7, 0x27, 0x31, - 0x8d, 0xaa, 0xb9, 0xed, 0xdc, 0x93, 0x7c, 0xbd, 0x72, 0x9d, 0xda, 0xd6, 0x10, 0x47, 0xe1, 0x4b, - 0x67, 0x62, 0x72, 0x90, 0x49, 0xfa, 0xd1, 0xb1, 0x78, 0x84, 0x87, 0x00, 0x90, 0x01, 0x4f, 0xb0, - 0x4b, 0x82, 0x2e, 0xab, 0x1a, 0xdb, 0x4b, 0x4f, 0xf2, 0x75, 0x67, 0x94, 0xda, 0xf9, 0x86, 0xd0, - 0x36, 0x4e, 0xce, 0xd9, 0x75, 0x6a, 0x3f, 0xd0, 0x00, 0x13, 0x47, 0x07, 0xe5, 0xa5, 0xd0, 0x08, - 0xba, 0x0c, 0xbe, 0x01, 0x45, 0xaf, 0x83, 0x83, 0xd8, 0xf5, 0x68, 0xfc, 0x75, 0xd0, 0xae, 0x2e, - 0x6f, 0xe7, 0x9e, 0x14, 0xf6, 0x36, 0x77, 0x26, 0x89, 0xef, 0x1c, 0x09, 0xf3, 0x91, 0xb4, 0xd6, - 0x1f, 0x7f, 0x97, 0xda, 0x0b, 0xd7, 0xa9, 0xbd, 0xae, 0x30, 0xb3, 0x91, 0x0e, 0x2a, 0x78, 0x53, - 0x4f, 0xb8, 0x07, 0x36, 0x70, 0x18, 0xd2, 0xb7, 0x6e, 0x2f, 0x16, 0x95, 0x12, 0x8f, 0x13, 0xdf, - 0xe5, 0x03, 0x56, 0x5d, 0xd9, 0xce, 0x3d, 0x31, 0xd1, 0xba, 0x34, 0x7e, 0x31, 0xb5, 0x5d, 0x0c, - 0x18, 0xdc, 0x03, 0x45, 0x51, 0xa6, 0xd7, 0xc1, 0x71, 0x4c, 0x42, 0x56, 0x35, 0x65, 0x41, 0xe5, - 0x51, 0x6a, 0x17, 0x1a, 0x6f, 0x5e, 0x1d, 0x69, 0x35, 0x2a, 0x90, 0x7e, 0x34, 0x16, 0xe0, 0x1b, - 0x50, 0xc2, 0x9e, 0x47, 0x18, 0x13, 0x69, 0xf0, 0x84, 0x86, 0xd5, 0xbc, 0xac, 0xa0, 0x9a, 0xa9, - 0xe0, 0x50, 0x3a, 0x1c, 0x29, 0x7b, 0x7d, 0x43, 0xd4, 0x30, 0x4a, 0xed, 0xb5, 0x19, 0x35, 0x5a, - 0xc3, 0x59, 0x11, 0xbe, 0x04, 0x8f, 0xb0, 0xc7, 0x83, 0x3e, 0x71, 0x19, 0xc7, 0x3c, 0xf0, 0xdc, - 0x6e, 0x42, 0x3c, 0x1a, 0x75, 0x83, 0x90, 0xb0, 0x2a, 0x10, 0x89, 0xa1, 0x87, 0xca, 0xa1, 0x29, - 0xed, 0xe7, 0x53, 0xf3, 0xa9, 0x61, 0x2e, 0x5a, 0x4b, 0xa7, 0x86, 0xb9, 0x64, 0x19, 0xa7, 0x86, - 0xb9, 0x6a, 0x99, 0xce, 0x9f, 0x72, 0x60, 0x96, 0x0e, 0xbe, 0x04, 0x2b, 0x5e, 0x42, 0x30, 0x27, - 0x72, 0xa9, 0x0b, 0x7b, 0x1f, 0xfd, 0x58, 0xbe, 0x17, 0xc3, 0x2e, 0xa9, 0x1b, 0x22, 0x67, 0xa4, - 0x23, 0xe0, 0x27, 0xc0, 0xf0, 0x70, 0x18, 0x56, 0x17, 0xef, 0x1d, 0x29, 0xfd, 0x9d, 0x7f, 0xe5, - 0xc0, 0x83, 0x1b, 0x1e, 0xf0, 0x2b, 0x50, 0xd0, 0x1d, 0xe4, 0xc3, 0xae, 0x4a, 0xa7, 0xb4, 0xb7, - 0x71, 0x03, 0x54, 0xa2, 0xfd, 0x64, 0x94, 0xda, 0x60, 0x2a, 0x5f, 0xa7, 0x36, 0x54, 0x93, 0x90, - 0x41, 0x70, 0x10, 0xc0, 0x13, 0x0f, 0xe8, 0x81, 0xf5, 0xd9, 0xf5, 0x71, 0xc3, 0x80, 0xf1, 0xea, - 0xa2, 0x5c, 0xda, 0xe7, 0xa3, 0xd4, 0x9e, 0xcd, 0xe8, 0x2c, 0x60, 0xfc, 0x3a, 0xb5, 0x6b, 0x33, - 0xa8, 0xd9, 0x48, 0x07, 0x3d, 0xc0, 0xf3, 0x01, 0xce, 0xff, 0x4b, 0xa0, 0x90, 0x19, 0x53, 0xf8, - 0x15, 0x28, 0x77, 0x68, 0x44, 0x18, 0x27, 0xd8, 0x77, 0x5b, 0x21, 0xf5, 0x2e, 0xf5, 0x0b, 0xf5, - 0xfc, 0x3f, 0xa9, 0xbd, 0xe1, 0x51, 0x16, 0x51, 0xc6, 0xfc, 0xcb, 0x9d, 0x80, 0xee, 0x46, 0x98, - 0x77, 0x76, 0x4e, 0x62, 0x41, 0xba, 0xa9, 0x48, 0xe7, 0x22, 0x1d, 0x54, 0x9a, 0x68, 0xea, 0x42, - 0x01, 0x3b, 0xa0, 0xe4, 0x63, 0xea, 0x7e, 0x4d, 0x93, 0x4b, 0x0d, 0xbe, 0x28, 0xc1, 0xeb, 0x3f, - 0x0a, 0x3e, 0x4a, 0xed, 0xe2, 0xf1, 0xe1, 0xe7, 0x9f, 0xd2, 0xe4, 0x52, 0x42, 0x5c, 0xa7, 0xf6, - 0x86, 0x22, 0x9b, 0x05, 0x72, 0x50, 0xd1, 0xc7, 0x74, 0xe2, 0x06, 0x7f, 0x0f, 0xac, 0x89, 0x03, - 0xeb, 0x75, 0xbb, 0x34, 0xe1, 0xd5, 0x25, 0xf1, 0xfe, 0xd4, 0x7f, 0x36, 0x4a, 0xed, 0x92, 0x86, - 0x6c, 0x2a, 0xcb, 0x75, 0x6a, 0x3f, 0x9c, 0x03, 0xd5, 0x31, 0x0e, 0x2a, 0x69, 0x58, 0xed, 0x0a, - 0x5b, 0xa0, 0x48, 0x82, 0xee, 0xb3, 0xfd, 0xa7, 0xba, 0x00, 0x43, 0x16, 0xf0, 0x9b, 0xbb, 0x0a, - 0x28, 0x34, 0x4e, 0xce, 0x9f, 0xed, 0x3f, 0x1d, 0xe7, 0xaf, 0xbf, 0x00, 0x59, 0x14, 0x07, 0x15, - 0x94, 0xa8, 0x92, 0x3f, 0x01, 0x5a, 0x74, 0x3b, 0x98, 0x75, 0xe4, 0x87, 0x25, 0x5f, 0x7f, 0x22, - 0x06, 0x48, 0x21, 0xfd, 0x0e, 0xb3, 0xce, 0xb4, 0xeb, 0xad, 0xe1, 0x1f, 0x71, 0xcc, 0x83, 0x5e, - 0x34, 0xc6, 0x02, 0x2a, 0x58, 0x78, 0x4d, 0xd2, 0xdd, 0xd7, 0xe9, 0xae, 0xdc, 0x37, 0xdd, 0xfd, - 0xdb, 0xd2, 0xdd, 0x9f, 0x4d, 0x57, 0xf9, 0x4c, 0x38, 0x0e, 0x34, 0xc7, 0xea, 0x7d, 0x39, 0x0e, - 0x6e, 0xe3, 0x38, 0x98, 0xe5, 0x50, 0x3e, 0x62, 0x2e, 0xe7, 0xea, 0xac, 0x9a, 0xf7, 0x9e, 0xcb, - 0x1b, 0x1d, 0x2a, 0x4d, 0x34, 0x0a, 0xfd, 0x12, 0x54, 0x3c, 0x1a, 0x33, 0x2e, 0x74, 0x31, 0xed, - 0x86, 0x44, 0x53, 0xe4, 0x25, 0xc5, 0xc1, 0x5d, 0x14, 0x8f, 0xf5, 0xf7, 0xfc, 0x96, 0x70, 0x07, - 0xad, 0xcf, 0xaa, 0x15, 0x99, 0x0b, 0xac, 0x2e, 0xe1, 0x24, 0x61, 0xad, 0x5e, 0xd2, 0xd6, 0x44, - 0x40, 0x12, 0xbd, 0xb8, 0x8b, 0x48, 0x4f, 0xe8, 0x7c, 0xa8, 0x83, 0xca, 0x53, 0x95, 0x22, 0xf8, - 0x12, 0x94, 0x02, 0xc1, 0xda, 0xea, 0x85, 0x1a, 0xbe, 0x20, 0xe1, 0xf7, 0xee, 0x82, 0xd7, 0x6f, - 0xd5, 0x6c, 0xa0, 0x83, 0xd6, 0xc6, 0x0a, 0x05, 0xed, 0x03, 0x18, 0xf5, 0x82, 0xc4, 0x6d, 0x87, - 0xd8, 0x0b, 0x48, 0xa2, 0xe1, 0x8b, 0x12, 0xfe, 0x93, 0xbb, 0xe0, 0x1f, 0x29, 0xf8, 0x9b, 0xc1, - 0x0e, 0xb2, 0x84, 0xf2, 0xb7, 0x4a, 0xa7, 0x58, 0x9a, 0xa0, 0xd8, 0x22, 0x49, 0x18, 0xc4, 0x1a, - 0x7f, 0x4d, 0xe2, 0x3f, 0xbd, 0x0b, 0x5f, 0x4f, 0x50, 0x36, 0xcc, 0x41, 0x05, 0x25, 0x4e, 0x40, - 0x43, 0x1a, 0xfb, 0x74, 0x0c, 0xfa, 0xe0, 0xde, 0xa0, 0xd9, 0x30, 0x07, 0x15, 0x94, 0xa8, 0x40, - 0xdb, 0x60, 0x1d, 0x27, 0x09, 0x7d, 0x3b, 0xd7, 0x10, 0x28, 0xb1, 0x7f, 0x7e, 0x17, 0xf6, 0xf8, - 0x3b, 0x7d, 0x33, 0x5a, 0x7c, 0xa7, 0x85, 0x76, 0xa6, 0x25, 0x3e, 0x80, 0xed, 0x04, 0x0f, 0xe7, - 0x78, 0x2a, 0xf7, 0x6e, 0xfc, 0xcd, 0x60, 0x07, 0x59, 0x42, 0x39, 0xc3, 0xf2, 0x0d, 0xa8, 0x44, - 0x24, 0x69, 0x13, 0x37, 0x26, 0x9c, 0x75, 0xc3, 0x80, 0x6b, 0x9e, 0x8d, 0x7b, 0xbf, 0x07, 0xb7, - 0x85, 0x3b, 0x08, 0x4a, 0xf5, 0x6b, 0xad, 0x9d, 0x4c, 0x29, 0xeb, 0xe0, 0xb8, 0xdd, 0xc1, 0x81, - 0x66, 0xd9, 0xbc, 0xf7, 0x94, 0xce, 0x06, 0x3a, 0x68, 0x6d, 0xac, 0x98, 0x2c, 0xb5, 0x87, 0x63, - 0xaf, 0x37, 0x5e, 0xea, 0x87, 0xf7, 0x5e, 0xea, 0x6c, 0x98, 0x38, 0x96, 0x49, 0x51, 0x82, 0x9e, - 0x1a, 0x66, 0xc9, 0x2a, 0x9f, 0x1a, 0x66, 0xd9, 0xb2, 0x4e, 0x0d, 0xd3, 0xb2, 0x1e, 0x9c, 0x1a, - 0xe6, 0xba, 0x55, 0x41, 0x6b, 0x43, 0x1a, 0x52, 0xb7, 0xff, 0x5c, 0x05, 0xa1, 0x02, 0x79, 0x8b, - 0x99, 0xfe, 0xd0, 0xa0, 0x92, 0x87, 0x39, 0x0e, 0x87, 0x4c, 0x37, 0x02, 0x59, 0xaa, 0x3d, 0x99, - 0x6d, 0x6b, 0x17, 0x2c, 0x8b, 0x53, 0x10, 0x81, 0x16, 0x58, 0xba, 0x24, 0x43, 0xb5, 0xd9, 0x22, - 0xf1, 0x08, 0x2b, 0x60, 0xb9, 0x8f, 0xc3, 0x1e, 0x51, 0x7b, 0x24, 0x52, 0x82, 0x73, 0x02, 0xca, - 0x17, 0x09, 0x8e, 0x99, 0x38, 0x41, 0xd1, 0xf8, 0x8c, 0xb6, 0x19, 0x84, 0xc0, 0x90, 0xfb, 0x84, - 0x8a, 0x95, 0xcf, 0xd0, 0x01, 0x46, 0x48, 0xdb, 0x4c, 0x9e, 0x16, 0x0a, 0x7b, 0xa5, 0xcc, 0x99, - 0xe4, 0x8c, 0xb6, 0x91, 0xb4, 0x39, 0xff, 0x5c, 0x04, 0x4b, 0x67, 0xb4, 0x0d, 0xab, 0x60, 0x15, - 0xfb, 0x7e, 0x42, 0x18, 0xd3, 0x10, 0x63, 0x11, 0x6e, 0x82, 0x15, 0x4e, 0xbb, 0x81, 0xa7, 0x70, - 0xf2, 0x48, 0x4b, 0x82, 0xd1, 0xc7, 0x1c, 0xcb, 0x1d, 0xb5, 0x88, 0xe4, 0xb3, 0x38, 0x82, 0xca, - 0x92, 0xdc, 0xb8, 0x17, 0xb5, 0x48, 0x22, 0x37, 0x46, 0xa3, 0x5e, 0xbe, 0x4a, 0xed, 0x82, 0xd4, - 0xbf, 0x96, 0x6a, 0x94, 0x15, 0xe0, 0xc7, 0x60, 0x95, 0x0f, 0xb2, 0x9b, 0xdc, 0xfa, 0x55, 0x6a, - 0x97, 0xf9, 0xb4, 0x3e, 0xb1, 0x87, 0xa1, 0x15, 0x3e, 0x90, 0x7b, 0xd9, 0x2e, 0x30, 0xf9, 0xc0, - 0x0d, 0x62, 0x9f, 0x0c, 0xe4, 0x3e, 0x66, 0xd4, 0x2b, 0x57, 0xa9, 0x6d, 0x65, 0xdc, 0x4f, 0x84, - 0x0d, 0xad, 0xf2, 0x81, 0x7c, 0x80, 0x1f, 0x03, 0xa0, 0x52, 0x92, 0x0c, 0x6a, 0x5b, 0x5a, 0xbb, - 0x4a, 0xed, 0xbc, 0xd4, 0x4a, 0xec, 0xe9, 0x23, 0x74, 0xc0, 0xb2, 0xc2, 0x36, 0x25, 0x76, 0xf1, - 0x2a, 0xb5, 0xcd, 0x90, 0xb6, 0x15, 0xa6, 0x32, 0x89, 0x56, 0x25, 0x24, 0xa2, 0x7d, 0xe2, 0xcb, - 0xbd, 0xc1, 0x44, 0x63, 0xd1, 0xf9, 0xf3, 0x22, 0x30, 0x2f, 0x06, 0x88, 0xb0, 0x5e, 0xc8, 0xe1, - 0xa7, 0xc0, 0x92, 0x27, 0x2f, 0xec, 0x71, 0x77, 0xa6, 0xb5, 0xf5, 0xc7, 0xd3, 0x2f, 0xf9, 0xbc, - 0x87, 0x83, 0xca, 0x63, 0xd5, 0xa1, 0xee, 0x7f, 0x05, 0x2c, 0xb7, 0x42, 0x4a, 0x23, 0x39, 0x02, - 0x45, 0xa4, 0x04, 0xf8, 0x99, 0xec, 0x9a, 0x5c, 0xde, 0x25, 0x79, 0x8e, 0xad, 0x65, 0x96, 0x77, - 0x6e, 0x38, 0xea, 0x9b, 0xfa, 0xde, 0x51, 0x52, 0xa4, 0x3a, 0xd0, 0x11, 0x4d, 0x95, 0xc3, 0x63, - 0x81, 0xa5, 0x84, 0x70, 0xb9, 0x5a, 0x45, 0x24, 0x1e, 0x61, 0x0d, 0x98, 0x09, 0xe9, 0x93, 0x84, - 0x13, 0x5f, 0xae, 0x8a, 0x89, 0x26, 0x32, 0x7c, 0x04, 0xcc, 0x36, 0x66, 0x6e, 0x8f, 0x11, 0x5f, - 0x2d, 0x01, 0x5a, 0x6d, 0x63, 0xf6, 0x05, 0x23, 0xfe, 0x4b, 0xe3, 0xdb, 0xbf, 0xd9, 0x0b, 0x0e, - 0x06, 0x05, 0x7d, 0xc8, 0xed, 0x75, 0x43, 0x72, 0xc7, 0x68, 0xed, 0x81, 0x22, 0xe3, 0x34, 0xc1, - 0x6d, 0xe2, 0x5e, 0x92, 0xa1, 0x1e, 0x30, 0x35, 0x2e, 0x5a, 0xff, 0x19, 0x19, 0x32, 0x94, 0x15, - 0x34, 0xc5, 0x5f, 0x0d, 0x50, 0xb8, 0x48, 0xb0, 0x47, 0xf4, 0x91, 0x55, 0x0c, 0xa9, 0x10, 0x13, - 0x4d, 0xa1, 0x25, 0xc1, 0xcd, 0x83, 0x88, 0xd0, 0x1e, 0xd7, 0x6f, 0xd0, 0x58, 0x14, 0x11, 0x09, - 0x21, 0x03, 0xe2, 0xc9, 0xfe, 0x19, 0x48, 0x4b, 0x70, 0x1f, 0xac, 0xf9, 0x01, 0xc3, 0xad, 0x50, - 0x5e, 0x5d, 0xbc, 0x4b, 0x55, 0x7e, 0xdd, 0xba, 0x4a, 0xed, 0xa2, 0x36, 0x34, 0x85, 0x1e, 0xcd, - 0x48, 0xf0, 0x97, 0xa0, 0x3c, 0x0d, 0x93, 0xd9, 0xaa, 0xab, 0x5a, 0x1d, 0x5e, 0xa5, 0x76, 0x69, - 0xe2, 0x2a, 0x2d, 0x68, 0x4e, 0x16, 0x4b, 0xec, 0x93, 0x56, 0xaf, 0x2d, 0xa7, 0xce, 0x44, 0x4a, - 0x10, 0xda, 0x30, 0x88, 0x02, 0x2e, 0xa7, 0x6c, 0x19, 0x29, 0x01, 0xbe, 0x00, 0x79, 0xda, 0x27, - 0x49, 0x12, 0xf8, 0xf2, 0x26, 0x75, 0xc7, 0x75, 0x13, 0x4d, 0x1d, 0x45, 0x55, 0x24, 0x96, 0xd9, - 0x45, 0x24, 0xa2, 0xc9, 0x50, 0x9e, 0x06, 0x74, 0x55, 0xca, 0xf0, 0x4a, 0xea, 0xd1, 0x8c, 0x04, - 0xeb, 0x00, 0xea, 0xb0, 0x84, 0xf0, 0x5e, 0x12, 0xbb, 0xf2, 0x8d, 0x2f, 0xca, 0x58, 0xf9, 0xde, - 0x29, 0x2b, 0x92, 0xc6, 0x63, 0xcc, 0x31, 0xba, 0xa1, 0x81, 0xbf, 0x06, 0x50, 0x2d, 0x86, 0xfb, - 0x0d, 0xa3, 0x93, 0x8b, 0xb2, 0xda, 0xce, 0x25, 0xbf, 0xb2, 0xea, 0x9c, 0x2d, 0x25, 0x9d, 0x32, - 0xaa, 0xab, 0x38, 0x35, 0x4c, 0xc3, 0x5a, 0x56, 0x17, 0xc1, 0x49, 0xe3, 0x74, 0x15, 0x68, 0x7d, - 0x2c, 0x67, 0xd2, 0xfb, 0xe9, 0x3f, 0x72, 0x20, 0x73, 0xc9, 0x82, 0xbf, 0x02, 0xb5, 0xc3, 0xa3, - 0xa3, 0x46, 0xb3, 0xe9, 0x5e, 0x7c, 0x79, 0xde, 0x70, 0xcf, 0x1b, 0xe8, 0xd5, 0x49, 0xb3, 0x79, - 0xf2, 0xf9, 0xeb, 0xb3, 0x46, 0xb3, 0x69, 0x2d, 0xd4, 0x3e, 0x7a, 0xf7, 0x7e, 0xbb, 0x3a, 0xf5, - 0x3f, 0x27, 0x49, 0x14, 0x30, 0x16, 0xd0, 0x38, 0x14, 0x23, 0xfa, 0x02, 0x6c, 0x66, 0xa3, 0x51, - 0xa3, 0x79, 0x81, 0x4e, 0x8e, 0x2e, 0x1a, 0xc7, 0x56, 0xae, 0x56, 0x7d, 0xf7, 0x7e, 0xbb, 0x32, - 0x8d, 0x44, 0x84, 0xf1, 0x24, 0x10, 0xb7, 0x71, 0x78, 0x00, 0xaa, 0xb7, 0x73, 0x36, 0x8e, 0xad, - 0xc5, 0x5a, 0xed, 0xdd, 0xfb, 0xed, 0xcd, 0xdb, 0x18, 0x89, 0x5f, 0x33, 0xbe, 0xfd, 0xfb, 0xd6, - 0x42, 0xfd, 0x17, 0xdf, 0x8d, 0xb6, 0x72, 0xdf, 0x8f, 0xb6, 0x72, 0xff, 0x1d, 0x6d, 0xe5, 0xfe, - 0xf2, 0x61, 0x6b, 0xe1, 0xfb, 0x0f, 0x5b, 0x0b, 0xff, 0xfe, 0xb0, 0xb5, 0xf0, 0x07, 0xbb, 0x1d, - 0xf0, 0x4e, 0xaf, 0xb5, 0xe3, 0xd1, 0x68, 0x97, 0xf4, 0x23, 0xca, 0x76, 0x29, 0xdb, 0x1d, 0xc8, - 0xbf, 0x4e, 0xc4, 0xed, 0x91, 0xb5, 0x56, 0xe4, 0x3f, 0x23, 0xcf, 0x7f, 0x08, 0x00, 0x00, 0xff, - 0xff, 0xc6, 0xf5, 0x8a, 0x10, 0x51, 0x11, 0x00, 0x00, + // 1916 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, + 0xd9, 0x17, 0xa5, 0x95, 0xb4, 0x1c, 0x52, 0xe4, 0x6a, 0x44, 0xc9, 0x34, 0x1d, 0x68, 0x85, 0xc5, + 0x7b, 0x30, 0x8c, 0xbc, 0x92, 0x2d, 0x5b, 0xa9, 0xeb, 0x16, 0x2d, 0x4c, 0x89, 0x69, 0xa5, 0xca, + 0x8e, 0x30, 0x54, 0x52, 0xa4, 0x0d, 0xb0, 0x18, 0xee, 0x4e, 0xc8, 0x8d, 0x76, 0x77, 0x88, 0x9d, + 0x21, 0x4d, 0xf6, 0xd8, 0x5e, 0x52, 0x9f, 0x7a, 0xed, 0xc1, 0x40, 0x81, 0x5e, 0x7a, 0xcc, 0x9f, + 0xd0, 0x63, 0xd0, 0x53, 0x4e, 0x45, 0xd1, 0xc3, 0xa2, 0xa0, 0x0f, 0x01, 0x74, 0xd4, 0xbd, 0x40, + 0x31, 0x1f, 0x24, 0x97, 0x94, 0x22, 0xe8, 0x22, 0xcd, 0xf3, 0xf5, 0xfb, 0x3d, 0xcf, 0xcc, 0xb3, + 0xf3, 0x41, 0xb0, 0x41, 0xd9, 0x1e, 0xe9, 0x47, 0x7b, 0xfd, 0x27, 0xe2, 0xdf, 0x6e, 0x37, 0xa1, + 0x9c, 0xc2, 0x3c, 0x65, 0xbb, 0x42, 0xea, 0x3f, 0xa9, 0xad, 0xe3, 0x28, 0x88, 0xe9, 0x9e, 0xfc, + 0xab, 0xac, 0xb5, 0x4a, 0x9b, 0xb6, 0xa9, 0x1c, 0xee, 0x89, 0x91, 0xd2, 0x3a, 0xbf, 0x37, 0xc0, + 0xca, 0x19, 0x4e, 0x70, 0xc4, 0xe0, 0x13, 0x90, 0x27, 0xfd, 0xc8, 0xf5, 0x49, 0x4c, 0xa3, 0x6a, + 0x6e, 0x27, 0xf7, 0x30, 0x5f, 0xaf, 0x5c, 0xa5, 0xb6, 0x35, 0xc4, 0x51, 0xf8, 0xc2, 0x99, 0x98, + 0x1c, 0x64, 0x92, 0x7e, 0x74, 0x24, 0x86, 0xf0, 0x25, 0x00, 0x64, 0xc0, 0x13, 0xec, 0x92, 0xa0, + 0xcb, 0xaa, 0xc6, 0xce, 0xd2, 0xc3, 0x7c, 0xdd, 0x19, 0xa5, 0x76, 0xbe, 0x21, 0xb4, 0x8d, 0xe3, + 0x33, 0x76, 0x95, 0xda, 0xeb, 0x1a, 0x60, 0xe2, 0xe8, 0xa0, 0xbc, 0x14, 0x1a, 0x41, 0x97, 0xc1, + 0xdf, 0x82, 0xa2, 0xd7, 0xc1, 0x41, 0xec, 0x7a, 0x34, 0xfe, 0x32, 0x68, 0x57, 0x97, 0x77, 0x72, + 0x0f, 0x0b, 0xfb, 0x5b, 0xbb, 0x93, 0x5a, 0x76, 0x0f, 0x85, 0xf9, 0x50, 0x5a, 0xeb, 0x3b, 0xdf, + 0xa6, 0xf6, 0xc2, 0x55, 0x6a, 0x6f, 0x28, 0xcc, 0x6c, 0xa4, 0xf3, 0xb7, 0xef, 0xbf, 0x79, 0x94, + 0x43, 0x05, 0x6f, 0xea, 0x0e, 0xf7, 0xc1, 0x26, 0x0e, 0x43, 0xfa, 0xc6, 0xed, 0xc5, 0xa2, 0x5c, + 0xe2, 0x71, 0xe2, 0xbb, 0x7c, 0xc0, 0xaa, 0x2b, 0x3b, 0xb9, 0x87, 0x26, 0xda, 0x90, 0xc6, 0x4f, + 0xa7, 0xb6, 0xf3, 0x01, 0x83, 0xfb, 0xa0, 0x28, 0x6a, 0xf5, 0x3a, 0x38, 0x8e, 0x49, 0xc8, 0xaa, + 0xa6, 0xac, 0xaa, 0x3c, 0x4a, 0xed, 0x42, 0xe3, 0xb3, 0x57, 0x87, 0x5a, 0x8d, 0x0a, 0xa4, 0x1f, + 0x8d, 0x05, 0xf8, 0x19, 0x28, 0x61, 0xcf, 0x23, 0x8c, 0x89, 0x5c, 0x78, 0x42, 0xc3, 0x6a, 0x5e, + 0x96, 0x51, 0xcd, 0x94, 0xf1, 0x52, 0x3a, 0x1c, 0x2a, 0x7b, 0x7d, 0x53, 0x14, 0x32, 0x4a, 0xed, + 0xb5, 0x19, 0x35, 0x5a, 0xc3, 0x59, 0x11, 0xbe, 0x00, 0xf7, 0xb1, 0xc7, 0x83, 0x3e, 0x71, 0x19, + 0xc7, 0x3c, 0xf0, 0xdc, 0x6e, 0x42, 0x3c, 0x1a, 0x75, 0x83, 0x90, 0xb0, 0x2a, 0x10, 0x89, 0xa1, + 0x7b, 0xca, 0xa1, 0x29, 0xed, 0x67, 0x53, 0xf3, 0x8b, 0x7b, 0x6f, 0xbf, 0xff, 0xe6, 0x11, 0x24, + 0xfd, 0x88, 0xb2, 0xbd, 0x81, 0x6c, 0x16, 0xb5, 0xce, 0x27, 0x86, 0xb9, 0x68, 0x2d, 0x9d, 0x18, + 0xe6, 0x92, 0x65, 0x9c, 0x18, 0xe6, 0xaa, 0x65, 0x3a, 0x7f, 0xc8, 0x81, 0xd9, 0x3c, 0xe0, 0x0b, + 0xb0, 0xe2, 0x25, 0x04, 0x73, 0x22, 0x1b, 0xa1, 0xb0, 0xff, 0xc1, 0x0f, 0x15, 0x72, 0x3e, 0xec, + 0x92, 0xba, 0x21, 0x8a, 0x41, 0x3a, 0x02, 0x7e, 0x04, 0x0c, 0x0f, 0x87, 0x61, 0x75, 0xf1, 0xce, + 0x91, 0xd2, 0xdf, 0xf9, 0x67, 0x0e, 0xac, 0x5f, 0xf3, 0x80, 0x5f, 0x80, 0x82, 0x9e, 0x5a, 0x3e, + 0xec, 0xaa, 0x74, 0x4a, 0xfb, 0x9b, 0xd7, 0x40, 0x25, 0xda, 0xff, 0x8d, 0x52, 0x1b, 0x4c, 0xe5, + 0xab, 0xd4, 0x86, 0xaa, 0x4f, 0x32, 0x08, 0x0e, 0x02, 0x78, 0xe2, 0x01, 0x3d, 0xb0, 0x31, 0xbb, + 0x70, 0x6e, 0x18, 0x30, 0x5e, 0x5d, 0x94, 0x6b, 0xfe, 0x74, 0x94, 0xda, 0xb3, 0x19, 0x9d, 0x06, + 0x8c, 0x5f, 0xa5, 0x76, 0x6d, 0x06, 0x35, 0x1b, 0xe9, 0xa0, 0x75, 0x3c, 0x1f, 0xe0, 0xfc, 0xb7, + 0x04, 0x0a, 0x99, 0x26, 0x86, 0x5f, 0x80, 0x72, 0x87, 0x46, 0x84, 0x71, 0x82, 0x7d, 0xb7, 0x15, + 0x52, 0xef, 0x42, 0x7f, 0x6e, 0x4f, 0xff, 0x9d, 0xda, 0x9b, 0x1e, 0x65, 0x11, 0x65, 0xcc, 0xbf, + 0xd8, 0x0d, 0xe8, 0x5e, 0x84, 0x79, 0x67, 0xf7, 0x38, 0x16, 0xa4, 0x5b, 0x8a, 0x74, 0x2e, 0xd2, + 0x41, 0xa5, 0x89, 0xa6, 0x2e, 0x14, 0xb0, 0x03, 0x4a, 0x3e, 0xa6, 0xee, 0x97, 0x34, 0xb9, 0xd0, + 0xe0, 0x8b, 0x12, 0xbc, 0xfe, 0x83, 0xe0, 0xa3, 0xd4, 0x2e, 0x1e, 0xbd, 0xfc, 0xe4, 0x63, 0x9a, + 0x5c, 0x48, 0x88, 0xab, 0xd4, 0xde, 0x54, 0x64, 0xb3, 0x40, 0x0e, 0x2a, 0xfa, 0x98, 0x4e, 0xdc, + 0xe0, 0xaf, 0x81, 0x35, 0x71, 0x60, 0xbd, 0x6e, 0x97, 0x26, 0xbc, 0xba, 0x24, 0x3e, 0xac, 0xfa, + 0xff, 0x8f, 0x52, 0xbb, 0xa4, 0x21, 0x9b, 0xca, 0x72, 0x95, 0xda, 0xf7, 0xe6, 0x40, 0x75, 0x8c, + 0x83, 0x4a, 0x1a, 0x56, 0xbb, 0xc2, 0x16, 0x28, 0x92, 0xa0, 0xfb, 0xe4, 0xe0, 0xb1, 0x2e, 0xc0, + 0x90, 0x05, 0xfc, 0xfc, 0xb6, 0x02, 0x0a, 0x8d, 0xe3, 0xb3, 0x27, 0x07, 0x8f, 0xc7, 0xf9, 0xeb, + 0xfd, 0x21, 0x8b, 0xe2, 0xa0, 0x82, 0x12, 0x55, 0xf2, 0xc7, 0x40, 0x8b, 0x6e, 0x07, 0xb3, 0x8e, + 0xdc, 0x76, 0xf2, 0xf5, 0x87, 0xa2, 0x81, 0x14, 0xd2, 0x2f, 0x31, 0xeb, 0x4c, 0x67, 0xbd, 0x35, + 0xfc, 0x1d, 0x8e, 0x79, 0xd0, 0x8b, 0xc6, 0x58, 0x40, 0x05, 0x0b, 0xaf, 0x49, 0xba, 0x07, 0x3a, + 0xdd, 0x95, 0xbb, 0xa6, 0x7b, 0x70, 0x53, 0xba, 0x07, 0xb3, 0xe9, 0x2a, 0x9f, 0x09, 0xc7, 0x73, + 0xcd, 0xb1, 0x7a, 0x57, 0x8e, 0xe7, 0x37, 0x71, 0x3c, 0x9f, 0xe5, 0x50, 0x3e, 0xa2, 0x2f, 0xe7, + 0xea, 0xac, 0x9a, 0x77, 0xee, 0xcb, 0x6b, 0x33, 0x54, 0x9a, 0x68, 0x14, 0xfa, 0x05, 0xa8, 0x78, + 0x34, 0x66, 0x5c, 0xe8, 0x62, 0xda, 0x0d, 0x89, 0xa6, 0xc8, 0x4b, 0x8a, 0xe7, 0xb7, 0x51, 0x3c, + 0xd0, 0xbb, 0xfd, 0x0d, 0xe1, 0x0e, 0xda, 0x98, 0x55, 0x2b, 0x32, 0x17, 0x58, 0x5d, 0xc2, 0x49, + 0xc2, 0x5a, 0xbd, 0xa4, 0xad, 0x89, 0x80, 0x24, 0x7a, 0x76, 0x1b, 0x91, 0xee, 0xd0, 0xf9, 0x50, + 0x07, 0x95, 0xa7, 0x2a, 0x45, 0xf0, 0x39, 0x28, 0x05, 0x82, 0xb5, 0xd5, 0x0b, 0x35, 0x7c, 0x41, + 0xc2, 0xef, 0xdf, 0x06, 0xaf, 0xbf, 0xaa, 0xd9, 0x40, 0x07, 0xad, 0x8d, 0x15, 0x0a, 0xda, 0x07, + 0x30, 0xea, 0x05, 0x89, 0xdb, 0x0e, 0xb1, 0x17, 0x90, 0x44, 0xc3, 0x17, 0x25, 0xfc, 0x47, 0xb7, + 0xc1, 0xdf, 0x57, 0xf0, 0xd7, 0x83, 0x1d, 0x64, 0x09, 0xe5, 0x2f, 0x94, 0x4e, 0xb1, 0x34, 0x41, + 0xb1, 0x45, 0x92, 0x30, 0x88, 0x35, 0xfe, 0x9a, 0xc4, 0x7f, 0x7c, 0x1b, 0xbe, 0xee, 0xa0, 0x6c, + 0x98, 0x83, 0x0a, 0x4a, 0x9c, 0x80, 0x86, 0x34, 0xf6, 0xe9, 0x18, 0x74, 0xfd, 0xce, 0xa0, 0xd9, + 0x30, 0x07, 0x15, 0x94, 0xa8, 0x40, 0xdb, 0x60, 0x03, 0x27, 0x09, 0x7d, 0x33, 0x37, 0x21, 0x50, + 0x62, 0xff, 0xe8, 0x36, 0xec, 0xf1, 0x3e, 0x7d, 0x3d, 0x5a, 0xec, 0xd3, 0x42, 0x3b, 0x33, 0x25, + 0x3e, 0x80, 0xed, 0x04, 0x0f, 0xe7, 0x78, 0x2a, 0x77, 0x9e, 0xf8, 0xeb, 0xc1, 0x0e, 0xb2, 0x84, + 0x72, 0x86, 0xe5, 0x2b, 0x50, 0x89, 0x48, 0xd2, 0x26, 0x6e, 0x4c, 0x38, 0xeb, 0x86, 0x01, 0xd7, + 0x3c, 0x9b, 0x77, 0xfe, 0x0e, 0x6e, 0x0a, 0x77, 0x10, 0x94, 0xea, 0xd7, 0x5a, 0x3b, 0xe9, 0x52, + 0xd6, 0xc1, 0x71, 0xbb, 0x83, 0x03, 0xcd, 0xb2, 0x75, 0xe7, 0x2e, 0x9d, 0x0d, 0x74, 0xd0, 0xda, + 0x58, 0x31, 0x59, 0x6a, 0x0f, 0xc7, 0x5e, 0x6f, 0xbc, 0xd4, 0xf7, 0xee, 0xbc, 0xd4, 0xd9, 0x30, + 0x07, 0x15, 0x94, 0x28, 0x41, 0x4f, 0x0c, 0xb3, 0x64, 0x95, 0x4f, 0x0c, 0xb3, 0x6c, 0x59, 0x27, + 0x86, 0x69, 0x59, 0xeb, 0x27, 0x86, 0xb9, 0x61, 0x55, 0xd0, 0xda, 0x90, 0x86, 0xd4, 0xed, 0x3f, + 0x55, 0x41, 0xa8, 0x40, 0xde, 0x60, 0xa6, 0x37, 0x1a, 0x54, 0xf2, 0x30, 0xc7, 0xe1, 0x90, 0xe9, + 0x89, 0x40, 0x96, 0x9a, 0x9e, 0xcc, 0xb1, 0xb5, 0x07, 0x96, 0xc5, 0xf5, 0x88, 0x40, 0x0b, 0x2c, + 0x5d, 0x90, 0xa1, 0x3a, 0x6c, 0x91, 0x18, 0xc2, 0x0a, 0x58, 0xee, 0xe3, 0xb0, 0x47, 0xd4, 0x19, + 0x89, 0x94, 0xe0, 0x1c, 0x83, 0xf2, 0x79, 0x82, 0x63, 0x26, 0xae, 0x56, 0x34, 0x3e, 0xa5, 0x6d, + 0x06, 0x21, 0x30, 0xe4, 0x39, 0xa1, 0x62, 0xe5, 0x18, 0x3a, 0xc0, 0x08, 0x69, 0x9b, 0xc9, 0xdb, + 0x42, 0x61, 0xbf, 0x94, 0xb9, 0x93, 0x9c, 0xd2, 0x36, 0x92, 0x36, 0xe7, 0x1f, 0x8b, 0x60, 0xe9, + 0x94, 0xb6, 0x61, 0x15, 0xac, 0x62, 0xdf, 0x4f, 0x08, 0x63, 0x1a, 0x62, 0x2c, 0xc2, 0x2d, 0xb0, + 0xc2, 0x69, 0x37, 0xf0, 0x14, 0x4e, 0x1e, 0x69, 0x49, 0x30, 0xfa, 0x98, 0x63, 0x79, 0xa2, 0x16, + 0x91, 0x1c, 0x8b, 0xbb, 0xa9, 0x2c, 0xc9, 0x8d, 0x7b, 0x51, 0x8b, 0x24, 0xf2, 0x60, 0x34, 0xea, + 0xe5, 0xcb, 0xd4, 0x2e, 0x48, 0xfd, 0x6b, 0xa9, 0x46, 0x59, 0x01, 0x7e, 0x08, 0x56, 0xf9, 0x20, + 0x7b, 0xc8, 0x6d, 0x5c, 0xa6, 0x76, 0x99, 0x4f, 0xeb, 0x13, 0x67, 0x18, 0x5a, 0xe1, 0x03, 0x79, + 0x96, 0xed, 0x01, 0x93, 0x0f, 0xdc, 0x20, 0xf6, 0xc9, 0x40, 0x9e, 0x63, 0x46, 0xbd, 0x72, 0x99, + 0xda, 0x56, 0xc6, 0xfd, 0x58, 0xd8, 0xd0, 0x2a, 0x1f, 0xc8, 0x01, 0xfc, 0x10, 0x00, 0x95, 0x92, + 0x64, 0x50, 0xc7, 0xd2, 0xda, 0x65, 0x6a, 0xe7, 0xa5, 0x56, 0x62, 0x4f, 0x87, 0xd0, 0x01, 0xcb, + 0x0a, 0xdb, 0x94, 0xd8, 0xc5, 0xcb, 0xd4, 0x36, 0x43, 0xda, 0x56, 0x98, 0xca, 0x24, 0xa6, 0x2a, + 0x21, 0x11, 0xed, 0x13, 0x5f, 0x9e, 0x0d, 0x26, 0x1a, 0x8b, 0xce, 0x1f, 0x17, 0x81, 0x79, 0x3e, + 0x40, 0x84, 0xf5, 0x42, 0x0e, 0x3f, 0x06, 0x96, 0xbc, 0x79, 0x61, 0x8f, 0xbb, 0x33, 0x53, 0x5b, + 0x7f, 0x30, 0xdd, 0xc9, 0xe7, 0x3d, 0x1c, 0x54, 0x1e, 0xab, 0x5e, 0xea, 0xf9, 0xaf, 0x80, 0xe5, + 0x56, 0x48, 0x69, 0x24, 0x5b, 0xa0, 0x88, 0x94, 0x00, 0xcf, 0xe4, 0xac, 0xc9, 0xe5, 0x5d, 0x92, + 0xf7, 0xd8, 0x5a, 0x66, 0x79, 0xe7, 0x9a, 0xa3, 0xfe, 0x40, 0xbf, 0x4a, 0x4a, 0x8a, 0x54, 0x07, + 0xea, 0x07, 0xc9, 0x0a, 0x1f, 0xc8, 0x0e, 0xb2, 0xc0, 0x52, 0x42, 0xb8, 0x5c, 0xb2, 0x22, 0x12, + 0x43, 0x58, 0x03, 0x66, 0x42, 0xfa, 0x24, 0xe1, 0xc4, 0x97, 0x4b, 0x63, 0xa2, 0x89, 0x0c, 0xef, + 0x03, 0xb3, 0x8d, 0x99, 0xdb, 0x63, 0xc4, 0x57, 0xeb, 0x80, 0x56, 0xdb, 0x98, 0x7d, 0xca, 0x88, + 0xff, 0xc2, 0xf8, 0xfa, 0x2f, 0xf6, 0x82, 0x83, 0x41, 0x41, 0xdf, 0x74, 0x7b, 0xdd, 0x90, 0xdc, + 0xd2, 0x5f, 0xfb, 0xa0, 0xc8, 0x38, 0x4d, 0x70, 0x9b, 0xb8, 0x17, 0x64, 0xa8, 0xbb, 0x4c, 0xf5, + 0x8c, 0xd6, 0xff, 0x8a, 0x0c, 0x19, 0xca, 0x0a, 0x9a, 0xe2, 0xcf, 0x06, 0x28, 0x9c, 0x27, 0xd8, + 0x23, 0xfa, 0xde, 0x2a, 0x3a, 0x55, 0x88, 0x89, 0xa6, 0xd0, 0x92, 0xe0, 0xe6, 0x41, 0x44, 0x68, + 0x8f, 0xeb, 0xcf, 0x68, 0x2c, 0x8a, 0x88, 0x84, 0x90, 0x01, 0xf1, 0xe4, 0x24, 0x1a, 0x48, 0x4b, + 0xf0, 0x00, 0xac, 0xf9, 0x01, 0xc3, 0xad, 0x50, 0x3e, 0x6c, 0xbc, 0x0b, 0x55, 0x7e, 0xdd, 0xba, + 0x4c, 0xed, 0xa2, 0x36, 0x34, 0x85, 0x1e, 0xcd, 0x48, 0xf0, 0x27, 0xa0, 0x3c, 0x0d, 0x93, 0xd9, + 0xaa, 0x87, 0x5c, 0x1d, 0x5e, 0xa6, 0x76, 0x69, 0xe2, 0x2a, 0x2d, 0x68, 0x4e, 0x16, 0xeb, 0xec, + 0x93, 0x56, 0xaf, 0x2d, 0x5b, 0xcf, 0x44, 0x4a, 0x10, 0xda, 0x30, 0x88, 0x02, 0x2e, 0x5b, 0x6d, + 0x19, 0x29, 0x01, 0x3e, 0x03, 0x79, 0xda, 0x27, 0x49, 0x12, 0xf8, 0xf2, 0x9d, 0x75, 0xcb, 0x8b, + 0x14, 0x4d, 0x1d, 0x45, 0x55, 0x24, 0x96, 0xd9, 0x45, 0x24, 0xa2, 0xc9, 0x50, 0x5e, 0x09, 0x74, + 0x55, 0xca, 0xf0, 0x4a, 0xea, 0xd1, 0x8c, 0x04, 0xeb, 0x00, 0xea, 0xb0, 0x84, 0xf0, 0x5e, 0x12, + 0xbb, 0xf2, 0xb3, 0x2f, 0xca, 0x58, 0xf9, 0xf1, 0x29, 0x2b, 0x92, 0xc6, 0x23, 0xcc, 0x31, 0xba, + 0xa6, 0x81, 0x3f, 0x03, 0x50, 0x2d, 0x86, 0xfb, 0x15, 0xa3, 0x93, 0xb7, 0xb4, 0x3a, 0xd3, 0x25, + 0xbf, 0xb2, 0xea, 0x9c, 0x2d, 0x25, 0x9d, 0x30, 0xaa, 0xab, 0x38, 0x31, 0x4c, 0xc3, 0x5a, 0x56, + 0xaf, 0xc1, 0xc9, 0xc4, 0xe9, 0x2a, 0xd0, 0xc6, 0x58, 0xce, 0xa4, 0xf7, 0xe8, 0xef, 0x39, 0x90, + 0x79, 0x69, 0xc1, 0x9f, 0x82, 0xda, 0xcb, 0xc3, 0xc3, 0x46, 0xb3, 0xe9, 0x9e, 0x7f, 0x7e, 0xd6, + 0x70, 0xcf, 0x1a, 0xe8, 0xd5, 0x71, 0xb3, 0x79, 0xfc, 0xc9, 0xeb, 0xd3, 0x46, 0xb3, 0x69, 0x2d, + 0xd4, 0x3e, 0x78, 0xfb, 0x6e, 0xa7, 0x3a, 0xf5, 0x3f, 0x23, 0x49, 0x14, 0x30, 0x16, 0xd0, 0x38, + 0x14, 0x2d, 0xfa, 0x0c, 0x6c, 0x65, 0xa3, 0x51, 0xa3, 0x79, 0x8e, 0x8e, 0x0f, 0xcf, 0x1b, 0x47, + 0x56, 0xae, 0x56, 0x7d, 0xfb, 0x6e, 0xa7, 0x32, 0x8d, 0x44, 0x84, 0xf1, 0x24, 0x10, 0x6f, 0x75, + 0xf8, 0x1c, 0x54, 0x6f, 0xe6, 0x6c, 0x1c, 0x59, 0x8b, 0xb5, 0xda, 0xdb, 0x77, 0x3b, 0x5b, 0x37, + 0x31, 0x12, 0xbf, 0x66, 0x7c, 0xfd, 0xd7, 0xed, 0x85, 0xfa, 0x8f, 0xbf, 0x1d, 0x6d, 0xe7, 0xbe, + 0x1b, 0x6d, 0xe7, 0xfe, 0x33, 0xda, 0xce, 0xfd, 0xe9, 0xfd, 0xf6, 0xc2, 0x77, 0xef, 0xb7, 0x17, + 0xfe, 0xf5, 0x7e, 0x7b, 0xe1, 0x37, 0x76, 0x3b, 0xe0, 0x9d, 0x5e, 0x6b, 0xd7, 0xa3, 0xd1, 0x9e, + 0x7a, 0x40, 0x4f, 0xde, 0xd0, 0xe2, 0x09, 0xc9, 0x5a, 0x2b, 0xf2, 0xc7, 0x93, 0xa7, 0xff, 0x0b, + 0x00, 0x00, 0xff, 0xff, 0xc9, 0x23, 0x48, 0x4e, 0x87, 0x11, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/evm/types/genesis.pb.go b/x/evm/types/genesis.pb.go index c14bdc87..41667155 100644 --- a/x/evm/types/genesis.pb.go +++ b/x/evm/types/genesis.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -152,26 +153,27 @@ func init() { func init() { proto.RegisterFile("os/evm/v1/genesis.proto", fileDescriptor_5c2e74114f53521b) } var fileDescriptor_5c2e74114f53521b = []byte{ - // 292 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xbd, 0x4e, 0xc3, 0x30, - 0x14, 0x85, 0x63, 0x5a, 0x35, 0xc4, 0x45, 0xfc, 0x18, 0x24, 0x42, 0x07, 0xa7, 0xea, 0x94, 0xc9, - 0x56, 0xcb, 0x84, 0x3a, 0x91, 0x85, 0x15, 0xa5, 0x1b, 0x9b, 0x9b, 0x58, 0xa1, 0x43, 0x7a, 0xa3, - 0xd8, 0x8d, 0x40, 0xf0, 0x10, 0x3c, 0x07, 0x4f, 0xd2, 0xb1, 0x23, 0x13, 0xa0, 0xe4, 0x45, 0x50, - 0x9c, 0xb4, 0xb4, 0xdb, 0xf5, 0xf5, 0x77, 0xce, 0xb1, 0x0f, 0xbe, 0x06, 0xc5, 0x65, 0x91, 0xf2, - 0x62, 0xcc, 0x13, 0xb9, 0x94, 0x6a, 0xa1, 0x58, 0x96, 0x83, 0x06, 0xe2, 0x80, 0x62, 0xb2, 0x48, - 0x59, 0x31, 0x1e, 0x5c, 0x25, 0x90, 0x80, 0xd9, 0xf2, 0x7a, 0x6a, 0x80, 0xc1, 0xe5, 0xbf, 0xb2, - 0xe6, 0xcc, 0x72, 0xf4, 0x8e, 0x4f, 0x1e, 0x1a, 0x9b, 0x99, 0x16, 0x5a, 0x92, 0x29, 0x3e, 0x16, - 0x51, 0x04, 0xab, 0xa5, 0x56, 0x2e, 0x1a, 0x76, 0xfc, 0xfe, 0xe4, 0x86, 0xed, 0x8c, 0x59, 0x8b, - 0xde, 0x37, 0x44, 0xd0, 0x5d, 0x7f, 0x7b, 0x56, 0xb8, 0x13, 0x10, 0x8e, 0x7b, 0x99, 0xc8, 0x45, - 0xaa, 0xdc, 0xa3, 0x21, 0xf2, 0xfb, 0x93, 0x8b, 0x3d, 0xe9, 0xa3, 0xb9, 0x68, 0x25, 0x2d, 0x36, - 0x7a, 0xc3, 0xa7, 0x87, 0x96, 0xc4, 0xc5, 0xb6, 0x88, 0xe3, 0x5c, 0xaa, 0x3a, 0x1e, 0xf9, 0x4e, - 0xb8, 0x3d, 0x12, 0x82, 0xbb, 0x11, 0xc4, 0xd2, 0x58, 0x3b, 0xa1, 0x99, 0xc9, 0x14, 0xdb, 0x4a, - 0x43, 0x2e, 0x12, 0xe9, 0x76, 0xcc, 0x63, 0xcf, 0xf7, 0x12, 0xcd, 0x87, 0x82, 0xb3, 0x3a, 0xf0, - 0xf3, 0xc7, 0xb3, 0x67, 0x0d, 0x18, 0x6e, 0x15, 0xc1, 0xdd, 0xba, 0xa4, 0x68, 0x53, 0x52, 0xf4, - 0x5b, 0x52, 0xf4, 0x51, 0x51, 0x6b, 0x53, 0x51, 0xeb, 0xab, 0xa2, 0xd6, 0x93, 0x97, 0x2c, 0xf4, - 0xf3, 0x6a, 0xce, 0x22, 0x48, 0xeb, 0xaa, 0x40, 0x71, 0x50, 0xfc, 0xc5, 0x94, 0xa7, 0x5f, 0x33, - 0xa9, 0xe6, 0x3d, 0x53, 0xde, 0xed, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa5, 0x37, 0x87, 0x0c, - 0x8d, 0x01, 0x00, 0x00, + // 310 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x50, 0x3f, 0x4f, 0xc2, 0x40, + 0x14, 0xef, 0x89, 0x01, 0x7b, 0x18, 0x23, 0x27, 0x89, 0x95, 0xe1, 0x20, 0x4c, 0xc4, 0xe1, 0x2e, + 0xa0, 0x8b, 0x1b, 0xb2, 0xb8, 0x1a, 0xd8, 0xdc, 0x8e, 0xf6, 0x52, 0x3b, 0xb4, 0xaf, 0xe9, 0x1d, + 0x8d, 0x6e, 0x4e, 0xce, 0x7e, 0x0c, 0xe3, 0xe4, 0xc7, 0x60, 0x64, 0x74, 0x52, 0xd3, 0x0e, 0x7e, + 0x0d, 0xd3, 0x6b, 0xc1, 0xba, 0x34, 0xaf, 0xef, 0xfd, 0xfe, 0xdd, 0x0f, 0x9f, 0x82, 0xe2, 0x32, + 0x0d, 0x79, 0x3a, 0xe6, 0xbe, 0x8c, 0xa4, 0x0a, 0x14, 0x8b, 0x13, 0xd0, 0x40, 0x6c, 0x50, 0x4c, + 0xa6, 0x21, 0x4b, 0xc7, 0xbd, 0x8e, 0x08, 0x83, 0x08, 0xb8, 0xf9, 0x96, 0xd7, 0x5e, 0xd7, 0x07, + 0x1f, 0xcc, 0xc8, 0x8b, 0xa9, 0xda, 0x9e, 0xfc, 0x89, 0x15, 0x54, 0xb3, 0x1c, 0x3e, 0x23, 0x7c, + 0x78, 0x53, 0x4a, 0x2f, 0xb4, 0xd0, 0x92, 0x4c, 0xf1, 0x81, 0x70, 0x5d, 0x58, 0x45, 0x5a, 0x39, + 0x68, 0xd0, 0x18, 0xb5, 0x27, 0x67, 0x6c, 0x67, 0xc6, 0x2a, 0xe8, 0x75, 0x89, 0x98, 0xd9, 0xeb, + 0xcf, 0xbe, 0xf5, 0xfa, 0xf3, 0x7e, 0x8e, 0xe6, 0x3b, 0x16, 0xb9, 0xc4, 0xcd, 0x58, 0x24, 0x22, + 0x54, 0xce, 0xde, 0x00, 0x8d, 0xda, 0x93, 0x4e, 0x8d, 0x7f, 0x6b, 0x0e, 0x75, 0x5e, 0x85, 0x1d, + 0x3e, 0x21, 0x7c, 0xf4, 0x5f, 0x9d, 0x38, 0xb8, 0x25, 0x3c, 0x2f, 0x91, 0xaa, 0x48, 0x82, 0x46, + 0xf6, 0x7c, 0xfb, 0x4b, 0x08, 0xde, 0x77, 0xc1, 0x93, 0xc6, 0xc0, 0x9e, 0x9b, 0x99, 0x4c, 0x71, + 0x4b, 0x69, 0x48, 0x84, 0x2f, 0x9d, 0x86, 0xc9, 0x7d, 0x5c, 0xf3, 0x35, 0x6f, 0x9b, 0x75, 0x0b, + 0xdb, 0xb7, 0xaf, 0x7e, 0x6b, 0x51, 0x02, 0xcb, 0x04, 0x5b, 0xda, 0xec, 0x6a, 0x9d, 0x51, 0xb4, + 0xc9, 0x28, 0xfa, 0xce, 0x28, 0x7a, 0xc9, 0xa9, 0xb5, 0xc9, 0xa9, 0xf5, 0x91, 0x53, 0xeb, 0xae, + 0xef, 0x07, 0xfa, 0x7e, 0xb5, 0x64, 0x2e, 0x84, 0x45, 0x77, 0xa0, 0x38, 0x28, 0xfe, 0x60, 0xda, + 0xd4, 0x8f, 0xb1, 0x54, 0xcb, 0xa6, 0x69, 0xf3, 0xe2, 0x37, 0x00, 0x00, 0xff, 0xff, 0x93, 0x56, + 0x91, 0xe9, 0xb1, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/evm/types/genesis_test.go b/x/evm/types/genesis_test.go index c54685c0..60328f6d 100644 --- a/x/evm/types/genesis_test.go +++ b/x/evm/types/genesis_test.go @@ -5,6 +5,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/crypto/ethsecp256k1" + testconstants "github.com/evmos/os/testutil/constants" "github.com/stretchr/testify/suite" ) @@ -83,8 +84,7 @@ func (suite *GenesisTestSuite) TestValidateGenesisAccount() { func (suite *GenesisTestSuite) TestValidateGenesis() { defaultGenesisWithEVMDenom := DefaultGenesisState() - defaultParamsWithEVMDenom := DefaultParamsWithEVMDenom(testDenom) - defaultGenesisWithEVMDenom.Params = defaultParamsWithEVMDenom + defaultGenesisWithEVMDenom.Params.EvmDenom = testconstants.ExampleAttoDenom testCases := []struct { name string @@ -96,11 +96,6 @@ func (suite *GenesisTestSuite) TestValidateGenesis() { genState: DefaultGenesisState(), expPass: false, }, - { - name: "default with EVM denom set", - genState: defaultGenesisWithEVMDenom, - expPass: true, - }, { name: "valid genesis", genState: &GenesisState{ @@ -114,7 +109,7 @@ func (suite *GenesisTestSuite) TestValidateGenesis() { }, }, }, - Params: defaultParamsWithEVMDenom, + Params: DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom), }, expPass: true, }, @@ -125,7 +120,7 @@ func (suite *GenesisTestSuite) TestValidateGenesis() { }, { name: "copied genesis", - genState: NewGenesisState(defaultParamsWithEVMDenom, DefaultGenesisState().Accounts), + genState: NewGenesisState(defaultGenesisWithEVMDenom.Params, DefaultGenesisState().Accounts), expPass: true, }, { @@ -152,7 +147,7 @@ func (suite *GenesisTestSuite) TestValidateGenesis() { }, }, }, - Params: defaultParamsWithEVMDenom, + Params: DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom), }, expPass: false, }, @@ -223,11 +218,14 @@ func (suite *GenesisTestSuite) TestValidateGenesis() { for _, tc := range testCases { tc := tc - err := tc.genState.Validate() - if tc.expPass { - suite.Require().NoError(err, tc.name) - } else { - suite.Require().Error(err, tc.name) - } + + suite.Run(tc.name, func() { + err := tc.genState.Validate() + if tc.expPass { + suite.Require().NoError(err, tc.name) + } else { + suite.Require().Error(err, tc.name) + } + }) } } diff --git a/x/evm/types/interfaces.go b/x/evm/types/interfaces.go index 83a71ca5..b5cf906a 100644 --- a/x/evm/types/interfaces.go +++ b/x/evm/types/interfaces.go @@ -3,43 +3,46 @@ package types import ( + "context" "math/big" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/ethereum/go-ethereum/common" - + "cosmossdk.io/core/address" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ethereum/go-ethereum/common" "github.com/evmos/os/x/evm/core/vm" - feemarkettypes "github.com/evmos/os/x/feemarket/types" ) // AccountKeeper defines the expected account keeper interface type AccountKeeper interface { - NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + NewAccountWithAddress(ctx context.Context, addr sdk.AccAddress) sdk.AccountI GetModuleAddress(moduleName string) sdk.AccAddress - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI - SetAccount(ctx sdk.Context, account authtypes.AccountI) - RemoveAccount(ctx sdk.Context, account authtypes.AccountI) - GetParams(ctx sdk.Context) (params authtypes.Params) - GetSequence(ctx sdk.Context, account sdk.AccAddress) (uint64, error) + IterateAccounts(ctx context.Context, cb func(account sdk.AccountI) bool) + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI + SetAccount(ctx context.Context, account sdk.AccountI) + RemoveAccount(ctx context.Context, account sdk.AccountI) + GetParams(ctx context.Context) (params authtypes.Params) + GetSequence(ctx context.Context, account sdk.AccAddress) (uint64, error) + AddressCodec() address.Codec } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { authtypes.BankKeeper - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error } // StakingKeeper returns the historical headers kept in store. type StakingKeeper interface { - GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool) - GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator stakingtypes.Validator, found bool) + GetHistoricalInfo(ctx context.Context, height int64) (stakingtypes.HistoricalInfo, error) + GetValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) (stakingtypes.Validator, error) + ValidatorAddressCodec() address.Codec } // FeeMarketKeeper diff --git a/x/evm/types/legacy_tx.go b/x/evm/types/legacy_tx.go index da7d0291..e939d69a 100644 --- a/x/evm/types/legacy_tx.go +++ b/x/evm/types/legacy_tx.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package types import ( @@ -10,6 +11,7 @@ import ( "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/evmos/os/types" + ethutils "github.com/evmos/os/utils/eth" ) func NewLegacyTx(tx *ethtypes.Transaction) (*LegacyTx, error) { @@ -67,7 +69,7 @@ func (tx *LegacyTx) Copy() TxData { // GetChainID returns the chain id field from the derived signature values func (tx *LegacyTx) GetChainID() *big.Int { v, _, _ := tx.GetRawSignatureValues() - return DeriveChainID(v) + return ethutils.DeriveChainID(v) } // GetAccessList returns nil @@ -143,7 +145,7 @@ func (tx *LegacyTx) AsEthereumData() ethtypes.TxData { // GetRawSignatureValues returns the V, R, S signature values of the transaction. // The return values should not be modified by the caller. func (tx *LegacyTx) GetRawSignatureValues() (v, r, s *big.Int) { - return rawSignatureValues(tx.V, tx.R, tx.S) + return ethutils.RawSignatureValues(tx.V, tx.R, tx.S) } // SetSignatureValues sets the signature values to the transaction. diff --git a/x/evm/types/msg.go b/x/evm/types/msg.go index 40b90887..3c03348d 100644 --- a/x/evm/types/msg.go +++ b/x/evm/types/msg.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package types import ( @@ -9,18 +10,22 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" + txsigning "cosmossdk.io/x/tx/signing" "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/cosmos/cosmos-sdk/x/auth/signing" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" + evmapi "github.com/evmos/os/api/os/evm/v1" "github.com/evmos/os/types" + protov2 "google.golang.org/protobuf/proto" ) var ( @@ -38,6 +43,11 @@ const ( TypeMsgEthereumTx = "ethereum_tx" ) +var MsgEthereumTxCustomGetSigner = txsigning.CustomGetSigner{ + MsgType: protov2.MessageName(&evmapi.MsgEthereumTx{}), + Fn: evmapi.GetSigners, +} + // NewTx returns a reference to a new Ethereum transaction message. func NewTx( tx *EvmTxArgs, @@ -193,23 +203,8 @@ func (msg *MsgEthereumTx) GetMsgs() []sdk.Msg { return []sdk.Msg{msg} } -// GetSigners returns the expected signers for an Ethereum transaction message. -// For such a message, there should exist only a single 'signer'. -// -// NOTE: This method panics if 'Sign' hasn't been called first. -func (msg *MsgEthereumTx) GetSigners() []sdk.AccAddress { - data, err := UnpackTxData(msg.Data) - if err != nil { - panic(err) - } - - sender, err := msg.GetSender(data.GetChainID()) - if err != nil { - panic(err) - } - - signer := sdk.AccAddress(sender.Bytes()) - return []sdk.AccAddress{signer} +func (msg *MsgEthereumTx) GetMsgsV2() ([]protov2.Message, error) { + return nil, errors.New("not implemented") } // GetSignBytes returns the Amino bytes of an Ethereum transaction message used @@ -237,7 +232,7 @@ func (msg *MsgEthereumTx) Sign(ethSigner ethtypes.Signer, keyringSigner keyring. tx := msg.AsTransaction() txHash := ethSigner.Hash(tx) - sig, _, err := keyringSigner.SignByAddress(from, txHash.Bytes()) + sig, _, err := keyringSigner.SignByAddress(from, txHash.Bytes(), signingtypes.SignMode_SIGN_MODE_TEXTUAL) if err != nil { return err } @@ -365,13 +360,6 @@ func (msg *MsgEthereumTx) BuildTx(b client.TxBuilder, evmDenom string) (signing. return tx, nil } -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (m MsgUpdateParams) GetSigners() []sdk.AccAddress { - //#nosec G703 -- gosec raises a warning about a non-handled error which we deliberately ignore here - addr, _ := sdk.AccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} - // ValidateBasic does a sanity check of the provided data func (m *MsgUpdateParams) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { diff --git a/x/evm/types/msg_test.go b/x/evm/types/msg_test.go index 377da5f5..9347c6a8 100644 --- a/x/evm/types/msg_test.go +++ b/x/evm/types/msg_test.go @@ -17,8 +17,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/evmos/os/crypto/ethsecp256k1" "github.com/evmos/os/encoding" - exampleapp "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" + testconstants "github.com/evmos/os/testutil/constants" utiltx "github.com/evmos/os/testutil/tx" "github.com/evmos/os/x/evm/types" "github.com/stretchr/testify/suite" @@ -51,7 +50,7 @@ func (suite *MsgsTestSuite) SetupTest() { suite.chainID = big.NewInt(1) suite.hundredBigInt = big.NewInt(100) - encodingConfig := encoding.MakeConfig(exampleapp.ModuleBasics) + encodingConfig := encoding.MakeConfig() suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) } @@ -69,7 +68,6 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_Constructor() { suite.Require().Equal(msg.Type(), types.TypeMsgEthereumTx) // suite.Require().NotNil(msg.To()) suite.Require().Equal(msg.GetMsgs(), []sdk.Msg{msg}) - suite.Require().Panics(func() { msg.GetSigners() }) suite.Require().Panics(func() { msg.GetSignBytes() }) evmTx2 := &types.EvmTxArgs{ @@ -115,7 +113,7 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_BuildTx() { tc.msg.Data = nil } - tx, err := tc.msg.BuildTx(suite.clientCtx.TxConfig.NewTxBuilder(), testutil.ExampleAttoDenom) + tx, err := tc.msg.BuildTx(suite.clientCtx.TxConfig.NewTxBuilder(), testconstants.ExampleAttoDenom) if tc.expError { suite.Require().Error(err) } else { @@ -124,7 +122,7 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_BuildTx() { suite.Require().Empty(tx.GetMemo()) suite.Require().Empty(tx.GetTimeoutHeight()) suite.Require().Equal(uint64(100000), tx.GetGas()) - suite.Require().Equal(sdk.NewCoins(sdk.NewCoin(testutil.ExampleAttoDenom, sdkmath.NewInt(100000))), tx.GetFee()) + suite.Require().Equal(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(100000))), tx.GetFee()) } } } diff --git a/x/evm/types/params.go b/x/evm/types/params.go index c2df7441..6930f658 100644 --- a/x/evm/types/params.go +++ b/x/evm/types/params.go @@ -10,8 +10,8 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/params" diff --git a/x/evm/types/params_test.go b/x/evm/types/params_test.go index 8f0a099c..6286abda 100644 --- a/x/evm/types/params_test.go +++ b/x/evm/types/params_test.go @@ -4,20 +4,14 @@ import ( "testing" ethparams "github.com/ethereum/go-ethereum/params" + testconstants "github.com/evmos/os/testutil/constants" "github.com/stretchr/testify/require" ) -const testDenom = "testdenom" - func TestParamsValidate(t *testing.T) { t.Parallel() extraEips := []string{"ethereum_2929", "ethereum_1884", "ethereum_1344"} - - defaultParams := DefaultParams() - defaultParamsWithEVMDenom := defaultParams - defaultParamsWithEVMDenom.EvmDenom = testDenom - testCases := []struct { name string params Params @@ -27,17 +21,16 @@ func TestParamsValidate(t *testing.T) { { name: "default", params: DefaultParams(), - expPass: false, // NOTE: it's false here because we require all customer chains to set their own EVM denom - errContains: "invalid denom: ", + errContains: "invalid denom", }, { - name: "default with custom EVM denom", - params: defaultParamsWithEVMDenom, + name: "default with denom", + params: DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom), expPass: true, }, { name: "valid", - params: NewParams(testDenom, false, DefaultChainConfig(), extraEips, nil, nil, DefaultAccessControl), + params: NewParams(testconstants.ExampleAttoDenom, false, DefaultChainConfig(), extraEips, nil, nil, DefaultAccessControl), expPass: true, }, { @@ -55,7 +48,7 @@ func TestParamsValidate(t *testing.T) { { name: "invalid eip", params: Params{ - EvmDenom: testDenom, + EvmDenom: testconstants.ExampleAttoDenom, ExtraEIPs: []string{"os_1000000"}, }, errContains: "EIP os_1000000 is not activateable, valid EIPs are", @@ -63,7 +56,7 @@ func TestParamsValidate(t *testing.T) { { name: "unsorted precompiles", params: Params{ - EvmDenom: testDenom, + EvmDenom: testconstants.ExampleAttoDenom, ActiveStaticPrecompiles: []string{ "0x0000000000000000000000000000000000000801", "0x0000000000000000000000000000000000000800", diff --git a/x/evm/types/permissions_test.go b/x/evm/types/permissions_test.go index 7f0a2e59..05b7b788 100644 --- a/x/evm/types/permissions_test.go +++ b/x/evm/types/permissions_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/ethereum/go-ethereum/common" + testconstants "github.com/evmos/os/testutil/constants" testkeyring "github.com/evmos/os/testutil/integration/os/keyring" "github.com/evmos/os/x/evm/types" "github.com/stretchr/testify/suite" @@ -35,7 +36,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should allow call and create with default accessControl", getAccessControl: func() types.AccessControl { - return types.DefaultAccessControl + return types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl }, canCall: true, canCreate: true, @@ -46,7 +47,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should not allow call and create with nobody accessControl", getAccessControl: func() types.AccessControl { - p := types.DefaultAccessControl + p := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl p.Create.AccessType = types.AccessTypeRestricted p.Call.AccessType = types.AccessTypeRestricted return p @@ -60,7 +61,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should not allow call with permissionless policy and signer in AccessControlList", getAccessControl: func() types.AccessControl { - p := types.DefaultAccessControl + p := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl p.Call.AccessType = types.AccessTypePermissionless p.Call.AccessControlList = []string{keyring.GetAddr(0).String()} return p @@ -74,7 +75,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should not allow call with permissionless policy and signer not in AccessControlList", getAccessControl: func() types.AccessControl { - p := types.DefaultAccessControl + p := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl p.Call.AccessType = types.AccessTypePermissionless p.Call.AccessControlList = []string{keyring.GetAddr(0).String()} return p @@ -88,7 +89,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should allow call with permissionless policy while caller nor signer are in AccessControlList", getAccessControl: func() types.AccessControl { - p := types.DefaultAccessControl + p := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl p.Call.AccessType = types.AccessTypePermissionless p.Call.AccessControlList = []string{keyring.GetAddr(0).String()} return p @@ -102,7 +103,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should allow call with permissionless policy and caller not in AccessControlList", getAccessControl: func() types.AccessControl { - p := types.DefaultAccessControl + p := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl p.Call.AccessType = types.AccessTypePermissionless p.Call.AccessControlList = []string{keyring.GetAddr(1).String()} return p @@ -116,7 +117,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should not allow create with permissionless policy and signer in AccessControlList", getAccessControl: func() types.AccessControl { - p := types.DefaultAccessControl + p := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl p.Create.AccessType = types.AccessTypePermissionless p.Create.AccessControlList = []string{keyring.GetAddr(0).String()} return p @@ -130,7 +131,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should not allow create with permissionless policy and signer not in AccessControlList", getAccessControl: func() types.AccessControl { - p := types.DefaultAccessControl + p := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl p.Create.AccessType = types.AccessTypePermissionless p.Create.AccessControlList = []string{keyring.GetAddr(0).String()} return p @@ -144,7 +145,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should allow create with permissionless policy while caller nor signer are in AccessControlList", getAccessControl: func() types.AccessControl { - p := types.DefaultAccessControl + p := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl p.Create.AccessType = types.AccessTypePermissionless p.Create.AccessControlList = []string{keyring.GetAddr(0).String()} return p @@ -158,7 +159,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should allow create with permissionless policy and caller not in AccessControlList", getAccessControl: func() types.AccessControl { - p := types.DefaultAccessControl + p := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl p.Create.AccessType = types.AccessTypePermissionless p.Create.AccessControlList = []string{keyring.GetAddr(1).String()} return p @@ -172,7 +173,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should not allow call with permissioned policy and not in AccessControlList", getAccessControl: func() types.AccessControl { - p := types.DefaultAccessControl + p := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl p.Call.AccessType = types.AccessTypePermissioned p.Call.AccessControlList = []string{keyring.GetAddr(1).String()} return p @@ -186,7 +187,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should not allow create with permissioned policy and not in AccessControlList", getAccessControl: func() types.AccessControl { - p := types.DefaultAccessControl + p := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl p.Create.AccessType = types.AccessTypePermissioned p.Create.AccessControlList = []string{keyring.GetAddr(1).String()} return p @@ -200,7 +201,7 @@ func (suite *UnitTestSuite) TestAccessControl() { { name: "should allow call and create with permissioned policy and address in AccessControlList", getAccessControl: func() types.AccessControl { - p := types.DefaultAccessControl + p := types.DefaultParamsWithEVMDenom(testconstants.ExampleAttoDenom).AccessControl p.Create.AccessType = types.AccessTypePermissioned p.Create.AccessControlList = []string{keyring.GetAddr(0).String()} p.Call.AccessType = types.AccessTypePermissioned diff --git a/x/evm/types/query.pb.go b/x/evm/types/query.pb.go index 739bfd0e..3daa5776 100644 --- a/x/evm/types/query.pb.go +++ b/x/evm/types/query.pb.go @@ -9,6 +9,7 @@ import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -1333,98 +1334,99 @@ func init() { func init() { proto.RegisterFile("os/evm/v1/query.proto", fileDescriptor_03991b98eceb9743) } var fileDescriptor_03991b98eceb9743 = []byte{ - // 1443 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xc6, 0x4e, 0xec, 0x3c, 0x27, 0x6d, 0x3a, 0x49, 0x5a, 0xc7, 0x4d, 0xec, 0x74, 0x69, - 0x48, 0x94, 0xd2, 0x5d, 0x92, 0x22, 0xa4, 0x22, 0x24, 0x54, 0x47, 0x6d, 0x29, 0x6d, 0x51, 0x31, - 0x11, 0x07, 0x24, 0x64, 0x8d, 0xd7, 0xd3, 0xb5, 0x15, 0x7b, 0xc7, 0xdd, 0x19, 0x5b, 0x0e, 0x55, - 0x2f, 0x3d, 0x20, 0x10, 0x97, 0x4a, 0xdc, 0x38, 0xf5, 0xc0, 0x77, 0xe0, 0x2b, 0xf4, 0x58, 0x89, - 0x0b, 0xe2, 0x50, 0x50, 0xc3, 0x81, 0x5b, 0xef, 0x9c, 0xd0, 0xfc, 0x59, 0xef, 0xac, 0xed, 0x24, - 0x2a, 0x7f, 0x6e, 0x9c, 0x76, 0xe7, 0xcd, 0x9b, 0xf7, 0xfb, 0xbd, 0x79, 0x6f, 0xde, 0x7b, 0xb0, - 0x44, 0x99, 0x4b, 0x7a, 0x6d, 0xb7, 0xb7, 0xed, 0x3e, 0xe8, 0x92, 0xf0, 0xc0, 0xe9, 0x84, 0x94, - 0x53, 0x34, 0x43, 0x99, 0x43, 0x7a, 0x6d, 0xa7, 0xb7, 0x5d, 0xd8, 0xf2, 0x28, 0x6b, 0x53, 0xe6, - 0xd6, 0x30, 0x23, 0x4a, 0xc7, 0xed, 0x6d, 0xd7, 0x08, 0xc7, 0xdb, 0x6e, 0x07, 0xfb, 0xcd, 0x00, - 0xf3, 0x26, 0x0d, 0xd4, 0xb1, 0xc2, 0xa2, 0x4f, 0x7d, 0x2a, 0x7f, 0x5d, 0xf1, 0xa7, 0xa5, 0x2b, - 0x3e, 0xa5, 0x7e, 0x8b, 0xb8, 0xb8, 0xd3, 0x74, 0x71, 0x10, 0x50, 0x2e, 0x8f, 0x30, 0xbd, 0x5b, - 0xd2, 0xbb, 0x72, 0x55, 0xeb, 0xde, 0x77, 0x79, 0xb3, 0x4d, 0x18, 0xc7, 0xed, 0x8e, 0x56, 0x58, - 0x88, 0x29, 0x0a, 0x4a, 0x4a, 0x88, 0x62, 0x21, 0xef, 0x2b, 0x99, 0x7d, 0x15, 0x16, 0x3e, 0x11, - 0xfc, 0xae, 0x79, 0x1e, 0xed, 0x06, 0xbc, 0x42, 0x1e, 0x74, 0x09, 0xe3, 0x28, 0x0f, 0x19, 0x5c, - 0xaf, 0x87, 0x84, 0xb1, 0xbc, 0xb5, 0x66, 0x6d, 0xce, 0x54, 0xa2, 0xe5, 0x7b, 0xd9, 0xaf, 0x9f, - 0x96, 0x26, 0xfe, 0x78, 0x5a, 0x9a, 0xb0, 0x3d, 0x58, 0x4c, 0x1e, 0x65, 0x1d, 0x1a, 0x30, 0x22, - 0xce, 0xd6, 0x70, 0x0b, 0x07, 0x1e, 0x89, 0xce, 0xea, 0x25, 0x3a, 0x0f, 0x33, 0x1e, 0xad, 0x93, - 0x6a, 0x03, 0xb3, 0x46, 0x7e, 0x52, 0xee, 0x65, 0x85, 0xe0, 0x43, 0xcc, 0x1a, 0x68, 0x11, 0xa6, - 0x02, 0x2a, 0x0e, 0xa5, 0xd6, 0xac, 0xcd, 0x74, 0x45, 0x2d, 0xec, 0x0f, 0x60, 0x59, 0x82, 0xec, - 0xca, 0x0b, 0xfd, 0x1b, 0x2c, 0xbf, 0xb2, 0xa0, 0x30, 0xce, 0x82, 0x26, 0xbb, 0x0e, 0xa7, 0x54, - 0xac, 0xaa, 0x49, 0x4b, 0x73, 0x4a, 0x7a, 0x4d, 0x09, 0x51, 0x01, 0xb2, 0x4c, 0x80, 0x0a, 0x7e, - 0x93, 0x92, 0xdf, 0x60, 0x2d, 0x4c, 0x60, 0x65, 0xb5, 0x1a, 0x74, 0xdb, 0x35, 0x12, 0x6a, 0x0f, - 0xe6, 0xb4, 0xf4, 0x63, 0x29, 0xb4, 0x6f, 0xc3, 0x8a, 0xe4, 0xf1, 0x19, 0x6e, 0x35, 0xeb, 0x98, - 0xd3, 0x70, 0xc8, 0x99, 0x0b, 0x30, 0xeb, 0xd1, 0x60, 0x98, 0x47, 0x4e, 0xc8, 0xae, 0x8d, 0x78, - 0xf5, 0xad, 0x05, 0xab, 0x47, 0x58, 0xd3, 0x8e, 0x6d, 0xc0, 0xe9, 0x88, 0x55, 0xd2, 0x62, 0x44, - 0xf6, 0x5f, 0x74, 0x2d, 0x4a, 0xa2, 0xb2, 0x8a, 0xf3, 0xeb, 0x84, 0xe7, 0x6d, 0x9d, 0x44, 0x83, - 0xa3, 0x27, 0x25, 0x91, 0x7d, 0x5b, 0x83, 0x7d, 0xca, 0x69, 0x88, 0xfd, 0x93, 0xc1, 0xd0, 0x3c, - 0xa4, 0xf6, 0xc9, 0x81, 0xce, 0x37, 0xf1, 0x6b, 0xc0, 0xbf, 0xa5, 0xe1, 0x07, 0xc6, 0x34, 0xfc, - 0x22, 0x4c, 0xf5, 0x70, 0xab, 0x1b, 0x81, 0xab, 0x85, 0xfd, 0x2e, 0xcc, 0xeb, 0x54, 0xaa, 0xbf, - 0x96, 0x93, 0x1b, 0x70, 0xc6, 0x38, 0xa7, 0x21, 0x10, 0xa4, 0x45, 0xee, 0xcb, 0x53, 0xb3, 0x15, - 0xf9, 0x6f, 0x7f, 0x09, 0x48, 0x2a, 0xee, 0xf5, 0xef, 0x50, 0x9f, 0x45, 0x10, 0x08, 0xd2, 0xf2, - 0xc5, 0x28, 0xfb, 0xf2, 0x1f, 0xdd, 0x00, 0x88, 0x2b, 0x89, 0xf4, 0x2d, 0xb7, 0xf3, 0xa6, 0xa3, - 0x92, 0xd6, 0x11, 0x65, 0xc7, 0x51, 0xa5, 0x49, 0x97, 0x1d, 0xe7, 0x5e, 0x7c, 0x55, 0x15, 0xe3, - 0xa4, 0x41, 0xf2, 0xb1, 0xa5, 0x2f, 0x36, 0x02, 0xd7, 0x3c, 0x6d, 0x48, 0xb7, 0xa8, 0x2f, 0xbc, - 0x4b, 0x6d, 0xe6, 0x76, 0x4e, 0x39, 0x83, 0x2a, 0xe7, 0xdc, 0xa1, 0x7e, 0x45, 0xee, 0xa1, 0x9b, - 0x63, 0xd8, 0x6c, 0x9c, 0xc8, 0x46, 0x01, 0x98, 0x74, 0xec, 0x45, 0x7d, 0x01, 0xf7, 0x70, 0x88, - 0xdb, 0xd1, 0x05, 0xd8, 0x37, 0x34, 0xb3, 0x48, 0xaa, 0x99, 0xb9, 0x30, 0xdd, 0x91, 0x12, 0x79, - 0x33, 0xb9, 0x9d, 0x33, 0x06, 0x37, 0xa5, 0x5a, 0x4e, 0x3f, 0x7b, 0x51, 0x9a, 0xa8, 0x68, 0x35, - 0xfb, 0x47, 0x0b, 0x4e, 0x5d, 0xe7, 0x8d, 0x5d, 0xdc, 0x6a, 0x19, 0x77, 0x8b, 0x43, 0x9f, 0x45, - 0x51, 0x10, 0xff, 0xe8, 0x1c, 0x64, 0x7c, 0xcc, 0xaa, 0x1e, 0xee, 0xe8, 0x07, 0x31, 0xed, 0x63, - 0xb6, 0x8b, 0x3b, 0xe8, 0x0b, 0x98, 0xef, 0x84, 0xb4, 0x43, 0x19, 0x09, 0x07, 0x8f, 0x4a, 0x3c, - 0x88, 0xd9, 0xf2, 0xce, 0x9f, 0x2f, 0x4a, 0x8e, 0xdf, 0xe4, 0x8d, 0x6e, 0xcd, 0xf1, 0x68, 0xdb, - 0xd5, 0xf5, 0x5f, 0x7d, 0x2e, 0xb3, 0xfa, 0xbe, 0xcb, 0x0f, 0x3a, 0x84, 0x39, 0xbb, 0xf1, 0x6b, - 0xae, 0x9c, 0x8e, 0x6c, 0x45, 0x2f, 0x71, 0x19, 0xb2, 0x5e, 0x03, 0x37, 0x83, 0x6a, 0xb3, 0x9e, - 0x4f, 0xaf, 0x59, 0x9b, 0xa9, 0x4a, 0x46, 0xae, 0x6f, 0xd5, 0xed, 0x0d, 0x58, 0xb8, 0xce, 0x78, - 0xb3, 0x8d, 0x39, 0xb9, 0x89, 0xe3, 0x1b, 0x98, 0x87, 0x94, 0x8f, 0x15, 0xf9, 0x74, 0x45, 0xfc, - 0xda, 0xaf, 0x52, 0x51, 0x14, 0x43, 0xec, 0x91, 0xbd, 0x7e, 0xe4, 0xe7, 0x16, 0xa4, 0xda, 0xcc, - 0xd7, 0x17, 0x95, 0x37, 0x2e, 0xea, 0x2e, 0xf3, 0xaf, 0xf3, 0x06, 0x09, 0x49, 0xb7, 0xbd, 0xd7, - 0xaf, 0x08, 0x25, 0x74, 0x15, 0x66, 0xb9, 0x38, 0x5d, 0xf5, 0x68, 0x70, 0xbf, 0xe9, 0x4b, 0x17, - 0x73, 0x3b, 0x67, 0x8d, 0x43, 0xd2, 0xf8, 0xae, 0xdc, 0xad, 0xe4, 0x78, 0xbc, 0x40, 0xef, 0xc3, - 0x6c, 0x27, 0x24, 0x75, 0xe2, 0x11, 0xc6, 0x68, 0xc8, 0xf2, 0x69, 0x99, 0x34, 0x47, 0xe3, 0x25, - 0xb4, 0x45, 0x09, 0xac, 0xb5, 0xa8, 0xb7, 0x1f, 0x15, 0x9b, 0x29, 0x79, 0x09, 0x39, 0x29, 0x53, - 0xa5, 0x06, 0xad, 0x02, 0x28, 0x15, 0xf9, 0x22, 0xa6, 0xe5, 0x8b, 0x98, 0x91, 0x12, 0xd9, 0x44, - 0x76, 0xa3, 0x6d, 0xd1, 0x10, 0xf3, 0x19, 0x49, 0xbc, 0xe0, 0xa8, 0x6e, 0xe9, 0x44, 0xdd, 0xd2, - 0xd9, 0x8b, 0xba, 0x65, 0x39, 0x2b, 0xf2, 0xe3, 0xc9, 0xaf, 0x25, 0x4b, 0x1b, 0x11, 0x3b, 0x63, - 0xc3, 0x9c, 0xfd, 0x6f, 0xc2, 0x3c, 0x93, 0x08, 0x33, 0xb2, 0x61, 0x4e, 0xd1, 0x6f, 0xe3, 0x7e, - 0x55, 0x44, 0x16, 0x8c, 0x1b, 0xb8, 0x8b, 0xfb, 0x37, 0x31, 0xfb, 0x28, 0x9d, 0x9d, 0x9c, 0x4f, - 0x55, 0xb2, 0xbc, 0x5f, 0x6d, 0x06, 0x75, 0xd2, 0xb7, 0xb7, 0x74, 0x09, 0x1b, 0x04, 0x3c, 0xae, - 0x2f, 0x75, 0xcc, 0x71, 0x94, 0xd9, 0xe2, 0xdf, 0xfe, 0x21, 0x05, 0x67, 0x63, 0xe5, 0xb2, 0xb0, - 0x6a, 0x24, 0x08, 0xef, 0x47, 0xaf, 0xfc, 0x98, 0x04, 0xe1, 0x7d, 0xf6, 0x4f, 0x12, 0xe4, 0xff, - 0x10, 0x9f, 0x1c, 0x62, 0xfb, 0x32, 0x9c, 0x1b, 0x89, 0xd2, 0x31, 0x51, 0x5d, 0x1a, 0xb4, 0x5f, - 0x46, 0x6e, 0x90, 0xa8, 0xcc, 0xdb, 0x77, 0x06, 0xad, 0x55, 0x8b, 0xb5, 0x89, 0x77, 0x20, 0x2b, - 0x4a, 0x72, 0xf5, 0x3e, 0xd1, 0xed, 0xad, 0xbc, 0xfc, 0xcb, 0x8b, 0xd2, 0x92, 0xf2, 0x90, 0xd5, - 0xf7, 0x9d, 0x26, 0x75, 0xdb, 0x98, 0x37, 0x9c, 0x5b, 0x01, 0x17, 0x6d, 0x57, 0x9e, 0xde, 0x79, - 0x05, 0x30, 0x25, 0xcd, 0xa1, 0x0e, 0x64, 0xf4, 0xb0, 0x81, 0x8a, 0x46, 0xc8, 0xc7, 0x8c, 0x91, - 0x85, 0xd2, 0x91, 0xfb, 0x8a, 0x8b, 0x7d, 0xf1, 0xf1, 0x4f, 0xbf, 0x7f, 0x37, 0x59, 0x44, 0x2b, - 0x6e, 0x3c, 0x9b, 0xea, 0xd9, 0xc2, 0x7d, 0xa8, 0x03, 0xf3, 0x08, 0x7d, 0x63, 0xc1, 0x5c, 0x62, - 0x7c, 0x43, 0x17, 0x87, 0x0d, 0x8f, 0x9b, 0x0f, 0x0b, 0xeb, 0x27, 0x68, 0x69, 0x12, 0x97, 0x24, - 0x89, 0x75, 0xf4, 0x86, 0x41, 0x22, 0x1a, 0x0a, 0x47, 0xb8, 0x7c, 0x6f, 0xc1, 0xfc, 0xf0, 0xd0, - 0x85, 0x36, 0x86, 0x81, 0x8e, 0x18, 0xf2, 0x0a, 0x9b, 0x27, 0x2b, 0x6a, 0x52, 0x57, 0x24, 0xa9, - 0xcb, 0xe8, 0x92, 0x41, 0xaa, 0x17, 0x29, 0xc7, 0xbc, 0xcc, 0x91, 0xf1, 0x11, 0x7a, 0x00, 0x19, - 0x3d, 0x48, 0x8d, 0x86, 0x26, 0x39, 0x9c, 0x8d, 0x86, 0x66, 0x68, 0x02, 0xb3, 0xd7, 0x25, 0x81, - 0x12, 0x5a, 0x35, 0x08, 0xe8, 0x19, 0x8c, 0x19, 0xf7, 0xd1, 0x83, 0x8c, 0x1e, 0x9e, 0x46, 0x21, - 0x93, 0x23, 0xda, 0x28, 0xe4, 0xd0, 0xd4, 0x65, 0x6f, 0x49, 0xc8, 0x8b, 0xc8, 0x36, 0x20, 0x99, - 0xd2, 0x89, 0x11, 0xdd, 0x87, 0xfb, 0xe4, 0xe0, 0x11, 0x22, 0x90, 0x16, 0xe3, 0x14, 0x3a, 0x3f, - 0x1a, 0xe3, 0xc1, 0x70, 0x56, 0x58, 0x19, 0xbf, 0xa9, 0xe1, 0x6c, 0x09, 0xb7, 0x82, 0x0a, 0x89, - 0xb8, 0xd7, 0x13, 0xee, 0xd5, 0x60, 0x5a, 0x8d, 0x12, 0x68, 0x75, 0xd8, 0x56, 0x62, 0x46, 0x29, - 0x14, 0x8f, 0xda, 0xd6, 0x60, 0xcb, 0x12, 0x6c, 0x01, 0x9d, 0x31, 0xc0, 0xd4, 0x58, 0x82, 0x3c, - 0xc8, 0xe8, 0xa9, 0x04, 0x2d, 0x1b, 0x56, 0x92, 0x93, 0x4a, 0x61, 0xed, 0xc8, 0x9a, 0x1c, 0x41, - 0x9c, 0x97, 0x10, 0x4b, 0x68, 0xc1, 0x80, 0x20, 0xbc, 0x51, 0xf5, 0x84, 0xe5, 0x26, 0xe4, 0x8c, - 0x09, 0xe2, 0x38, 0x20, 0xd3, 0x93, 0x31, 0x43, 0x87, 0x5d, 0x92, 0x30, 0xcb, 0xe8, 0x9c, 0x09, - 0xa3, 0xf5, 0x44, 0x45, 0x43, 0x3e, 0x64, 0x74, 0x33, 0x1a, 0x4d, 0x89, 0xe4, 0x58, 0x32, 0x9a, - 0x12, 0x43, 0x5d, 0x6c, 0xac, 0x4f, 0xaa, 0xf7, 0xf0, 0x3e, 0x62, 0x00, 0x71, 0x89, 0x44, 0x17, - 0xc6, 0xda, 0x32, 0x9b, 0x5c, 0xc1, 0x3e, 0x4e, 0x45, 0x23, 0x16, 0x25, 0x62, 0x1e, 0x9d, 0x1d, - 0x41, 0x94, 0x25, 0x5a, 0x78, 0xa7, 0x2b, 0xea, 0xb8, 0x37, 0x66, 0x56, 0xe0, 0x71, 0x6f, 0x2c, - 0x51, 0x8a, 0xc7, 0x7a, 0x17, 0xd5, 0xe6, 0xf2, 0xd5, 0x67, 0x2f, 0x8b, 0xd6, 0xf3, 0x97, 0x45, - 0xeb, 0xb7, 0x97, 0x45, 0xeb, 0xc9, 0x61, 0x71, 0xe2, 0xf9, 0x61, 0x71, 0xe2, 0xe7, 0xc3, 0xe2, - 0xc4, 0xe7, 0x25, 0xa3, 0x3f, 0x91, 0x9e, 0x68, 0x4f, 0x94, 0xb9, 0x7d, 0x69, 0x40, 0x36, 0xa7, - 0xda, 0xb4, 0xec, 0x83, 0x57, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x85, 0x39, 0x51, 0x95, 0xaa, - 0x10, 0x00, 0x00, + // 1461 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xc6, 0x4e, 0xec, 0x3c, 0x27, 0x6d, 0x3a, 0x4d, 0x53, 0xc7, 0x4d, 0xec, 0x64, 0x45, + 0x6a, 0x2b, 0xa2, 0xbb, 0x4d, 0x40, 0x95, 0x8a, 0x90, 0x50, 0x1d, 0xf5, 0x8b, 0xb6, 0xa8, 0x98, + 0x88, 0x03, 0x12, 0xb2, 0xc6, 0xeb, 0xc9, 0xda, 0xc4, 0xbb, 0xe3, 0xee, 0x8c, 0x2d, 0x87, 0xaa, + 0x97, 0x1e, 0x10, 0x12, 0x1c, 0x2a, 0xf5, 0x8c, 0xd4, 0x23, 0xdc, 0xb8, 0xf1, 0x2f, 0xf4, 0x58, + 0x89, 0x0b, 0xe2, 0x50, 0x50, 0x8b, 0x04, 0x7f, 0x00, 0x27, 0x4e, 0x68, 0x3e, 0xd6, 0xde, 0xf5, + 0x47, 0x42, 0xf9, 0xb8, 0x71, 0xb1, 0x77, 0xde, 0xbc, 0x79, 0xbf, 0xdf, 0x9b, 0xf7, 0xe6, 0xbd, + 0x07, 0x67, 0x28, 0xb3, 0x49, 0xd7, 0xb3, 0xbb, 0xdb, 0xf6, 0xbd, 0x0e, 0x09, 0x0e, 0xad, 0x76, + 0x40, 0x39, 0x45, 0x73, 0x94, 0x59, 0xa4, 0xeb, 0x59, 0xdd, 0xed, 0xdc, 0x29, 0xec, 0x35, 0x7d, + 0x6a, 0xcb, 0x5f, 0xb5, 0x9b, 0xdb, 0x72, 0x28, 0xf3, 0x28, 0xb3, 0x6b, 0x98, 0x11, 0x75, 0xcc, + 0xee, 0x6e, 0xd7, 0x08, 0xc7, 0xdb, 0x76, 0x1b, 0xbb, 0x4d, 0x1f, 0xf3, 0x26, 0xf5, 0xb5, 0xee, + 0x92, 0x4b, 0x5d, 0x2a, 0x3f, 0x6d, 0xf1, 0xa5, 0xa5, 0xab, 0x2e, 0xa5, 0x6e, 0x8b, 0xd8, 0xb8, + 0xdd, 0xb4, 0xb1, 0xef, 0x53, 0x2e, 0x8f, 0x30, 0xbd, 0x5b, 0xd0, 0xbb, 0x72, 0x55, 0xeb, 0xec, + 0xdb, 0xbc, 0xe9, 0x11, 0xc6, 0xb1, 0xd7, 0xd6, 0x0a, 0xa7, 0x07, 0xac, 0x05, 0x4b, 0x25, 0x44, + 0x03, 0x21, 0xef, 0x29, 0x99, 0x79, 0x19, 0x4e, 0xbf, 0x2f, 0xf8, 0x5d, 0x71, 0x1c, 0xda, 0xf1, + 0x79, 0x85, 0xdc, 0xeb, 0x10, 0xc6, 0x51, 0x16, 0x52, 0xb8, 0x5e, 0x0f, 0x08, 0x63, 0x59, 0x63, + 0xdd, 0x28, 0xcd, 0x55, 0xc2, 0xe5, 0x5b, 0xe9, 0xcf, 0x9f, 0x14, 0xa6, 0x7e, 0x7b, 0x52, 0x98, + 0x32, 0x1d, 0x58, 0x8a, 0x1f, 0x65, 0x6d, 0xea, 0x33, 0x22, 0xce, 0xd6, 0x70, 0x0b, 0xfb, 0x0e, + 0x09, 0xcf, 0xea, 0x25, 0x3a, 0x07, 0x73, 0x0e, 0xad, 0x93, 0x6a, 0x03, 0xb3, 0x46, 0x76, 0x5a, + 0xee, 0xa5, 0x85, 0xe0, 0x06, 0x66, 0x0d, 0xb4, 0x04, 0x33, 0x3e, 0x15, 0x87, 0x12, 0xeb, 0x46, + 0x29, 0x59, 0x51, 0x0b, 0xf3, 0x1d, 0x58, 0x91, 0x20, 0xbb, 0xf2, 0x42, 0xff, 0x06, 0xcb, 0xcf, + 0x0c, 0xc8, 0x8d, 0xb3, 0xa0, 0xc9, 0x6e, 0xc2, 0x09, 0x15, 0xab, 0x6a, 0xdc, 0xd2, 0x82, 0x92, + 0x5e, 0x51, 0x42, 0x94, 0x83, 0x34, 0x13, 0xa0, 0x82, 0xdf, 0xb4, 0xe4, 0xd7, 0x5f, 0x0b, 0x13, + 0x58, 0x59, 0xad, 0xfa, 0x1d, 0xaf, 0x46, 0x02, 0xed, 0xc1, 0x82, 0x96, 0xbe, 0x27, 0x85, 0xe6, + 0x2d, 0x58, 0x95, 0x3c, 0x3e, 0xc4, 0xad, 0x66, 0x1d, 0x73, 0x1a, 0x0c, 0x39, 0xb3, 0x01, 0xf3, + 0x0e, 0xf5, 0x87, 0x79, 0x64, 0x84, 0xec, 0xca, 0x88, 0x57, 0x5f, 0x18, 0xb0, 0x36, 0xc1, 0x9a, + 0x76, 0xac, 0x08, 0x27, 0x43, 0x56, 0x71, 0x8b, 0x21, 0xd9, 0x7f, 0xd1, 0xb5, 0x30, 0x89, 0xca, + 0x2a, 0xce, 0xaf, 0x12, 0x9e, 0x8b, 0x3a, 0x89, 0xfa, 0x47, 0x8f, 0x4b, 0x22, 0xf3, 0x96, 0x06, + 0xfb, 0x80, 0xd3, 0x00, 0xbb, 0xc7, 0x83, 0xa1, 0x45, 0x48, 0x1c, 0x90, 0x43, 0x9d, 0x6f, 0xe2, + 0x33, 0x02, 0xff, 0xba, 0x86, 0xef, 0x1b, 0xd3, 0xf0, 0x4b, 0x30, 0xd3, 0xc5, 0xad, 0x4e, 0x08, + 0xae, 0x16, 0xe6, 0x25, 0x58, 0xd4, 0xa9, 0x54, 0x7f, 0x25, 0x27, 0x8b, 0x70, 0x2a, 0x72, 0x4e, + 0x43, 0x20, 0x48, 0x8a, 0xdc, 0x97, 0xa7, 0xe6, 0x2b, 0xf2, 0xdb, 0xfc, 0x14, 0x90, 0x54, 0xdc, + 0xeb, 0xdd, 0xa6, 0x2e, 0x0b, 0x21, 0x10, 0x24, 0xe5, 0x8b, 0x51, 0xf6, 0xe5, 0x37, 0xba, 0x06, + 0x30, 0xa8, 0x24, 0xd2, 0xb7, 0xcc, 0xce, 0x79, 0x4b, 0x25, 0xad, 0x25, 0xca, 0x8e, 0xa5, 0xaa, + 0x95, 0x2e, 0x3b, 0xd6, 0xdd, 0xc1, 0x55, 0x55, 0x22, 0x27, 0x23, 0x24, 0x1f, 0x1a, 0xfa, 0x62, + 0x43, 0x70, 0xcd, 0xd3, 0x84, 0x64, 0x8b, 0xba, 0xc2, 0xbb, 0x44, 0x29, 0xb3, 0x73, 0xc2, 0xea, + 0x17, 0x3e, 0xeb, 0x36, 0x75, 0x2b, 0x72, 0x0f, 0x5d, 0x1f, 0xc3, 0xa6, 0x78, 0x2c, 0x1b, 0x05, + 0x10, 0xa5, 0x63, 0x2e, 0xe9, 0x0b, 0xb8, 0x8b, 0x03, 0xec, 0x85, 0x17, 0xd0, 0x0f, 0x79, 0x28, + 0xd5, 0xcc, 0xde, 0x84, 0xd9, 0xb6, 0x94, 0xc8, 0x9b, 0xc9, 0xec, 0x9c, 0x8a, 0x70, 0x53, 0xaa, + 0xe5, 0xb9, 0xa7, 0xcf, 0x0b, 0x53, 0x5f, 0xff, 0xfa, 0xed, 0x96, 0x51, 0xd1, 0xba, 0xe6, 0x77, + 0x06, 0x9c, 0xb8, 0xca, 0x1b, 0xbb, 0xb8, 0xd5, 0x8a, 0x5c, 0x30, 0x0e, 0x5c, 0x16, 0x86, 0x42, + 0x7c, 0xa3, 0xb3, 0x90, 0x72, 0x31, 0xab, 0x3a, 0xb8, 0xad, 0x5f, 0xc5, 0xac, 0x8b, 0xd9, 0x2e, + 0x6e, 0xa3, 0x8f, 0x61, 0xb1, 0x1d, 0xd0, 0x36, 0x65, 0x24, 0xe8, 0xbf, 0x2c, 0xf1, 0x2a, 0xe6, + 0xcb, 0x3b, 0x7f, 0x3c, 0x2f, 0x58, 0x6e, 0x93, 0x37, 0x3a, 0x35, 0xcb, 0xa1, 0x9e, 0xad, 0x9b, + 0x80, 0xfa, 0xbb, 0xc0, 0xea, 0x07, 0x36, 0x3f, 0x6c, 0x13, 0x66, 0xed, 0x0e, 0x9e, 0x74, 0xe5, + 0x64, 0x68, 0x2b, 0x7c, 0x8e, 0x2b, 0x90, 0x76, 0x1a, 0xb8, 0xe9, 0x57, 0x9b, 0xf5, 0x6c, 0x72, + 0xdd, 0x28, 0x25, 0x2a, 0x29, 0xb9, 0xbe, 0x59, 0x37, 0x8b, 0x70, 0xfa, 0x2a, 0xe3, 0x4d, 0x0f, + 0x73, 0x72, 0x1d, 0x0f, 0xae, 0x61, 0x11, 0x12, 0x2e, 0x56, 0xe4, 0x93, 0x15, 0xf1, 0x69, 0xfe, + 0x9e, 0x08, 0x43, 0x19, 0x60, 0x87, 0xec, 0xf5, 0x42, 0x3f, 0xb7, 0x20, 0xe1, 0x31, 0x57, 0xdf, + 0x56, 0x36, 0x72, 0x5b, 0x77, 0x98, 0x7b, 0x95, 0x37, 0x48, 0x40, 0x3a, 0xde, 0x5e, 0xaf, 0x22, + 0x94, 0xd0, 0x65, 0x98, 0xe7, 0xe2, 0x74, 0xd5, 0xa1, 0xfe, 0x7e, 0xd3, 0x95, 0x2e, 0x66, 0x76, + 0x96, 0x23, 0x87, 0xa4, 0xf1, 0x5d, 0xb9, 0x5b, 0xc9, 0xf0, 0xc1, 0x02, 0xbd, 0x0d, 0xf3, 0xed, + 0x80, 0xd4, 0x89, 0x43, 0x18, 0xa3, 0x01, 0xcb, 0x26, 0x65, 0xe6, 0x4c, 0xc6, 0x8b, 0x69, 0x8b, + 0x3a, 0x58, 0x6b, 0x51, 0xe7, 0x20, 0xac, 0x38, 0x33, 0xf2, 0x12, 0x32, 0x52, 0xa6, 0xea, 0x0d, + 0x5a, 0x03, 0x50, 0x2a, 0xf2, 0x59, 0xcc, 0xca, 0x67, 0x31, 0x27, 0x25, 0xb2, 0x93, 0xdc, 0x08, + 0xb7, 0x45, 0x57, 0xcc, 0xa6, 0x24, 0xf1, 0x9c, 0xa5, 0x5a, 0xa6, 0x15, 0xb6, 0x4c, 0x6b, 0x2f, + 0x6c, 0x99, 0xe5, 0x05, 0x91, 0x24, 0x8f, 0x7e, 0x2a, 0x18, 0x2a, 0x51, 0x94, 0x25, 0xb1, 0x3d, + 0x36, 0xd6, 0xe9, 0xff, 0x26, 0xd6, 0x73, 0xb1, 0x58, 0x23, 0x13, 0x16, 0x94, 0x0f, 0x1e, 0xee, + 0x55, 0x45, 0x78, 0x21, 0x72, 0x0d, 0x77, 0x70, 0xef, 0x3a, 0x66, 0xef, 0x26, 0xd3, 0xd3, 0x8b, + 0x89, 0x4a, 0x9a, 0xf7, 0xaa, 0x4d, 0xbf, 0x4e, 0x7a, 0xe6, 0x96, 0x2e, 0x66, 0xfd, 0xa8, 0x0f, + 0x2a, 0x4d, 0x1d, 0x73, 0x1c, 0xa6, 0xb7, 0xf8, 0x36, 0xbf, 0x49, 0xc0, 0xf2, 0x40, 0xb9, 0x2c, + 0xac, 0x46, 0xb2, 0x84, 0xf7, 0xc2, 0xf7, 0x7e, 0x44, 0x96, 0xf0, 0x1e, 0xfb, 0x27, 0x59, 0xf2, + 0x7f, 0x9c, 0xff, 0x62, 0x9c, 0xcd, 0x0b, 0x70, 0x76, 0x24, 0x54, 0x47, 0x84, 0xf6, 0x4c, 0xbf, + 0x1b, 0x33, 0x72, 0x8d, 0x84, 0x55, 0xdf, 0xbc, 0xdd, 0xef, 0xb4, 0x5a, 0xdc, 0xaf, 0xa2, 0x69, + 0x51, 0xa1, 0xab, 0xfb, 0x44, 0x77, 0xbb, 0xf2, 0xca, 0x8f, 0xcf, 0x0b, 0x67, 0x94, 0x87, 0xac, + 0x7e, 0x60, 0x35, 0xa9, 0xed, 0x61, 0xde, 0xb0, 0x6e, 0xfa, 0x5c, 0x74, 0x61, 0x79, 0x7a, 0xe7, + 0x71, 0x06, 0x66, 0xa4, 0x39, 0xc4, 0x20, 0xa5, 0x67, 0x0f, 0x94, 0x8f, 0xc4, 0x7d, 0xcc, 0x54, + 0x99, 0x2b, 0x4c, 0xdc, 0x57, 0x5c, 0xcc, 0xe2, 0xc3, 0xef, 0x7f, 0x79, 0x3c, 0xbd, 0x81, 0x0a, + 0x62, 0x4e, 0x1d, 0x4c, 0xab, 0x7a, 0xda, 0xb0, 0xef, 0xeb, 0xd8, 0x3c, 0x40, 0x5f, 0x1a, 0xb0, + 0x10, 0x1b, 0xe8, 0xd0, 0x6b, 0xc3, 0xb6, 0xc7, 0x4d, 0x8c, 0xb9, 0xcd, 0x63, 0xb4, 0x34, 0x0f, + 0x4b, 0xf2, 0x28, 0xa1, 0xf3, 0x71, 0x1e, 0xe1, 0xa4, 0x38, 0x42, 0xe7, 0x2b, 0x03, 0x16, 0x87, + 0x27, 0x31, 0x54, 0x1c, 0xc6, 0x9a, 0x30, 0xf9, 0xe5, 0x4a, 0xc7, 0x2b, 0x6a, 0x5e, 0x97, 0x24, + 0xaf, 0x8b, 0xc8, 0x8a, 0xf3, 0xea, 0x86, 0xfa, 0x03, 0x6a, 0xd1, 0x51, 0xf2, 0x01, 0xe2, 0x90, + 0xd2, 0x03, 0xd6, 0x68, 0x8c, 0xe2, 0x43, 0xdb, 0x68, 0x8c, 0x86, 0x26, 0x33, 0xb3, 0x24, 0x39, + 0x98, 0x68, 0x3d, 0xce, 0x41, 0x8f, 0x67, 0x2c, 0x72, 0x2b, 0x87, 0x90, 0xd2, 0x73, 0xd5, 0x28, + 0x6a, 0x7c, 0x7a, 0x1b, 0x45, 0x1d, 0x1a, 0xc8, 0xcc, 0x0b, 0x12, 0xb5, 0x88, 0x36, 0xe3, 0xa8, + 0x4c, 0xa9, 0x0d, 0x40, 0xed, 0xfb, 0x07, 0xe4, 0xf0, 0x01, 0x6a, 0x40, 0x52, 0x0c, 0x5b, 0xe8, + 0xdc, 0x68, 0xbc, 0xfb, 0xa3, 0x5b, 0x6e, 0x75, 0xfc, 0xa6, 0x46, 0xdc, 0x94, 0x88, 0x05, 0xb4, + 0x36, 0x9c, 0x03, 0xf5, 0x98, 0x93, 0x04, 0x66, 0xd5, 0xac, 0x81, 0xd6, 0x86, 0xcd, 0xc5, 0x86, + 0x98, 0x5c, 0x7e, 0xd2, 0xb6, 0xc6, 0x5b, 0x95, 0x78, 0xcb, 0x68, 0x29, 0x8e, 0xa7, 0xa6, 0x16, + 0xb4, 0x0f, 0x29, 0x3d, 0xb4, 0xa0, 0x95, 0x88, 0xa1, 0xf8, 0x20, 0x93, 0x5b, 0x9f, 0x58, 0xad, + 0x43, 0x94, 0xbc, 0x44, 0xc9, 0xa2, 0xe5, 0x38, 0x0a, 0xe1, 0x8d, 0xaa, 0x23, 0x8c, 0xb7, 0x20, + 0x13, 0x99, 0x31, 0x8e, 0xc2, 0x8a, 0xfa, 0x33, 0x66, 0x2c, 0x31, 0x4d, 0x89, 0xb4, 0x8a, 0x72, + 0x43, 0x48, 0x5a, 0x55, 0x14, 0x3b, 0xf4, 0x09, 0xa4, 0x74, 0xb3, 0x1a, 0xcd, 0x90, 0xf8, 0xec, + 0x32, 0x9a, 0x21, 0x43, 0x5d, 0x6e, 0x92, 0x67, 0xaa, 0x3d, 0xf1, 0x1e, 0xea, 0x02, 0x0c, 0x0a, + 0x28, 0xda, 0x18, 0x6b, 0x2e, 0xda, 0x07, 0x73, 0xe6, 0x51, 0x2a, 0x1a, 0x74, 0x43, 0x82, 0x9e, + 0x43, 0x2b, 0xe3, 0x40, 0x65, 0x0d, 0x17, 0x3e, 0xea, 0x92, 0x3b, 0xee, 0xed, 0x45, 0x4b, 0xf4, + 0xb8, 0xb7, 0x17, 0xab, 0xd5, 0x93, 0x7c, 0x0c, 0xeb, 0x77, 0xf9, 0xf2, 0xd3, 0x17, 0x79, 0xe3, + 0xd9, 0x8b, 0xbc, 0xf1, 0xf3, 0x8b, 0xbc, 0xf1, 0xe8, 0x65, 0x7e, 0xea, 0xd9, 0xcb, 0xfc, 0xd4, + 0x0f, 0x2f, 0xf3, 0x53, 0x1f, 0x15, 0x22, 0x3d, 0x4c, 0x9d, 0xa5, 0xcc, 0xee, 0x49, 0x03, 0xb2, + 0x81, 0xd5, 0x66, 0x65, 0xc3, 0x7c, 0xe3, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x54, 0xb4, 0xfd, + 0x17, 0xf0, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/evm/types/query.pb.gw.go b/x/evm/types/query.pb.gw.go index d557ab15..71f00259 100644 --- a/x/evm/types/query.pb.gw.go +++ b/x/evm/types/query.pb.gw.go @@ -1126,29 +1126,29 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Account_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"os", "evm", "v1", "account", "address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Account_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"evmos", "evm", "v1", "account", "address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_CosmosAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"os", "evm", "v1", "cosmos_account", "address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_CosmosAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"evmos", "evm", "v1", "cosmos_account", "address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ValidatorAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"os", "evm", "v1", "validator_account", "cons_address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ValidatorAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"evmos", "evm", "v1", "validator_account", "cons_address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Balance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"os", "evm", "v1", "balances", "address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Balance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"evmos", "evm", "v1", "balances", "address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Storage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"os", "evm", "v1", "storage", "address", "key"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Storage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"evmos", "evm", "v1", "storage", "address", "key"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Code_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"os", "evm", "v1", "codes", "address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Code_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"evmos", "evm", "v1", "codes", "address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"os", "evm", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"evmos", "evm", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_EthCall_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"os", "evm", "v1", "eth_call"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_EthCall_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"evmos", "evm", "v1", "eth_call"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_EstimateGas_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"os", "evm", "v1", "estimate_gas"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_EstimateGas_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"evmos", "evm", "v1", "estimate_gas"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_TraceTx_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"os", "evm", "v1", "trace_tx"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_TraceTx_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"evmos", "evm", "v1", "trace_tx"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_TraceBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"os", "evm", "v1", "trace_block"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_TraceBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"evmos", "evm", "v1", "trace_block"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_BaseFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"os", "evm", "v1", "base_fee"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_BaseFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"evmos", "evm", "v1", "base_fee"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/evm/types/tx.pb.go b/x/evm/types/tx.pb.go index 96a01dcf..0e1d271b 100644 --- a/x/evm/types/tx.pb.go +++ b/x/evm/types/tx.pb.go @@ -11,6 +11,7 @@ import ( _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -454,67 +455,71 @@ func init() { func init() { proto.RegisterFile("os/evm/v1/tx.proto", fileDescriptor_ee118b465a09a876) } var fileDescriptor_ee118b465a09a876 = []byte{ - // 947 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x31, 0x8c, 0xe3, 0x44, - 0x14, 0x8d, 0x13, 0x27, 0x71, 0x26, 0x61, 0x81, 0x61, 0xef, 0xce, 0x89, 0x50, 0x1c, 0x99, 0x26, - 0x42, 0x5a, 0x5b, 0xb7, 0x48, 0x48, 0xbb, 0xdd, 0xe6, 0x76, 0x0f, 0x1d, 0xca, 0xc2, 0xc9, 0xe4, - 0x1a, 0x9a, 0x68, 0xd6, 0x9e, 0x9d, 0x58, 0xc4, 0x1e, 0xcb, 0x33, 0xb1, 0x12, 0xca, 0xab, 0x10, - 0x0d, 0x20, 0x6a, 0x24, 0x6a, 0x2a, 0x8a, 0x93, 0x28, 0x69, 0x4f, 0x54, 0x27, 0x68, 0x10, 0x45, - 0x40, 0x59, 0x24, 0xa4, 0x2d, 0x91, 0xe8, 0xd1, 0xcc, 0x38, 0x9b, 0x84, 0x53, 0x16, 0x58, 0x21, - 0xba, 0xf9, 0xf3, 0xfe, 0xff, 0xf3, 0xe6, 0x3d, 0xfb, 0x0f, 0x80, 0x94, 0xb9, 0x38, 0x8b, 0xdc, - 0xec, 0xae, 0xcb, 0xa7, 0x4e, 0x92, 0x52, 0x4e, 0x61, 0x8d, 0x32, 0x07, 0x67, 0x91, 0x93, 0xdd, - 0x6d, 0xdd, 0xf1, 0x29, 0x8b, 0x28, 0x73, 0x23, 0x46, 0x44, 0x4a, 0xc4, 0x88, 0xca, 0x69, 0x35, - 0x15, 0x30, 0x94, 0x91, 0xab, 0x82, 0x1c, 0xda, 0x25, 0x94, 0x50, 0xb5, 0x2f, 0x56, 0xf9, 0xee, - 0xab, 0x84, 0x52, 0x32, 0xc6, 0x2e, 0x4a, 0x42, 0x17, 0xc5, 0x31, 0xe5, 0x88, 0x87, 0x34, 0x5e, - 0xd6, 0x34, 0x73, 0x54, 0x46, 0x67, 0x93, 0x73, 0x17, 0xc5, 0xb3, 0x1c, 0x7a, 0x65, 0xc5, 0x50, - 0x90, 0x92, 0x9b, 0xf6, 0x27, 0x1a, 0x78, 0xe1, 0x94, 0x91, 0x13, 0x3e, 0xc2, 0x29, 0x9e, 0x44, - 0x83, 0x29, 0xec, 0x02, 0x3d, 0x40, 0x1c, 0x99, 0x5a, 0x47, 0xeb, 0xd6, 0xf7, 0x77, 0x1d, 0xd5, - 0xd0, 0x59, 0x36, 0x74, 0x8e, 0xe2, 0x99, 0x27, 0x33, 0x60, 0x13, 0xe8, 0x2c, 0xfc, 0x10, 0x9b, - 0xc5, 0x8e, 0xd6, 0xd5, 0x7a, 0xe5, 0xcb, 0xb9, 0xa5, 0xed, 0x79, 0x72, 0x0b, 0x5a, 0x40, 0x1f, - 0x21, 0x36, 0x32, 0x4b, 0x1d, 0xad, 0x5b, 0xeb, 0xd5, 0x7f, 0x9f, 0x5b, 0xd5, 0x74, 0x9c, 0x1c, - 0xda, 0x7b, 0xb6, 0x27, 0x01, 0x08, 0x81, 0x7e, 0x9e, 0xd2, 0xc8, 0xd4, 0x45, 0x82, 0x27, 0xd7, - 0x87, 0xfa, 0x47, 0x5f, 0x5a, 0x05, 0xfb, 0xb3, 0x22, 0x30, 0xfa, 0x98, 0x20, 0x7f, 0x36, 0x98, - 0xc2, 0x5d, 0x50, 0x8e, 0x69, 0xec, 0x63, 0xc9, 0x46, 0xf7, 0x54, 0x00, 0xdf, 0x04, 0x35, 0x82, - 0x84, 0x64, 0xa1, 0xaf, 0x4e, 0xaf, 0xf5, 0x9a, 0x3f, 0xcd, 0xad, 0x5b, 0x4a, 0x3d, 0x16, 0x7c, - 0xe0, 0x84, 0xd4, 0x8d, 0x10, 0x1f, 0x39, 0x0f, 0x62, 0xee, 0x19, 0x04, 0xb1, 0x87, 0x22, 0x15, - 0xb6, 0x41, 0x89, 0x20, 0x26, 0x49, 0xe9, 0xbd, 0xc6, 0x62, 0x6e, 0x19, 0x6f, 0x21, 0xd6, 0x0f, - 0xa3, 0x90, 0x7b, 0x02, 0x80, 0x3b, 0xa0, 0xc8, 0x69, 0x4e, 0xa9, 0xc8, 0x29, 0x3c, 0x00, 0xe5, - 0x0c, 0x8d, 0x27, 0xd8, 0x2c, 0xcb, 0x33, 0x5e, 0xdb, 0x7a, 0xc6, 0x62, 0x6e, 0x55, 0x8e, 0x22, - 0x3a, 0x89, 0xb9, 0xa7, 0x2a, 0xc4, 0xfd, 0xa4, 0x8a, 0x95, 0x8e, 0xd6, 0x6d, 0xe4, 0x7a, 0x35, - 0x80, 0x96, 0x99, 0x55, 0xb9, 0xa1, 0x65, 0x22, 0x4a, 0x4d, 0x43, 0x45, 0xa9, 0x88, 0x98, 0x59, - 0x53, 0x11, 0x3b, 0xdc, 0x11, 0x4a, 0x7c, 0xf7, 0x64, 0xaf, 0x32, 0x98, 0x1e, 0x23, 0x8e, 0xec, - 0x6f, 0x4a, 0xa0, 0x71, 0xe4, 0xfb, 0x98, 0xb1, 0x7e, 0xc8, 0xf8, 0x60, 0x0a, 0xdf, 0x06, 0x86, - 0x3f, 0x42, 0x61, 0x3c, 0x0c, 0x03, 0x29, 0x4d, 0xad, 0xe7, 0x5e, 0x47, 0xae, 0x7a, 0x4f, 0x24, - 0x3f, 0x38, 0xbe, 0x9c, 0x5b, 0x55, 0x5f, 0x2d, 0xbd, 0x7c, 0x11, 0xac, 0x34, 0x2e, 0x6e, 0xd5, - 0xb8, 0xf4, 0xaf, 0x35, 0xd6, 0xaf, 0xd7, 0xb8, 0xfc, 0xbc, 0xc6, 0x95, 0x1b, 0x6b, 0x5c, 0x5d, - 0xd3, 0x78, 0x00, 0x0c, 0x24, 0x85, 0xc2, 0xcc, 0x34, 0x3a, 0xa5, 0x6e, 0x7d, 0xff, 0xb6, 0x73, - 0xf5, 0x17, 0x3a, 0x4a, 0xc3, 0xc1, 0x24, 0x19, 0xe3, 0x5e, 0xe7, 0xe9, 0xdc, 0x2a, 0x5c, 0xce, - 0x2d, 0x80, 0xae, 0x84, 0xfd, 0xea, 0x67, 0x0b, 0xac, 0x64, 0xf6, 0xae, 0x3a, 0x29, 0xe7, 0x6a, - 0x1b, 0xce, 0x81, 0x0d, 0xe7, 0xea, 0xdb, 0x9c, 0xfb, 0xa3, 0x04, 0x1a, 0xc7, 0xb3, 0x18, 0x45, - 0xa1, 0x7f, 0x1f, 0xe3, 0xff, 0xc5, 0xb9, 0x03, 0x50, 0x17, 0xce, 0xf1, 0x30, 0x19, 0xfa, 0x28, - 0xf9, 0x7b, 0xef, 0x84, 0xcf, 0x83, 0x30, 0xb9, 0x87, 0x92, 0x65, 0xe9, 0x39, 0xc6, 0xb2, 0x54, - 0xff, 0x27, 0xa5, 0xf7, 0x31, 0x16, 0xa5, 0xb9, 0xef, 0xe5, 0xeb, 0x7d, 0xaf, 0x3c, 0xef, 0x7b, - 0xf5, 0xc6, 0xbe, 0x1b, 0x5b, 0x7c, 0xaf, 0xfd, 0xb7, 0xbe, 0x83, 0x0d, 0xdf, 0xeb, 0x1b, 0xbe, - 0x37, 0xb6, 0xf9, 0x6e, 0x83, 0xd6, 0xc9, 0x94, 0xe3, 0x98, 0x85, 0x34, 0x7e, 0x37, 0x91, 0x13, - 0x7a, 0x35, 0x63, 0xf3, 0x49, 0xf7, 0x85, 0x06, 0x6e, 0x6d, 0xcc, 0x5e, 0x0f, 0xb3, 0x84, 0xc6, - 0x4c, 0xde, 0x50, 0x8e, 0x4f, 0x4d, 0x4d, 0x47, 0x39, 0x31, 0x6d, 0xa0, 0x8f, 0x29, 0x61, 0x66, - 0x51, 0xde, 0x6e, 0x67, 0xed, 0x76, 0x7d, 0x4a, 0x3c, 0x89, 0xc1, 0x97, 0x40, 0x29, 0xc5, 0x5c, - 0x5a, 0xde, 0xf0, 0xc4, 0x12, 0x36, 0x81, 0x91, 0x45, 0x43, 0x9c, 0xa6, 0x34, 0xcd, 0x07, 0x5b, - 0x35, 0x8b, 0x4e, 0x44, 0x28, 0x20, 0x61, 0xf6, 0x84, 0xe1, 0x40, 0xd9, 0xe6, 0x55, 0x09, 0x62, - 0x8f, 0x18, 0x0e, 0x72, 0x7e, 0x1f, 0x6b, 0xe0, 0xc5, 0x53, 0x46, 0x1e, 0x25, 0x01, 0xe2, 0xf8, - 0x21, 0x4a, 0x51, 0xc4, 0xc4, 0x58, 0x40, 0x13, 0x3e, 0xa2, 0x69, 0xc8, 0x67, 0xf9, 0xf7, 0x6b, - 0x7e, 0xff, 0x64, 0x6f, 0x37, 0x7f, 0xb8, 0x8e, 0x82, 0x20, 0xc5, 0x8c, 0xbd, 0xc7, 0xd3, 0x30, - 0x26, 0xde, 0x2a, 0x15, 0xba, 0xa0, 0x92, 0xc8, 0x0e, 0xf2, 0x5b, 0xad, 0xef, 0xbf, 0xbc, 0xc6, - 0x5f, 0xb5, 0xee, 0xe9, 0xc2, 0x18, 0x2f, 0x4f, 0x3b, 0xdc, 0x79, 0xfc, 0xdb, 0xd7, 0xaf, 0xaf, - 0x1a, 0xd8, 0x4d, 0x70, 0xe7, 0x2f, 0x5c, 0x96, 0x6a, 0xed, 0x7f, 0xab, 0x81, 0xd2, 0x29, 0x23, - 0x70, 0x04, 0xc0, 0xda, 0x3b, 0x66, 0xae, 0x9d, 0xb0, 0xa1, 0x72, 0xab, 0xb3, 0x0d, 0x59, 0x76, - 0xb4, 0xdb, 0x8f, 0x7f, 0xf8, 0xf5, 0xf3, 0xa2, 0x69, 0xdf, 0x76, 0xd7, 0xde, 0xcc, 0x3c, 0x6d, - 0xc8, 0xa7, 0xf0, 0x1d, 0xd0, 0xd8, 0x50, 0xa5, 0xb5, 0xd9, 0x71, 0x1d, 0x6b, 0xd9, 0xdb, 0xb1, - 0xe5, 0x79, 0xbd, 0x83, 0xa7, 0x8b, 0xb6, 0xf6, 0x6c, 0xd1, 0xd6, 0x7e, 0x59, 0xb4, 0xb5, 0x4f, - 0x2f, 0xda, 0x85, 0x67, 0x17, 0xed, 0xc2, 0x8f, 0x17, 0xed, 0xc2, 0xfb, 0x16, 0x09, 0xf9, 0x68, - 0x72, 0xe6, 0xf8, 0x34, 0x12, 0x44, 0x28, 0x13, 0x8c, 0xa6, 0x92, 0x13, 0x9f, 0x25, 0x98, 0x9d, - 0x55, 0xe4, 0xc3, 0xfc, 0xc6, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8e, 0xc8, 0xc7, 0x6d, 0x80, - 0x08, 0x00, 0x00, + // 1020 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xda, 0xeb, 0x5f, 0x63, 0xd3, 0xa6, 0x4b, 0xda, 0xae, 0x2d, 0xb4, 0x6b, 0x2d, 0x20, + 0x59, 0x41, 0xd9, 0x55, 0x03, 0x42, 0x4a, 0x6e, 0x71, 0x93, 0xa2, 0xa2, 0x04, 0xaa, 0xc5, 0x3d, + 0xc0, 0xc5, 0x9a, 0xac, 0x27, 0xeb, 0x15, 0xde, 0x9d, 0xd5, 0xbe, 0xb1, 0x65, 0x73, 0x42, 0x3d, + 0x21, 0x0e, 0x08, 0x89, 0x33, 0x12, 0xdc, 0x10, 0x42, 0x28, 0x87, 0xfe, 0x0d, 0xa8, 0xe2, 0x14, + 0xc1, 0x05, 0x71, 0x30, 0xc8, 0x41, 0x8a, 0x94, 0x23, 0x7f, 0x01, 0x9a, 0x99, 0x75, 0x6c, 0x37, + 0x72, 0x0a, 0x95, 0xe8, 0x25, 0x9a, 0x37, 0xef, 0xcd, 0xdb, 0x6f, 0xbe, 0xef, 0xcb, 0x1b, 0x23, + 0x8d, 0x82, 0x43, 0x06, 0xa1, 0x33, 0xb8, 0xe3, 0xb0, 0xa1, 0x1d, 0x27, 0x94, 0x51, 0xad, 0x44, + 0xc1, 0x26, 0x83, 0xd0, 0x1e, 0xdc, 0xa9, 0xdd, 0xc0, 0x61, 0x10, 0x51, 0x47, 0xfc, 0x95, 0xd9, + 0xda, 0x6d, 0x8f, 0x42, 0x48, 0xc1, 0x09, 0xc1, 0xe7, 0xa7, 0x42, 0xf0, 0xd3, 0x44, 0x55, 0x26, + 0xda, 0x22, 0x72, 0x64, 0x90, 0xa6, 0xd6, 0x7c, 0xea, 0x53, 0xb9, 0xcf, 0x57, 0xe9, 0xee, 0x2b, + 0x3e, 0xa5, 0x7e, 0x8f, 0x38, 0x38, 0x0e, 0x1c, 0x1c, 0x45, 0x94, 0x61, 0x16, 0xd0, 0x68, 0x7a, + 0xa6, 0x9a, 0x66, 0x45, 0x74, 0xd8, 0x3f, 0x72, 0x70, 0x34, 0x4a, 0x53, 0x2f, 0xcf, 0x40, 0x73, + 0x9c, 0x62, 0xd3, 0xfa, 0x51, 0x41, 0x2f, 0x1d, 0x80, 0xbf, 0xc7, 0xba, 0x24, 0x21, 0xfd, 0xb0, + 0x35, 0xd4, 0x1a, 0x48, 0xed, 0x60, 0x86, 0x75, 0xa5, 0xae, 0x34, 0xca, 0x9b, 0x6b, 0xb6, 0x6c, + 0x68, 0x4f, 0x1b, 0xda, 0x3b, 0xd1, 0xc8, 0x15, 0x15, 0x9a, 0x81, 0x54, 0x08, 0x3e, 0x21, 0x7a, + 0xa6, 0xae, 0x34, 0x94, 0x26, 0x3a, 0x1f, 0x9b, 0xca, 0xc6, 0x77, 0x67, 0xc7, 0xeb, 0x8a, 0x2b, + 0xf6, 0xb5, 0xd7, 0x90, 0xda, 0xc5, 0xd0, 0xd5, 0xb3, 0x75, 0xa5, 0x51, 0x6a, 0xae, 0xfe, 0x3d, + 0x36, 0x0b, 0x49, 0x2f, 0xde, 0xb6, 0x36, 0xac, 0xb4, 0x8a, 0x67, 0x35, 0x0d, 0xa9, 0x47, 0x09, + 0x0d, 0x75, 0x95, 0x57, 0xb9, 0x62, 0xbd, 0x5d, 0xfd, 0xec, 0x1b, 0x73, 0xe5, 0xf3, 0xb3, 0xe3, + 0xf5, 0x55, 0x0a, 0xce, 0x02, 0x3c, 0xeb, 0xdb, 0x0c, 0x2a, 0xee, 0x13, 0x1f, 0x7b, 0xa3, 0xd6, + 0x50, 0x5b, 0x43, 0xb9, 0x88, 0x46, 0x1e, 0x11, 0x60, 0x55, 0x57, 0x06, 0xda, 0xdb, 0xa8, 0xe4, + 0x63, 0xce, 0x68, 0xe0, 0x49, 0x70, 0xa5, 0x66, 0xf5, 0xf7, 0xb1, 0x79, 0x53, 0x92, 0x0b, 0x9d, + 0x8f, 0xed, 0x80, 0x3a, 0x21, 0x66, 0x5d, 0xfb, 0x7e, 0xc4, 0xdc, 0xa2, 0x8f, 0xe1, 0x01, 0x2f, + 0xd5, 0x0c, 0x94, 0xf5, 0x31, 0x08, 0xb8, 0x6a, 0xb3, 0x32, 0x19, 0x9b, 0xc5, 0x77, 0x30, 0xec, + 0x07, 0x61, 0xc0, 0x5c, 0x9e, 0xd0, 0xae, 0xa1, 0x0c, 0xa3, 0x29, 0xce, 0x0c, 0xa3, 0xda, 0x16, + 0xca, 0x0d, 0x70, 0xaf, 0x4f, 0xf4, 0x9c, 0xf8, 0xc6, 0xab, 0x4b, 0xbf, 0x31, 0x19, 0x9b, 0xf9, + 0x9d, 0x90, 0xf6, 0x23, 0xe6, 0xca, 0x13, 0xfc, 0xd2, 0x82, 0xe4, 0x7c, 0x5d, 0x69, 0x54, 0x52, + 0x3a, 0x2b, 0x48, 0x19, 0xe8, 0x05, 0xb1, 0xa1, 0x0c, 0x78, 0x94, 0xe8, 0x45, 0x19, 0x25, 0x3c, + 0x02, 0xbd, 0x24, 0x23, 0xd8, 0x36, 0x38, 0x3d, 0x3f, 0x3f, 0xde, 0xc8, 0xb7, 0x86, 0xbb, 0x98, + 0x61, 0x4e, 0x54, 0x99, 0x82, 0x33, 0xa5, 0xc5, 0x3a, 0xc9, 0xa2, 0xca, 0x8e, 0xe7, 0x11, 0x80, + 0xfd, 0x00, 0x58, 0x6b, 0xa8, 0xbd, 0x8b, 0x8a, 0x5e, 0x17, 0x07, 0x51, 0x3b, 0xe8, 0x08, 0xaa, + 0x4a, 0x4d, 0xe7, 0x2a, 0xb0, 0x85, 0xbb, 0xbc, 0xf8, 0xfe, 0xee, 0xf9, 0xd8, 0x2c, 0x78, 0x72, + 0xe9, 0xa6, 0x8b, 0xce, 0x8c, 0xf3, 0xcc, 0x52, 0xce, 0xb3, 0xff, 0x99, 0x73, 0xf5, 0x6a, 0xce, + 0x73, 0x97, 0x39, 0xcf, 0x3f, 0x37, 0xe7, 0x85, 0x39, 0xce, 0x3f, 0x44, 0x45, 0x2c, 0x88, 0x22, + 0xa0, 0x17, 0xeb, 0xd9, 0x46, 0x79, 0xf3, 0x96, 0x7d, 0xf1, 0x7f, 0x6c, 0x4b, 0x0e, 0x5b, 0xfd, + 0xb8, 0x47, 0x9a, 0xaf, 0x3f, 0x19, 0x9b, 0x2b, 0xe7, 0x63, 0x13, 0xe1, 0x0b, 0x62, 0xbf, 0xff, + 0xc3, 0x44, 0x33, 0x9a, 0xa5, 0xa7, 0x2f, 0xda, 0x49, 0x39, 0x4b, 0x0b, 0x72, 0xa2, 0x05, 0x39, + 0xcb, 0x53, 0x39, 0xad, 0xcb, 0x72, 0x5e, 0xa7, 0xe0, 0xcc, 0x2b, 0x68, 0x7d, 0xa1, 0xa2, 0xca, + 0xee, 0x28, 0xc2, 0x61, 0xe0, 0xdd, 0x23, 0xe4, 0x85, 0x48, 0xba, 0x85, 0xca, 0x5c, 0x52, 0x16, + 0xc4, 0x6d, 0x0f, 0xc7, 0xcf, 0x16, 0x95, 0x1b, 0xa0, 0x15, 0xc4, 0x77, 0x71, 0x3c, 0x3d, 0x7a, + 0x44, 0x88, 0x38, 0xaa, 0xfe, 0x9b, 0xa3, 0xf7, 0x08, 0xe1, 0x47, 0x53, 0x43, 0xe4, 0xae, 0x36, + 0x44, 0xfe, 0xb2, 0x21, 0x0a, 0xcf, 0x6d, 0x88, 0xe2, 0x12, 0x43, 0x94, 0xfe, 0x07, 0x43, 0xa0, + 0x05, 0x43, 0x94, 0x17, 0x0c, 0x51, 0x79, 0x86, 0x21, 0xe6, 0xf5, 0xb7, 0x2c, 0x54, 0xdb, 0x1b, + 0x32, 0x12, 0x41, 0x40, 0xa3, 0xf7, 0x63, 0xf1, 0x04, 0xcc, 0xa6, 0xe4, 0xb6, 0xca, 0x3b, 0x58, + 0x5f, 0x2b, 0xe8, 0xe6, 0xc2, 0xf4, 0x74, 0x09, 0xc4, 0x34, 0x02, 0x71, 0x75, 0x31, 0x9a, 0x15, + 0x39, 0x74, 0xc5, 0x20, 0xb6, 0x90, 0xda, 0xa3, 0x3e, 0xe8, 0x19, 0x71, 0xed, 0x6b, 0x73, 0xd7, + 0xde, 0xa7, 0xbe, 0x2b, 0x72, 0xda, 0x2a, 0xca, 0x26, 0x84, 0x09, 0x2f, 0x54, 0x5c, 0xbe, 0xd4, + 0xaa, 0xa8, 0x38, 0x08, 0xdb, 0x24, 0x49, 0x68, 0x92, 0x8e, 0xc6, 0xc2, 0x20, 0xdc, 0xe3, 0x21, + 0x4f, 0x71, 0x17, 0xf4, 0x81, 0x74, 0xa4, 0x9e, 0x6e, 0xc1, 0xc7, 0xf0, 0x10, 0x48, 0x27, 0xc5, + 0xf7, 0x83, 0x82, 0xae, 0x1f, 0x80, 0xff, 0x30, 0xee, 0x60, 0x46, 0x1e, 0xe0, 0x04, 0x87, 0xc0, + 0x07, 0x09, 0xee, 0xb3, 0x2e, 0x4d, 0x02, 0x36, 0x4a, 0x8d, 0xad, 0xff, 0xf2, 0x78, 0x63, 0x2d, + 0x7d, 0x19, 0x77, 0x3a, 0x9d, 0x84, 0x00, 0x7c, 0xc0, 0x92, 0x20, 0xf2, 0xdd, 0x59, 0xa9, 0xf6, + 0x16, 0xca, 0xc7, 0xa2, 0x83, 0x30, 0x71, 0x79, 0xf3, 0xc6, 0x1c, 0x7e, 0xd9, 0xba, 0x59, 0xe2, + 0x8a, 0x49, 0x55, 0xd2, 0xda, 0xed, 0x37, 0x1e, 0x9d, 0x1d, 0xaf, 0xcf, 0xba, 0x70, 0xa6, 0x75, + 0x0a, 0xce, 0x50, 0x3c, 0x94, 0x4f, 0x41, 0xb3, 0xaa, 0xe8, 0xf6, 0x53, 0x5b, 0x53, 0x3e, 0x37, + 0x7f, 0x52, 0x50, 0xf6, 0x00, 0x7c, 0xad, 0x8b, 0xd0, 0xdc, 0x53, 0xaa, 0xcf, 0x61, 0x58, 0xd0, + 0xa1, 0x56, 0x5f, 0x96, 0x99, 0x76, 0xb4, 0x8c, 0x47, 0xbf, 0xfe, 0xf5, 0x55, 0x46, 0xb7, 0x6e, + 0x39, 0x73, 0xcf, 0x76, 0x5a, 0xd6, 0x66, 0x43, 0xed, 0x3d, 0x54, 0x59, 0xe0, 0xad, 0xb6, 0xd8, + 0x71, 0x3e, 0x57, 0xb3, 0x96, 0xe7, 0xa6, 0xdf, 0xab, 0xe5, 0x3e, 0xe5, 0xc4, 0x34, 0xb7, 0x9e, + 0x4c, 0x0c, 0xe5, 0x64, 0x62, 0x28, 0x7f, 0x4e, 0x0c, 0xe5, 0xcb, 0x53, 0x63, 0xe5, 0xe4, 0xd4, + 0x58, 0xf9, 0xed, 0xd4, 0x58, 0xf9, 0xc8, 0xf4, 0x03, 0xd6, 0xed, 0x1f, 0xda, 0x1e, 0x0d, 0x39, + 0x1e, 0x0a, 0xce, 0x05, 0x51, 0x6c, 0x14, 0x13, 0x38, 0xcc, 0x8b, 0x9f, 0x08, 0x6f, 0xfe, 0x13, + 0x00, 0x00, 0xff, 0xff, 0xfb, 0xfe, 0x2b, 0xe7, 0x1d, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/evm/types/tx_data.go b/x/evm/types/tx_data.go index 2f3ae6f2..05c7622b 100644 --- a/x/evm/types/tx_data.go +++ b/x/evm/types/tx_data.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package types import ( @@ -69,49 +70,6 @@ func NewTxDataFromTx(tx *ethtypes.Transaction) (TxData, error) { return txData, nil } -// DeriveChainID derives the chain id from the given v parameter. -// -// CONTRACT: v value is either: -// -// - {0,1} + CHAIN_ID * 2 + 35, if EIP155 is used -// - {0,1} + 27, otherwise -// -// Ref: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md -func DeriveChainID(v *big.Int) *big.Int { - if v == nil || v.Sign() < 1 { - return nil - } - - if v.BitLen() <= 64 { - v := v.Uint64() - if v == 27 || v == 28 { - return new(big.Int) - } - - if v < 35 { - return nil - } - - // V MUST be of the form {0,1} + CHAIN_ID * 2 + 35 - return new(big.Int).SetUint64((v - 35) / 2) - } - v = new(big.Int).Sub(v, big.NewInt(35)) - return v.Div(v, big.NewInt(2)) -} - -func rawSignatureValues(vBz, rBz, sBz []byte) (v, r, s *big.Int) { - if len(vBz) > 0 { - v = new(big.Int).SetBytes(vBz) - } - if len(rBz) > 0 { - r = new(big.Int).SetBytes(rBz) - } - if len(sBz) > 0 { - s = new(big.Int).SetBytes(sBz) - } - return v, r, s -} - func fee(gasPrice *big.Int, gas uint64) *big.Int { gasLimit := new(big.Int).SetUint64(gas) return new(big.Int).Mul(gasPrice, gasLimit) diff --git a/x/evm/types/tx_data_test.go b/x/evm/types/tx_data_test.go index 7d2db408..1c68472e 100644 --- a/x/evm/types/tx_data_test.go +++ b/x/evm/types/tx_data_test.go @@ -5,6 +5,7 @@ import ( "testing" sdkmath "cosmossdk.io/math" + ethutils "github.com/evmos/os/utils/eth" "github.com/stretchr/testify/require" ) @@ -83,7 +84,7 @@ func TestTxData_DeriveChainID(t *testing.T) { for _, tc := range testCases { v, _, _ := tc.data.GetRawSignatureValues() - chainID := DeriveChainID(v) + chainID := ethutils.DeriveChainID(v) require.Equal(t, tc.expChainID, chainID, tc.msg) } } diff --git a/x/evm/types/utils_test.go b/x/evm/types/utils_test.go index 55bc37de..8c3c9fbb 100644 --- a/x/evm/types/utils_test.go +++ b/x/evm/types/utils_test.go @@ -9,12 +9,15 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - proto "github.com/cosmos/gogoproto/proto" + "github.com/ethereum/go-ethereum/common" + + proto "github.com/cosmos/gogoproto/proto" + "github.com/evmos/os/encoding" - exampleapp "github.com/evmos/os/example_chain" utiltx "github.com/evmos/os/testutil/tx" evmtypes "github.com/evmos/os/x/evm/types" + "github.com/stretchr/testify/require" ) @@ -49,7 +52,7 @@ func TestUnwrapEthererumMsg(t *testing.T) { _, err := evmtypes.UnwrapEthereumMsg(nil, common.Hash{}) require.NotNil(t, err) - encodingConfig := encoding.MakeConfig(exampleapp.ModuleBasics) + encodingConfig := encoding.MakeConfig() clientCtx := client.Context{}.WithTxConfig(encodingConfig.TxConfig) builder, _ := clientCtx.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder) diff --git a/x/feemarket/client/cli/query.go b/x/feemarket/client/cli/query.go index b6a62539..0779b035 100644 --- a/x/feemarket/client/cli/query.go +++ b/x/feemarket/client/cli/query.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package cli import ( diff --git a/x/feemarket/keeper/abci.go b/x/feemarket/keeper/abci.go index 1db8d273..cbf1537c 100644 --- a/x/feemarket/keeper/abci.go +++ b/x/feemarket/keeper/abci.go @@ -1,25 +1,25 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package keeper import ( + "errors" "fmt" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/evmos/os/x/feemarket/types" - "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/evmos/os/x/feemarket/types" ) // BeginBlock updates base fee -func (k *Keeper) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { +func (k *Keeper) BeginBlock(ctx sdk.Context) error { baseFee := k.CalculateBaseFee(ctx) // return immediately if base fee is nil if baseFee == nil { - return + return nil } k.SetBaseFee(ctx, baseFee) @@ -35,28 +35,33 @@ func (k *Keeper) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { sdk.NewAttribute(types.AttributeKeyBaseFee, baseFee.String()), ), }) + + return nil } // EndBlock update block gas wanted. // The EVM end block logic doesn't update the validator set, thus it returns // an empty slice. -func (k *Keeper) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) { +func (k *Keeper) EndBlock(ctx sdk.Context) error { if ctx.BlockGasMeter() == nil { - k.Logger(ctx).Error("block gas meter is nil when setting block gas wanted") - return + err := errors.New("block gas meter is nil when setting block gas wanted") + k.Logger(ctx).Error(err.Error()) + return err } gasWanted := math.NewIntFromUint64(k.GetTransientGasWanted(ctx)) gasUsed := math.NewIntFromUint64(ctx.BlockGasMeter().GasConsumedToLimit()) if !gasWanted.IsInt64() { - k.Logger(ctx).Error("integer overflow by integer type conversion. Gas wanted > MaxInt64", "gas wanted", gasWanted.String()) - return + err := fmt.Errorf("integer overflow by integer type conversion. Gas wanted > MaxInt64. Gas wanted: %s", gasWanted) + k.Logger(ctx).Error(err.Error()) + return err } if !gasUsed.IsInt64() { - k.Logger(ctx).Error("integer overflow by integer type conversion. Gas used > MaxInt64", "gas used", gasUsed.String()) - return + err := fmt.Errorf("integer overflow by integer type conversion. Gas used > MaxInt64. Gas used: %s", gasUsed) + k.Logger(ctx).Error(err.Error()) + return err } // to prevent BaseFee manipulation we limit the gasWanted so that @@ -77,4 +82,6 @@ func (k *Keeper) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) { sdk.NewAttribute("height", fmt.Sprintf("%d", ctx.BlockHeight())), sdk.NewAttribute("amount", fmt.Sprintf("%d", updatedGasWanted)), )) + + return nil } diff --git a/x/feemarket/keeper/abci_test.go b/x/feemarket/keeper/abci_test.go index ae338c93..73e05205 100644 --- a/x/feemarket/keeper/abci_test.go +++ b/x/feemarket/keeper/abci_test.go @@ -1,13 +1,20 @@ package keeper_test import ( - "fmt" + "testing" - "github.com/cometbft/cometbft/abci/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/evmos/os/testutil/integration/os/network" + "github.com/stretchr/testify/require" ) -func (suite *KeeperTestSuite) TestEndBlock() { +func TestEndBlock(t *testing.T) { + var ( + nw *network.UnitTestNetwork + ctx sdk.Context + ) + testCases := []struct { name string NoBaseFee bool @@ -25,24 +32,31 @@ func (suite *KeeperTestSuite) TestEndBlock() { false, func() { meter := storetypes.NewGasMeter(uint64(1000000000)) - suite.ctx = suite.ctx.WithBlockGasMeter(meter) - suite.app.FeeMarketKeeper.SetTransientBlockGasWanted(suite.ctx, 5000000) + ctx = ctx.WithBlockGasMeter(meter) + nw.App.FeeMarketKeeper.SetTransientBlockGasWanted(ctx, 5000000) }, uint64(2500000), }, } for _, tc := range testCases { - suite.Run(fmt.Sprintf("Case %s", tc.name), func() { - suite.SetupTest() // reset - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) + t.Run(tc.name, func(t *testing.T) { + // reset network and context + nw = network.NewUnitTestNetwork() + ctx = nw.GetContext() + + params := nw.App.FeeMarketKeeper.GetParams(ctx) params.NoBaseFee = tc.NoBaseFee - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) - suite.Require().NoError(err) + + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) + require.NoError(t, err) tc.malleate() - suite.app.FeeMarketKeeper.EndBlock(suite.ctx, types.RequestEndBlock{Height: 1}) - gasWanted := suite.app.FeeMarketKeeper.GetBlockGasWanted(suite.ctx) - suite.Require().Equal(tc.expGasWanted, gasWanted, tc.name) + + err = nw.App.FeeMarketKeeper.EndBlock(ctx) + require.NoError(t, err) + + gasWanted := nw.App.FeeMarketKeeper.GetBlockGasWanted(ctx) + require.Equal(t, tc.expGasWanted, gasWanted, tc.name) }) } } diff --git a/x/feemarket/keeper/eip1559.go b/x/feemarket/keeper/eip1559.go index 6b738b52..b2f67c45 100644 --- a/x/feemarket/keeper/eip1559.go +++ b/x/feemarket/keeper/eip1559.go @@ -46,7 +46,7 @@ func (k Keeper) CalculateBaseFee(ctx sdk.Context) *big.Int { gasLimit := new(big.Int).SetUint64(math.MaxUint64) // NOTE: a MaxGas equal to -1 means that block gas is unlimited - if consParams != nil && consParams.Block != nil && consParams.Block.MaxGas > -1 { + if consParams.Block != nil && consParams.Block.MaxGas > -1 { gasLimit = big.NewInt(consParams.Block.MaxGas) } diff --git a/x/feemarket/keeper/eip1559_test.go b/x/feemarket/keeper/eip1559_test.go index 6b40450e..002a23e4 100644 --- a/x/feemarket/keeper/eip1559_test.go +++ b/x/feemarket/keeper/eip1559_test.go @@ -1,21 +1,30 @@ package keeper_test import ( - "fmt" "math/big" + "testing" "cosmossdk.io/math" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/evmos/os/testutil/integration/os/network" + "github.com/stretchr/testify/require" ) -func (suite *KeeperTestSuite) TestCalculateBaseFee() { +func TestCalculateBaseFee(t *testing.T) { + var ( + nw *network.UnitTestNetwork + ctx sdk.Context + initialBaseFee math.Int + ) + testCases := []struct { name string NoBaseFee bool blockHeight int64 parentBlockGasWanted uint64 minGasPrice math.LegacyDec - expFee *big.Int + expFee func() *big.Int }{ { "without BaseFee", @@ -31,7 +40,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { 0, 0, math.LegacyZeroDec(), - suite.app.FeeMarketKeeper.GetParams(suite.ctx).BaseFee.BigInt(), + func() *big.Int { return nw.App.FeeMarketKeeper.GetParams(ctx).BaseFee.BigInt() }, }, { "with BaseFee - parent block wanted the same gas as its target (ElasticityMultiplier = 2)", @@ -39,7 +48,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { 1, 50, math.LegacyZeroDec(), - suite.app.FeeMarketKeeper.GetParams(suite.ctx).BaseFee.BigInt(), + func() *big.Int { return nw.App.FeeMarketKeeper.GetParams(ctx).BaseFee.BigInt() }, }, { "with BaseFee - parent block wanted the same gas as its target, with higher min gas price (ElasticityMultiplier = 2)", @@ -47,7 +56,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { 1, 50, math.LegacyNewDec(1500000000), - suite.app.FeeMarketKeeper.GetParams(suite.ctx).BaseFee.BigInt(), + func() *big.Int { return nw.App.FeeMarketKeeper.GetParams(ctx).BaseFee.BigInt() }, }, { "with BaseFee - parent block wanted more gas than its target (ElasticityMultiplier = 2)", @@ -55,7 +64,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { 1, 100, math.LegacyZeroDec(), - big.NewInt(1125000000), + func() *big.Int { return initialBaseFee.Add(math.NewInt(109375000)).BigInt() }, }, { "with BaseFee - parent block wanted more gas than its target, with higher min gas price (ElasticityMultiplier = 2)", @@ -63,7 +72,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { 1, 100, math.LegacyNewDec(1500000000), - big.NewInt(1125000000), + func() *big.Int { return initialBaseFee.Add(math.NewInt(109375000)).BigInt() }, }, { "with BaseFee - Parent gas wanted smaller than parent gas target (ElasticityMultiplier = 2)", @@ -71,7 +80,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { 1, 25, math.LegacyZeroDec(), - big.NewInt(937500000), + func() *big.Int { return initialBaseFee.Sub(math.NewInt(54687500)).BigInt() }, }, { "with BaseFee - Parent gas wanted smaller than parent gas target, with higher min gas price (ElasticityMultiplier = 2)", @@ -79,24 +88,28 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { 1, 25, math.LegacyNewDec(1500000000), - big.NewInt(1500000000), + func() *big.Int { return big.NewInt(1500000000) }, }, } for _, tc := range testCases { - suite.Run(fmt.Sprintf("Case %s", tc.name), func() { - suite.SetupTest() // reset + t.Run(tc.name, func(t *testing.T) { + // reset network and context + nw = network.NewUnitTestNetwork() + ctx = nw.GetContext() - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) + params := nw.App.FeeMarketKeeper.GetParams(ctx) params.NoBaseFee = tc.NoBaseFee params.MinGasPrice = tc.minGasPrice - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) - suite.Require().NoError(err) + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) + require.NoError(t, err) + + initialBaseFee = params.BaseFee // Set block height - suite.ctx = suite.ctx.WithBlockHeight(tc.blockHeight) + ctx = ctx.WithBlockHeight(tc.blockHeight) // Set parent block gas - suite.app.FeeMarketKeeper.SetBlockGasWanted(suite.ctx, tc.parentBlockGasWanted) + nw.App.FeeMarketKeeper.SetBlockGasWanted(ctx, tc.parentBlockGasWanted) // Set next block target/gasLimit through Consensus Param MaxGas blockParams := tmproto.BlockParams{ @@ -104,13 +117,13 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { MaxBytes: 10, } consParams := tmproto.ConsensusParams{Block: &blockParams} - suite.ctx = suite.ctx.WithConsensusParams(&consParams) + ctx = ctx.WithConsensusParams(consParams) - fee := suite.app.FeeMarketKeeper.CalculateBaseFee(suite.ctx) + fee := nw.App.FeeMarketKeeper.CalculateBaseFee(ctx) if tc.NoBaseFee { - suite.Require().Nil(fee, tc.name) + require.Nil(t, fee, tc.name) } else { - suite.Require().Equal(tc.expFee, fee, tc.name) + require.Equal(t, tc.expFee(), fee, tc.name) } }) } diff --git a/x/feemarket/keeper/grpc_query_test.go b/x/feemarket/keeper/grpc_query_test.go index 6abdabb7..45b17d06 100644 --- a/x/feemarket/keeper/grpc_query_test.go +++ b/x/feemarket/keeper/grpc_query_test.go @@ -1,12 +1,21 @@ package keeper_test import ( + "testing" + sdkmath "cosmossdk.io/math" - ethparams "github.com/ethereum/go-ethereum/params" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/evmos/os/testutil/integration/os/network" "github.com/evmos/os/x/feemarket/types" + "github.com/stretchr/testify/require" ) -func (suite *KeeperTestSuite) TestQueryParams() { +func TestQueryParams(t *testing.T) { + var ( + nw *network.UnitTestNetwork + ctx sdk.Context + ) + testCases := []struct { name string expPass bool @@ -17,23 +26,33 @@ func (suite *KeeperTestSuite) TestQueryParams() { }, } for _, tc := range testCases { - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) - exp := &types.QueryParamsResponse{Params: params} + t.Run(tc.name, func(t *testing.T) { + // reset network and context + nw = network.NewUnitTestNetwork() + ctx = nw.GetContext() + qc := nw.GetFeeMarketClient() + + params := nw.App.FeeMarketKeeper.GetParams(ctx) + exp := &types.QueryParamsResponse{Params: params} - res, err := suite.queryClient.Params(suite.ctx.Context(), &types.QueryParamsRequest{}) - if tc.expPass { - suite.Require().Equal(exp, res, tc.name) - suite.Require().NoError(err) - } else { - suite.Require().Error(err) - } + res, err := qc.Params(ctx.Context(), &types.QueryParamsRequest{}) + if tc.expPass { + require.Equal(t, exp, res, tc.name) + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) } } -func (suite *KeeperTestSuite) TestQueryBaseFee() { +func TestQueryBaseFee(t *testing.T) { var ( - aux sdkmath.Int - expRes *types.QueryBaseFeeResponse + aux sdkmath.Int + expRes *types.QueryBaseFeeResponse + nw *network.UnitTestNetwork + ctx sdk.Context + initialBaseFee sdkmath.Int ) testCases := []struct { @@ -44,7 +63,6 @@ func (suite *KeeperTestSuite) TestQueryBaseFee() { { "pass - default Base Fee", func() { - initialBaseFee := sdkmath.NewInt(ethparams.InitialBaseFee) expRes = &types.QueryBaseFeeResponse{BaseFee: &initialBaseFee} }, true, @@ -53,7 +71,7 @@ func (suite *KeeperTestSuite) TestQueryBaseFee() { "pass - non-nil Base Fee", func() { baseFee := sdkmath.OneInt().BigInt() - suite.app.FeeMarketKeeper.SetBaseFee(suite.ctx, baseFee) + nw.App.FeeMarketKeeper.SetBaseFee(ctx, baseFee) aux = sdkmath.NewIntFromBigInt(baseFee) expRes = &types.QueryBaseFeeResponse{BaseFee: &aux} @@ -62,20 +80,32 @@ func (suite *KeeperTestSuite) TestQueryBaseFee() { }, } for _, tc := range testCases { - tc.malleate() + t.Run(tc.name, func(t *testing.T) { + // reset network and context + nw = network.NewUnitTestNetwork() + ctx = nw.GetContext() + qc := nw.GetFeeMarketClient() + initialBaseFee = sdkmath.NewIntFromBigInt(nw.App.FeeMarketKeeper.GetBaseFee(ctx)) - res, err := suite.queryClient.BaseFee(suite.ctx.Context(), &types.QueryBaseFeeRequest{}) - if tc.expPass { - suite.Require().NotNil(res) - suite.Require().Equal(expRes, res, tc.name) - suite.Require().NoError(err) - } else { - suite.Require().Error(err) - } + tc.malleate() + + res, err := qc.BaseFee(ctx.Context(), &types.QueryBaseFeeRequest{}) + if tc.expPass { + require.NotNil(t, res) + require.Equal(t, expRes, res, tc.name) + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) } } -func (suite *KeeperTestSuite) TestQueryBlockGas() { +func TestQueryBlockGas(t *testing.T) { + var ( + nw *network.UnitTestNetwork + ctx sdk.Context + ) testCases := []struct { name string expPass bool @@ -86,15 +116,22 @@ func (suite *KeeperTestSuite) TestQueryBlockGas() { }, } for _, tc := range testCases { - gas := suite.app.FeeMarketKeeper.GetBlockGasWanted(suite.ctx) - exp := &types.QueryBlockGasResponse{Gas: int64(gas)} //#nosec G115 -- int overflow is not a concern here -- gas is not going to exceed int64 max value + t.Run(tc.name, func(t *testing.T) { + // reset network and context + nw = network.NewUnitTestNetwork() + ctx = nw.GetContext() + qc := nw.GetFeeMarketClient() + + gas := nw.App.FeeMarketKeeper.GetBlockGasWanted(ctx) + exp := &types.QueryBlockGasResponse{Gas: int64(gas)} //#nosec G115 - res, err := suite.queryClient.BlockGas(suite.ctx.Context(), &types.QueryBlockGasRequest{}) - if tc.expPass { - suite.Require().Equal(exp, res, tc.name) - suite.Require().NoError(err) - } else { - suite.Require().Error(err) - } + res, err := qc.BlockGas(ctx.Context(), &types.QueryBlockGasRequest{}) + if tc.expPass { + require.Equal(t, exp, res, tc.name) + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) } } diff --git a/x/feemarket/keeper/integration_test.go b/x/feemarket/keeper/integration_test.go index c7da2c8f..1740c0f2 100644 --- a/x/feemarket/keeper/integration_test.go +++ b/x/feemarket/keeper/integration_test.go @@ -2,96 +2,186 @@ package keeper_test import ( "math/big" - "strings" + "testing" "cosmossdk.io/math" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/evmos/os/testutil/integration/common/factory" + testutils "github.com/evmos/os/testutil/integration/os/utils" + evmtypes "github.com/evmos/os/x/evm/types" + fmkttypes "github.com/evmos/os/x/feemarket/types" //nolint:revive // dot imports are fine for Ginkgo . "github.com/onsi/ginkgo/v2" + //nolint:revive // dot imports are fine for Ginkgo . "github.com/onsi/gomega" - - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/evmos/os/crypto/ethsecp256k1" - chainutil "github.com/evmos/os/example_chain/testutil" - "github.com/evmos/os/testutil" - utiltx "github.com/evmos/os/testutil/tx" - - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) -var chainID = testutil.ExampleChainID +type txParams struct { + gasPrice *big.Int + gasFeeCap *big.Int + gasTipCap *big.Int + accesses *ethtypes.AccessList +} +type getprices func() txParams + +func TestKeeperIntegrationTestSuite(t *testing.T) { + // Run Ginkgo integration tests + RegisterFailHandler(Fail) + RunSpecs(t, "Keeper Suite") +} var _ = Describe("Feemarket", func() { var ( - privKey *ethsecp256k1.PrivKey - msg banktypes.MsgSend + s *KeeperTestSuite + privKey cryptotypes.PrivKey ) + BeforeEach(func() { + s = new(KeeperTestSuite) + s.SetupTest() + privKey = s.keyring.GetPrivKey(0) + }) + Describe("Performing Cosmos transactions", func() { + var ( + txArgs factory.CosmosTxArgs + gasWanted uint64 = 200_000 + ) + + BeforeEach(func() { + msg := banktypes.MsgSend{ + FromAddress: s.keyring.GetAccAddr(0).String(), + ToAddress: s.keyring.GetAccAddr(1).String(), + Amount: sdk.Coins{sdk.Coin{ + Denom: s.denom, + Amount: math.NewInt(10000), + }}, + } + txArgs = factory.CosmosTxArgs{ + ChainID: s.network.GetChainID(), + Msgs: []sdk.Msg{&msg}, + Gas: &gasWanted, + } + }) + Context("with min-gas-prices (local) < MinGasPrices (feemarket param)", func() { + // minGasPrices is the feemarket MinGasPrices + const minGasPrices int64 = 15 + BeforeEach(func() { - privKey, msg = setupTestWithContext(chainID, "1", math.LegacyNewDec(3), math.ZeroInt()) + // local min-gas-prices is 10aevmos + params := fmkttypes.DefaultParams() + params.MinGasPrice = math.LegacyNewDec(minGasPrices) + params.BaseFee = math.ZeroInt() + err := testutils.UpdateFeeMarketParams( + testutils.UpdateParamsInput{ + Tf: s.factory, + Network: s.network, + Pk: privKey, + Params: params, + }, + ) + Expect(err).To(BeNil()) }) Context("during CheckTx", func() { It("should reject transactions with gasPrice < MinGasPrices", func() { - gasPrice := math.NewInt(2) - _, err := chainutil.CheckTx(s.ctx, s.app, privKey, &gasPrice, &msg) - Expect(err).ToNot(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "provided fee < minimum global fee"), - ).To(BeTrue(), err.Error()) + gasPrice := math.NewInt(minGasPrices - 3) + txArgs.GasPrice = &gasPrice + tx, err := s.factory.BuildCosmosTx(privKey, txArgs) + Expect(err).To(BeNil()) + bz, err := s.factory.EncodeTx(tx) + Expect(err).To(BeNil()) + + res, err := s.network.CheckTx(bz) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("provided fee < minimum global fee")) }) It("should accept transactions with gasPrice >= MinGasPrices", func() { - gasPrice := math.NewInt(3) - res, err := chainutil.CheckTx(s.ctx, s.app, privKey, &gasPrice, &msg) + gasPrice := math.NewInt(minGasPrices) + txArgs.GasPrice = &gasPrice + tx, err := s.factory.BuildCosmosTx(privKey, txArgs) Expect(err).To(BeNil()) - Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) + bz, err := s.factory.EncodeTx(tx) + Expect(err).To(BeNil()) + + res, err := s.network.CheckTx(bz) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeTrue(), "transaction should have succeeded", res.GetLog()) }) }) Context("during DeliverTx", func() { It("should reject transactions with gasPrice < MinGasPrices", func() { - gasPrice := math.NewInt(2) - _, err := chainutil.DeliverTx(s.ctx, s.app, privKey, &gasPrice, &msg) - Expect(err).NotTo(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "provided fee < minimum global fee"), - ).To(BeTrue(), err.Error()) + gasPrice := math.NewInt(minGasPrices - 2) + txArgs.GasPrice = &gasPrice + res, err := s.factory.ExecuteCosmosTx(privKey, txArgs) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("provided fee < minimum global fee")) }) It("should accept transactions with gasPrice >= MinGasPrices", func() { - gasPrice := math.NewInt(3) - res, err := chainutil.DeliverTx(s.ctx, s.app, privKey, &gasPrice, &msg) - s.Require().NoError(err) + gasPrice := math.NewInt(minGasPrices) + txArgs.GasPrice = &gasPrice + res, err := s.factory.ExecuteCosmosTx(privKey, txArgs) + Expect(err).To(BeNil()) Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) }) }) }) Context("with min-gas-prices (local) == MinGasPrices (feemarket param)", func() { + // minGasPrices is the feemarket MinGasPrices + const minGasPrices int64 = 10 BeforeEach(func() { - privKey, msg = setupTestWithContext(chainID, "3", math.LegacyNewDec(3), math.ZeroInt()) + // local min-gas-prices is 10aevmos + params := fmkttypes.DefaultParams() + params.MinGasPrice = math.LegacyNewDec(minGasPrices) + params.BaseFee = math.ZeroInt() + + err := testutils.UpdateFeeMarketParams( + testutils.UpdateParamsInput{ + Tf: s.factory, + Network: s.network, + Pk: privKey, + Params: params, + }, + ) + Expect(err).To(BeNil()) }) Context("during CheckTx", func() { It("should reject transactions with gasPrice < min-gas-prices", func() { - gasPrice := math.NewInt(2) - _, err := chainutil.CheckTx(s.ctx, s.app, privKey, &gasPrice, &msg) - Expect(err).ToNot(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "insufficient fee"), - ).To(BeTrue(), err.Error()) + gasPrice := math.NewInt(minGasPrices - 3) + txArgs.GasPrice = &gasPrice + tx, err := s.factory.BuildCosmosTx(privKey, txArgs) + Expect(err).To(BeNil()) + bz, err := s.factory.EncodeTx(tx) + Expect(err).To(BeNil()) + + res, err := s.network.CheckTx(bz) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("insufficient fee")) }) It("should accept transactions with gasPrice >= MinGasPrices", func() { - gasPrice := math.NewInt(3) - res, err := chainutil.CheckTx(s.ctx, s.app, privKey, &gasPrice, &msg) + gasPrice := math.NewInt(minGasPrices) + txArgs.GasPrice = &gasPrice + tx, err := s.factory.BuildCosmosTx(privKey, txArgs) + Expect(err).To(BeNil()) + bz, err := s.factory.EncodeTx(tx) + Expect(err).To(BeNil()) + + res, err := s.network.CheckTx(bz) Expect(err).To(BeNil()) Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) }) @@ -99,18 +189,18 @@ var _ = Describe("Feemarket", func() { Context("during DeliverTx", func() { It("should reject transactions with gasPrice < MinGasPrices", func() { - gasPrice := math.NewInt(2) - _, err := chainutil.DeliverTx(s.ctx, s.app, privKey, &gasPrice, &msg) - Expect(err).NotTo(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "provided fee < minimum global fee"), - ).To(BeTrue(), err.Error()) + gasPrice := math.NewInt(minGasPrices - 2) + txArgs.GasPrice = &gasPrice + res, err := s.factory.ExecuteCosmosTx(privKey, txArgs) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("provided fee < minimum global fee")) }) It("should accept transactions with gasPrice >= MinGasPrices", func() { - gasPrice := math.NewInt(3) - res, err := chainutil.DeliverTx(s.ctx, s.app, privKey, &gasPrice, &msg) + gasPrice := math.NewInt(minGasPrices) + txArgs.GasPrice = &gasPrice + res, err := s.factory.ExecuteCosmosTx(privKey, txArgs) Expect(err).To(BeNil()) Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) }) @@ -118,64 +208,92 @@ var _ = Describe("Feemarket", func() { }) Context("with MinGasPrices (feemarket param) < min-gas-prices (local)", func() { + // minGasPrices is the feemarket MinGasPrices + const minGasPrices int64 = 7 + baseFee := math.NewInt(15) + BeforeEach(func() { - privKey, msg = setupTestWithContext(chainID, "5", math.LegacyNewDec(3), math.NewInt(5)) + // local min-gas-prices is 10aevmos + params := fmkttypes.DefaultParams() + params.MinGasPrice = math.LegacyNewDec(minGasPrices) + params.BaseFee = baseFee + + err := testutils.UpdateFeeMarketParams( + testutils.UpdateParamsInput{ + Tf: s.factory, + Network: s.network, + Pk: privKey, + Params: params, + }, + ) + Expect(err).To(BeNil()) }) - //nolint Context("during CheckTx", func() { It("should reject transactions with gasPrice < MinGasPrices", func() { - gasPrice := math.NewInt(2) - _, err := chainutil.CheckTx(s.ctx, s.app, privKey, &gasPrice, &msg) - Expect(err).ToNot(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "insufficient fee"), - ).To(BeTrue(), err.Error()) + gasPrice := math.NewInt(minGasPrices - 3) + txArgs.GasPrice = &gasPrice + tx, err := s.factory.BuildCosmosTx(privKey, txArgs) + Expect(err).To(BeNil()) + bz, err := s.factory.EncodeTx(tx) + Expect(err).To(BeNil()) + + res, err := s.network.CheckTx(bz) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("insufficient fee")) }) It("should reject transactions with MinGasPrices < gasPrice < baseFee", func() { - gasPrice := math.NewInt(4) - _, err := chainutil.CheckTx(s.ctx, s.app, privKey, &gasPrice, &msg) - Expect(err).ToNot(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "insufficient fee"), - ).To(BeTrue(), err.Error()) + gasPrice := math.NewInt(minGasPrices + 1) + txArgs.GasPrice = &gasPrice + tx, err := s.factory.BuildCosmosTx(privKey, txArgs) + Expect(err).To(BeNil()) + bz, err := s.factory.EncodeTx(tx) + Expect(err).To(BeNil()) + + res, err := s.network.CheckTx(bz) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("insufficient fee")) }) It("should accept transactions with gasPrice >= baseFee", func() { - gasPrice := math.NewInt(5) - res, err := chainutil.CheckTx(s.ctx, s.app, privKey, &gasPrice, &msg) + gasPrice := baseFee + txArgs.GasPrice = &gasPrice + tx, err := s.factory.BuildCosmosTx(privKey, txArgs) + Expect(err).To(BeNil()) + bz, err := s.factory.EncodeTx(tx) + Expect(err).To(BeNil()) + + res, err := s.network.CheckTx(bz) Expect(err).To(BeNil()) Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) }) }) - //nolint Context("during DeliverTx", func() { It("should reject transactions with gasPrice < MinGasPrices", func() { - gasPrice := math.NewInt(2) - _, err := chainutil.DeliverTx(s.ctx, s.app, privKey, &gasPrice, &msg) - Expect(err).NotTo(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "provided fee < minimum global fee"), - ).To(BeTrue(), err.Error()) + gasPrice := math.NewInt(minGasPrices - 2) + txArgs.GasPrice = &gasPrice + res, err := s.factory.ExecuteCosmosTx(privKey, txArgs) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("provided fee < minimum global fee")) }) It("should reject transactions with MinGasPrices < gasPrice < baseFee", func() { - gasPrice := math.NewInt(4) - _, err := chainutil.CheckTx(s.ctx, s.app, privKey, &gasPrice, &msg) - Expect(err).ToNot(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "insufficient fee"), - ).To(BeTrue(), err.Error()) + gasPrice := math.NewInt(minGasPrices + 1) + txArgs.GasPrice = &gasPrice + res, err := s.factory.ExecuteCosmosTx(privKey, txArgs) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("insufficient fee")) }) It("should accept transactions with gasPrice >= baseFee", func() { - gasPrice := math.NewInt(5) - res, err := chainutil.DeliverTx(s.ctx, s.app, privKey, &gasPrice, &msg) + gasPrice := baseFee + txArgs.GasPrice = &gasPrice + res, err := s.factory.ExecuteCosmosTx(privKey, txArgs) Expect(err).To(BeNil()) Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) }) @@ -184,15 +302,22 @@ var _ = Describe("Feemarket", func() { }) Describe("Performing EVM transactions", func() { - type txParams struct { - gasPrice *big.Int - gasFeeCap *big.Int - gasTipCap *big.Int - accesses *ethtypes.AccessList - } - type getprices func() txParams + var ( + txArgs evmtypes.EvmTxArgs + gasWanted uint64 = 200_000 + ) + + BeforeEach(func() { + toAddr := s.keyring.GetAddr(1) + txArgs = evmtypes.EvmTxArgs{ + ChainID: s.network.GetEIP155ChainID(), + GasLimit: gasWanted, + To: &toAddr, + Amount: big.NewInt(10000), + } + }) - Context("with BaseFee (feemarket) < MinGasPrices (feemarket param)", func() { + Context("with MinGasPrices (feemarket param) < BaseFee (feemarket)", func() { var ( baseFee int64 minGasPrices int64 @@ -200,60 +325,113 @@ var _ = Describe("Feemarket", func() { BeforeEach(func() { baseFee = 10_000_000_000 - minGasPrices = baseFee + 30_000_000_000 + minGasPrices = baseFee - 5_000_000_000 + + params := fmkttypes.DefaultParams() + params.MinGasPrice = math.LegacyNewDec(minGasPrices) + params.BaseFee = math.NewInt(baseFee) // Note that the tests run the same transactions with `gasLimit = - // 100000`. With the fee calculation `Fee = (baseFee + tip) * gasLimit`, - // a `minGasPrices = 40_000_000_000` results in `minGlobalFee = - // 4000000000000000` - privKey, _ = setupTestWithContext(chainID, "1", math.LegacyNewDec(minGasPrices), math.NewInt(baseFee)) + // 200_000`. With the fee calculation `Fee = (baseFee + tip) * gasLimit`, + // a `minGasPrices = 5_000_000_000` results in `minGlobalFee = + // 1_000_000_000_000_000` + err := testutils.UpdateFeeMarketParams( + testutils.UpdateParamsInput{ + Tf: s.factory, + Network: s.network, + Pk: privKey, + Params: params, + }, + ) + Expect(err).To(BeNil()) }) Context("during CheckTx", func() { - DescribeTable("should reject transactions with EffectivePrice < MinGasPrices", + DescribeTable("should reject transactions with gasPrice < MinGasPrices", func(malleate getprices) { p := malleate() - to := utiltx.GenerateAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - _, err := chainutil.CheckEthTx(s.app, privKey, msgEthereumTx) - Expect(err).ToNot(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "provided fee < minimum global fee"), - ).To(BeTrue(), err.Error()) + + txArgs.GasPrice = p.gasPrice + txArgs.GasFeeCap = p.gasFeeCap + txArgs.GasTipCap = p.gasTipCap + txArgs.Accesses = p.accesses + + tx, err := s.factory.GenerateSignedEthTx(privKey, txArgs) + Expect(err).To(BeNil()) + + Expect(err).To(BeNil()) + bz, err := s.factory.EncodeTx(tx) + Expect(err).To(BeNil()) + + res, err := s.network.CheckTx(bz) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("provided fee < minimum global fee")) }, Entry("legacy tx", func() txParams { - return txParams{big.NewInt(minGasPrices - 10_000_000_000), nil, nil, nil} + return txParams{big.NewInt(minGasPrices - 1_000_000_000), nil, nil, nil} }), Entry("dynamic tx with GasFeeCap < MinGasPrices, no gasTipCap", func() txParams { - return txParams{nil, big.NewInt(minGasPrices - 10_000_000_000), big.NewInt(0), ðtypes.AccessList{}} + return txParams{nil, big.NewInt(minGasPrices - 1_000_000_000), big.NewInt(0), ðtypes.AccessList{}} }), Entry("dynamic tx with GasFeeCap < MinGasPrices, max gasTipCap", func() txParams { - // Note that max priority fee per gas can't be higher than the max fee per gas (gasFeeCap), i.e. 30_000_000_000) - return txParams{nil, big.NewInt(minGasPrices - 10_000_000_000), big.NewInt(30_000_000_000), ðtypes.AccessList{}} + return txParams{nil, big.NewInt(minGasPrices - 1_000_000_000), big.NewInt(minGasPrices - 1_000_000_000), ðtypes.AccessList{}} + }), + ) + + DescribeTable("should reject transactions with MinGasPrices < tx gasPrice < EffectivePrice", + func(malleate getprices) { + p := malleate() + + txArgs.GasPrice = p.gasPrice + txArgs.GasFeeCap = p.gasFeeCap + txArgs.GasTipCap = p.gasTipCap + txArgs.Accesses = p.accesses + + tx, err := s.factory.GenerateSignedEthTx(privKey, txArgs) + Expect(err).To(BeNil()) + + Expect(err).To(BeNil()) + bz, err := s.factory.EncodeTx(tx) + Expect(err).To(BeNil()) + + res, err := s.network.CheckTx(bz) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("insufficient fee")) + }, + Entry("legacy tx", func() txParams { + return txParams{big.NewInt(baseFee - 2_000_000_000), nil, nil, nil} }), - Entry("dynamic tx with GasFeeCap > MinGasPrices, EffectivePrice < MinGasPrices", func() txParams { - return txParams{nil, big.NewInt(minGasPrices + 10_000_000_000), big.NewInt(0), ðtypes.AccessList{}} + Entry("dynamic tx", func() txParams { + return txParams{nil, big.NewInt(baseFee - 2_000_000_000), big.NewInt(0), ðtypes.AccessList{}} }), ) - DescribeTable("should accept transactions with gasPrice >= MinGasPrices", + DescribeTable("should accept transactions with gasPrice >= EffectivePrice", func(malleate getprices) { p := malleate() - to := utiltx.GenerateAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - res, err := chainutil.CheckEthTx(s.app, privKey, msgEthereumTx) + txArgs.GasPrice = p.gasPrice + txArgs.GasFeeCap = p.gasFeeCap + txArgs.GasTipCap = p.gasTipCap + txArgs.Accesses = p.accesses + + tx, err := s.factory.GenerateSignedEthTx(privKey, txArgs) Expect(err).To(BeNil()) + + Expect(err).To(BeNil()) + bz, err := s.factory.EncodeTx(tx) + Expect(err).To(BeNil()) + + res, err := s.network.CheckTx(bz) + Expect(err).To(BeNil(), "transaction should have succeeded") Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) }, Entry("legacy tx", func() txParams { - return txParams{big.NewInt(minGasPrices), nil, nil, nil} + return txParams{big.NewInt(baseFee), nil, nil, nil} }), - // Note that this tx is not rejected on CheckTx, but not on DeliverTx, - // as the baseFee is set to minGasPrices during DeliverTx when baseFee - // < minGasPrices - Entry("dynamic tx with GasFeeCap > MinGasPrices, EffectivePrice > MinGasPrices", func() txParams { - return txParams{nil, big.NewInt(minGasPrices), big.NewInt(30_000_000_000), ðtypes.AccessList{}} + Entry("dynamic tx", func() txParams { + return txParams{nil, big.NewInt(baseFee), big.NewInt(0), ðtypes.AccessList{}} }), ) }) @@ -262,181 +440,239 @@ var _ = Describe("Feemarket", func() { DescribeTable("should reject transactions with gasPrice < MinGasPrices", func(malleate getprices) { p := malleate() - to := utiltx.GenerateAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - _, err := chainutil.DeliverEthTx(s.app, privKey, msgEthereumTx) - Expect(err).ToNot(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "provided fee < minimum global fee"), - ).To(BeTrue(), err.Error()) + + txArgs.GasPrice = p.gasPrice + txArgs.GasFeeCap = p.gasFeeCap + txArgs.GasTipCap = p.gasTipCap + txArgs.Accesses = p.accesses + + res, err := s.factory.ExecuteEthTx(privKey, txArgs) + Expect(err).NotTo(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("provided fee < minimum global fee")) }, Entry("legacy tx", func() txParams { - return txParams{big.NewInt(minGasPrices - 10_000_000_000), nil, nil, nil} + return txParams{big.NewInt(minGasPrices - 1_000_000_000), nil, nil, nil} }), - Entry("dynamic tx with GasFeeCap < MinGasPrices, no gasTipCap", func() txParams { - return txParams{nil, big.NewInt(minGasPrices - 10_000_000_000), big.NewInt(0), ðtypes.AccessList{}} + Entry("dynamic tx", func() txParams { + return txParams{nil, big.NewInt(minGasPrices - 1_000_000_000), nil, ðtypes.AccessList{}} }), - Entry("dynamic tx with GasFeeCap < MinGasPrices, max gasTipCap", func() txParams { - // Note that max priority fee per gas can't be higher than the max fee per gas (gasFeeCap), i.e. 30_000_000_000) - return txParams{nil, big.NewInt(minGasPrices - 10_000_000_000), big.NewInt(30_000_000_000), ðtypes.AccessList{}} + ) + + DescribeTable("should reject transactions with MinGasPrices < gasPrice < EffectivePrice", + func(malleate getprices) { + p := malleate() + + txArgs.GasPrice = p.gasPrice + txArgs.GasFeeCap = p.gasFeeCap + txArgs.GasTipCap = p.gasTipCap + txArgs.Accesses = p.accesses + + res, err := s.factory.ExecuteEthTx(privKey, txArgs) + Expect(err).NotTo(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("insufficient fee")) + }, + // Note that the baseFee is not 10_000_000_000 anymore but updates to 7_656_250_000 because of the s.Commit + Entry("legacy tx", func() txParams { + return txParams{big.NewInt(baseFee - 2_500_000_000), nil, nil, nil} + }), + Entry("dynamic tx", func() txParams { + return txParams{nil, big.NewInt(baseFee - 2_500_000_000), big.NewInt(0), ðtypes.AccessList{}} }), ) - DescribeTable("should accept transactions with gasPrice >= MinGasPrices", + DescribeTable("should accept transactions with gasPrice >= EffectivePrice", func(malleate getprices) { p := malleate() - to := utiltx.GenerateAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - res, err := chainutil.DeliverEthTx(s.app, privKey, msgEthereumTx) - Expect(err).To(BeNil(), "transaction should have succeeded") + + txArgs.GasPrice = p.gasPrice + txArgs.GasFeeCap = p.gasFeeCap + txArgs.GasTipCap = p.gasTipCap + txArgs.Accesses = p.accesses + + res, err := s.factory.ExecuteEthTx(privKey, txArgs) + Expect(err).To(BeNil()) Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) }, Entry("legacy tx", func() txParams { - return txParams{big.NewInt(minGasPrices + 1), nil, nil, nil} + return txParams{big.NewInt(baseFee), nil, nil, nil} }), - Entry("dynamic tx, EffectivePrice > MinGasPrices", func() txParams { - return txParams{nil, big.NewInt(minGasPrices + 10_000_000_000), big.NewInt(30_000_000_000), ðtypes.AccessList{}} + Entry("dynamic tx", func() txParams { + return txParams{nil, big.NewInt(baseFee), big.NewInt(0), ðtypes.AccessList{}} }), ) }) }) - Context("with MinGasPrices (feemarket param) < BaseFee (feemarket)", func() { + Context("with BaseFee (feemarket) < MinGasPrices (feemarket param)", func() { var ( baseFee int64 minGasPrices int64 ) - BeforeEach(func() { - baseFee = 10_000_000_000 - minGasPrices = baseFee - 5_000_000_000 - - // Note that the tests run the same transactions with `gasLimit = - // 100_000`. With the fee calculation `Fee = (baseFee + tip) * gasLimit`, - // a `minGasPrices = 5_000_000_000` results in `minGlobalFee = - // 500_000_000_000_000` - privKey, _ = setupTestWithContext(chainID, "1", math.LegacyNewDec(minGasPrices), math.NewInt(baseFee)) - }) - Context("during CheckTx", func() { - DescribeTable("should reject transactions with gasPrice < MinGasPrices", + BeforeEach(func() { + baseFee = 10_000_000_000 + minGasPrices = baseFee + 30_000_000_000 + + // Note that the tests run the same transactions with `gasLimit = + // 200000`. With the fee calculation `Fee = (baseFee + tip) * gasLimit`, + // with `minGasPrices = 40_000_000_000` results in `minGlobalFee = + // 8000000000000000` + // local min-gas-prices is 10aevmos + params := fmkttypes.DefaultParams() + params.MinGasPrice = math.LegacyNewDec(minGasPrices) + params.BaseFee = math.NewInt(baseFee) + + // Note that the tests run the same transactions with `gasLimit = + // 200_000`. With the fee calculation `Fee = (baseFee + tip) * gasLimit`, + // a `minGasPrices = 5_000_000_000` results in `minGlobalFee = + // 1_000_000_000_000_000` + err := testutils.UpdateFeeMarketParams( + testutils.UpdateParamsInput{ + Tf: s.factory, + Network: s.network, + Pk: privKey, + Params: params, + }, + ) + Expect(err).To(BeNil()) + }) + + DescribeTable("should reject transactions with EffectivePrice < MinGasPrices", func(malleate getprices) { p := malleate() - to := utiltx.GenerateAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - _, err := chainutil.CheckEthTx(s.app, privKey, msgEthereumTx) - Expect(err).ToNot(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "provided fee < minimum global fee"), - ).To(BeTrue(), err.Error()) + + txArgs.GasPrice = p.gasPrice + txArgs.GasFeeCap = p.gasFeeCap + txArgs.GasTipCap = p.gasTipCap + txArgs.Accesses = p.accesses + + tx, err := s.factory.GenerateSignedEthTx(privKey, txArgs) + Expect(err).To(BeNil()) + + Expect(err).To(BeNil()) + bz, err := s.factory.EncodeTx(tx) + Expect(err).To(BeNil()) + + res, err := s.network.CheckTx(bz) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("provided fee < minimum global fee")) }, Entry("legacy tx", func() txParams { - return txParams{big.NewInt(minGasPrices - 1_000_000_000), nil, nil, nil} + return txParams{big.NewInt(minGasPrices - 10_000_000_000), nil, nil, nil} }), Entry("dynamic tx with GasFeeCap < MinGasPrices, no gasTipCap", func() txParams { - return txParams{nil, big.NewInt(minGasPrices - 1_000_000_000), big.NewInt(0), ðtypes.AccessList{}} + return txParams{nil, big.NewInt(minGasPrices - 10_000_000_000), big.NewInt(0), ðtypes.AccessList{}} }), Entry("dynamic tx with GasFeeCap < MinGasPrices, max gasTipCap", func() txParams { - return txParams{nil, big.NewInt(minGasPrices - 1_000_000_000), big.NewInt(minGasPrices - 1_000_000_000), ðtypes.AccessList{}} + // Note that max priority fee per gas can't be higher than the max fee per gas (gasFeeCap), i.e. 30_000_000_000) + return txParams{nil, big.NewInt(minGasPrices - 10_000_000_000), big.NewInt(30_000_000_000), ðtypes.AccessList{}} }), ) - DescribeTable("should reject transactions with MinGasPrices < tx gasPrice < EffectivePrice", + DescribeTable("should accept transactions with gasPrice >= MinGasPrices", func(malleate getprices) { p := malleate() - to := utiltx.GenerateAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - _, err := chainutil.CheckEthTx(s.app, privKey, msgEthereumTx) - Expect(err).ToNot(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "insufficient fee"), - ).To(BeTrue(), err.Error()) - }, - Entry("legacy tx", func() txParams { - return txParams{big.NewInt(baseFee - 1_000_000_000), nil, nil, nil} - }), - Entry("dynamic tx", func() txParams { - return txParams{nil, big.NewInt(baseFee - 1_000_000_000), big.NewInt(0), ðtypes.AccessList{}} - }), - ) - DescribeTable("should accept transactions with gasPrice >= EffectivePrice", - func(malleate getprices) { - p := malleate() - to := utiltx.GenerateAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - res, err := chainutil.CheckEthTx(s.app, privKey, msgEthereumTx) - Expect(err).To(BeNil(), "transaction should have succeeded") - Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) + txArgs.GasPrice = p.gasPrice + txArgs.GasFeeCap = p.gasFeeCap + txArgs.GasTipCap = p.gasTipCap + txArgs.Accesses = p.accesses + + tx, err := s.factory.GenerateSignedEthTx(privKey, txArgs) + Expect(err).To(BeNil()) + + Expect(err).To(BeNil()) + bz, err := s.factory.EncodeTx(tx) + Expect(err).To(BeNil()) + + res, err := s.network.CheckTx(bz) + Expect(err).To(BeNil()) + Expect(res.IsOK()).To(BeTrue(), "transaction should have succeeded", res.GetLog()) }, Entry("legacy tx", func() txParams { - return txParams{big.NewInt(baseFee), nil, nil, nil} + return txParams{big.NewInt(minGasPrices), nil, nil, nil} }), - Entry("dynamic tx", func() txParams { - return txParams{nil, big.NewInt(baseFee), big.NewInt(0), ðtypes.AccessList{}} + // Note that this tx is not rejected on CheckTx, but not on DeliverTx, + // as the baseFee is set to minGasPrices during DeliverTx when baseFee + // < minGasPrices + Entry("dynamic tx with GasFeeCap > MinGasPrices, EffectivePrice > MinGasPrices", func() txParams { + return txParams{nil, big.NewInt(minGasPrices), big.NewInt(30_000_000_000), ðtypes.AccessList{}} }), ) }) Context("during DeliverTx", func() { + BeforeEach(func() { + baseFee = 10_000_000_000 + minGasPrices = baseFee + 30_000_000_000 + + // Note that the tests run the same transactions with `gasLimit = + // 200000`. With the fee calculation `Fee = (baseFee + tip) * gasLimit`, + // with `minGasPrices = 40_000_000_000` results in `minGlobalFee = + // 8000000000000000` + // local min-gas-prices is 10aevmos + params := fmkttypes.DefaultParams() + params.MinGasPrice = math.LegacyNewDec(minGasPrices) + params.BaseFee = math.NewInt(baseFee) + + err := testutils.UpdateFeeMarketParams( + testutils.UpdateParamsInput{ + Tf: s.factory, + Network: s.network, + Pk: privKey, + Params: params, + }, + ) + Expect(err).To(BeNil()) + }) DescribeTable("should reject transactions with gasPrice < MinGasPrices", func(malleate getprices) { p := malleate() - to := utiltx.GenerateAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - _, err := chainutil.DeliverEthTx(s.app, privKey, msgEthereumTx) - Expect(err).ToNot(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "provided fee < minimum global fee"), - ).To(BeTrue(), err.Error()) - }, - Entry("legacy tx", func() txParams { - return txParams{big.NewInt(minGasPrices - 1_000_000_000), nil, nil, nil} - }), - Entry("dynamic tx", func() txParams { - return txParams{nil, big.NewInt(minGasPrices - 1_000_000_000), nil, ðtypes.AccessList{}} - }), - ) - DescribeTable("should reject transactions with MinGasPrices < gasPrice < EffectivePrice", - func(malleate getprices) { - p := malleate() - to := utiltx.GenerateAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - _, err := chainutil.DeliverEthTx(s.app, privKey, msgEthereumTx) - Expect(err).NotTo(BeNil(), "transaction should have failed") - Expect( - strings.Contains(err.Error(), - "insufficient fee"), - ).To(BeTrue(), err.Error()) + txArgs.GasPrice = p.gasPrice + txArgs.GasFeeCap = p.gasFeeCap + txArgs.GasTipCap = p.gasTipCap + txArgs.Accesses = p.accesses + + res, err := s.factory.ExecuteEthTx(privKey, txArgs) + Expect(err).NotTo(BeNil()) + Expect(res.IsOK()).To(BeFalse()) + Expect(res.Log).To(ContainSubstring("provided fee < minimum global fee")) }, - // Note that the baseFee is not 10_000_000_000 anymore but updates to 8_750_000_000 because of the s.Commit Entry("legacy tx", func() txParams { - return txParams{big.NewInt(baseFee - 2_000_000_000), nil, nil, nil} + return txParams{big.NewInt(minGasPrices - 10_000_000_000), nil, nil, nil} }), - Entry("dynamic tx", func() txParams { - return txParams{nil, big.NewInt(baseFee - 2_000_000_000), big.NewInt(0), ðtypes.AccessList{}} + Entry("dynamic tx with GasFeeCap < MinGasPrices, no gasTipCap", func() txParams { + return txParams{nil, big.NewInt(minGasPrices - 10_000_000_000), big.NewInt(0), ðtypes.AccessList{}} + }), + Entry("dynamic tx with GasFeeCap < MinGasPrices, max gasTipCap", func() txParams { + // Note that max priority fee per gas can't be higher than the max fee per gas (gasFeeCap), i.e. 30_000_000_000) + return txParams{nil, big.NewInt(minGasPrices - 10_000_000_000), big.NewInt(30_000_000_000), ðtypes.AccessList{}} }), ) - DescribeTable("should accept transactions with gasPrice >= EffectivePrice", + DescribeTable("should accept transactions with gasPrice >= MinGasPrices", func(malleate getprices) { p := malleate() - to := utiltx.GenerateAddress() - msgEthereumTx := buildEthTx(privKey, &to, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses) - res, err := chainutil.DeliverEthTx(s.app, privKey, msgEthereumTx) - Expect(err).To(BeNil()) + + txArgs.GasPrice = p.gasPrice + txArgs.GasFeeCap = p.gasFeeCap + txArgs.GasTipCap = p.gasTipCap + txArgs.Accesses = p.accesses + + res, err := s.factory.ExecuteEthTx(privKey, txArgs) + Expect(err).To(BeNil(), "transaction should have succeeded") Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog()) }, Entry("legacy tx", func() txParams { - return txParams{big.NewInt(baseFee), nil, nil, nil} + return txParams{big.NewInt(minGasPrices + 1), nil, nil, nil} }), - Entry("dynamic tx", func() txParams { - return txParams{nil, big.NewInt(baseFee), big.NewInt(0), ðtypes.AccessList{}} + Entry("dynamic tx, EffectivePrice > MinGasPrices", func() txParams { + return txParams{nil, big.NewInt(minGasPrices + 10_000_000_000), big.NewInt(30_000_000_000), ðtypes.AccessList{}} }), ) }) diff --git a/x/feemarket/keeper/keeper.go b/x/feemarket/keeper/keeper.go index dd9edcb8..8777e60c 100644 --- a/x/feemarket/keeper/keeper.go +++ b/x/feemarket/keeper/keeper.go @@ -1,16 +1,16 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package keeper import ( "math/big" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/evmos/os/x/feemarket/types" ) diff --git a/x/feemarket/keeper/keeper_test.go b/x/feemarket/keeper/keeper_test.go index 78bace63..926c05a9 100644 --- a/x/feemarket/keeper/keeper_test.go +++ b/x/feemarket/keeper/keeper_test.go @@ -2,11 +2,19 @@ package keeper_test import ( "math/big" + "testing" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/evmos/os/testutil/integration/os/network" + "github.com/stretchr/testify/require" ) -func (suite *KeeperTestSuite) TestSetGetBlockGasWanted() { +func TestSetGetBlockGasWanted(t *testing.T) { + var ( + nw *network.UnitTestNetwork + ctx sdk.Context + ) testCases := []struct { name string malleate func() @@ -15,20 +23,30 @@ func (suite *KeeperTestSuite) TestSetGetBlockGasWanted() { { "with last block given", func() { - suite.app.FeeMarketKeeper.SetBlockGasWanted(suite.ctx, uint64(1000000)) + nw.App.FeeMarketKeeper.SetBlockGasWanted(ctx, uint64(1000000)) }, uint64(1000000), }, } for _, tc := range testCases { - tc.malleate() + t.Run(tc.name, func(t *testing.T) { + // reset network and context + nw = network.NewUnitTestNetwork() + ctx = nw.GetContext() - gas := suite.app.FeeMarketKeeper.GetBlockGasWanted(suite.ctx) - suite.Require().Equal(tc.expGas, gas, tc.name) + tc.malleate() + + gas := nw.App.FeeMarketKeeper.GetBlockGasWanted(ctx) + require.Equal(t, tc.expGas, gas, tc.name) + }) } } -func (suite *KeeperTestSuite) TestSetGetGasFee() { +func TestSetGetGasFee(t *testing.T) { + var ( + nw *network.UnitTestNetwork + ctx sdk.Context + ) testCases := []struct { name string malleate func() @@ -37,16 +55,22 @@ func (suite *KeeperTestSuite) TestSetGetGasFee() { { "with last block given", func() { - suite.app.FeeMarketKeeper.SetBaseFee(suite.ctx, math.LegacyOneDec().BigInt()) + nw.App.FeeMarketKeeper.SetBaseFee(ctx, math.LegacyOneDec().BigInt()) }, math.LegacyOneDec().BigInt(), }, } for _, tc := range testCases { - tc.malleate() + t.Run(tc.name, func(t *testing.T) { + // reset network and context + nw = network.NewUnitTestNetwork() + ctx = nw.GetContext() + + tc.malleate() - fee := suite.app.FeeMarketKeeper.GetBaseFee(suite.ctx) - suite.Require().Equal(tc.expFee, fee, tc.name) + fee := nw.App.FeeMarketKeeper.GetBaseFee(ctx) + require.Equal(t, tc.expFee, fee, tc.name) + }) } } diff --git a/x/feemarket/keeper/msg_server_test.go b/x/feemarket/keeper/msg_server_test.go index 57b985c3..027c30ba 100644 --- a/x/feemarket/keeper/msg_server_test.go +++ b/x/feemarket/keeper/msg_server_test.go @@ -1,12 +1,22 @@ package keeper_test import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/evmos/os/testutil/integration/os/network" "github.com/evmos/os/x/feemarket/types" + "github.com/stretchr/testify/require" ) -func (suite *KeeperTestSuite) TestUpdateParams() { +func TestUpdateParams(t *testing.T) { + var ( + nw *network.UnitTestNetwork + ctx sdk.Context + ) + testCases := []struct { name string request *types.MsgUpdateParams @@ -28,12 +38,16 @@ func (suite *KeeperTestSuite) TestUpdateParams() { } for _, tc := range testCases { - suite.Run("MsgUpdateParams", func() { - _, err := suite.app.FeeMarketKeeper.UpdateParams(suite.ctx, tc.request) + t.Run(tc.name, func(t *testing.T) { + // reset network and context + nw = network.NewUnitTestNetwork() + ctx = nw.GetContext() + + _, err := nw.App.FeeMarketKeeper.UpdateParams(ctx, tc.request) if tc.expectErr { - suite.Require().Error(err) + require.Error(t, err) } else { - suite.Require().NoError(err) + require.NoError(t, err) } }) } diff --git a/x/feemarket/keeper/params_test.go b/x/feemarket/keeper/params_test.go index a46e58a9..52c63d8e 100644 --- a/x/feemarket/keeper/params_test.go +++ b/x/feemarket/keeper/params_test.go @@ -2,21 +2,31 @@ package keeper_test import ( "reflect" + "testing" + "github.com/evmos/os/testutil/integration/os/network" "github.com/evmos/os/x/feemarket/types" + "github.com/stretchr/testify/require" ) -func (suite *KeeperTestSuite) TestGetParams() { - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) - suite.Require().NotNil(params.BaseFee) - suite.Require().NotNil(params.MinGasPrice) - suite.Require().NotNil(params.MinGasMultiplier) +func TestGetParams(t *testing.T) { + nw := network.NewUnitTestNetwork() + ctx := nw.GetContext() + + params := nw.App.FeeMarketKeeper.GetParams(ctx) + require.NotNil(t, params.BaseFee) + require.NotNil(t, params.MinGasPrice) + require.NotNil(t, params.MinGasMultiplier) } -func (suite *KeeperTestSuite) TestSetGetParams() { - params := suite.app.FeeMarketKeeper.GetParams(suite.ctx) - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) - suite.Require().NoError(err) +func TestSetGetParams(t *testing.T) { + nw := network.NewUnitTestNetwork() + ctx := nw.GetContext() + + params := types.DefaultParams() + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) + require.NoError(t, err) + testCases := []struct { name string paramsFun func() interface{} @@ -29,7 +39,7 @@ func (suite *KeeperTestSuite) TestSetGetParams() { return types.DefaultParams() }, func() interface{} { - return suite.app.FeeMarketKeeper.GetParams(suite.ctx) + return nw.App.FeeMarketKeeper.GetParams(ctx) }, true, }, @@ -37,24 +47,24 @@ func (suite *KeeperTestSuite) TestSetGetParams() { "success - Check ElasticityMultiplier is set to 3 and can be retrieved correctly", func() interface{} { params.ElasticityMultiplier = 3 - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) - suite.Require().NoError(err) + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) + require.NoError(t, err) return params.ElasticityMultiplier }, func() interface{} { - return suite.app.FeeMarketKeeper.GetParams(suite.ctx).ElasticityMultiplier + return nw.App.FeeMarketKeeper.GetParams(ctx).ElasticityMultiplier }, true, }, { "success - Check BaseFeeEnabled is computed with its default params and can be retrieved correctly", func() interface{} { - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, types.DefaultParams()) - suite.Require().NoError(err) + err := nw.App.FeeMarketKeeper.SetParams(ctx, types.DefaultParams()) + require.NoError(t, err) return true }, func() interface{} { - return suite.app.FeeMarketKeeper.GetBaseFeeEnabled(suite.ctx) + return nw.App.FeeMarketKeeper.GetBaseFeeEnabled(ctx) }, true, }, @@ -63,20 +73,20 @@ func (suite *KeeperTestSuite) TestSetGetParams() { func() interface{} { params.NoBaseFee = true params.EnableHeight = 5 - err := suite.app.FeeMarketKeeper.SetParams(suite.ctx, params) - suite.Require().NoError(err) + err := nw.App.FeeMarketKeeper.SetParams(ctx, params) + require.NoError(t, err) return true }, func() interface{} { - return suite.app.FeeMarketKeeper.GetBaseFeeEnabled(suite.ctx) + return nw.App.FeeMarketKeeper.GetBaseFeeEnabled(ctx) }, false, }, } for _, tc := range testCases { - suite.Run(tc.name, func() { + t.Run(tc.name, func(t *testing.T) { outcome := reflect.DeepEqual(tc.paramsFun(), tc.getFun()) - suite.Require().Equal(tc.expected, outcome) + require.Equal(t, tc.expected, outcome) }) } } diff --git a/x/feemarket/keeper/setup_test.go b/x/feemarket/keeper/setup_test.go index 1979d362..b169f0ec 100644 --- a/x/feemarket/keeper/setup_test.go +++ b/x/feemarket/keeper/setup_test.go @@ -1,58 +1,45 @@ package keeper_test import ( - "testing" - - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/ginkgo/v2" - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/gomega" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - app "github.com/evmos/os/example_chain" - "github.com/evmos/os/testutil" - "github.com/evmos/os/x/feemarket/types" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/evmos/os/testutil/integration/os/factory" + "github.com/evmos/os/testutil/integration/os/grpc" + testkeyring "github.com/evmos/os/testutil/integration/os/keyring" + "github.com/evmos/os/testutil/integration/os/network" "github.com/stretchr/testify/suite" ) type KeeperTestSuite struct { suite.Suite - ctx sdk.Context - app *app.ExampleChain - queryClient types.QueryClient - address common.Address - consAddress sdk.ConsAddress - - // for generate test tx - clientCtx client.Context - ethSigner ethtypes.Signer - - appCodec codec.Codec - signer keyring.Signer - denom string -} - -var s *KeeperTestSuite - -func TestKeeperTestSuite(t *testing.T) { - s = new(KeeperTestSuite) - suite.Run(t, s) + network *network.UnitTestNetwork + factory factory.TxFactory + grpcHandler grpc.Handler + keyring testkeyring.Keyring - // Run Ginkgo integration tests - RegisterFailHandler(Fail) - RunSpecs(t, "Keeper Suite") + denom string } // SetupTest setup test environment func (suite *KeeperTestSuite) SetupTest() { - checkTx := false - chainID := testutil.ExampleChainID - suite.app = app.Setup(suite.T(), checkTx, chainID) - suite.SetupApp(checkTx, chainID) + keyring := testkeyring.New(2) + nw := network.NewUnitTestNetwork( + network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), + network.WithCustomBaseAppOpts(baseapp.SetMinGasPrices("10aevmos")), + ) + grpcHandler := grpc.NewIntegrationHandler(nw) + txFactory := factory.New(nw, grpcHandler) + + ctx := nw.GetContext() + sk := nw.App.StakingKeeper + bondDenom, err := sk.BondDenom(ctx) + if err != nil { + panic(err) + } + + suite.denom = bondDenom + suite.factory = txFactory + suite.grpcHandler = grpcHandler + suite.keyring = keyring + suite.network = nw } diff --git a/x/feemarket/keeper/utils_test.go b/x/feemarket/keeper/utils_test.go deleted file mode 100644 index 74a35275..00000000 --- a/x/feemarket/keeper/utils_test.go +++ /dev/null @@ -1,204 +0,0 @@ -package keeper_test - -import ( - "encoding/json" - "math/big" - "time" - - "cosmossdk.io/math" - dbm "github.com/cometbft/cometbft-db" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client" - simutils "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/evmos/os/crypto/ethsecp256k1" - "github.com/evmos/os/encoding" - exampleapp "github.com/evmos/os/example_chain" - chainutil "github.com/evmos/os/example_chain/testutil" - "github.com/evmos/os/testutil" - utiltx "github.com/evmos/os/testutil/tx" - evmtypes "github.com/evmos/os/x/evm/types" - "github.com/evmos/os/x/feemarket/types" - "github.com/stretchr/testify/require" -) - -func (suite *KeeperTestSuite) SetupApp(checkTx bool, chainID string) { - t := suite.T() - // account key - priv, err := ethsecp256k1.GenerateKey() - require.NoError(t, err) - suite.address = common.BytesToAddress(priv.PubKey().Address().Bytes()) - suite.signer = utiltx.NewSigner(priv) - - // consensus key - priv, err = ethsecp256k1.GenerateKey() - require.NoError(t, err) - suite.consAddress = sdk.ConsAddress(priv.PubKey().Address()) - - header := testutil.NewHeader( - 1, time.Now().UTC(), chainID, suite.consAddress, nil, nil, - ) - - suite.ctx = suite.app.BaseApp.NewContext(checkTx, header) - - queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) - types.RegisterQueryServer(queryHelper, suite.app.FeeMarketKeeper) - suite.queryClient = types.NewQueryClient(queryHelper) - - acc := authtypes.NewBaseAccount(sdk.AccAddress(suite.address.Bytes()), nil, 0, 0) - suite.app.AccountKeeper.SetAccount(suite.ctx, acc) - - valAddr := sdk.ValAddress(suite.address.Bytes()) - validator, err := stakingtypes.NewValidator(valAddr, priv.PubKey(), stakingtypes.Description{}) - require.NoError(t, err) - validator = stakingkeeper.TestingUpdateValidator(suite.app.StakingKeeper, suite.ctx, validator, true) - err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, validator.GetOperator()) - require.NoError(t, err) - - err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) - require.NoError(t, err) - suite.app.StakingKeeper.SetValidator(suite.ctx, validator) - - stakingParams := stakingtypes.DefaultParams() - stakingParams.BondDenom = testutil.ExampleAttoDenom - err = suite.app.StakingKeeper.SetParams(suite.ctx, stakingParams) - require.NoError(t, err) - - encodingConfig := encoding.MakeConfig(exampleapp.ModuleBasics) - suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) - suite.ethSigner = ethtypes.LatestSignerForChainID(suite.app.EVMKeeper.ChainID()) - suite.appCodec = encodingConfig.Codec - suite.denom = testutil.ExampleAttoDenom -} - -// Commit commits and starts a new block with an updated context. -func (suite *KeeperTestSuite) Commit() { - suite.CommitAfter(time.Second * 0) -} - -// Commit commits a block at a given time. -func (suite *KeeperTestSuite) CommitAfter(t time.Duration) { - var err error - suite.ctx, err = chainutil.CommitAndCreateNewCtx(suite.ctx, suite.app, t, nil) - suite.Require().NoError(err) - queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) - types.RegisterQueryServer(queryHelper, suite.app.FeeMarketKeeper) - suite.queryClient = types.NewQueryClient(queryHelper) -} - -// setupTestWithContext sets up a test chain with an example Cosmos send msg, -// given a local (validator config) and a global (feemarket param) minGasPrice -func setupTestWithContext(chainID, valMinGasPrice string, minGasPrice math.LegacyDec, baseFee math.Int) (*ethsecp256k1.PrivKey, banktypes.MsgSend) { - privKey, msg := setupTest(valMinGasPrice+s.denom, chainID) - params := types.DefaultParams() - params.MinGasPrice = minGasPrice - err := s.app.FeeMarketKeeper.SetParams(s.ctx, params) - s.Require().NoError(err) - s.app.FeeMarketKeeper.SetBaseFee(s.ctx, baseFee.BigInt()) - s.Commit() - - return privKey, msg -} - -func setupTest(localMinGasPrices, chainID string) (*ethsecp256k1.PrivKey, banktypes.MsgSend) { - setupChain(localMinGasPrices, chainID) - - address, privKey := utiltx.NewAccAddressAndKey() - amount, ok := math.NewIntFromString("10000000000000000000") - s.Require().True(ok) - initBalance := sdk.Coins{sdk.Coin{ - Denom: s.denom, - Amount: amount, - }} - err := chainutil.FundAccount(s.ctx, s.app.BankKeeper, address, initBalance) - s.Require().NoError(err) - - msg := banktypes.MsgSend{ - FromAddress: address.String(), - ToAddress: address.String(), - Amount: sdk.Coins{sdk.Coin{ - Denom: s.denom, - Amount: math.NewInt(10000), - }}, - } - s.Commit() - return privKey, msg -} - -func setupChain(localMinGasPricesStr string, chainID string) { - // Initialize the app, so we can use SetMinGasPrices to set the - // validator-specific min-gas-prices setting - db := dbm.NewMemDB() - newapp := exampleapp.NewExampleApp( - log.NewNopLogger(), - db, - nil, - true, - simutils.NewAppOptionsWithFlagHome(exampleapp.DefaultNodeHome), - baseapp.SetChainID(chainID), - baseapp.SetMinGasPrices(localMinGasPricesStr), - ) - - genesisState := chainutil.NewTestGenesisState(newapp.AppCodec()) - genesisState[types.ModuleName] = newapp.AppCodec().MustMarshalJSON(types.DefaultGenesisState()) - - stateBytes, err := json.MarshalIndent(genesisState, "", " ") - s.Require().NoError(err) - - // Initialize the chain - newapp.InitChain( - abci.RequestInitChain{ - ChainId: chainID, - Validators: []abci.ValidatorUpdate{}, - AppStateBytes: stateBytes, - ConsensusParams: chainutil.DefaultConsensusParams, - }, - ) - - s.app = newapp - s.SetupApp(false, chainID) -} - -func getNonce(addressBytes []byte) uint64 { - return s.app.EVMKeeper.GetNonce( - s.ctx, - common.BytesToAddress(addressBytes), - ) -} - -func buildEthTx( - priv *ethsecp256k1.PrivKey, - to *common.Address, - gasPrice *big.Int, - gasFeeCap *big.Int, - gasTipCap *big.Int, - accesses *ethtypes.AccessList, -) *evmtypes.MsgEthereumTx { - chainID := s.app.EVMKeeper.ChainID() - from := common.BytesToAddress(priv.PubKey().Address().Bytes()) - nonce := getNonce(from.Bytes()) - data := make([]byte, 0) - gasLimit := uint64(100000) - ethTxParams := &evmtypes.EvmTxArgs{ - ChainID: chainID, - Nonce: nonce, - To: to, - GasLimit: gasLimit, - GasPrice: gasPrice, - GasFeeCap: gasFeeCap, - GasTipCap: gasTipCap, - Input: data, - Accesses: accesses, - } - msgEthereumTx := evmtypes.NewTx(ethTxParams) - msgEthereumTx.From = from.String() - return msgEthereumTx -} diff --git a/x/feemarket/module.go b/x/feemarket/module.go index 10044652..0545f67b 100644 --- a/x/feemarket/module.go +++ b/x/feemarket/module.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package feemarket import ( @@ -7,32 +8,32 @@ import ( "encoding/json" "fmt" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - + "cosmossdk.io/core/appmodule" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/evmos/os/x/feemarket/client/cli" "github.com/evmos/os/x/feemarket/keeper" "github.com/evmos/os/x/feemarket/types" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" ) // consensusVersion defines the current x/feemarket module consensus version. const consensusVersion = 4 var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.EndBlockAppModule = AppModule{} - _ module.BeginBlockAppModule = AppModule{} + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + + _ appmodule.HasEndBlocker = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} + _ module.HasABCIGenesis = AppModule{} ) // AppModuleBasic defines the basic application module used by the fee market module. @@ -80,21 +81,16 @@ func (b AppModuleBasic) RegisterGRPCGatewayRoutes(c client.Context, serveMux *ru } } -// GetTxCmd returns the root tx command for the fee market module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return nil +// RegisterInterfaces registers interfaces and implementations of the fee market module. +func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) } -// GetQueryCmd returns no root query command for the fee market module. +// GetQueryCmd returns the root query command for the fee market module. func (AppModuleBasic) GetQueryCmd() *cobra.Command { return cli.GetQueryCmd() } -// RegisterInterfaces registers interfaces and implementations of the fee market module. -func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { - types.RegisterInterfaces(registry) -} - // ____________________________________________________________________________ // AppModule implements an application module for the fee market module. @@ -131,15 +127,16 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { } // BeginBlock returns the begin block for the fee market module. -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - am.keeper.BeginBlock(ctx, req) +func (am AppModule) BeginBlock(ctx context.Context) error { + c := sdk.UnwrapSDKContext(ctx) + return am.keeper.BeginBlock(c) } // EndBlock returns the end blocker for the fee market module. It returns no validator // updates. -func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate { - am.keeper.EndBlock(ctx, req) - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(ctx context.Context) error { + c := sdk.UnwrapSDKContext(ctx) + return am.keeper.EndBlock(c) } // InitGenesis performs genesis initialization for the fee market module. It returns @@ -160,7 +157,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // RegisterStoreDecoder registers a decoder for fee market module's types -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // GenerateGenesisState creates a randomized GenState of the fee market module. func (AppModule) GenerateGenesisState(_ *module.SimulationState) { @@ -170,3 +167,9 @@ func (AppModule) GenerateGenesisState(_ *module.SimulationState) { func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return nil } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/feemarket/types/codec.go b/x/feemarket/types/codec.go index 11ec3877..8c9a7bfc 100644 --- a/x/feemarket/types/codec.go +++ b/x/feemarket/types/codec.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package types import ( @@ -15,13 +16,15 @@ var ( // ONLY be used in certain instances of tests and for JSON encoding. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) - // AminoCdc is a amino codec created to support amino JSON compatible msgs. - AminoCdc = codec.NewAminoCodec(amino) + // AminoCdc is an amino codec created to support amino JSON compatible msgs. + // + // For now, we'll leave this. PENDING to check if we can remove it. + AminoCdc = codec.NewAminoCodec(amino) //nolint:staticcheck ) const ( // Amino names - updateParamsName = "ethermint/feemarket/MsgUpdateParams" + updateParamsName = "os/feemarket/MsgUpdateParams" ) // NOTE: This is required for the GetSignBytes function diff --git a/x/feemarket/types/events.pb.go b/x/feemarket/types/events.pb.go index b8006ef6..c2098edd 100644 --- a/x/feemarket/types/events.pb.go +++ b/x/feemarket/types/events.pb.go @@ -22,7 +22,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// EventFeeMarket is the event type for the fee market module +// EventFeeMarket is the event type for the feemarket module type EventFeeMarket struct { // base_fee for EIP-1559 blocks BaseFee string `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3" json:"base_fee,omitempty"` diff --git a/x/feemarket/types/feemarket.pb.go b/x/feemarket/types/feemarket.pb.go index cec88bdf..9a636db7 100644 --- a/x/feemarket/types/feemarket.pb.go +++ b/x/feemarket/types/feemarket.pb.go @@ -6,6 +6,7 @@ package types import ( cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -115,32 +116,34 @@ func init() { func init() { proto.RegisterFile("os/feemarket/v1/feemarket.proto", fileDescriptor_1824628138b64297) } var fileDescriptor_1824628138b64297 = []byte{ - // 395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6a, 0xdb, 0x40, - 0x10, 0x86, 0xb5, 0x75, 0xe2, 0x28, 0x9b, 0x9a, 0x9a, 0x25, 0x01, 0xd1, 0x50, 0x59, 0x34, 0x14, - 0x74, 0x92, 0x08, 0xb9, 0xf4, 0x52, 0x0a, 0x6e, 0x68, 0xda, 0xd2, 0x42, 0xaa, 0x63, 0x2f, 0xcb, - 0x4a, 0x99, 0x48, 0x4b, 0xb4, 0x3b, 0x42, 0xbb, 0x31, 0xf5, 0x5b, 0xf4, 0x4d, 0xfa, 0x1a, 0x3e, - 0xfa, 0x58, 0x7a, 0x30, 0xc5, 0x7e, 0x91, 0x62, 0xc9, 0xb6, 0x0c, 0xbd, 0xf4, 0x26, 0xfd, 0xff, - 0xff, 0xfd, 0xcc, 0x30, 0x4b, 0x47, 0x68, 0xe2, 0x7b, 0x00, 0x25, 0xea, 0x07, 0xb0, 0xf1, 0xe4, - 0xb2, 0xfb, 0x89, 0xaa, 0x1a, 0x2d, 0xb2, 0x67, 0x68, 0xa2, 0x4e, 0x9b, 0x5c, 0x3e, 0x3f, 0xcd, - 0x31, 0xc7, 0xc6, 0x8b, 0xd7, 0x5f, 0x6d, 0xec, 0xe5, 0xcf, 0x1e, 0xed, 0xdf, 0x8a, 0x5a, 0x28, - 0xc3, 0x7c, 0x7a, 0xa2, 0x91, 0xa7, 0xc2, 0x00, 0xbf, 0x07, 0xf0, 0x48, 0x40, 0x42, 0x37, 0x39, - 0xd6, 0x38, 0x16, 0x06, 0xde, 0x03, 0xb0, 0x37, 0xf4, 0x7c, 0x6b, 0xf2, 0xac, 0x10, 0x3a, 0x07, - 0x7e, 0x07, 0x1a, 0x95, 0xd4, 0xc2, 0x62, 0xed, 0x3d, 0x09, 0x48, 0x38, 0x48, 0xbc, 0xb4, 0x4d, - 0xbf, 0x6b, 0x02, 0xd7, 0x9d, 0xcf, 0xae, 0xe8, 0x19, 0x94, 0xc2, 0x58, 0x99, 0x49, 0x3b, 0xe5, - 0xea, 0xb1, 0xb4, 0xb2, 0x2a, 0x25, 0xd4, 0x5e, 0xaf, 0x01, 0x4f, 0x3b, 0xf3, 0xcb, 0xce, 0x63, - 0x17, 0x74, 0x00, 0x5a, 0xa4, 0x25, 0xf0, 0x02, 0x64, 0x5e, 0x58, 0xef, 0x30, 0x20, 0x61, 0x2f, - 0x79, 0xda, 0x8a, 0x1f, 0x1a, 0x8d, 0xbd, 0xa6, 0xee, 0x6e, 0xea, 0x7e, 0x40, 0xc2, 0xe3, 0xf1, - 0x8b, 0xd9, 0x62, 0xe4, 0xfc, 0x5e, 0x8c, 0xce, 0x32, 0x34, 0x0a, 0x8d, 0xb9, 0x7b, 0x88, 0x24, - 0xc6, 0x4a, 0xd8, 0x22, 0xfa, 0xa8, 0x6d, 0x72, 0xb4, 0x19, 0x92, 0xdd, 0xd0, 0x81, 0x92, 0x9a, - 0xe7, 0xc2, 0xf0, 0xaa, 0x96, 0x19, 0x78, 0x47, 0x0d, 0x7e, 0xb1, 0xc1, 0xcf, 0xff, 0xc5, 0x3f, - 0x43, 0x2e, 0xb2, 0xe9, 0x35, 0x64, 0xc9, 0x89, 0x92, 0xfa, 0x46, 0x98, 0xdb, 0x35, 0xc7, 0xbe, - 0x52, 0xb6, 0x2d, 0xda, 0xdb, 0xcc, 0xfd, 0xff, 0xb6, 0x61, 0xdb, 0xd6, 0xad, 0xfe, 0xe9, 0xc0, - 0x3d, 0x18, 0x1e, 0x26, 0x43, 0xa9, 0xa5, 0x95, 0xa2, 0xdc, 0xdd, 0x65, 0xfc, 0x76, 0xb6, 0xf4, - 0xc9, 0x7c, 0xe9, 0x93, 0x3f, 0x4b, 0x9f, 0xfc, 0x58, 0xf9, 0xce, 0x7c, 0xe5, 0x3b, 0xbf, 0x56, - 0xbe, 0xf3, 0xed, 0x55, 0x2e, 0x6d, 0xf1, 0x98, 0x46, 0x19, 0xaa, 0x18, 0x26, 0x0a, 0x4d, 0x8c, - 0x26, 0xfe, 0xbe, 0xf7, 0x4c, 0xec, 0xb4, 0x02, 0x93, 0xf6, 0x9b, 0xcb, 0x5f, 0xfd, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0xf5, 0xc7, 0x0c, 0xeb, 0x43, 0x02, 0x00, 0x00, + // 428 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcf, 0x6a, 0xdb, 0x40, + 0x10, 0xc6, 0xbd, 0x75, 0xe2, 0x38, 0x9b, 0x9a, 0xba, 0x4b, 0x0c, 0xc2, 0x01, 0xd9, 0xa4, 0x14, + 0x44, 0x0e, 0x5a, 0x42, 0x6e, 0x85, 0x50, 0x70, 0x43, 0xff, 0x91, 0x42, 0xd0, 0xa1, 0x87, 0x5e, + 0x96, 0x95, 0x32, 0x91, 0x96, 0x68, 0x77, 0x84, 0x76, 0x63, 0xea, 0x57, 0xe8, 0xa9, 0x8f, 0xd1, + 0x63, 0x1e, 0x23, 0xc7, 0x1c, 0x4b, 0x0e, 0xa1, 0xd8, 0x87, 0xbc, 0x46, 0x89, 0x94, 0x58, 0xa6, + 0x3d, 0xe5, 0xb2, 0xcc, 0x7e, 0xdf, 0xcc, 0x8f, 0xd9, 0x9d, 0xa1, 0x23, 0xb4, 0xfc, 0x0c, 0x40, + 0xcb, 0xf2, 0x1c, 0x1c, 0x9f, 0xee, 0x37, 0x97, 0xb0, 0x28, 0xd1, 0x21, 0x7b, 0x81, 0x36, 0x6c, + 0xb4, 0xe9, 0xfe, 0xf0, 0xa5, 0xd4, 0xca, 0x20, 0xaf, 0xce, 0x3a, 0x67, 0xb8, 0x9d, 0x62, 0x8a, + 0x55, 0xc8, 0xef, 0xa3, 0x5a, 0xdd, 0xbd, 0x69, 0xd3, 0xce, 0x89, 0x2c, 0xa5, 0xb6, 0xcc, 0xa7, + 0x5b, 0x06, 0x45, 0x2c, 0x2d, 0x88, 0x33, 0x00, 0x8f, 0x8c, 0x49, 0xd0, 0x8d, 0x36, 0x0d, 0x4e, + 0xa4, 0x85, 0xf7, 0x00, 0xec, 0x90, 0xee, 0x3c, 0x9a, 0x22, 0xc9, 0xa4, 0x49, 0x41, 0x9c, 0x82, + 0x41, 0xad, 0x8c, 0x74, 0x58, 0x7a, 0xcf, 0xc6, 0x24, 0xe8, 0x45, 0x5e, 0x5c, 0x67, 0xbf, 0xab, + 0x12, 0x8e, 0x1a, 0x9f, 0x1d, 0xd0, 0x01, 0xe4, 0xd2, 0x3a, 0x95, 0x28, 0x37, 0x13, 0xfa, 0x22, + 0x77, 0xaa, 0xc8, 0x15, 0x94, 0x5e, 0xbb, 0x2a, 0xdc, 0x6e, 0xcc, 0x2f, 0x4b, 0x8f, 0xbd, 0xa2, + 0x3d, 0x30, 0x32, 0xce, 0x41, 0x64, 0xa0, 0xd2, 0xcc, 0x79, 0xeb, 0x63, 0x12, 0xb4, 0xa3, 0xe7, + 0xb5, 0xf8, 0xb1, 0xd2, 0xd8, 0x21, 0xed, 0x2e, 0xbb, 0xee, 0x8c, 0x49, 0xb0, 0x39, 0xd9, 0xbd, + 0xba, 0x1d, 0xb5, 0x6e, 0x6e, 0x47, 0x83, 0x04, 0xad, 0x46, 0x6b, 0x4f, 0xcf, 0x43, 0x85, 0x5c, + 0x4b, 0x97, 0x85, 0x9f, 0x8c, 0xfb, 0x75, 0x77, 0xb9, 0x47, 0xa2, 0x8d, 0x87, 0x4e, 0xd9, 0x31, + 0xed, 0x69, 0x65, 0x44, 0x2a, 0xad, 0x28, 0x4a, 0x95, 0x80, 0xb7, 0x51, 0x31, 0x82, 0x07, 0xc6, + 0xce, 0xff, 0x8c, 0x63, 0x48, 0x65, 0x32, 0x3b, 0x82, 0xa4, 0x26, 0x6d, 0x69, 0x65, 0x3e, 0x48, + 0x7b, 0x72, 0x5f, 0xcc, 0xbe, 0x52, 0xf6, 0x48, 0x5b, 0x79, 0x63, 0xf7, 0x89, 0xc8, 0x7e, 0x8d, + 0x6c, 0x7e, 0xe2, 0xcd, 0xf0, 0xc7, 0xdd, 0xe5, 0xde, 0x00, 0x2d, 0xff, 0xbe, 0xb2, 0x0a, 0xf5, + 0xe4, 0x3e, 0xaf, 0x75, 0xd7, 0xfa, 0xeb, 0x51, 0x5f, 0x19, 0xe5, 0x94, 0xcc, 0x97, 0x23, 0x9c, + 0xbc, 0xbd, 0x9a, 0xfb, 0xe4, 0x7a, 0xee, 0x93, 0x3f, 0x73, 0x9f, 0xfc, 0x5c, 0xf8, 0xad, 0xeb, + 0x85, 0xdf, 0xfa, 0xbd, 0xf0, 0x5b, 0xdf, 0x5e, 0xa7, 0xca, 0x65, 0x17, 0x71, 0x98, 0xa0, 0xe6, + 0x30, 0xd5, 0x68, 0xf9, 0x3f, 0x64, 0x37, 0x2b, 0xc0, 0xc6, 0x9d, 0x6a, 0x49, 0x0e, 0xfe, 0x06, + 0x00, 0x00, 0xff, 0xff, 0x50, 0x16, 0x20, 0x30, 0x81, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/feemarket/types/genesis.pb.go b/x/feemarket/types/genesis.pb.go index 9071d472..73c81723 100644 --- a/x/feemarket/types/genesis.pb.go +++ b/x/feemarket/types/genesis.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -86,22 +87,23 @@ func init() { func init() { proto.RegisterFile("os/feemarket/v1/genesis.proto", fileDescriptor_5517463fd90912fc) } var fileDescriptor_5517463fd90912fc = []byte{ - // 237 bytes of a gzipped FileDescriptorProto + // 253 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcd, 0x2f, 0xd6, 0x4f, 0x4b, 0x4d, 0xcd, 0x4d, 0x2c, 0xca, 0x4e, 0x2d, 0xd1, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcf, 0x2f, 0xd6, 0x83, 0x4b, - 0xeb, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0xe5, 0xf4, 0x41, 0x2c, 0x88, 0x32, - 0x29, 0x79, 0x74, 0x53, 0x10, 0x7a, 0xc0, 0x0a, 0x94, 0x8a, 0xb8, 0x78, 0xdc, 0x21, 0x06, 0x07, - 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x99, 0x72, 0xb1, 0x15, 0x24, 0x16, 0x25, 0xe6, 0x16, 0x4b, 0x30, - 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x89, 0xeb, 0xa1, 0x59, 0xa4, 0x17, 0x00, 0x96, 0x76, 0x62, 0x39, - 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, 0x58, 0x48, 0x9a, 0x8b, 0x33, 0x29, 0x27, 0x3f, 0x39, 0x3b, - 0x3e, 0x3d, 0xb1, 0x58, 0x82, 0x59, 0x81, 0x51, 0x83, 0x25, 0x88, 0x03, 0x2c, 0xe0, 0x9e, 0x58, - 0xec, 0xc5, 0xc2, 0xc1, 0x24, 0xc0, 0x1c, 0xc4, 0x91, 0x94, 0x58, 0x9c, 0x1a, 0x9f, 0x96, 0x9a, - 0xea, 0x64, 0x7f, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, - 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xaa, 0xe9, 0x99, - 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xa9, 0x65, 0xb9, 0xf9, 0xc5, 0xfa, 0xf9, - 0xc5, 0xfa, 0x15, 0x48, 0x3e, 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xbb, 0xdd, 0x18, - 0x10, 0x00, 0x00, 0xff, 0xff, 0x6c, 0x2a, 0x45, 0xc6, 0x24, 0x01, 0x00, 0x00, + 0xeb, 0x95, 0x19, 0x4a, 0x09, 0x26, 0xe6, 0x66, 0xe6, 0xe5, 0xeb, 0x83, 0x49, 0x88, 0x1a, 0x29, + 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0x30, 0x53, 0x1f, 0xc4, 0x82, 0x8a, 0xca, 0xa3, 0x1b, 0x8c, 0x30, + 0x06, 0xac, 0x40, 0xa9, 0x9c, 0x8b, 0xc7, 0x1d, 0x62, 0x57, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, + 0x15, 0x17, 0x5b, 0x41, 0x62, 0x51, 0x62, 0x6e, 0xb1, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, + 0xb8, 0x1e, 0x9a, 0xdd, 0x7a, 0x01, 0x60, 0x69, 0x27, 0xce, 0x13, 0xf7, 0xe4, 0x19, 0x56, 0x3c, + 0xdf, 0xa0, 0xc5, 0x18, 0x04, 0xd5, 0x21, 0x24, 0xcd, 0xc5, 0x99, 0x94, 0x93, 0x9f, 0x9c, 0x1d, + 0x9f, 0x9e, 0x58, 0x2c, 0xc1, 0xac, 0xc0, 0xa8, 0xc1, 0x12, 0xc4, 0x01, 0x16, 0x70, 0x4f, 0x2c, + 0xf6, 0x62, 0xe1, 0x60, 0x12, 0x60, 0x0e, 0xe2, 0x48, 0x4a, 0x2c, 0x4e, 0x8d, 0x4f, 0x4b, 0x4d, + 0x75, 0xb2, 0x3f, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, + 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xd5, 0xf4, 0xcc, + 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xd4, 0xb2, 0xdc, 0xfc, 0x62, 0xfd, 0xfc, + 0x62, 0xfd, 0x0a, 0x24, 0x6f, 0x94, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x3d, 0x60, 0x0c, + 0x08, 0x00, 0x00, 0xff, 0xff, 0x98, 0xdb, 0x43, 0x85, 0x3c, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/feemarket/types/msg.go b/x/feemarket/types/msg.go index 053b603a..d8da4607 100644 --- a/x/feemarket/types/msg.go +++ b/x/feemarket/types/msg.go @@ -1,5 +1,6 @@ // Copyright Tharsis Labs Ltd.(Evmos) // SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + package types import ( @@ -9,12 +10,6 @@ import ( var _ sdk.Msg = &MsgUpdateParams{} -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { - addr := sdk.MustAccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} - // ValidateBasic does a sanity check of the provided data func (m *MsgUpdateParams) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { diff --git a/x/feemarket/types/params_test.go b/x/feemarket/types/params_test.go index f27c2d05..a47241de 100644 --- a/x/feemarket/types/params_test.go +++ b/x/feemarket/types/params_test.go @@ -3,7 +3,7 @@ package types import ( "testing" - "cosmossdk.io/math" + sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/suite" ) @@ -24,7 +24,7 @@ func (suite *ParamsTestSuite) TestParamsValidate() { {"default", DefaultParams(), false}, { "valid", - NewParams(true, 7, 3, 2000000000, int64(544435345345435345), math.LegacyNewDecWithPrec(20, 4), DefaultMinGasMultiplier), + NewParams(true, 7, 3, 2000000000, int64(544435345345435345), sdkmath.LegacyNewDecWithPrec(20, 4), DefaultMinGasMultiplier), false, }, { @@ -34,27 +34,27 @@ func (suite *ParamsTestSuite) TestParamsValidate() { }, { "base fee change denominator is 0 ", - NewParams(true, 0, 3, 2000000000, int64(544435345345435345), math.LegacyNewDecWithPrec(20, 4), DefaultMinGasMultiplier), + NewParams(true, 0, 3, 2000000000, int64(544435345345435345), sdkmath.LegacyNewDecWithPrec(20, 4), DefaultMinGasMultiplier), true, }, { "invalid: min gas price negative", - NewParams(true, 7, 3, 2000000000, int64(544435345345435345), math.LegacyNewDecFromInt(math.NewInt(-1)), DefaultMinGasMultiplier), + NewParams(true, 7, 3, 2000000000, int64(544435345345435345), sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(-1)), DefaultMinGasMultiplier), true, }, { "valid: min gas multiplier zero", - NewParams(true, 7, 3, 2000000000, int64(544435345345435345), DefaultMinGasPrice, math.LegacyZeroDec()), + NewParams(true, 7, 3, 2000000000, int64(544435345345435345), DefaultMinGasPrice, sdkmath.LegacyZeroDec()), false, }, { "invalid: min gas multiplier is negative", - NewParams(true, 7, 3, 2000000000, int64(544435345345435345), DefaultMinGasPrice, math.LegacyNewDecWithPrec(-5, 1)), + NewParams(true, 7, 3, 2000000000, int64(544435345345435345), DefaultMinGasPrice, sdkmath.LegacyNewDecWithPrec(-5, 1)), true, }, { "invalid: min gas multiplier bigger than 1", - NewParams(true, 7, 3, 2000000000, int64(544435345345435345), math.LegacyNewDecWithPrec(20, 4), math.LegacyNewDec(2)), + NewParams(true, 7, 3, 2000000000, int64(544435345345435345), sdkmath.LegacyNewDecWithPrec(20, 4), sdkmath.LegacyNewDec(2)), true, }, } @@ -80,14 +80,14 @@ func (suite *ParamsTestSuite) TestParamsValidatePriv() { suite.Require().NoError(validateElasticityMultiplier(uint32(2))) suite.Require().Error(validateBaseFee("")) suite.Require().Error(validateBaseFee(int64(2000000000))) - suite.Require().Error(validateBaseFee(math.NewInt(-2000000000))) - suite.Require().NoError(validateBaseFee(math.NewInt(2000000000))) + suite.Require().Error(validateBaseFee(sdkmath.NewInt(-2000000000))) + suite.Require().NoError(validateBaseFee(sdkmath.NewInt(2000000000))) suite.Require().Error(validateEnableHeight("")) suite.Require().Error(validateEnableHeight(int64(-544435345345435345))) suite.Require().NoError(validateEnableHeight(int64(544435345345435345))) - suite.Require().Error(validateMinGasPrice(math.LegacyDec{})) - suite.Require().Error(validateMinGasMultiplier(math.LegacyNewDec(-5))) - suite.Require().Error(validateMinGasMultiplier(math.LegacyDec{})) + suite.Require().Error(validateMinGasPrice(sdkmath.LegacyDec{})) + suite.Require().Error(validateMinGasMultiplier(sdkmath.LegacyNewDec(-5))) + suite.Require().Error(validateMinGasMultiplier(sdkmath.LegacyDec{})) suite.Require().Error(validateMinGasMultiplier("")) } @@ -98,13 +98,11 @@ func (suite *ParamsTestSuite) TestParamsValidateMinGasPrice() { expError bool }{ {"default", DefaultParams().MinGasPrice, false}, - {"valid", math.LegacyNewDecFromInt(math.NewInt(1)), false}, + {"valid", sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(1)), false}, + {"valid", sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(1)), false}, {"invalid - wrong type - bool", false, true}, - {"invalid - wrong type - string", "", true}, - {"invalid - wrong type - int64", int64(123), true}, - {"invalid - wrong type - math.Int", math.NewInt(1), true}, {"invalid - is nil", nil, true}, - {"invalid - is negative", math.LegacyNewDecFromInt(math.NewInt(-1)), true}, + {"invalid - is negative", sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(-1)), true}, } for _, tc := range testCases { diff --git a/x/feemarket/types/query.pb.go b/x/feemarket/types/query.pb.go index d18f7db8..034d698b 100644 --- a/x/feemarket/types/query.pb.go +++ b/x/feemarket/types/query.pb.go @@ -7,6 +7,7 @@ import ( context "context" cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -286,34 +287,35 @@ func init() { func init() { proto.RegisterFile("os/feemarket/v1/query.proto", fileDescriptor_133bffc3ae615960) } var fileDescriptor_133bffc3ae615960 = []byte{ - // 425 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xb1, 0x6f, 0xd3, 0x40, - 0x14, 0xc6, 0xed, 0x16, 0xd2, 0x72, 0x0c, 0xa0, 0x23, 0xa1, 0xc4, 0xad, 0x6c, 0x30, 0x14, 0xc1, - 0x72, 0xa7, 0x16, 0x98, 0x91, 0x3c, 0x80, 0x90, 0x18, 0xc0, 0x23, 0x4b, 0x75, 0x0e, 0xaf, 0xae, - 0x95, 0xda, 0xcf, 0xf5, 0x5d, 0x22, 0x32, 0xb0, 0xf0, 0x17, 0x20, 0xf1, 0x4f, 0x75, 0xac, 0xc4, - 0x82, 0x18, 0x22, 0x94, 0xf0, 0x3f, 0xb0, 0x22, 0x9f, 0x2f, 0x09, 0xb6, 0x15, 0xb2, 0x9d, 0xde, - 0xfb, 0xee, 0xfb, 0xf9, 0xfb, 0x7c, 0x64, 0x1f, 0x25, 0x3f, 0x05, 0x48, 0x45, 0x31, 0x04, 0xc5, - 0xc7, 0x47, 0xfc, 0x62, 0x04, 0xc5, 0x84, 0xe5, 0x05, 0x2a, 0xa4, 0xb7, 0x50, 0xb2, 0xe5, 0x92, - 0x8d, 0x8f, 0x9c, 0x6e, 0x8c, 0x31, 0xea, 0x1d, 0x2f, 0x4f, 0x95, 0xcc, 0x39, 0x88, 0x11, 0xe3, - 0x73, 0xe0, 0x22, 0x4f, 0xb8, 0xc8, 0x32, 0x54, 0x42, 0x25, 0x98, 0x49, 0xb3, 0xf5, 0x9a, 0x84, - 0x95, 0xa3, 0x16, 0xf8, 0x5d, 0x42, 0xdf, 0x97, 0xd0, 0x77, 0xa2, 0x10, 0xa9, 0x0c, 0xe1, 0x62, - 0x04, 0x52, 0xf9, 0x6f, 0xc9, 0x9d, 0xda, 0x54, 0xe6, 0x98, 0x49, 0xa0, 0x2f, 0x48, 0x27, 0xd7, - 0x93, 0x7b, 0xf6, 0x7d, 0xfb, 0xc9, 0xcd, 0xe3, 0x3d, 0xd6, 0xf8, 0x46, 0x56, 0x5d, 0x08, 0xae, - 0x5d, 0x4e, 0x3d, 0x2b, 0x34, 0x62, 0xbf, 0x67, 0xdc, 0x02, 0x21, 0xe1, 0x15, 0xc0, 0x0a, 0xd2, - 0xad, 0x8f, 0x0d, 0xe5, 0x39, 0xd9, 0x8d, 0x84, 0x84, 0x93, 0x53, 0x00, 0xcd, 0xb9, 0x11, 0xf4, - 0x7f, 0x4e, 0xbd, 0xde, 0x00, 0x65, 0x8a, 0x52, 0x7e, 0x1c, 0xb2, 0x04, 0x79, 0x2a, 0xd4, 0x19, - 0x7b, 0x93, 0xa9, 0x70, 0x27, 0xaa, 0x6e, 0xfb, 0x77, 0x17, 0x6e, 0xe7, 0x38, 0x18, 0xbe, 0x16, - 0xcb, 0x28, 0x4f, 0x49, 0xaf, 0x31, 0x37, 0x98, 0xdb, 0x64, 0x3b, 0x16, 0x55, 0x92, 0xed, 0xb0, - 0x3c, 0x1e, 0xff, 0xd9, 0x22, 0xd7, 0xb5, 0x96, 0x2a, 0xd2, 0xa9, 0x92, 0xd0, 0x87, 0xad, 0x88, - 0xed, 0xba, 0x9c, 0x47, 0xff, 0x17, 0x55, 0x40, 0xdf, 0xfb, 0xf2, 0xfd, 0xf7, 0xb7, 0xad, 0x3e, - 0xdd, 0xe3, 0xcd, 0x9f, 0x52, 0xf5, 0x44, 0x27, 0x64, 0xc7, 0x74, 0x41, 0xd7, 0x38, 0xd6, 0x1b, - 0x74, 0x0e, 0x37, 0xa8, 0x0c, 0xf8, 0x81, 0x06, 0xef, 0xd3, 0x7e, 0x0b, 0xbc, 0xe8, 0x99, 0x7e, - 0x26, 0xbb, 0x8b, 0x82, 0xe8, 0x3a, 0xd7, 0x7a, 0xb1, 0xce, 0xe3, 0x4d, 0x32, 0x43, 0xf7, 0x35, - 0xfd, 0x80, 0x3a, 0x6d, 0x7a, 0x29, 0x3d, 0x89, 0x85, 0x0c, 0x5e, 0x5e, 0xce, 0x5c, 0xfb, 0x6a, - 0xe6, 0xda, 0xbf, 0x66, 0xae, 0xfd, 0x75, 0xee, 0x5a, 0x57, 0x73, 0xd7, 0xfa, 0x31, 0x77, 0xad, - 0x0f, 0x87, 0x71, 0xa2, 0xce, 0x46, 0x11, 0x1b, 0x60, 0xca, 0x61, 0x9c, 0xa2, 0x2c, 0x5d, 0x3e, - 0xfd, 0xe3, 0xa3, 0x26, 0x39, 0xc8, 0xa8, 0xa3, 0x5f, 0xf3, 0xb3, 0xbf, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x66, 0x00, 0xd4, 0xe3, 0x52, 0x03, 0x00, 0x00, + // 446 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xb1, 0x6e, 0xd4, 0x40, + 0x10, 0x86, 0xed, 0x44, 0x5c, 0x92, 0xa5, 0x00, 0x96, 0x3b, 0xc2, 0x39, 0x91, 0x0d, 0x86, 0x20, + 0xa0, 0xd8, 0x55, 0x02, 0x15, 0x0d, 0x92, 0x0b, 0x10, 0x12, 0x05, 0x71, 0x49, 0x13, 0xad, 0x8f, + 0x89, 0x63, 0x5d, 0xec, 0x71, 0xbc, 0x7b, 0x27, 0xae, 0xa0, 0xe1, 0x09, 0x90, 0x78, 0x09, 0x4a, + 0x1e, 0x23, 0x65, 0x24, 0x1a, 0x44, 0x11, 0xa1, 0x3b, 0x24, 0x1e, 0x81, 0x16, 0x79, 0xbd, 0x0e, + 0xd8, 0x56, 0x92, 0xc6, 0x1a, 0xcd, 0xfe, 0xf3, 0x7f, 0x3b, 0xbf, 0x97, 0x6c, 0xa0, 0xe4, 0xfb, + 0x00, 0xa9, 0x28, 0xc6, 0xa0, 0xf8, 0x74, 0x9b, 0x1f, 0x4d, 0xa0, 0x98, 0xb1, 0xbc, 0x40, 0x85, + 0xf4, 0x1a, 0x4a, 0x76, 0x76, 0xc8, 0xa6, 0xdb, 0xce, 0x0d, 0x91, 0x26, 0x19, 0x72, 0xfd, 0xad, + 0x34, 0x4e, 0x3f, 0xc6, 0x18, 0x75, 0xc9, 0xcb, 0xca, 0x74, 0x37, 0x63, 0xc4, 0xf8, 0x10, 0xb8, + 0xc8, 0x13, 0x2e, 0xb2, 0x0c, 0x95, 0x50, 0x09, 0x66, 0xd2, 0x9c, 0x7a, 0x6d, 0xe8, 0x3f, 0x88, + 0x16, 0xf8, 0x7d, 0x42, 0x77, 0xcb, 0x7b, 0xbc, 0x11, 0x85, 0x48, 0x65, 0x08, 0x47, 0x13, 0x90, + 0xca, 0xdf, 0x25, 0x37, 0x1b, 0x5d, 0x99, 0x63, 0x26, 0x81, 0x3e, 0x23, 0xbd, 0x5c, 0x77, 0x6e, + 0xdb, 0x77, 0xec, 0x87, 0x57, 0x77, 0xd6, 0x59, 0xeb, 0xda, 0xac, 0x1a, 0x08, 0xd6, 0x8e, 0x4f, + 0x3d, 0xeb, 0xcb, 0xef, 0xaf, 0x8f, 0xed, 0xd0, 0x4c, 0xf8, 0x03, 0x63, 0x19, 0x08, 0x09, 0x2f, + 0x00, 0x6a, 0xd2, 0x6b, 0xd2, 0x6f, 0xb6, 0x0d, 0xea, 0x29, 0x59, 0x8d, 0x84, 0x84, 0xbd, 0x7d, + 0x00, 0x0d, 0x5b, 0x0b, 0x86, 0x3f, 0x4e, 0xbd, 0xc1, 0x08, 0x65, 0x8a, 0x52, 0xbe, 0x1b, 0xb3, + 0x04, 0x79, 0x2a, 0xd4, 0x01, 0x7b, 0x95, 0xa9, 0x70, 0x25, 0xaa, 0xa6, 0xfd, 0x5b, 0xb5, 0xdb, + 0x21, 0x8e, 0xc6, 0x2f, 0xc5, 0xd9, 0x3e, 0x8f, 0xc8, 0xa0, 0xd5, 0x37, 0x98, 0xeb, 0x64, 0x39, + 0x16, 0xd5, 0x3a, 0xcb, 0x61, 0x59, 0xee, 0xfc, 0x59, 0x22, 0x57, 0xb4, 0x96, 0x2a, 0xd2, 0xab, + 0xd6, 0xa1, 0xf7, 0x3a, 0x7b, 0x76, 0x33, 0x73, 0xee, 0x5f, 0x2c, 0xaa, 0x80, 0xbe, 0xf7, 0xf1, + 0xdb, 0xaf, 0xcf, 0x4b, 0x43, 0xba, 0xce, 0xdb, 0x7f, 0xa6, 0xca, 0x89, 0xce, 0xc8, 0x8a, 0xc9, + 0x82, 0x9e, 0xe3, 0xd8, 0x4c, 0xd0, 0xd9, 0xba, 0x44, 0x65, 0xc0, 0x77, 0x35, 0x78, 0x83, 0x0e, + 0x3b, 0xe0, 0x3a, 0x67, 0xfa, 0x81, 0xac, 0xd6, 0x01, 0xd1, 0xf3, 0x5c, 0x9b, 0xc1, 0x3a, 0x0f, + 0x2e, 0x93, 0x19, 0xba, 0xaf, 0xe9, 0x9b, 0xd4, 0xe9, 0xd2, 0x4b, 0xe9, 0x5e, 0x2c, 0x64, 0xf0, + 0xfc, 0x78, 0xee, 0xda, 0x27, 0x73, 0xd7, 0xfe, 0x39, 0x77, 0xed, 0x4f, 0x0b, 0xd7, 0x3a, 0x59, + 0xb8, 0xd6, 0xf7, 0x85, 0x6b, 0xbd, 0xdd, 0x8a, 0x13, 0x75, 0x30, 0x89, 0xd8, 0x08, 0x53, 0x0e, + 0xd3, 0x14, 0x65, 0xe9, 0xf2, 0xfe, 0x3f, 0x1f, 0x35, 0xcb, 0x41, 0x46, 0x3d, 0xfd, 0xa4, 0x9f, + 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x09, 0xd3, 0xe9, 0x6f, 0x6a, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feemarket/types/tx.pb.go b/x/feemarket/types/tx.pb.go index 236240ac..3989b1c6 100644 --- a/x/feemarket/types/tx.pb.go +++ b/x/feemarket/types/tx.pb.go @@ -8,6 +8,7 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -132,27 +133,29 @@ func init() { func init() { proto.RegisterFile("os/feemarket/v1/tx.proto", fileDescriptor_05c3066a421d8b70) } var fileDescriptor_05c3066a421d8b70 = []byte{ - // 312 bytes of a gzipped FileDescriptorProto + // 343 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc8, 0x2f, 0xd6, 0x4f, 0x4b, 0x4d, 0xcd, 0x4d, 0x2c, 0xca, 0x4e, 0x2d, 0xd1, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, - 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcf, 0x2f, 0xd6, 0x83, 0xcb, 0xe8, 0x95, 0x19, 0x4a, 0x89, - 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb, 0xe7, 0x16, 0xa7, 0x83, 0x14, 0xe6, 0x16, 0xa7, 0x43, - 0x54, 0x4a, 0x49, 0x42, 0x24, 0xe2, 0xc1, 0x3c, 0x7d, 0x08, 0x07, 0x2a, 0x25, 0x92, 0x9e, 0x9f, - 0x9e, 0x0f, 0x11, 0x07, 0xb1, 0xa0, 0xa2, 0xf2, 0xe8, 0x96, 0x22, 0xec, 0x01, 0x2b, 0x50, 0x9a, - 0xc0, 0xc8, 0xc5, 0xef, 0x5b, 0x9c, 0x1e, 0x5a, 0x90, 0x92, 0x58, 0x92, 0x1a, 0x90, 0x58, 0x94, - 0x98, 0x5b, 0x2c, 0x64, 0xc6, 0xc5, 0x99, 0x58, 0x5a, 0x92, 0x91, 0x5f, 0x94, 0x59, 0x52, 0x29, - 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0x71, 0x69, 0x8b, 0xae, 0x08, 0xd4, 0x3e, 0xc7, 0x94, - 0x94, 0xa2, 0xd4, 0xe2, 0xe2, 0xe0, 0x92, 0xa2, 0xcc, 0xbc, 0xf4, 0x20, 0x84, 0x52, 0x21, 0x53, - 0x2e, 0xb6, 0x02, 0xb0, 0x09, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0xe2, 0x7a, 0x68, 0x1e, - 0xd3, 0x83, 0x58, 0xe0, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54, 0xb1, 0x15, 0x5f, 0xd3, - 0xf3, 0x0d, 0x5a, 0x08, 0x63, 0x94, 0x24, 0xb9, 0xc4, 0xd1, 0x5c, 0x14, 0x94, 0x5a, 0x5c, 0x90, - 0x9f, 0x57, 0x9c, 0x6a, 0x94, 0xc8, 0xc5, 0xec, 0x5b, 0x9c, 0x2e, 0x14, 0xc5, 0xc5, 0x83, 0xe2, - 0x60, 0x05, 0x0c, 0x8b, 0xd0, 0x0c, 0x90, 0xd2, 0x20, 0xa4, 0x02, 0x66, 0x85, 0x93, 0xfd, 0x89, - 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, - 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xa9, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, - 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0x96, 0x81, 0xe2, 0x27, 0xbf, 0x58, 0xbf, 0x02, 0x29, 0x78, - 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x01, 0x6b, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, - 0x36, 0xff, 0x86, 0xa9, 0xf0, 0x01, 0x00, 0x00, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcf, 0x2f, 0xd6, 0x83, 0xcb, 0xe8, 0x95, 0x19, 0x4a, 0x09, + 0x26, 0xe6, 0x66, 0xe6, 0xe5, 0xeb, 0x83, 0x49, 0x88, 0x1a, 0x29, 0xf1, 0xe4, 0xfc, 0xe2, 0xdc, + 0xfc, 0x62, 0xfd, 0xdc, 0xe2, 0x74, 0x90, 0xde, 0xdc, 0xe2, 0x74, 0xa8, 0x84, 0x24, 0x44, 0x22, + 0x1e, 0xcc, 0xd3, 0x87, 0x70, 0xa0, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x10, 0x71, 0x10, 0x0b, + 0x2a, 0x2a, 0x8f, 0xee, 0x0e, 0x84, 0xd5, 0x60, 0x05, 0x4a, 0x3b, 0x18, 0xb9, 0xf8, 0x7d, 0x8b, + 0xd3, 0x43, 0x0b, 0x52, 0x12, 0x4b, 0x52, 0x03, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0x85, 0xcc, 0xb8, + 0x38, 0x13, 0x4b, 0x4b, 0x32, 0xf2, 0x8b, 0x32, 0x4b, 0x2a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, + 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x15, 0x81, 0xda, 0xe7, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x1c, + 0x5c, 0x52, 0x94, 0x99, 0x97, 0x1e, 0x84, 0x50, 0x2a, 0x64, 0xc5, 0xc5, 0x56, 0x00, 0x36, 0x41, + 0x82, 0x49, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x5c, 0x0f, 0xcd, 0xaf, 0x7a, 0x10, 0x0b, 0x9c, 0x38, + 0x4f, 0xdc, 0x93, 0x67, 0x58, 0xf1, 0x7c, 0x83, 0x16, 0x63, 0x10, 0x54, 0x87, 0x95, 0x61, 0xd3, + 0xf3, 0x0d, 0x5a, 0x08, 0xb3, 0xba, 0x9e, 0x6f, 0xd0, 0x92, 0xcb, 0x2f, 0xd6, 0xaf, 0x40, 0x72, + 0x3d, 0x9a, 0x33, 0x95, 0x24, 0xb9, 0xc4, 0xd1, 0x84, 0x82, 0x52, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, + 0x53, 0x8d, 0x32, 0xb8, 0x98, 0x7d, 0x8b, 0xd3, 0x85, 0xa2, 0xb8, 0x78, 0x50, 0x3c, 0xa6, 0x80, + 0xe1, 0x20, 0x34, 0x03, 0xa4, 0x34, 0x08, 0xa9, 0x80, 0x59, 0x21, 0xc5, 0xda, 0x00, 0x72, 0xbf, + 0x93, 0xfd, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, + 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xa9, 0xa6, 0x67, 0x96, + 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0x96, 0x81, 0xa2, 0x13, 0xcd, 0x3f, 0x25, + 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x78, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x7f, + 0x4c, 0x5b, 0xee, 0x32, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/ibc/transfer/ibc_module.go b/x/ibc/transfer/ibc_module.go index 70a47355..988f1a04 100644 --- a/x/ibc/transfer/ibc_module.go +++ b/x/ibc/transfer/ibc_module.go @@ -4,8 +4,8 @@ package transfer import ( - ibctransfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibctransfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" "github.com/evmos/os/x/ibc/transfer/keeper" ) diff --git a/x/ibc/transfer/keeper/keeper.go b/x/ibc/transfer/keeper/keeper.go index dbae791b..36142a9b 100644 --- a/x/ibc/transfer/keeper/keeper.go +++ b/x/ibc/transfer/keeper/keeper.go @@ -4,15 +4,13 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - - "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" "github.com/evmos/os/x/ibc/transfer/types" ) @@ -39,12 +37,14 @@ func NewKeeper( bankKeeper types.BankKeeper, scopedKeeper capabilitykeeper.ScopedKeeper, erc20Keeper types.ERC20Keeper, + authority string, ) Keeper { // create the original IBC transfer keeper for embedding transferKeeper := keeper.NewKeeper( cdc, storeKey, paramSpace, ics4Wrapper, channelKeeper, portKeeper, accountKeeper, bankKeeper, scopedKeeper, + authority, ) return Keeper{ diff --git a/x/ibc/transfer/keeper/keeper_test.go b/x/ibc/transfer/keeper/keeper_test.go index ca4342d6..ed9e0cac 100644 --- a/x/ibc/transfer/keeper/keeper_test.go +++ b/x/ibc/transfer/keeper/keeper_test.go @@ -1,182 +1,93 @@ package keeper_test import ( - "encoding/json" - "math" "math/big" "testing" - "time" - - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/ginkgo/v2" - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/gomega" - - sdkmath "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + + "cosmossdk.io/math" + abcitypes "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - "github.com/cosmos/ibc-go/v7/modules/core/exported" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/evmos/os/contracts" - "github.com/evmos/os/crypto/ethsecp256k1" - exampleapp "github.com/evmos/os/example_chain" - chainutil "github.com/evmos/os/example_chain/testutil" - "github.com/evmos/os/server/config" - evmosutil "github.com/evmos/os/testutil" - utiltx "github.com/evmos/os/testutil/tx" - "github.com/evmos/os/x/erc20/types" - "github.com/evmos/os/x/evm/statedb" - evm "github.com/evmos/os/x/evm/types" + "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + + "github.com/evmos/os/contracts" + cmnfactory "github.com/evmos/os/testutil/integration/common/factory" + "github.com/evmos/os/testutil/integration/os/factory" + "github.com/evmos/os/testutil/integration/os/grpc" + "github.com/evmos/os/testutil/integration/os/keyring" + "github.com/evmos/os/testutil/integration/os/network" + erc20types "github.com/evmos/os/x/erc20/types" + evm "github.com/evmos/os/x/evm/types" + + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + "github.com/cosmos/ibc-go/v8/modules/core/exported" ) type KeeperTestSuite struct { suite.Suite - ctx sdk.Context - app *exampleapp.ExampleChain - queryClientEvm evm.QueryClient - queryClient types.QueryClient - address common.Address - consAddress sdk.ConsAddress - clientCtx client.Context //nolint:unused - ethSigner ethtypes.Signer - priv cryptotypes.PrivKey - validator stakingtypes.Validator - signer keyring.Signer - mintFeeCollector bool + network *network.UnitTestNetwork + handler grpc.Handler + keyring keyring.Keyring + factory factory.TxFactory + + otherDenom string } -var s *KeeperTestSuite +var timeoutHeight = clienttypes.NewHeight(1000, 1000) func TestKeeperTestSuite(t *testing.T) { - s = new(KeeperTestSuite) + s := new(KeeperTestSuite) suite.Run(t, s) - - // Run Ginkgo integration tests - RegisterFailHandler(Fail) - RunSpecs(t, "Keeper Suite") } func (suite *KeeperTestSuite) SetupTest() { - suite.DoSetupTest(suite.T()) -} - -func (suite *KeeperTestSuite) DoSetupTest(t require.TestingT) { - // account key - priv, err := ethsecp256k1.GenerateKey() - require.NoError(t, err) - suite.priv = priv - suite.address = common.BytesToAddress(priv.PubKey().Address().Bytes()) - suite.signer = utiltx.NewSigner(priv) - - // consensus key - privCons, err := ethsecp256k1.GenerateKey() - require.NoError(t, err) - consAddress := sdk.ConsAddress(privCons.PubKey().Address()) - suite.consAddress = consAddress - - // init app - chainID := evmosutil.ExampleChainID - suite.app = exampleapp.Setup(suite.T(), false, chainID) - header := evmosutil.NewHeader( - 1, time.Now().UTC(), chainID, suite.consAddress, nil, nil, - ) - suite.ctx = suite.app.BaseApp.NewContext(false, header) - - // query clients - queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) - types.RegisterQueryServer(queryHelper, suite.app.Erc20Keeper) - suite.queryClient = types.NewQueryClient(queryHelper) - - queryHelperEvm := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) - evm.RegisterQueryServer(queryHelperEvm, suite.app.EVMKeeper) - suite.queryClientEvm = evm.NewQueryClient(queryHelperEvm) - - // bond denom - stakingParams := suite.app.StakingKeeper.GetParams(suite.ctx) - stakingParams.BondDenom = evmosutil.ExampleAttoDenom - err = suite.app.StakingKeeper.SetParams(suite.ctx, stakingParams) - suite.Require().NoError(err) - - // Set Validator - valAddr := sdk.ValAddress(suite.address.Bytes()) - validator, err := stakingtypes.NewValidator(valAddr, privCons.PubKey(), stakingtypes.Description{}) - require.NoError(t, err) - validator = stakingkeeper.TestingUpdateValidator(suite.app.StakingKeeper, suite.ctx, validator, true) - err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, validator.GetOperator()) - require.NoError(t, err) - err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) - require.NoError(t, err) - - // fund signer acc to pay for tx fees - amt := sdkmath.NewInt(int64(math.Pow10(18) * 2)) - err = chainutil.FundAccount( - suite.ctx, - suite.app.BankKeeper, - suite.priv.PubKey().Address().Bytes(), - sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, amt)), - ) - suite.Require().NoError(err) - - // TODO change to setup with 1 validator - validators := s.app.StakingKeeper.GetValidators(s.ctx, 2) - // set a bonded validator that takes part in consensus - if validators[0].Status == stakingtypes.Bonded { - suite.validator = validators[0] - } else { - suite.validator = validators[1] + keys := keyring.New(2) + suite.otherDenom = "xmpl" + + // Set custom genesis with capability record + customGenesis := network.CustomGenesisState{} + + capParams := capabilitytypes.DefaultGenesis() + capParams.Index = 2 + capParams.Owners = []capabilitytypes.GenesisOwners{ + { + Index: 1, + IndexOwners: capabilitytypes.CapabilityOwners{ + Owners: []capabilitytypes.Owner{ + { + Module: "ibc", + Name: "capabilities/ports/transfer/channels/channel-0", + }, + { + Module: "transfer", + Name: "capabilities/ports/transfer/channels/channel-0", + }, + }, + }, + }, } - suite.ethSigner = ethtypes.LatestSignerForChainID(s.app.EVMKeeper.ChainID()) -} - -var timeoutHeight = clienttypes.NewHeight(1000, 1000) + customGenesis[capabilitytypes.ModuleName] = capParams -func (suite *KeeperTestSuite) StateDB() *statedb.StateDB { - return statedb.New(suite.ctx, suite.app.EVMKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(suite.ctx.HeaderHash().Bytes()))) -} - -func (suite *KeeperTestSuite) MintFeeCollector(coins sdk.Coins) { - err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, coins) - suite.Require().NoError(err) - err = suite.app.BankKeeper.SendCoinsFromModuleToModule(suite.ctx, types.ModuleName, authtypes.FeeCollectorName, coins) - suite.Require().NoError(err) -} - -// Commit commits and starts a new block with an updated context. -func (suite *KeeperTestSuite) Commit() { - suite.CommitAndBeginBlockAfter(time.Hour * 1) -} + nw := network.NewUnitTestNetwork( + network.WithPreFundedAccounts(keys.GetAllAccAddrs()...), + network.WithOtherDenoms([]string{suite.otherDenom}), + network.WithCustomGenesis(customGenesis), + ) + gh := grpc.NewIntegrationHandler(nw) + tf := factory.New(nw, gh) -// Commit commits a block at a given time. Reminder: At the end of each -// Tendermint Consensus round the following methods are run -// 1. BeginBlock -// 2. DeliverTx -// 3. EndBlock -// 4. Commit -func (suite *KeeperTestSuite) CommitAndBeginBlockAfter(t time.Duration) { - var err error - suite.ctx, err = chainutil.CommitAndCreateNewCtx(suite.ctx, suite.app, t, nil) - suite.Require().NoError(err) - queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) - evm.RegisterQueryServer(queryHelper, suite.app.EVMKeeper) - suite.queryClientEvm = evm.NewQueryClient(queryHelper) + suite.network = nw + suite.factory = tf + suite.handler = gh + suite.keyring = keys } var _ transfertypes.ChannelKeeper = &MockChannelKeeper{} @@ -231,61 +142,51 @@ func (b *MockICS4Wrapper) SendPacket( return 0, nil } -// DeployContract deploys the ERC20MinterBurnerDecimalsContract. -func (suite *KeeperTestSuite) DeployContract(name, symbol string, decimals uint8) (common.Address, error) { - suite.Commit() - addr, err := chainutil.DeployContract( - suite.ctx, - suite.app, - suite.priv, - suite.queryClientEvm, - contracts.ERC20MinterBurnerDecimalsContract, - name, symbol, decimals, +func (suite *KeeperTestSuite) MintERC20Token(contractAddr, to common.Address, amount *big.Int) (abcitypes.ExecTxResult, error) { + res, err := suite.factory.ExecuteContractCall( + suite.keyring.GetPrivKey(0), + evm.EvmTxArgs{ + To: &contractAddr, + }, + factory.CallArgs{ + ContractABI: contracts.ERC20MinterBurnerDecimalsContract.ABI, + MethodName: "mint", + Args: []interface{}{to, amount}, + }, ) - suite.Commit() - return addr, err -} + if err != nil { + return res, err + } -func (suite *KeeperTestSuite) MintERC20Token(contractAddr, from, to common.Address, amount *big.Int) *evm.MsgEthereumTx { - transferData, err := contracts.ERC20MinterBurnerDecimalsContract.ABI.Pack("mint", to, amount) - suite.Require().NoError(err) - return suite.sendTx(contractAddr, from, transferData) + return res, suite.network.NextBlock() } -func (suite *KeeperTestSuite) sendTx(contractAddr, from common.Address, transferData []byte) *evm.MsgEthereumTx { - ctx := sdk.WrapSDKContext(suite.ctx) - chainID := suite.app.EVMKeeper.ChainID() +func (suite *KeeperTestSuite) DeployContract(name, symbol string, decimals uint8) (common.Address, error) { + addr, err := suite.factory.DeployContract( + suite.keyring.GetPrivKey(0), + evm.EvmTxArgs{}, + factory.ContractDeploymentData{ + Contract: contracts.ERC20MinterBurnerDecimalsContract, + ConstructorArgs: []interface{}{name, symbol, decimals}, + }, + ) + if err != nil { + return common.Address{}, err + } - args, err := json.Marshal(&evm.TransactionArgs{To: &contractAddr, From: &from, Data: (*hexutil.Bytes)(&transferData)}) - suite.Require().NoError(err) - res, err := suite.queryClientEvm.EstimateGas(ctx, &evm.EthCallRequest{ - Args: args, - GasCap: config.DefaultGasCap, - }) - suite.Require().NoError(err) - - nonce := suite.app.EVMKeeper.GetNonce(suite.ctx, suite.address) - - // Mint the max gas to the FeeCollector to ensure balance in case of refund - suite.MintFeeCollector(sdk.NewCoins(sdk.NewCoin(evmosutil.ExampleAttoDenom, sdkmath.NewInt(suite.app.FeeMarketKeeper.GetBaseFee(suite.ctx).Int64()*int64(res.Gas))))) //#nosec G115 -- int overflow is not a concern here -- block number is not likely to exceed int64 max value - - ethTxParams := evm.EvmTxArgs{ - ChainID: chainID, - Nonce: nonce, - To: &contractAddr, - GasLimit: res.Gas, - GasFeeCap: suite.app.FeeMarketKeeper.GetBaseFee(suite.ctx), - GasTipCap: big.NewInt(1), - Input: transferData, - Accesses: ðtypes.AccessList{}, + return addr, suite.network.NextBlock() +} + +func (suite *KeeperTestSuite) ConvertERC20(sender keyring.Key, contractAddr common.Address, amt math.Int) error { + msg := &erc20types.MsgConvertERC20{ + ContractAddress: contractAddr.Hex(), + Amount: amt, + Sender: sender.Addr.String(), + Receiver: sender.AccAddr.String(), } - ercTransferTx := evm.NewTx(ðTxParams) - - ercTransferTx.From = suite.address.Hex() - err = ercTransferTx.Sign(ethtypes.LatestSignerForChainID(chainID), suite.signer) - suite.Require().NoError(err) - rsp, err := suite.app.EVMKeeper.EthereumTx(ctx, ercTransferTx) - suite.Require().NoError(err) - suite.Require().Empty(rsp.VmError) - return ercTransferTx + _, err := suite.factory.CommitCosmosTx(sender.Priv, cmnfactory.CosmosTxArgs{ + Msgs: []sdk.Msg{msg}, + }) + + return err } diff --git a/x/ibc/transfer/keeper/msg_server.go b/x/ibc/transfer/keeper/msg_server.go index a8b9461f..fc1be2b0 100644 --- a/x/ibc/transfer/keeper/msg_server.go +++ b/x/ibc/transfer/keeper/msg_server.go @@ -7,14 +7,14 @@ import ( "context" "strings" - "github.com/armon/go-metrics" "github.com/ethereum/go-ethereum/common" + "github.com/hashicorp/go-metrics" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" erc20types "github.com/evmos/os/x/erc20/types" ) @@ -50,27 +50,27 @@ func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types. pairID := k.erc20Keeper.GetTokenPairID(ctx, denom) if len(pairID) == 0 { // no-op: token is not registered so we can proceed with regular transfer - return k.Keeper.Transfer(sdk.WrapSDKContext(ctx), msg) + return k.Keeper.Transfer(ctx, msg) } pair, _ := k.erc20Keeper.GetTokenPair(ctx, pairID) if !pair.Enabled { // no-op: pair is not enabled so we can proceed with regular transfer - return k.Keeper.Transfer(sdk.WrapSDKContext(ctx), msg) + return k.Keeper.Transfer(ctx, msg) } sender := sdk.MustAccAddressFromBech32(msg.Sender) if !k.erc20Keeper.IsERC20Enabled(ctx) { // no-op: continue with regular transfer - return k.Keeper.Transfer(sdk.WrapSDKContext(ctx), msg) + return k.Keeper.Transfer(ctx, msg) } // update the msg denom to the token pair denom msg.Token.Denom = pair.Denom if !pair.IsNativeERC20() { - return k.Keeper.Transfer(sdk.WrapSDKContext(ctx), msg) + return k.Keeper.Transfer(ctx, msg) } // if the user has enough balance of the Cosmos representation, then we don't need to Convert balance := k.bankKeeper.GetBalance(ctx, sender, pair.Denom) @@ -86,7 +86,7 @@ func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types. ) }() - return k.Keeper.Transfer(sdk.WrapSDKContext(ctx), msg) + return k.Keeper.Transfer(ctx, msg) } // Only convert if the pair is a native ERC20 @@ -101,7 +101,7 @@ func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types. ) // Use MsgConvertERC20 to convert the ERC20 to a Cosmos IBC Coin - if _, err := k.erc20Keeper.ConvertERC20(sdk.WrapSDKContext(ctx), msgConvertERC20); err != nil { + if _, err := k.erc20Keeper.ConvertERC20(ctx, msgConvertERC20); err != nil { return nil, err } @@ -115,5 +115,5 @@ func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types. ) }() - return k.Keeper.Transfer(sdk.WrapSDKContext(ctx), msg) + return k.Keeper.Transfer(ctx, msg) } diff --git a/x/ibc/transfer/keeper/msg_server_test.go b/x/ibc/transfer/keeper/msg_server_test.go index d64a2427..39cbbfdc 100644 --- a/x/ibc/transfer/keeper/msg_server_test.go +++ b/x/ibc/transfer/keeper/msg_server_test.go @@ -2,26 +2,32 @@ package keeper_test import ( "fmt" - "math/big" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - erc20types "github.com/evmos/os/x/erc20/types" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + "github.com/evmos/os/testutil/integration/os/keyring" + testutils "github.com/evmos/os/testutil/integration/os/utils" "github.com/evmos/os/x/ibc/transfer/keeper" "github.com/stretchr/testify/mock" ) func (suite *KeeperTestSuite) TestTransfer() { + var ( + ctx sdk.Context + sender keyring.Key + ) mockChannelKeeper := &MockChannelKeeper{} mockICS4Wrapper := &MockICS4Wrapper{} mockChannelKeeper.On("GetNextSequenceSend", mock.Anything, mock.Anything, mock.Anything).Return(1, true) mockChannelKeeper.On("GetChannel", mock.Anything, mock.Anything, mock.Anything).Return(channeltypes.Channel{Counterparty: channeltypes.NewCounterparty("transfer", "channel-1")}, true) mockICS4Wrapper.On("SendPacket", mock.Anything, mock.Anything, mock.Anything).Return(nil) + authAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() testCases := []struct { name string @@ -31,15 +37,7 @@ func (suite *KeeperTestSuite) TestTransfer() { { "pass - no token pair", func() *types.MsgTransfer { - senderAcc := sdk.AccAddress(suite.address.Bytes()) - transferMsg := types.NewMsgTransfer("transfer", "channel-0", sdk.NewCoin("aevmos", math.NewInt(10)), senderAcc.String(), "", timeoutHeight, 0, "") - - coins := sdk.NewCoins(sdk.NewCoin("aevmos", math.NewInt(10))) - err := suite.app.BankKeeper.MintCoins(suite.ctx, erc20types.ModuleName, coins) - suite.Require().NoError(err) - err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, erc20types.ModuleName, senderAcc, coins) - suite.Require().NoError(err) - suite.Commit() + transferMsg := types.NewMsgTransfer("transfer", "channel-0", sdk.NewCoin("aevmos", math.NewInt(10)), sender.AccAddr.String(), "", timeoutHeight, 0, "") return transferMsg }, true, @@ -50,74 +48,79 @@ func (suite *KeeperTestSuite) TestTransfer() { addr := "" contractAddr, err := suite.DeployContract("coin", "token", uint8(6)) suite.Require().NoError(err) - suite.Commit() - // senderAcc := sdk.MustAccAddressFromBech32(addr) transferMsg := types.NewMsgTransfer("transfer", "channel-0", sdk.NewCoin("erc20/"+contractAddr.String(), math.NewInt(10)), addr, "", timeoutHeight, 0, "") return transferMsg }, false, }, { - "no-op - disabled erc20 by params - sufficient sdk.Coins balance)", + "no-op - disabled erc20 by params - sufficient sdk.Coins balance", func() *types.MsgTransfer { contractAddr, err := suite.DeployContract("coin", "token", uint8(6)) suite.Require().NoError(err) - suite.Commit() - pair, err := suite.app.Erc20Keeper.RegisterERC20(suite.ctx, contractAddr) + pair, err := testutils.RegisterERC20(suite.factory, suite.network, testutils.ERC20RegistrationData{ + Addresses: []string{contractAddr.Hex()}, + ProposerPriv: sender.Priv, + }) suite.Require().NoError(err) - suite.Commit() - - senderAcc := sdk.AccAddress(suite.address.Bytes()) - suite.MintERC20Token(contractAddr, suite.address, suite.address, big.NewInt(10)) - suite.Commit() + suite.Require().True(len(pair) == 1) - coin := sdk.NewCoin(pair.Denom, math.NewInt(10)) - coins := sdk.NewCoins(coin) - - err = suite.app.BankKeeper.MintCoins(suite.ctx, erc20types.ModuleName, coins) + amt := math.NewInt(10) + _, err = suite.MintERC20Token(contractAddr, sender.Addr, amt.BigInt()) suite.Require().NoError(err) - suite.Commit() - err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, erc20types.ModuleName, senderAcc, coins) + // convert all ERC20 to IBC coin + err = suite.ConvertERC20(sender, contractAddr, amt) suite.Require().NoError(err) - suite.Commit() - params := suite.app.Erc20Keeper.GetParams(suite.ctx) + params := suite.network.App.Erc20Keeper.GetParams(ctx) params.EnableErc20 = false - err = suite.app.Erc20Keeper.SetParams(suite.ctx, params) + + err = testutils.UpdateERC20Params(testutils.UpdateParamsInput{ + Tf: suite.factory, + Network: suite.network, + Pk: sender.Priv, + Params: params, + }) suite.Require().NoError(err) - suite.Commit() - transferMsg := types.NewMsgTransfer("transfer", "channel-0", sdk.NewCoin(pair.Denom, math.NewInt(10)), senderAcc.String(), "", timeoutHeight, 0, "") + coin := sdk.NewCoin(pair[0].Denom, amt) + transferMsg := types.NewMsgTransfer("transfer", "channel-0", coin, sender.AccAddr.String(), "", timeoutHeight, 0, "") return transferMsg }, true, }, { - "error - disabled erc20 by params - insufficient sdk.Coins balance)", + "error - disabled erc20 by params - insufficient sdk.Coins balance", func() *types.MsgTransfer { contractAddr, err := suite.DeployContract("coin", "token", uint8(6)) suite.Require().NoError(err) - suite.Commit() - pair, err := suite.app.Erc20Keeper.RegisterERC20(suite.ctx, contractAddr) + pair, err := testutils.RegisterERC20(suite.factory, suite.network, testutils.ERC20RegistrationData{ + Addresses: []string{contractAddr.Hex()}, + ProposerPriv: sender.Priv, + }) suite.Require().NoError(err) - suite.Commit() + suite.Require().True(len(pair) == 1) - senderAcc := sdk.AccAddress(suite.address.Bytes()) - suite.MintERC20Token(contractAddr, suite.address, suite.address, big.NewInt(10)) - suite.Commit() + amt := math.NewInt(10) + _, err = suite.MintERC20Token(contractAddr, sender.Addr, amt.BigInt()) + suite.Require().NoError(err) - params := suite.app.Erc20Keeper.GetParams(suite.ctx) + params := suite.network.App.Erc20Keeper.GetParams(ctx) params.EnableErc20 = false - err = suite.app.Erc20Keeper.SetParams(suite.ctx, params) + err = testutils.UpdateERC20Params(testutils.UpdateParamsInput{ + Tf: suite.factory, + Network: suite.network, + Pk: sender.Priv, + Params: params, + }) suite.Require().NoError(err) - suite.Commit() - transferMsg := types.NewMsgTransfer("transfer", "channel-0", sdk.NewCoin(pair.Denom, math.NewInt(10)), senderAcc.String(), "", timeoutHeight, 0, "") + transferMsg := types.NewMsgTransfer("transfer", "channel-0", sdk.NewCoin(pair[0].Denom, amt), sender.AccAddr.String(), "", timeoutHeight, 0, "") return transferMsg }, @@ -126,20 +129,8 @@ func (suite *KeeperTestSuite) TestTransfer() { { "no-op - pair not registered", func() *types.MsgTransfer { - senderAcc := sdk.AccAddress(suite.address.Bytes()) - - coin := sdk.NewCoin("test", math.NewInt(10)) - coins := sdk.NewCoins(coin) - - err := suite.app.BankKeeper.MintCoins(suite.ctx, erc20types.ModuleName, coins) - suite.Require().NoError(err) - - err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, erc20types.ModuleName, senderAcc, coins) - suite.Require().NoError(err) - suite.Commit() - - transferMsg := types.NewMsgTransfer("transfer", "channel-0", coin, senderAcc.String(), "", timeoutHeight, 0, "") - + coin := sdk.NewCoin(suite.otherDenom, math.NewInt(10)) + transferMsg := types.NewMsgTransfer("transfer", "channel-0", coin, sender.AccAddr.String(), "", timeoutHeight, 0, "") return transferMsg }, true, @@ -149,24 +140,28 @@ func (suite *KeeperTestSuite) TestTransfer() { func() *types.MsgTransfer { contractAddr, err := suite.DeployContract("coin", "token", uint8(6)) suite.Require().NoError(err) - suite.Commit() - pair, err := suite.app.Erc20Keeper.RegisterERC20(suite.ctx, contractAddr) + pair, err := testutils.RegisterERC20(suite.factory, suite.network, testutils.ERC20RegistrationData{ + Addresses: []string{contractAddr.Hex()}, + ProposerPriv: sender.Priv, + }) suite.Require().NoError(err) - pair.Enabled = false - suite.app.Erc20Keeper.SetTokenPair(suite.ctx, *pair) + suite.Require().True(len(pair) == 1) - coin := sdk.NewCoin(pair.Denom, math.NewInt(10)) - senderAcc := sdk.AccAddress(suite.address.Bytes()) - transferMsg := types.NewMsgTransfer("transfer", "channel-0", coin, senderAcc.String(), "", timeoutHeight, 0, "") + amt := math.NewInt(10) + _, err = suite.MintERC20Token(contractAddr, sender.Addr, amt.BigInt()) + suite.Require().NoError(err) - // mint coins to perform the regular transfer without conversions - err = suite.app.BankKeeper.MintCoins(suite.ctx, erc20types.ModuleName, sdk.NewCoins(coin)) + // convert all erc20 to coins to perform regular transfer without conversion + err = suite.ConvertERC20(sender, contractAddr, amt) suite.Require().NoError(err) - err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, erc20types.ModuleName, senderAcc, sdk.NewCoins(coin)) + // disable token conversion + err = testutils.ToggleTokenConversion(suite.factory, suite.network, sender.Priv, pair[0].Denom) suite.Require().NoError(err) - suite.Commit() + + coin := sdk.NewCoin(pair[0].Denom, math.NewInt(10)) + transferMsg := types.NewMsgTransfer("transfer", "channel-0", coin, sender.AccAddr.String(), "", timeoutHeight, 0, "") return transferMsg }, @@ -177,18 +172,22 @@ func (suite *KeeperTestSuite) TestTransfer() { func() *types.MsgTransfer { contractAddr, err := suite.DeployContract("coin", "token", uint8(6)) suite.Require().NoError(err) - suite.Commit() - pair, err := suite.app.Erc20Keeper.RegisterERC20(suite.ctx, contractAddr) + res, err := testutils.RegisterERC20(suite.factory, suite.network, testutils.ERC20RegistrationData{ + Addresses: []string{contractAddr.Hex()}, + ProposerPriv: sender.Priv, + }) suite.Require().NoError(err) - suite.Commit() + suite.Require().True(len(res) == 1) + pair := res[0] suite.Require().Equal("erc20/"+pair.Erc20Address, pair.Denom) - senderAcc := sdk.AccAddress(suite.address.Bytes()) - transferMsg := types.NewMsgTransfer("transfer", "channel-0", sdk.NewCoin(pair.Denom, math.NewInt(10)), senderAcc.String(), "", timeoutHeight, 0, "") + amt := math.NewInt(10) + _, err = suite.MintERC20Token(contractAddr, sender.Addr, amt.BigInt()) + suite.Require().NoError(err) + + transferMsg := types.NewMsgTransfer("transfer", "channel-0", sdk.NewCoin(pair.Denom, amt), sender.AccAddr.String(), "", timeoutHeight, 0, "") - suite.MintERC20Token(contractAddr, suite.address, suite.address, big.NewInt(10)) - suite.Commit() return transferMsg }, true, @@ -198,21 +197,25 @@ func (suite *KeeperTestSuite) TestTransfer() { func() *types.MsgTransfer { contractAddr, err := suite.DeployContract("coin", "token", uint8(6)) suite.Require().NoError(err) - suite.Commit() - pair, err := suite.app.Erc20Keeper.RegisterERC20(suite.ctx, contractAddr) + pair, err := testutils.RegisterERC20(suite.factory, suite.network, testutils.ERC20RegistrationData{ + Addresses: []string{contractAddr.Hex()}, + ProposerPriv: sender.Priv, + }) suite.Require().NoError(err) - suite.Commit() + suite.Require().True(len(pair) == 1) - senderAcc := sdk.AccAddress(suite.address.Bytes()) - transferMsg := types.NewMsgTransfer("transfer", "channel-0", sdk.NewCoin(pair.Denom, math.NewInt(10)), senderAcc.String(), "", timeoutHeight, 0, "") - - coins := sdk.NewCoins(sdk.NewCoin(pair.Denom, math.NewInt(10))) - err = suite.app.BankKeeper.MintCoins(suite.ctx, erc20types.ModuleName, coins) + // mint some erc20 tokens + amt := math.NewInt(10) + _, err = suite.MintERC20Token(contractAddr, suite.keyring.GetAddr(0), amt.BigInt()) suite.Require().NoError(err) - err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, erc20types.ModuleName, senderAcc, coins) + + // convert all to IBC coins + sender := suite.keyring.GetKey(0) + err = suite.ConvertERC20(sender, contractAddr, amt) suite.Require().NoError(err) - suite.Commit() + + transferMsg := types.NewMsgTransfer("transfer", "channel-0", sdk.NewCoin(pair[0].Denom, amt), sender.AccAddr.String(), "", timeoutHeight, 0, "") return transferMsg }, @@ -223,14 +226,15 @@ func (suite *KeeperTestSuite) TestTransfer() { func() *types.MsgTransfer { contractAddr, err := suite.DeployContract("coin", "token", uint8(6)) suite.Require().NoError(err) - suite.Commit() - pair, err := suite.app.Erc20Keeper.RegisterERC20(suite.ctx, contractAddr) + pair, err := testutils.RegisterERC20(suite.factory, suite.network, testutils.ERC20RegistrationData{ + Addresses: []string{contractAddr.Hex()}, + ProposerPriv: sender.Priv, + }) suite.Require().NoError(err) - suite.Commit() + suite.Require().True(len(pair) == 1) - senderAcc := sdk.AccAddress(suite.address.Bytes()) - transferMsg := types.NewMsgTransfer("transfer", "channel-0", sdk.NewCoin(pair.Denom, math.NewInt(10)), senderAcc.String(), "", timeoutHeight, 0, "") + transferMsg := types.NewMsgTransfer("transfer", "channel-0", sdk.NewCoin(pair[0].Denom, math.NewInt(10)), sender.AccAddr.String(), "", timeoutHeight, 0, "") return transferMsg }, false, @@ -241,7 +245,7 @@ func (suite *KeeperTestSuite) TestTransfer() { { "no-op - fail transfer", func() *types.MsgTransfer { - senderAcc := sdk.AccAddress(suite.address.Bytes()) + senderAcc := suite.keyring.GetAccAddr(0) denom := "ibc/DF63978F803A2E27CA5CC9B7631654CCF0BBC788B3B7F0A10200508E37C70992" coinMetadata := banktypes.Metadata{ @@ -265,7 +269,7 @@ func (suite *KeeperTestSuite) TestTransfer() { coin := sdk.NewCoin(denom, math.NewInt(10)) - pair, err := suite.app.Erc20Keeper.RegisterERC20Extension(suite.ctx, coinMetadata.Base) + pair, err := suite.network.App.Erc20Keeper.RegisterERC20Extension(suite.network.GetContext(), coinMetadata.Base) suite.Require().Equal(pair.Denom, denom) suite.Require().NoError(err) @@ -278,22 +282,24 @@ func (suite *KeeperTestSuite) TestTransfer() { } for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.name), func() { - suite.mintFeeCollector = true suite.SetupTest() - - _, err := suite.app.GetScopedIBCKeeper().NewCapability(suite.ctx, host.ChannelCapabilityPath("transfer", "channel-0")) - suite.Require().NoError(err) - - suite.app.TransferKeeper = keeper.NewKeeper( - suite.app.AppCodec(), suite.app.GetKey(types.StoreKey), suite.app.GetSubspace(types.ModuleName), - &MockICS4Wrapper{}, // ICS4 Wrapper: claims IBC middleware - mockChannelKeeper, &suite.app.IBCKeeper.PortKeeper, - suite.app.AccountKeeper, suite.app.BankKeeper, suite.app.GetScopedIBCKeeper(), - suite.app.Erc20Keeper, // Add ERC20 Keeper for ERC20 transfers + sender = suite.keyring.GetKey(0) + ctx = suite.network.GetContext() + + suite.network.App.TransferKeeper = keeper.NewKeeper( + suite.network.App.AppCodec(), suite.network.App.GetKey(types.StoreKey), suite.network.App.GetSubspace(types.ModuleName), + &MockICS4Wrapper{}, // ICS4 Wrapper + mockChannelKeeper, suite.network.App.IBCKeeper.PortKeeper, + suite.network.App.AccountKeeper, suite.network.App.BankKeeper, suite.network.App.ScopedTransferKeeper, + suite.network.App.Erc20Keeper, // Add ERC20 Keeper for ERC20 transfers + authAddr, ) msg := tc.malleate() - _, err = suite.app.TransferKeeper.Transfer(sdk.WrapSDKContext(suite.ctx), msg) + // get updated context with the latest changes + ctx = suite.network.GetContext() + + _, err := suite.network.App.TransferKeeper.Transfer(ctx, msg) if tc.expPass { suite.Require().NoError(err) } else { @@ -301,5 +307,4 @@ func (suite *KeeperTestSuite) TestTransfer() { } }) } - suite.mintFeeCollector = false } diff --git a/x/ibc/transfer/module.go b/x/ibc/transfer/module.go index 5148e571..d409e62e 100644 --- a/x/ibc/transfer/module.go +++ b/x/ibc/transfer/module.go @@ -8,9 +8,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" - ibctransfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibctransfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" "github.com/evmos/os/x/ibc/transfer/keeper" ) @@ -53,4 +53,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { if err := cfg.RegisterMigration(types.ModuleName, 2, m.MigrateTotalEscrowForDenom); err != nil { panic(fmt.Sprintf("failed to migrate transfer app from version 2 to 3: %v", err)) } + + if err := cfg.RegisterMigration(types.ModuleName, 3, m.MigrateParams); err != nil { + panic(fmt.Errorf("failed to migrate transfer app version 3 to 4 (self-managed params migration): %v", err)) + } + + if err := cfg.RegisterMigration(types.ModuleName, 4, m.MigrateDenomMetadata); err != nil { + panic(fmt.Errorf("failed to migrate transfer app from version 4 to 5 (set denom metadata migration): %v", err)) + } } diff --git a/x/ibc/transfer/types/interfaces.go b/x/ibc/transfer/types/interfaces.go index c4dccd56..351304ca 100644 --- a/x/ibc/transfer/types/interfaces.go +++ b/x/ibc/transfer/types/interfaces.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" erc20types "github.com/evmos/os/x/erc20/types" ) @@ -16,12 +16,13 @@ import ( // AccountKeeper defines the expected interface needed to retrieve account info. type AccountKeeper interface { transfertypes.AccountKeeper + GetAccount(context.Context, sdk.AccAddress) sdk.AccountI } // BankKeeper defines the expected interface needed to check balances and send coins. type BankKeeper interface { transfertypes.BankKeeper - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin } // ERC20Keeper defines the expected ERC20 keeper interface for supporting